/* 工单管理工作台 - 全局样式 v0.7 (indigo 主题 + 侧边栏布局) */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #6366f1;
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --bg: #f8fafc;
  --bg-gradient: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  --card: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 12px rgba(15,23,42,0.08);
  --shadow-lg: 0 10px 30px rgba(15,23,42,0.10);
  --sidebar-w: 240px;
  --sidebar-bg: #eef2ff;
  --sidebar-bg-2: #e0e7ff;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ 侧边栏 ============ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: #475569;
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(15,23,42,0.06);
  border-right: 1px solid #e0e7ff;
  transition: transform 0.25s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 20px;
  font-size: 17px; font-weight: 700; color: #1e293b;
  border-bottom: 1px solid #e0e7ff;
}
.sidebar-brand .brand-icon { font-size: 22px; }
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  color: #475569;
  font-size: 14.5px;
  font-weight: 500;
  transition: all 0.15s;
}
.sidebar-nav a:hover {
  background: var(--primary-50);
  color: var(--primary);
  text-decoration: none;
}
.sidebar-nav a.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79,70,229,0.25);
}
.sidebar-nav a .nav-icon { font-size: 18px; width: 22px; text-align: center; }

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid #e0e7ff;
}
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e0e7ff;
  margin-bottom: 10px;
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 16px;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { color: #1e293b; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-badge {
  display: inline-block;
  font-size: 13px; padding: 3px 10px; border-radius: 6px; font-weight: 700;
  letter-spacing: 0.3px;
  margin-top: 2px;
}
.role-badge.admin { background: #ede9fe; color: #6d28d9; }
.role-badge.user { background: #dbeafe; color: #2563eb; }
.role-badge.boss { background: #fef3c7; color: #b45309; }

.sidebar-actions { display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: #475569;
  font-size: 13.5px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: all 0.15s;
}
.sidebar-link:hover { background: var(--primary-50); color: var(--primary); text-decoration: none; }
.sidebar-link.logout:hover { background: #fee2e2; color: #dc2626; }

/* 移动端汉堡按钮 */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 110;
  width: 42px; height: 42px;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  align-items: center; justify-content: center;
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: 99;
}

/* ============ 主内容区 ============ */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 28px 32px 60px;
  transition: margin-left 0.25s ease;
}
.main-content.full {
  margin-left: 0;
  padding: 0;
}

/* ============ 容器 ============ */
.container { max-width: 100%; margin: 0 auto; padding: 0 clamp(20px, 3vw, 48px); }

/* ============ 卡片 ============ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.card-title { font-size: 17px; font-weight: 600; margin: 0 0 16px; color: var(--text); }

/* ============ 页头 ============ */
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.detail-title { font-size: 22px; font-weight: 700; margin: 0; color: var(--text); }
.detail-meta { color: var(--text-muted); font-size: 13px; margin-top: 6px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; margin: 18px 0; }
.detail-grid .item { font-size: 14px; }
.detail-grid .item .label { color: var(--text-muted); margin-bottom: 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.detail-grid .item .value { font-weight: 600; color: var(--text); }
.section-title { font-size: 16px; font-weight: 600; margin: 22px 0 12px; padding-bottom: 10px; border-bottom: 2px solid var(--primary-50); color: var(--text); }

/* ============ 表单 ============ */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 7px; font-weight: 600; font-size: 13.5px; color: var(--text); }
.form-group .required { color: var(--danger); margin-left: 4px; }
.form-control {
  width: 100%; padding: 10px 14px; font-size: 15px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff;
  color: var(--text); transition: all 0.15s;
  font-family: inherit;
}
.form-control:hover { border-color: #cbd5e1; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,70,229,0.12); }
.form-control:read-only, .form-control[readonly] { background: #f8fafc; color: var(--text-muted); cursor: not-allowed; }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { cursor: pointer; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; font-size: 14.5px; font-weight: 600;
  border: 1px solid #c7d2fe; border-radius: var(--radius-sm); cursor: pointer;
  background: var(--primary-50); color: var(--primary-dark);
  transition: all 0.15s;
  font-family: inherit;
  box-shadow: none;
}
.btn:hover { background: var(--primary-100); border-color: var(--primary-light); color: var(--primary-dark); text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,0.15); }
.btn:active { transform: translateY(0); }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); box-shadow: none; }
.btn-secondary:hover { background: var(--primary-50); border-color: var(--primary-light); color: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-danger { background: #fef2f2; color: #dc2626; border-color: #fecaca; box-shadow: none; }
.btn-danger:hover { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.btn-success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; box-shadow: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; box-shadow: none; }
.btn-sm:hover { box-shadow: var(--shadow); }
.btn-row { display: flex; gap: 10px; align-items: center; }

/* ============ 提示信息 - 用户偏好需要较大字号 ============ */
.alert {
  padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 15px;
  border: 1px solid transparent;
}
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--border-light); }
.data-table th { background: var(--primary-50); font-weight: 600; color: var(--primary-dark); font-size: 12.5px; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.3px; }
.data-table tbody tr:nth-child(even) { background: #fafbfc; }
.data-table tbody tr:hover { background: var(--primary-50); }
.data-table .order-no { font-family: Consolas, "Courier New", monospace; color: #333; font-weight: 600; }
.data-table code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 13px; color: var(--text); }

/* ============ 状态标签 ============ */
.tag { display: inline-block; padding: 4px 12px; border-radius: 14px; font-size: 13px; font-weight: 700; letter-spacing: 0.3px; line-height: 1.6; }
.tag-待处理 { background: #e0e7ff; color: #3730a3; }
.tag-处理中 { background: #fef3c7; color: #92400e; }
.tag-待验收 { background: #ccfbf1; color: #0f766e; border: 1px solid #5eead4; }
.tag-已完成 { background: #dcfce7; color: #166534; }
.tag-已归档 { background: #e2e8f0; color: #334155; }
.tag-已关闭 { background: #f1f5f9; color: #475569; }
/* 优先级标签：实色高对比，字体颜色显眼 */
.tag-低 { background: #16a34a; color: #fff; }
.tag-高 { background: #2563eb; color: #fff; }
.tag-中 { background: #ea580c; color: #fff; }
.tag-紧急 { background: #dc2626; color: #fff; }
/* v0.28zj 日常任务：浅绿底 + 深绿字（浅色背景配白字会看不清） */
.tag-日常任务 { background: #86efac; color: #14532d; }

/* ============ 分配人员多选组件（搜索 + 部门树 + 多选）============ */
.handler-picker { position: relative; }
.hp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.hp-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-50); border: 1px solid var(--primary-light);
  color: var(--primary-dark); border-radius: 14px; padding: 3px 6px 3px 12px;
  font-size: 13px; font-weight: 600; line-height: 1.5;
}
.hp-tag .hp-tag-x {
  width: 18px; height: 18px; border: none; border-radius: 50%;
  background: rgba(79,70,229,0.15); color: var(--primary-dark); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; padding: 0;
}
.hp-tag .hp-tag-x:hover { background: var(--primary); color: #fff; }
.hp-tag.is-lead::before { content: '主'; font-size: 10px; background: var(--primary); color: #fff; border-radius: 8px; padding: 1px 5px; margin-right: 2px; }
.hp-empty { color: var(--text-light); font-size: 13px; padding: 2px 0 6px; }
.hp-panel {
  position: absolute; z-index: 50; left: 0; right: 0; top: 100%;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); max-height: 320px; overflow-y: auto; display: none; margin-top: 4px;
}
.hp-panel.open { display: block; }
.hp-search-wrap { padding: 10px 12px 8px; border-bottom: 1px solid var(--border-light); position: sticky; top: 0; background: #fff; }
.hp-dept { border-bottom: 1px solid var(--border-light); }
.hp-dept:last-child { border-bottom: none; }
.hp-dept-head {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 8px 12px; font-weight: 700; font-size: 13px; color: var(--text);
  background: #f8fafc; user-select: none;
}
.hp-dept-head .hp-caret { transition: transform .15s; color: var(--text-muted); font-size: 11px; }
.hp-dept.collapsed .hp-caret { transform: rotate(-90deg); }
.hp-dept-head .hp-dept-count { margin-left: auto; font-weight: 500; color: var(--text-muted); font-size: 12px; }
.hp-dept-body { padding: 4px 8px 8px; }
.hp-dept.collapsed .hp-dept-body { display: none; }
/* v0.28 子部门层级缩进 + 分隔虚线 */
.hp-dept-sub { margin-left: 14px; border-left: 2px solid var(--border-light); padding-left: 8px; }
.hp-dept-sub .hp-dept-head { font-size: 12.5px; color: var(--text-light); }
.hp-user {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; cursor: pointer;
}
.hp-user:hover { background: var(--primary-50); }
.hp-user .hp-check {
  width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid #cbd5e1; background: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; flex-shrink: 0;
}
.hp-user.selected .hp-check { background: var(--primary); border-color: var(--primary); }
.hp-user .hp-name { font-size: 14px; color: var(--text); font-weight: 500; }
.hp-user .hp-sub { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.hp-user.selected .hp-name { color: var(--primary-dark); font-weight: 600; }
.hp-noresult { padding: 16px 12px; color: var(--text-light); font-size: 13px; text-align: center; }

/* 列表 / 详情中多人处理人的小标签 */
.h-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 12px; font-size: 12px; font-weight: 600;
  background: var(--primary-50); color: var(--primary-dark); border: 1px solid var(--primary-light);
  margin: 1px 4px 1px 0; line-height: 1.5;
}
.h-chip.lead::after { content: '主'; font-size: 10px; background: var(--primary); color: #fff; border-radius: 8px; padding: 0 5px; }
.tag-已发布 { background: #dcfce7; color: #166534; }
.tag-已下架 { background: #f1f5f9; color: #475569; }

/* 工具类型标签 */
.tag-type { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 600; }
.tag-type.file { background: #fef3c7; color: #92400e; }
.tag-type.web { background: #dcfce7; color: #166534; }
.tag-type.link { background: #dbeafe; color: #1d4ed8; }

/* ============ 优先级下拉（带颜色）============ */
.prio-select { font-weight: 600; border: 1px solid #cbd5e1; }
.prio-select option { padding: 6px 8px; }
/* 选中但值为空时（"全部"），保持普通样式 */
.prio-select:not(.prio-active) { background: #fff; color: #334155; font-weight: 400; }

/* ============ 筛选条 ============ */
/* v0.28zw 最终版：所有筛选项等宽等距（列数由页面按控件个数内联指定，默认 8 列），
   关键字输入框与状态/优先级同宽、中间留 gap，
   不再依赖控件内联 min-width（内联宽度曾把关键字框撑宽顶到状态框）。
   按钮（筛选/重置/导出/导入）固定在第二行右侧。 */
.filter-bar {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 12px;
  align-items: flex-end;
  background: #fff; padding: 14px 16px; border-radius: var(--radius); margin-bottom: 18px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.filter-bar .form-group { margin-bottom: 0; min-width: 0; }
/* 控件一律占满所在格：min-width:0 防止 input 默认 size=20 字符宽把格子撑大挤到邻居 */
.filter-bar .form-group > .form-control,
.filter-bar .form-group > input,
.filter-bar .form-group > select { min-width: 0; width: 100%; box-sizing: border-box; }
.filter-bar .form-group label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; }
.filter-bar .form-control { padding: 6px 8px; font-size: 13px; min-width: 0; width: 100%; box-sizing: border-box; }
.filter-bar input[type="text"] { display: block; width: 100%; min-width: 0; max-width: 100%; }
.filter-bar .btn-row { display: flex; gap: 10px; align-items: stretch; grid-column: 1 / -1; grid-row: 2; justify-self: end; }
.filter-bar .btn-row .btn { padding: 8px 20px; font-size: 14px; }

/* ============ 日期输入框（原生 type=date）——工单列表 / 概览共用 ============
   直接用原生控件：支持年/月/日分段编辑、键盘逐位输入、点日历选取，
   .value 恒为 YYYY-MM-DD，后端无需改动。不再用文本框+补横线的方案（会锁死中间段）。 */
.dp-date {
  font-family: inherit;                 /* 与页面字体一致，别用浏览器默认等宽 */
  line-height: normal;                  /* 避免不同浏览器下高度与相邻控件不一致 */
  min-height: 34px;
}
/* 日历图标：弱化显示，hover 时提亮，避免抢视觉重点 */
.dp-date::-webkit-calendar-picker-indicator {
  cursor: pointer; opacity: .5; transition: opacity .15s;
}
.dp-date::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* ============ 时间线 ============ */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 14px 0 14px 24px; border-left: 2px solid var(--primary-100); margin-left: 8px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 20px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
.timeline li .log-action { font-weight: 600; font-size: 14px; color: var(--text); }
.timeline li .log-time { color: var(--text-light); font-size: 12px; margin-bottom: 5px; }
.timeline li .log-content { background: #f8fafc; padding: 10px 14px; border-radius: 6px; font-size: 14px; white-space: pre-wrap; word-break: break-all; margin-top: 6px; border-left: 3px solid var(--primary-light); }
.timeline li .log-operator { color: var(--text-muted); font-size: 13px; font-weight: 500; }

/* ============ 登录页 ============ */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #a5b4fc 0%, #c7d2fe 55%, #e0e7ff 100%); padding: 20px; }
.login-card { background: #fff; border-radius: 16px; padding: 40px; width: 100%; max-width: 400px; box-shadow: 0 12px 40px rgba(79,70,229,.16); border: 1px solid #e0e7ff; }
.login-card h1 { font-size: 24px; text-align: center; margin: 0 0 6px; color: var(--text); font-weight: 700; }
.login-card .subtitle { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.login-card .test-hint { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 12px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 18px; line-height: 1.8; }

/* 品牌区 */
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-logo { font-size: 44px; margin-bottom: 6px; }

/* Tab 切换 */
.auth-tabs { display: flex; background: #f1f5f9; border-radius: 10px; padding: 4px; margin-bottom: 22px; }
.auth-tab {
  flex: 1; border: none; background: none; padding: 10px 0; border-radius: 8px;
  font-size: 15px; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all 0.2s;
}
.auth-tab.active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.auth-tab:hover:not(.active) { color: var(--text); }

/* 分割线 */
.auth-divider { display: flex; align-items: center; margin: 22px 0; color: #94a3b8; font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }
.auth-divider span { padding: 0 14px; }

/* 企业微信按钮 */
.btn-wecom {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #07c160; color: #fff; border: none; padding: 12px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.btn-wecom:hover { background: #06ad56; color: #fff; }
.btn-wecom-disabled { background: #cbd5e1; cursor: not-allowed; }
.btn-wecom-disabled:hover { background: #cbd5e1; }
.wecom-icon { font-size: 18px; }
.wecom-badge {
  display: inline-block; background: rgba(255,255,255,0.3); border-radius: 4px;
  padding: 2px 8px; font-size: 11px; font-weight: 500; margin-left: 4px;
}

/* ============ 工具类型选择卡片（上传页）============ */
.tool-type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 4px; }
.tool-type-card {
  border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 16px;
  cursor: pointer; transition: all 0.15s; background: #fff; text-align: center;
}
.tool-type-card:hover { border-color: var(--primary-light); background: var(--primary-50); }
.tool-type-card.selected { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 3px rgba(79,70,229,0.12); }
.tool-type-card .tt-icon { font-size: 28px; margin-bottom: 6px; }
.tool-type-card .tt-name { font-weight: 600; font-size: 14px; color: var(--text); }
.tool-type-card .tt-desc { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }

/* ============ 通用 ============ */

/* 批量操作栏（v0.28n 常驻显示，不再等勾选才出现） */
.batch-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--primary-50); border: 1px solid var(--primary-light);
  border-radius: var(--radius); padding: 10px 16px; margin-bottom: 14px;
}
.batch-bar .batch-info { font-size: 14px; color: var(--text); }
.batch-bar .batch-info b { color: var(--primary); font-size: 16px; }
.batch-bar .batch-sep { color: var(--border); }
.batch-bar .batch-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.batch-bar .batch-select { width: auto; min-width: 110px; padding: 6px 10px; font-size: 13.5px; }

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 8px; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 14px; }
.empty-state .empty-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }

/* ============ 仪表盘概览页 ============ */
/* 欢迎横幅 */
.hero-banner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; flex-wrap: wrap;
  background: linear-gradient(135deg, #a5b4fc 0%, #c7d2fe 55%, #e0e7ff 100%);
  border-radius: var(--radius);
  padding: 28px 32px; margin-bottom: 22px;
  color: #1e293b; box-shadow: 0 8px 24px rgba(79,70,229,0.14);
  border: 1px solid #e0e7ff;
  position: relative; overflow: hidden;
}
.hero-banner::after {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,0.35);
}
.hero-left { flex: 1; min-width: 240px; position: relative; z-index: 1; }
.hero-greeting { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.hero-date { font-size: 14px; opacity: 0.92; margin-bottom: 12px; }
.hero-role { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-role .role-badge { margin-top: 0; }
.hero-scope { font-size: 13px; opacity: 0.88; }
.hero-right { text-align: right; position: relative; z-index: 1; }
.hero-rate { font-size: 52px; font-weight: 800; line-height: 1; color: #4338ca; }
.hero-rate-unit { font-size: 24px; font-weight: 600; margin-left: 2px; }
.hero-rate-label { font-size: 13px; opacity: 0.92; margin-top: 4px; }
.hero-rate-sub { font-size: 12px; opacity: 0.78; margin-top: 2px; }
.hero-rate-tag { display:inline-block; margin-top: 8px; padding: 3px 10px; background: rgba(255,255,255,0.75); color: #4338ca; font-size: 11px; font-weight: 600; border-radius: 999px; letter-spacing: 0.3px; }

/* 核心指标卡片 */
.stat-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px;
  margin-bottom: 18px;
}
.stat-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow); transition: all 0.18s;
  text-decoration: none; position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent, var(--primary));
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none; }
.stat-card.stat-blue::before { background: #3b82f6; }
.stat-card.stat-indigo::before { background: #6366f1; }
.stat-card.stat-amber::before { background: #d97706; }
.stat-card.stat-green::before { background: #16a34a; }
.stat-card.stat-slate::before { background: #64748b; }
.stat-icon {
  font-size: 30px; width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: var(--primary-50); flex-shrink: 0;
}
.stat-card.stat-blue .stat-icon { background: #dbeafe; }
.stat-card.stat-indigo .stat-icon { background: #e0e7ff; }
.stat-card.stat-amber .stat-icon { background: #fef3c7; }
.stat-card.stat-green .stat-icon { background: #dcfce7; }
.stat-card.stat-slate .stat-icon { background: #f1f5f9; }
.stat-num { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

/* 快捷操作 */
.quick-actions {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px;
}
.quick-action {
  flex: 1; min-width: 140px;
  display: flex; align-items: center; gap: 12px; justify-content: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  box-shadow: var(--shadow); transition: all 0.18s;
  color: var(--text); font-weight: 600; font-size: 14.5px;
}
.quick-action:hover { transform: translateY(-2px); border-color: var(--primary-light); background: var(--primary-50); color: var(--primary-dark); text-decoration: none; box-shadow: var(--shadow-md); }
.quick-action .qa-icon { font-size: 22px; }

/* 两列布局 */
.dash-row { display: flex; gap: 20px; align-items: flex-start; }
.dash-col-main { flex: 1; min-width: 0; }
.dash-col-side { width: 340px; flex-shrink: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* 卡片头（标题+链接） */
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.link-more { font-size: 13.5px; font-weight: 600; }

/* 分布列表 + 进度条 */
.dist-list { display: flex; flex-direction: column; gap: 16px; }
.dist-item {  }
.dist-head { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; font-size: 13.5px; }
.dist-head .dist-name { font-weight: 600; color: var(--text); min-width: 36px; }
.dist-head .dist-count { color: var(--text); font-weight: 600; }
.dist-head .dist-pct { margin-left: auto; color: var(--text-muted); font-size: 12.5px; }
.progress-bar { height: 8px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; min-width: 2px; }

/* 分布汇总条 */
.dist-summary {
  display: flex; gap: 14px; margin-top: 20px; padding-top: 16px;
  border-top: 1px dashed var(--border);
}
.dist-summary .ds-item { flex: 1; text-align: center; }
.dist-summary .ds-label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.dist-summary .ds-value { display: block; font-size: 20px; font-weight: 700; color: var(--text); }
.dist-summary .ds-active { color: var(--warning); }
.dist-summary .ds-done { color: var(--success); }

/* 待办列表 */
.todo-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 8px;
  background: var(--danger); color: #fff; border-radius: 12px;
  font-size: 12.5px; font-weight: 700;
}
.todo-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.todo-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: all 0.15s; background: #fff;
}
.todo-item:hover { border-color: var(--primary-light); box-shadow: var(--shadow); }
.todo-link { display: block; padding: 12px 14px; }
.todo-link:hover { text-decoration: none; }
.todo-top { display: flex; gap: 6px; margin-bottom: 7px; }
.todo-title { font-weight: 600; color: var(--text); font-size: 14px; line-height: 1.4; margin-bottom: 6px; }
.todo-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 4px; flex-wrap: wrap; }

/* 系统概览 */
.sys-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sys-item { text-align: center; background: var(--primary-50); border-radius: var(--radius-sm); padding: 16px 8px; }
.sys-num { font-size: 26px; font-weight: 800; color: var(--primary-dark); line-height: 1.1; }
.sys-label { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

/* 排行榜 */
.rank-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.rank-item { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; }
.rank-no {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: #f1f5f9; color: var(--text-muted); font-weight: 700; font-size: 13px;
}
.rank-no-1 { background: linear-gradient(135deg, #fbbf24, #d97706); color: #fff; }
.rank-no-2 { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; }
.rank-no-3 { background: linear-gradient(135deg, #fb923c, #9a3412); color: #fff; }
.rank-name { font-weight: 600; color: var(--text); font-size: 14px; }
.rank-count { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.rank-bar { grid-column: 1 / -1; height: 5px; background: #f1f5f9; border-radius: 3px; overflow: hidden; }
.rank-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary-light), var(--primary)); border-radius: 3px; }

/* 提示卡片 */
.tip-card { background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%); border-color: #bbf7d0; }
.tip-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.tip-list li { font-size: 13.5px; color: var(--text); line-height: 1.6; padding-left: 20px; position: relative; }
.tip-list li::before { content: '✓'; position: absolute; left: 0; top: 0; color: var(--success); font-weight: 700; }
.tip-list li b { color: var(--primary-dark); }

/* ============ 响应式 ============ */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-row { flex-direction: column; }
  .dash-col-side { width: 100%; }
  /* 移动端：让右列（优先级分布）排到左列（看板）前面——HTML 物理顺序不动，仅 CSS order 翻转 */
  .dash-row > div:nth-child(2) { order: -1; }
}
@media (max-width: 900px) {
  /* v0.28zv+：窄屏下 .filter-bar 改回 flex-wrap（不再用 9 列 grid，控件自然换行）——PC 端不受影响 */
  .filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .filter-bar .form-group { flex: 1 1 calc(50% - 10px); min-width: 120px; }
  .filter-bar .form-group:first-of-type { flex: 1 1 100%; }
  .filter-bar .btn-row { width: 100%; justify-self: auto; justify-content: flex-end; }

  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .sidebar.open ~ .sidebar-overlay { display: block; }
  .main-content { margin-left: 0; padding: 60px 16px 40px; }
  .main-content.full { padding: 0; }
  .detail-grid { grid-template-columns: 1fr; }
  .tool-type-grid { grid-template-columns: 1fr; }
  /* 仪表盘响应式 */
  .hero-banner { padding: 22px 20px; }
  .hero-greeting { font-size: 20px; }
  .hero-rate { font-size: 40px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .quick-actions { flex-direction: column; }
  .quick-action { min-width: 0; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .hero-right { text-align: left; }
  .dist-summary { flex-direction: column; gap: 10px; }
  .card { padding: 16px; }
  /* 仪表盘今日数字卡紧凑 */
  .card > div[style*="grid-template-columns"] { gap:8px !important; }
  .card > div[style*="grid-template-columns"] > div { padding:14px 10px !important; }
  /* 指标卡窄屏 */
  .stat-card { padding: 14px 16px; }
  .stat-icon { width: 40px; height: 40px; font-size: 24px; }
  .stat-num { font-size: 22px; }
  .stat-label { font-size: 12px; }
  /* 快捷操作 */
  .quick-action { padding: 12px 14px; font-size: 13px; }
  .quick-action .qa-icon { font-size: 18px; }
  /* 侧边栏 */
  .sidebar-brand { padding: 18px 16px; font-size: 15px; }
  .sidebar-nav a { padding: 10px 12px; font-size: 13.5px; }
  /* 批量条横滑 */
  .batch-bar { overflow-x:auto; -webkit-overflow-scrolling:touch; flex-wrap:nowrap; padding:8px 12px; }
  .batch-bar::-webkit-scrollbar { display:none; }
  .batch-bar .batch-sep { flex-shrink:0; }
  .batch-bar .btn { flex-shrink:0; font-size:12.5px; padding:5px 10px; white-space:nowrap; }
  /* 页面标题区竖排 */
  .detail-header { flex-direction:column; gap:10px; }
  .detail-header > div:last-child { width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; flex-wrap:nowrap; }
  .detail-header > div:last-child .btn { flex-shrink:0; font-size:13px; }
}
/* 超窄屏 375px (iPhone SE/小屏安卓) */
@media (max-width: 375px) {
  .main-content { padding: 56px 12px 32px; }
  .card { padding: 16px; margin-bottom: 14px; }
  .card-title { font-size: 15px; }
  .hero-banner { padding: 18px 16px; }
  .hero-greeting { font-size: 17px; }
  .hero-role { font-size: 12px; }
  .role-badge { font-size: 11px; padding: 2px 6px; }
  /* 指标卡进一步缩小 */
  .stat-card { padding: 12px 14px; gap: 10px; }
  .stat-icon { width: 36px; height: 36px; font-size: 20px; }
  .stat-num { font-size: 20px; }
  .stat-label { font-size: 11px; }
  .quick-action { padding: 10px 12px; font-size: 12.5px; }
  .quick-action .qa-icon { font-size: 16px; }
  /* 表格 */
  .data-table th, .data-table td { padding: 10px 10px; font-size: 13px; }
  /* 表单 */
  .form-control { padding: 8px 12px; font-size: 14px; }
  /* 按钮 */
  .btn { padding: 9px 16px; font-size: 13px; }
}

/* v0.28zw.2：移除优先级卡片 720px 限高 + 末组内滚（v0.28zv+ 遗留）。
   原意是与左侧看板对齐，但内容超高时"日常任务"（末组）会出现一根内部滚动条，观感怪异；
   每组列表本就最多渲染 2 条，卡片自然高度 ≈760px，与看板相差几十像素，直接放任自然高度即可。 */

/* v0.28zw.4：筛选栏 创建人/处理人——手输输入框 + ▾ 勾选面板（替代 v0.28zw.3 纯勾选版） */
.msel { position: relative; }
.msel-row { display: flex; align-items: stretch; gap: 4px; }
.msel-input { flex: 1; min-width: 0; }
.msel-caret { flex-shrink: 0; border: 1px solid #cbd5e1; background: #f8fafc; border-radius: 6px; padding: 0 9px; cursor: pointer; color: #64748b; font-size: 11px; line-height: 1; }
.msel-caret:hover { background: #eef2ff; color: #4338ca; border-color: #a5b4fc; }
.msel-panel { display: none; position: absolute; top: 100%; left: 0; right: 0; min-width: 160px; max-height: 220px; overflow-y: auto; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 8px 24px rgba(15,23,42,.12); z-index: 60; margin-top: 4px; padding: 4px; }
.msel-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; color: #334155; font-weight: 400; }
.msel-opt:hover { background: #f1f5f9; }
.msel-opt input[type="checkbox"] { flex-shrink: 0; }

/* v0.28zw.6：工单列表字段紧凑显示——窄窗口（未最大化）也不换行挤压：
   全列不折行；标题超宽省略号（悬停看全名/进编辑看全量）；标签缩小一号 */
.orders-table th, .orders-table td { white-space: nowrap; padding: 10px 10px; }
.orders-table td.cell-title { max-width: 260px; }
.orders-table td.cell-title .t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orders-table .tag { white-space: nowrap; font-size: 11.5px; padding: 2px 7px; }
