/* =====================================================================
   公司综合管理平台 · 设计系统
   现代 SaaS 风格：柔和阴影 / 圆角 / 克制留白 / 清晰层级
   图标规范：全站统一 SVG 线性图标（stroke 2px, 24×24 viewBox）
   ===================================================================== */

:root {
  /* 品牌色 */
  --primary: #a100ff;
  --primary-600: #8a00d8;
  --primary-700: #7200b3;
  --primary-50: #f9f0ff;
  --primary-100: #efdbff;

  /* 语义色 */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --warn: #f59e0b;
  --warn-bg: #fffbeb;
  --info: #0ea5e9;

  /* 中性色 */
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #1e293b;
  --text-2: #475569;
  --muted: #94a3b8;
  --border: #e6e8ef;
  --border-strong: #d4d8e3;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow: 0 4px 14px rgba(15, 23, 42, .07), 0 2px 6px rgba(15, 23, 42, .04);
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, .12);
  --shadow-primary: 0 8px 22px rgba(79, 70, 229, .28);

  /* 圆角 / 间距 */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; color: var(--text); }

.muted { color: var(--muted); }
.sm { font-size: 12px; }
.hidden { display: none !important; }

/* ============================ 按钮 ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--primary); color: #fff; border: 1px solid transparent;
  padding: 9px 18px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13.5px; font-weight: 550; font-family: inherit;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--primary-600); box-shadow: var(--shadow-primary); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn.ghost { background: transparent; color: var(--primary); border-color: var(--primary-100); }
.btn.ghost:hover { background: var(--primary-50); box-shadow: none; }

.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #dc2626; box-shadow: 0 8px 22px rgba(239, 68, 68, .28); }

.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn-lg { padding: 12px 22px; font-size: 15px; }

/* ============================ 卡片 ============================ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.card h2 { font-size: 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.card h2 .hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-head h2 { margin: 0; }

/* ============================ 表单 ============================ */
.field { margin-bottom: 16px; }
.field > label {
  display: block; margin-bottom: 7px; color: var(--text-2);
  font-size: 12.5px; font-weight: 600;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font-size: 14px; font-family: inherit;
  background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.toolbar select {
  padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; background: var(--surface);
  color: var(--text); cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.toolbar select:hover { border-color: var(--primary-100); }
.toolbar select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }

/* ============================ 文件上传美化 ============================ */
input[type="file"] {
  width: 100%; padding: 10px; border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); font-size: 13px; font-family: inherit;
  background: var(--surface-2); color: var(--text-2); cursor: pointer;
  transition: border-color .15s, background .15s;
}
input[type="file"]:hover { border-color: var(--primary); background: var(--primary-50); }
input[type="file"]::file-selector-button {
  padding: 6px 14px; margin-right: 10px; border: none; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff; font-size: 12.5px; font-weight: 550;
  font-family: inherit; cursor: pointer; transition: background .15s;
}
input[type="file"]::file-selector-button:hover { background: var(--primary-600); }

/* ============================ 文本框美化 ============================ */
textarea {
  width: 100%; min-height: 60px; padding: 10px 13px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; line-height: 1.5;
  background: var(--surface); color: var(--text); resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
textarea::placeholder { color: var(--muted); }
textarea:hover { border-color: var(--border); }
textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }

/* ============================ 表格 ============================ */
.table-scroll { overflow-x: auto; border-radius: var(--radius-sm); }
/* 表格滚动条：横向滚动条常显，方便发现可左右滚动编辑 */
.table-scroll { scrollbar-width: thin; scrollbar-color: #b9a9cc transparent; }
.table-scroll::-webkit-scrollbar { height: 10px; width: 10px; }
.table-scroll::-webkit-scrollbar-track { background: transparent; }
.table-scroll::-webkit-scrollbar-thumb {
  background: #b9a9cc; border-radius: 99px; border: 2px solid transparent; background-clip: content-box;
}
.table-scroll::-webkit-scrollbar-thumb:hover { background: var(--primary); background-clip: content-box; border: 2px solid transparent; }
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.my-projects-table td[rowspan] { vertical-align: top; }
.my-projects-table td[rowspan] strong { display: block; margin-bottom: 2px; }
.my-projects-table .expense-amount { color: var(--danger); font-weight: 600; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
thead th {
  background: var(--surface-2); color: var(--text-2); font-weight: 600;
  text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap; position: sticky; top: 0;
}
tbody td { padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; white-space: nowrap; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }

/* 固定列宽 + 内容完整显示 */
/* 报销明细表：table-layout fixed + 最小宽度保证横向滚动
   注意：选择器需带 .table-scroll 提权，压过下方 .table-scroll table { min-width: 100% } 的特异性 */
.table-scroll table.table-fixed { table-layout: fixed; min-width: 1600px; }
.table-scroll table.table-fixed thead th { font-size: 12.5px; }
.table-scroll table.table-fixed tbody td { position: relative; }

/* 各列宽度（固定像素，合计 1600px；用像素避免隐藏"客户名称"列时百分比重分配导致列宽漂移） */
.table-fixed .col-fname   { width: 144px; }
.table-fixed .col-invno   { width: 144px; }
.table-fixed .col-expco   { width: 112px; }
.table-fixed .col-prjco   { width: 112px; }
.table-fixed .col-customer{ width: 112px; }
.table-fixed .col-subject { width: 128px; }
.table-fixed .col-date    { width: 112px; }
.table-fixed .col-amount  { width: 112px; }
.table-fixed .col-content { width: 160px; }
.table-fixed .col-from    { width: 96px; }
.table-fixed .col-to      { width: 96px; }
.table-fixed .col-note    { width: 160px; }
.table-fixed .col-action  { width: 112px; }

/* 表格滚动提示角标（可横向滚动时显示） */
.h-scroll-hint {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--primary); background: var(--primary-50);
  padding: 3px 10px; border-radius: 99px; white-space: nowrap;
  animation: fadeIn .3s ease;
}
.h-scroll-hint.show { display: inline-flex !important; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

/* 单元格内容超出省略（悬停用 title 看完整） */
.table-fixed td.cell-clip {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: default;
}
.table-fixed td.cell-clip:hover {
  overflow: visible; white-space: normal; word-break: break-all;
  background: var(--surface); z-index: 5; position: relative;
  box-shadow: var(--shadow); border-radius: var(--radius-sm);
  max-width: 280px;
}

/* 表格内表单控件 */
td input, td select {
  width: 100%; border: 1px solid transparent; background: transparent;
  padding: 6px 8px; border-radius: 6px; font-size: 13px; font-family: inherit; color: var(--text);
  transition: border-color .15s, background .15s;
}
td input:hover, td select:hover { border-color: var(--border); }
td input:focus, td select:focus { border-color: var(--primary); background: #fff; outline: none; box-shadow: 0 0 0 3px var(--primary-50); }
td.modified, tr.modified td { background: var(--warn-bg) !important; }
td.note input { background: #fffdf5; }

/* 会计科目低置信度提示 */
.subject-low-confidence {
  background: var(--warn-bg) !important;
  position: relative;
}
.subject-low-confidence select {
  border-color: var(--warn);
}
.confidence-hint {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.7;
  pointer-events: none;
}

/* 发票号：等宽字体，完整可读 */
td input.invoiceno {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Roboto Mono", monospace;
  font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--text);
}
/* 文件名：换行展示 */
td.filename { white-space: normal; word-break: break-all; line-height: 1.4; }
/* 金额：右对齐+加粗 */
td input.amount-input { text-align: right; font-weight: 650; font-size: 14px; }

.row-actions { display: flex; gap: 6px; justify-content: center; }

/* ============================ 徽章 ============================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 550;
  background: var(--primary-50); color: var(--primary-700);
}
.badge.ok { background: var(--success-bg); color: #047857; }
.badge.dup { background: var(--danger-bg); color: #b91c1c; }
.badge.warn { background: var(--warn-bg); color: #b45309; }
.badge.muted { background: #f1f5f9; color: var(--text-2); }

/* 状态颜色标签 */
.badge.submitted   { background: #dbeafe; color: #1d4ed8; }
.badge.approved    { background: var(--success-bg); color: #047857; }
.badge.rejected    { background: var(--danger-bg); color: #b91c1c; }
.badge.paid        { background: #f0fdf4; color: #166534; }
.badge.draft       { background: #f1f5f9; color: #64748b; }

/* ============================ 模态框 ============================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.modal-card {
  background: var(--card-bg);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-head h3 {
  margin: 0;
  font-size: 18px;
}
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-2);
  padding: 0;
  width: 32px;
  height: 32px;
  line-height: 32px;
}
.modal-close:hover {
  color: var(--text);
}
.modal-body {
  padding: 24px;
}
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.form-group {
  flex: 1;
}
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text);
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.input-with-btn {
  display: flex;
  gap: 8px;
}
.input-with-btn input {
  flex: 1;
}
.form-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-2);
}

/* 角色和状态徽章 */
.badge-role {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.badge-role.employee { background: #efdbff; color: #7200b3; }
.badge-role.manager { background: #fef3c7; color: #92400e; }
.badge-role.finance { background: #d1fae5; color: #065f46; }
.badge-role.admin { background: #fee2e2; color: #991b1b; }

.badge-status {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.badge-status.enabled { background: #d1fae5; color: #065f46; }
.badge-status.disabled { background: #fee2e2; color: #991b1b; }

@media (max-width: 640px) {
  .form-row {
    flex-direction: column;
  }
  .modal-card {
    width: 95%;
  }
}

/* ============================ 员工首页（原个人信息页） ============================ */

/* ---- 基本信息卡片 ---- */
.profile-info-card {
  margin-bottom: 20px;
}
.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  padding: 20px;
}
.profile-info-grid .info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.profile-info-grid .info-item:hover {
  background: var(--primary-50);
}
.profile-info-grid .info-label {
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 550;
}
.profile-info-grid .info-value {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
}

/* ---- 快捷操作 ---- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: all .18s;
}
.quick-action-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.15);
  transform: translateY(-2px);
}
.quick-action-btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-700));
  border-color: var(--primary);
  color: #fff;
}
.quick-action-btn.primary:hover {
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}
.quick-action-btn .qa-icon {
  font-size: 28px;
}
.quick-action-btn .qa-title {
  font-size: 15px;
  font-weight: 650;
}
.quick-action-btn .qa-desc {
  font-size: 12px;
  color: var(--text-2);
}
.quick-action-btn.primary .qa-desc {
  color: rgba(255,255,255,0.8);
}

/* ---- 项目归属 ---- */
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px;
}
.project-group {
  margin-bottom: 20px;
}
.project-group-title {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text-2);
  margin: 0 0 12px;
  padding-left: 4px;
}
.project-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}
.project-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  transition: background .12s;
  gap: 16px;
}
.project-card-head:hover {
  background: var(--surface-2);
}
.project-card-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.project-card-name {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-label {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 10px;
  white-space: nowrap;
}
.status-active  { background: #dcfce7; color: #15803d; }
.status-completed { background: #dbeafe; color: #1d4ed8; }
.status-terminated { background: #fee2e2; color: #b91c1c; }
.my-projects-table .expense-amount-col { text-align: center; vertical-align: middle; }
.my-projects-table .ratio-cell  { color: var(--primary); font-weight: 600; text-align: center; vertical-align: middle; }
.project-card-stats {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  color: var(--text-2);
}
.project-card-stats .stat-label {
  font-weight: 550;
  color: var(--text-2);
}
.project-expand-icon {
  font-size: 11px;
  color: var(--text-3);
  transition: transform .2s;
}
.project-contracts {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.contract-table-wrap {
  overflow-x: auto;
}
.contract-mini-table {
  width: 100%;
  font-size: 13px;
}
.contract-mini-table th {
  background: var(--surface);
  font-size: 12px;
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-2);
}
.contract-mini-table td {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}
.badge-status-active { background: #dcfce7; color: #15803d; }
.badge-status-completed { background: #dbeafe; color: #1d4ed8; }
.badge-status-terminated { background: #fee2e2; color: #b91c1c; }
.badge-status-pending { background: #fef3c7; color: #92400e; }

/* ---- 旧版个人信息（保留向后兼容） ---- */
.profile-info { padding: 20px; }
.info-row { display: flex; padding: 12px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-row label { width: 100px; font-weight: 500; color: var(--text-2); }
.info-value { flex: 1; color: var(--text); font-weight: 600; }
.password-form { padding: 20px; max-width: 400px; }
.password-form .form-group { margin-bottom: 16px; }
.password-form label { display: block; margin-bottom: 6px; font-weight: 500; }
.password-form input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.password-form input:focus { outline: none; border-color: var(--primary); }

/* ============================ 历史报销列表 ============================ */

/* 筛选栏 */
.filter-bar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-bottom: 16px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.filter-bar input, .filter-bar select {
  padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; color: var(--text); background: var(--surface);
  transition: border-color .15s;
}
.filter-bar input:focus, .filter-bar select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50);
}
.filter-bar input { width: 180px; }
.filter-bar select { width: 130px; }
.filter-bar .spacer { flex: 1; }
.filter-bar .filter-hint { font-size: 12px; color: var(--muted); }

/* 统计概要 */
.summary-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px;
  margin-bottom: 16px;
}
.summary-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow-sm); text-align: center;
}
.summary-item .label { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.summary-item .value { font-size: 18px; font-weight: 750; color: var(--text); }
.summary-item .value.highlight { color: var(--primary-700); }

/* 行展开 */
.expand-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: 14px; color: var(--text-2);
  transition: transform .2s, background .15s;
}
.expand-toggle:hover { background: var(--primary-50); color: var(--primary); }
.expand-toggle.open { transform: rotate(90deg); }

/* 展开的明细行 */
.expand-row td {
  padding: 0 12px 12px 12px; background: var(--surface-2) !important;
}
.expand-inner {
  padding: 12px 16px; background: var(--surface); border-radius: var(--radius-sm);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.expand-inner h4 { font-size: 13px; margin-bottom: 10px; color: var(--text-2); }
.expand-inner .mini-table { font-size: 12.5px; }
.expand-inner .mini-table th { font-size: 11.5px; padding: 8px 10px; background: var(--surface-2); }
.expand-inner .mini-table td { padding: 7px 10px; font-size: 12.5px; }
.expand-inner .order-actions { margin-top: 12px; display: flex; gap: 10px; }

/* 分页 */
.pager {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 16px; padding: 10px;
}
.pager button {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 7px 14px; cursor: pointer; font-family: inherit; font-size: 13px; color: var(--text-2);
  transition: .15s;
}
.pager button:hover { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); }
.pager button:disabled { opacity: .4; cursor: not-allowed; background: var(--surface); }
.pager button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager .page-info { font-size: 13px; color: var(--muted); padding: 0 8px; }

/* ============================ 统计条 / 金额 ============================ */
.total-bar {
  display: flex; justify-content: flex-end; align-items: center; gap: 14px;
  margin-top: 16px; padding: 14px 16px; background: var(--primary-50);
  border-radius: var(--radius); border: 1px solid var(--primary-100);
}
.total-bar .label { color: var(--text-2); font-size: 14px; }
.total-bar .amt { font-size: 22px; font-weight: 750; color: var(--primary-700); letter-spacing: -.02em; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.stat-card .k { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.stat-card .v { font-size: 24px; font-weight: 750; color: var(--text); letter-spacing: -.02em; }
.stat-card .v small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 4px; }

/* 图表容器 */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.chart-card .card-head { margin-bottom: 12px; }
.chart-card .card-head h3 { font-size: 14px; font-weight: 600; color: var(--text); }
.chart-wrap { position: relative; height: 280px; }
.chart-wrap canvas { width: 100% !important; }

/* 周期报表摘要条 */
.report-summary {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; margin-bottom: 8px;
}
.report-summary .tag { color: var(--text-2); font-size: 12px; }
.report-summary .sep { color: var(--border-strong); margin: 0 4px; }

@media (max-width: 768px) {
  .charts-row { grid-template-columns: 1fr; }
  .chart-wrap { height: 240px; }
}

/* ============================ 发票查看弹窗 ============================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 999;
  display: flex; align-items: center; justify-content: center;
}
.modal-overlay.hidden { display: none; }
.modal-content.inv-viewer {
  background: var(--surface); border-radius: 12px; padding: 16px;
  width: min(90vw, 900px); max-height: 85vh; overflow: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}

/* ============================ 提示 toast ============================ */
.toast {
  position: fixed; top: 22px; left: 50%; transform: translateX(-50%) translateY(-12px);
  background: #0f172a; color: #fff; padding: 11px 20px; border-radius: var(--radius-pill);
  z-index: 999; opacity: 0; transition: .25s ease; font-size: 13.5px; box-shadow: var(--shadow-lg);
  pointer-events: none; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--success); }

/* ============================ 分段导航 tabs ============================ */
.tabs { display: inline-flex; gap: 4px; background: #eef0f6; padding: 4px; border-radius: var(--radius-pill); margin-bottom: 18px; }
.tabs button {
  background: transparent; border: none; padding: 8px 20px; border-radius: var(--radius-pill);
  cursor: pointer; font-family: inherit; font-size: 13.5px; font-weight: 550; color: var(--text-2);
  transition: .15s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--surface); color: var(--primary-700); box-shadow: var(--shadow-sm); }

/* ============================ 空状态 ============================ */
.empty {
  text-align: center; padding: 46px 20px; color: var(--muted);
}
.empty .ic { font-size: 34px; margin-bottom: 10px; opacity: .7; }
.empty p { margin: 0; }

/* =====================================================================
   登录页 · 分屏布局
   ===================================================================== */
.login-page { min-height: 100vh; display: flex; }
.auth-split { display: flex; width: 100%; min-height: 100vh; }

/* 左侧品牌区（埃森哲紫风格） */
.auth-brand {
  position: relative; flex: 1 1 52%; overflow: hidden;
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.06) 1px, transparent 0) 0 0 / 28px 28px,
    radial-gradient(130% 130% at 22% 0%, #b33dff 0%, #a100ff 34%, #6a00b8 72%, #2d0a45 100%);
  color: #fff; padding: 52px 54px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-brand::before {
  content: ""; position: absolute; width: 340px; height: 340px; right: -110px; top: -110px;
  background: radial-gradient(circle, rgba(255,255,255,.14), transparent 68%); border-radius: 50%;
}
.auth-brand::after {
  content: ""; position: absolute; width: 240px; height: 240px; left: -80px; bottom: -80px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255,255,255,.03), 0 0 0 56px rgba(255,255,255,.02);
}
.brand-head { position: relative; z-index: 1; }
.brand-mark {
  width: 64px; height: 64px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,.10));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25), 0 8px 24px rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: center;
}
.auth-brand h1 {
  font-size: 32px; line-height: 1.2; margin: 20px 0 10px; font-weight: 700; letter-spacing: .5px;
  /* 渐变流光文字：白 → 淡紫 → 白 流动 */
  background: linear-gradient(90deg, #ffffff 0%, #e9d5ff 40%, #ffffff 62%, #e9d5ff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: titleShine 5s linear infinite;
}
@keyframes titleShine {
  to { background-position: 200% center; }
}
.auth-brand .brand-sub { font-size: 14.5px; opacity: .88; max-width: 400px; line-height: 1.6; }

/* 模块卡片（四宫格） */
.brand-modules {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin: 34px 0 30px; position: relative; z-index: 1; max-width: 440px;
}
.bm-card {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px; backdrop-filter: blur(4px);
  transition: background .18s, transform .18s;
}
.bm-card:hover { background: rgba(255,255,255,.14); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.bm-ic {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center;
}
.bm-txt { min-width: 0; }
.bm-txt b { display: block; font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.bm-txt span { display: block; font-size: 11.5px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.brand-quote {
  position: relative; z-index: 1; font-size: 13px; opacity: .78;
  border-top: 1px solid rgba(255,255,255,.18); padding-top: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand-ver {
  flex: none; font-size: 12px; padding: 3px 10px; border-radius: 99px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  letter-spacing: .5px;
}

/* ===== 登录页动效 ===== */
.auth-brand::before { animation: glowDrift 14s ease-in-out infinite alternate; }
@keyframes glowDrift {
  from { transform: translate(0, 0); }
  to { transform: translate(-46px, 44px) scale(1.06); }
}
.brand-head { animation: fadeUp .55s ease both; }
.brand-modules { animation: fadeUp .6s ease .12s both; }
.bm-card { opacity: 0; animation: fadeUp .45s ease forwards; }
.bm-card:nth-child(1) { animation-delay: .32s; }
.bm-card:nth-child(2) { animation-delay: .4s; }
.bm-card:nth-child(3) { animation-delay: .48s; }
.bm-card:nth-child(4) { animation-delay: .56s; }
.brand-quote { animation: fadeUp .5s ease .68s both; }
.auth-card { animation: fadeUp .6s ease .2s both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .auth-brand h1, .auth-brand::before, .bm-card, .brand-head, .brand-modules, .brand-quote, .auth-card { animation: none; opacity: 1; }
}

/* 右侧表单区 */
.auth-main {
  flex: 1 1 48%; background: var(--bg); display: flex; align-items: center; justify-content: center;
  padding: 40px 32px;
}
.auth-card { width: 100%; max-width: 400px; }
.auth-head { margin-bottom: 22px; }
.auth-head h2 { font-size: 24px; margin-bottom: 6px; }
.auth-head .sub { color: var(--muted); font-size: 13.5px; }

/* 登录方式切换 */
.seg { display: flex; background: #eef0f6; padding: 4px; border-radius: var(--radius-pill); margin-bottom: 22px; }
.seg button {
  flex: 1; padding: 9px; border: none; background: transparent; border-radius: var(--radius-pill);
  cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text-2); transition: .15s;
}
.seg button.active { background: var(--surface); color: var(--primary-700); box-shadow: var(--shadow-sm); }

.auth-form .field { position: relative; }
.auth-form .input-icon { position: relative; }
.auth-form .input-icon > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 15px; opacity: .55; display: inline-flex; align-items: center; }
.auth-form .input-icon > span.ic { color: var(--text-2); opacity: .6; }
.auth-form .input-icon > span.ic svg { display: block; }
.auth-form .input-icon input { padding-left: 38px; }
.auth-error { color: var(--danger); font-size: 12.5px; margin: -4px 0 14px; min-height: 16px; }

/* ===== 图形验证码 ===== */
.captcha-row { display: flex; gap: 10px; }
.captcha-row .input-icon { flex: 1; }
.captcha-box {
  width: 128px; height: 44px; flex: none; border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--border-strong); background: #f5f0fb;
  display: flex; align-items: center; justify-content: center; transition: border-color .15s;
}
.captcha-box:hover { border-color: var(--primary); }
.captcha-box svg { display: block; width: 100%; height: 100%; }
.captcha-box.spin { animation: captchaSpin .45s ease; }
@keyframes captchaSpin {
  0% { transform: rotate(0) scale(1); }
  40% { transform: rotate(-4deg) scale(.94); }
  100% { transform: rotate(0) scale(1); }
}

.auth-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 22px; }

/* =====================================================================
   员工端 · 应用外壳
   ===================================================================== */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
  position: sticky; top: 0; z-index: 50; background: var(--surface);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px; height: 62px;
}
.app-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; color: var(--text); }
.app-brand .logo {
  width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #a100ff, #a100ff);
  display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: var(--shadow-primary);
}
.app-user { display: flex; align-items: center; gap: 14px; }
.app-user .name { color: var(--text-2); font-size: 13.5px; }
.app-user .avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary-100); color: var(--primary-700);
  display: flex; align-items: center; justify-content: center; font-weight: 650; font-size: 14px;
}
.app-main { flex: 1; }
.app-main .container { max-width: 1480px; margin: 0 auto; padding: 26px 28px 48px; }
.page-title { font-size: 20px; margin-bottom: 4px; }
.page-desc { color: var(--muted); font-size: 13px; margin-bottom: 20px; }

/* 拖拽上传 */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 42px;
  text-align: center; color: var(--text-2); background: var(--surface-2);
  transition: .15s; cursor: pointer; font-size: 14px;
}
.dropzone:hover { border-color: var(--primary); background: var(--primary-50); }
.dropzone.drag { border-color: var(--primary); background: var(--primary-50); color: var(--primary-700); transform: scale(1.005); }
.dropzone .big { font-size: 30px; margin-bottom: 10px; }
.dropzone b { color: var(--text); }

/* =====================================================================
   后台 · 侧边栏外壳
   ===================================================================== */
.admin-shell { min-height: 100vh; display: flex; }

.sidebar {
  width: 248px; flex: none; background: linear-gradient(180deg, #5b0a8c 0%, #1e1b4b 100%);
  color: #c7d2fe; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 60;
}
.side-brand {
  display: flex; align-items: center; gap: 10px; padding: 22px 22px 18px;
  font-size: 17px; font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255,255,255,.1);
}
.side-brand .logo {
  width: 32px; height: 32px; border-radius: 9px; background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.side-nav { flex: 1; padding: 16px 14px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav-group { margin-bottom: 20px; }
.nav-group-title {
  font-size: 11px; font-weight: 600; color: #a5b4fc; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 8px 14px 6px;
}
.nav-group-title.collapsible {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: color 0.2s;
}
.nav-group-title.collapsible:hover {
  color: #fff;
}
.nav-collapse-icon {
  font-size: 8px;
  transition: transform 0.3s;
}
.nav-group.collapsed .nav-collapse-icon {
  transform: rotate(-90deg);
}
.nav-group.collapsed .nav-group-items {
  display: none;
}
.nav-group-items {
  display: block;
}
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px;
  background: transparent; border: none; color: #c7d2fe; cursor: pointer; font-family: inherit;
  font-size: 14px; font-weight: 500; text-align: left; transition: .15s; position: relative;
}
.nav-item .nav-ic { font-size: 15px; width: 20px; text-align: center; display: inline-flex; align-items: center; justify-content: center; opacity: .85; flex: none; }
.nav-item .nav-ic svg { display: block; }
.nav-item:hover .nav-ic { opacity: 1; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: rgba(99,102,241,.32); color: #fff; }
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px;
  background: #818cf8; border-radius: 0 4px 4px 0;
}
.side-foot {
  padding: 16px 18px;
  border-top: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.08);
  margin-top: auto;
  flex-shrink: 0;
}

.side-foot .name {
  font-size: 13px;
  color: #efdbff;
  font-weight: 500;
}

.admin-content { flex: 1; margin-left: 248px; min-width: 0; }
.admin-top {
  position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); padding: 16px 28px; display: flex; align-items: center; gap: 16px;
}
.admin-top h1 { font-size: 19px; flex: 1; }
.admin-top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.menu-btn { display: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; width: 38px; height: 38px; font-size: 18px; cursor: pointer; }
.admin-content .container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 28px 80px; /* 增加底部padding，避免被版权栏遮挡 */
}

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 55; }

/* ============================ 确认弹窗 ============================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); max-width: 820px; width: 92vw;
  max-height: 88vh; overflow-y: auto; padding: 28px 30px;
}
.modal-head h2 { font-size: 18px; margin-bottom: 4px; }
.modal-head p { margin-top: 4px; font-size: 13.5px; }
.modal-actions {
  display: flex; gap: 12px; justify-content: flex-end;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
}

/* 验真状态颜色 */
.warn-text { color: var(--warn); font-weight: 600; }
.danger-text { color: var(--danger); font-weight: 600; }

/* micro modal for simple confirm */
.micro-modal {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.micro-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 24px 28px; max-width: 480px; width: 90vw;
}
.micro-card h3 { margin-bottom: 10px; font-size: 16px; }
.micro-card .micro-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* 核销/付款确认弹窗 */
.cfm-box {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 24px 28px; max-width: 500px; width: 90vw;
}
.cfm-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding-top: 16px; border-top: 1px solid var(--border);
}

/* ============================ 问题文件清单面板 ============================ */
.excluded-panel {
  margin-top: 16px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface);
}
.excluded-panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: #fef2f2; border-bottom: 1px solid #fecaca;
  cursor: pointer; user-select: none;
}
.excluded-panel-head h3 {
  font-size: 14px; font-weight: 600; color: #b91c1c; flex: 1;
}
.excluded-panel-head .count-badge {
  font-size: 12px; background: #dc2626; color: #fff; padding: 2px 8px; border-radius: 10px;
  font-weight: 600; min-width: 18px; text-align: center;
}
.excluded-panel-head .toggle-arrow {
  font-size: 12px; color: #b91c1c; transition: transform .2s;
  width: 18px; text-align: center;
}
.excluded-panel-head .toggle-arrow.collapsed { transform: rotate(-90deg); }
.excluded-panel-body {
  max-height: 600px; overflow-y: auto; transition: max-height .3s ease;
}
.excluded-panel-body.collapsed { max-height: 0; overflow: hidden; }
.excluded-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid #fef2f2;
  font-size: 13px; line-height: 1.5;
}
.excluded-item:last-child { border-bottom: none; }
.excluded-item .file-icon { font-size: 18px; flex: none; margin-top: 1px; }
.excluded-item .file-info { flex: 1; min-width: 0; }
.excluded-item .file-name {
  font-weight: 600; color: var(--text); word-break: break-all;
}
.excluded-item .file-reason {
  color: var(--text-2); font-size: 12.5px; margin-top: 2px;
}
.excluded-item .file-reason strong { color: #b91c1c; }

/* 问题文件状态标签 */
.verify-badge {
  display: inline-block; font-size: 11.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px; white-space: nowrap; flex: none;
}
.verify-badge.invalid {
  background: #fef2f2; color: #dc2626; border: 1px solid #fecaca;
}
.verify-badge.suspect {
  background: #fffbeb; color: #d97706; border: 1px solid #fde68a;
}
.verify-badge.failed {
  background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca;
}
.verify-badge.valid {
  background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0;
}

/* 上传状态栏增强 */
.upload-status-bar {
  margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.upload-status-bar .status-chip {
  font-size: 12.5px; padding: 5px 12px; border-radius: 16px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.status-chip.ok { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.status-chip.warn { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.status-chip.err { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* ============================ 确认弹窗内验真结果面板 ============================ */
.verify-fail-box, .verify-warn-box {
  margin: 0 0 14px; border-radius: var(--radius-sm);
  padding: 0; overflow: hidden;
}
.verify-fail-box {
  background: #fef2f2; border: 1.5px solid #fca5a5;
}
.verify-warn-box {
  background: #fffbeb; border: 1.5px solid #fcd34d;
}
.vf-header {
  padding: 10px 14px; font-size: 13px; font-weight: 600;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.verify-fail-box .vf-header { color: #b91c1c; background: #fee2e2; }
.verify-warn-box .vf-header { color: #92400e; background: #fef3c7; }
.vf-row {
  padding: 10px 14px; border-bottom: 1px solid rgba(0,0,0,.04); font-size: 13px;
}
.vf-row:last-child { border-bottom: none; }
.vf-name { font-weight: 600; color: var(--text); margin-bottom: 2px; word-break: break-all; }
.vf-no { color: var(--text-2); font-size: 12px; font-family: ui-monospace, monospace; margin-bottom: 4px; }
.vf-issues { margin: 4px 0 0; padding-left: 18px; list-style: none; color: var(--text); line-height: 1.6; }
.vf-issues li { font-size: 12.5px; }
.vf-issues li:last-child { margin-bottom: 0; }
.verify-fail-box .vf-issues li { color: #991b1b; }
.verify-warn-box .vf-issues li { color: #92400e; }
.vf-footer {
  padding: 8px 14px; font-size: 12px; color: #b91c1c;
  background: #fee2e2; border-top: 1px solid #fca5a5;
}
.vf-actions {
  padding: 12px 14px; display: flex; gap: 10px; justify-content: flex-end;
  border-top: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.5);
}

/* ============================ 更新日志页 ============================ */
.changelog-page { max-width: 860px; }

.changelog-hero {
  text-align: center; padding: 40px 20px 32px;
  background: linear-gradient(135deg, #5b0a8c 0%, #a100ff 100%);
  border-radius: var(--radius-lg); color: #fff; margin-bottom: 24px;
}
.ver-badge {
  display: inline-block; background: rgba(255,255,255,.18); color: #fff;
  padding: 4px 16px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 700; letter-spacing: .06em; margin-bottom: 12px;
  backdrop-filter: blur(4px);
}
.changelog-hero h1 { font-size: 24px; margin-bottom: 6px; color: #fff; }
.ver-date { font-size: 13.5px; opacity: .8; margin: 0; }

.changelog-section { padding: 24px 28px; }
.section-header {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 16px; margin-bottom: 18px; border-bottom: 2px solid var(--border);
}
.section-header h2 { font-size: 17px; margin: 0; }
.section-icon { font-size: 20px; }
.section-header.dev { border-bottom-color: #818cf8; }
.section-header.fix { border-bottom-color: #f59e0b; }
.section-header.tech { border-bottom-color: var(--border-strong); }

.changelog-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.changelog-list li {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 13px 16px; background: var(--surface-2); border-radius: var(--radius-sm);
  border: 1px solid var(--border); transition: box-shadow .15s;
}
.changelog-list li:hover { box-shadow: var(--shadow-sm); }
.changelog-list li .cl-tag {
  flex: none; font-size: 11.5px; font-weight: 650; padding: 3px 10px;
  border-radius: var(--radius-pill); white-space: nowrap; margin-top: 1px;
}
.cl-tag.tag-new { background: #dbeafe; color: #1d4ed8; }
.cl-tag.tag-fix { background: #fef3c7; color: #92400e; }
.cl-tag.tag-db  { background: #f3e8ff; color: #7c3aed; }
.cl-tag.tag-api { background: #d1fae5; color: #065f46; }
.changelog-list li strong {
  display: block; font-size: 14px; color: var(--text); margin-bottom: 4px;
}
.changelog-list li p {
  margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.6;
}
.changelog-list li code {
  background: var(--primary-50); color: var(--primary-700);
  padding: 1px 7px; border-radius: 4px; font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.tech-stack {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.tech-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--surface-2); border-radius: var(--radius-sm);
  font-size: 13.5px;
}
.tech-label {
  font-size: 12px; font-weight: 650; color: var(--muted); min-width: 52px; text-transform: uppercase; letter-spacing: .04em;
}
@media (max-width: 600px) {
  .tech-stack { grid-template-columns: 1fr; }
}

/* ============================ 响应式 ============================ */
@media (max-width: 900px) {
  .auth-brand { display: none; }
  .auth-main { flex: 1; }

  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .admin-content { margin-left: 0; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar-overlay.show { display: block; }

  /* 移动端版权栏覆盖全屏 */
  .admin-page .app-footer { left: 0; }
}

/* ============================ 版权信息 ============================ */
.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 44px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  color: var(--text-2);
  z-index: 100;
}

/* 后台管理页版权栏 - 从侧边栏右侧开始，不遮挡侧边栏 */
.admin-page .app-footer {
  left: 248px;
  z-index: 50; /* 低于侧边栏(60)，避免覆盖 */
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.footer-content .copyright {
  font-weight: 500;
}

.footer-content .version {
  background: var(--primary-50);
  color: var(--primary-700);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 11px;
}

/* ============================ 个人信息页布局 ============================ */
.profile-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}
.profile-left {
  display: flex; flex-direction: column; gap: 20px;
  position: sticky; top: 88px;
}
.profile-right { min-width: 0; }

/* 旧版兼容 */
.form-hint {
  margin-top: 12px; padding: 10px 14px;
  background: var(--surface-2); border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--text-2); line-height: 1.5;
}

/* 标签页卡片 */
.profile-tabs-card {
  padding: 0;
}

.profile-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  background: var(--surface-2);
}

.profile-tab {
  flex: 1;
  padding: 14px 20px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  transition: color .15s, background .15s;
}

.profile-tab:hover {
  background: var(--primary-50);
  color: var(--primary-700);
}

.profile-tab.active {
  color: var(--primary);
  background: var(--surface);
}

.profile-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.profile-panel {
  display: none;
  padding: 20px;
}

.profile-panel.active {
  display: block;
}

/* 响应式 */
@media (max-width: 1100px) {
  .profile-layout { grid-template-columns: 1fr; }
  .profile-left { position: static; }
  .profile-info-grid { grid-template-columns: repeat(3, 1fr); }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .profile-info-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .project-card-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .project-card-stats { flex-wrap: wrap; gap: 8px; }
}

/* 后台管理表格优化 - 防止内容被压缩 */
.table-scroll table,
.table-wrap table {
  min-width: 100%;
}

/* 合同管理表格最小宽度（10列） */
#tab-contract table {
  min-width: 1200px;
}

/* 工资管理表格最小宽度 */
#tab-salary table {
  min-width: 1100px;
}

/* 绩效管理表格最小宽度 */
#tab-performance table {
  min-width: 1100px;
}

/* 财务报告表格最小宽度 */
#tab-financial-reports-external table,
#tab-financial-reports-internal table {
  min-width: 1000px;
}

/* 阶段管理表格最小宽度 */
#contractStagesModal table {
  min-width: 600px;
}

/* 文件名等特殊列允许换行 */
td.filename,
td.contract-name,
td.report-name {
  white-space: normal;
  word-break: break-word;
  max-width: 250px;
}

/* 操作列固定宽度 */
td[action],
th[action] {
  min-width: 140px;
}

/* 合同统计卡片优化 */
.stat-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-card > div:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-card > div:first-child::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

#companyStatsList > div {
  transition: transform 0.2s, box-shadow 0.2s;
}

#companyStatsList > div:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ==================== 统计报表 - 财务仪表板样式 ==================== */

/* 财务概览卡片组 - 优化布局，更紧凑美观 */
.finance-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1200px) {
  .finance-overview {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .finance-overview {
    grid-template-columns: 1fr;
  }
}

.finance-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.finance-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.finance-card.income::before {
  background: linear-gradient(90deg, #10b981, #059669);
}

.finance-card.expense::before {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.finance-card.receivable::before {
  background: linear-gradient(90deg, #a100ff, #a100ff);
}

.finance-card.reimbursement::before {
  background: linear-gradient(90deg, #0ea5e9, #0284c7);
}

.finance-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.finance-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.finance-icon {
  font-size: 22px;
  line-height: 1;
}

.finance-header h3 {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
  font-weight: 600;
}

.finance-body {
  position: relative;
  z-index: 1;
}

.finance-total {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.finance-breakdown {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.finance-breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: 6px;
  font-size: 12px;
}

.finance-breakdown-item .company-name {
  color: var(--text-2);
  font-weight: 500;
}

.finance-breakdown-item .company-amount {
  font-weight: 600;
  color: var(--text);
}

.finance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.finance-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.finance-row .label {
  font-size: 13px;
  color: var(--text-2);
}

.finance-row .value {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.finance-row .value.success {
  color: var(--success);
}

.finance-row .value.warn {
  color: var(--warn);
}

/* 统计报表的图表卡片 */
.charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.chart-card .card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.chart-card .card-head h3 {
  margin: 0;
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
}

.chart-wrap {
  padding: 20px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-wrap canvas {
  max-width: 100%;
  max-height: 100%;
}
/* 财务卡片悬停效果 */
.finance-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

/* 统计分段标题 */
.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 28px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

/* 员工排名高亮行 */
.top-rank td {
  font-weight: 600;
}

/* ============ 打印样式 ============ */
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body { background: #fff !important; color: #000 !important; font-size: 11px; }
  /* 隐藏非报表元素 */
  .sidebar, .admin-top, .toolbar, .btn, .sidebar-overlay, .toast, .side-nav,
  .nav-group, .side-brand, .side-foot, .menu-btn, .admin-top-actions,
  #statPrintInfo + .toolbar, .no-print { display: none !important; }
  /* 只显示统计报表内容 */
  .admin-content { margin-left: 0 !important; padding: 0 !important; }
  .container { max-width: 100% !important; padding: 0 !important; }
  .hidden { display: block !important; }
  #tab-stat { display: block !important; }
  #tab-stat > :not(.finance-overview):not(.charts-row):not(.chart-card):not(.card):not(.section-title) { display: none !important; }
  .section-title, #profitCharts { display: block !important; }
  /* 隐藏其他 tab */
  #tab-verify, #tab-invoice, #tab-salary, #tab-performance,
  #tab-contract, #tab-project, #tab-emp, #tab-report,
  #tab-report-external, #tab-report-internal, #tab-changelog { display: none !important; }
  /* 财务卡片 */
  .finance-overview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
  .finance-card {
    background: #fff; border: 1px solid #ccc; border-radius: 8px; padding: 10px 12px;
    box-shadow: none; page-break-inside: avoid;
  }
  .finance-card::before { display: none; }
  .finance-card:hover { transform: none; box-shadow: none; }
  .finance-total { font-size: 20px; margin-bottom: 4px; color: #000; }
  .finance-breakdown-item { font-size: 10px; padding: 2px 0; }
  /* 图表区域 */
  .charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; page-break-inside: avoid; }
  .chart-card { border: 1px solid #ccc; padding: 10px; margin-bottom: 8px; page-break-inside: avoid; box-shadow: none; }
  .chart-wrap { height: 220px; }
  .chart-wrap canvas { display: none !important; }
  .chart-print-img { display: block !important; }
  /* 表格 */
  .card { border: 1px solid #ccc; padding: 10px; margin-bottom: 8px; page-break-inside: avoid; box-shadow: none; }
  .card-head { margin-bottom: 6px; }
  .card-head h2, .card-head h3 { font-size: 13px; }
  .table-scroll { overflow: visible; }
  table { width: 100%; font-size: 10px; border-collapse: collapse; }
  th, td { padding: 4px 6px; border: 1px solid #ccc; }
  th { background: #eee; font-weight: 600; }
  /* 打印专用元素 */
  .print-only { display: block !important; }
  .print-only h2 { font-size: 18px; color: #000; }
}
.print-only { display: none; }

/* 工具栏按钮右对齐 */
.toolbar .stat-actions { margin-left: auto; display: flex; gap: 8px; }

/* ===== 各公司费用统计面板（整体面板式，非独立小卡片）===== */
.stat-panel {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.stat-panel .sp-cell {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  position: relative;
  transition: background .15s;
  min-width: 0;
}
.stat-panel .sp-cell + .sp-cell { border-left: 1px solid var(--border); }
.stat-panel .sp-cell:hover { background: var(--surface-2); }

/* 主指标：费用总计 */
.stat-panel .sp-main {
  background:
    radial-gradient(120% 140% at 100% 0%, var(--primary-100) 0%, transparent 55%),
    linear-gradient(160deg, var(--primary-50) 0%, transparent 60%);
}
.stat-panel .sp-main .sp-value {
  font-size: clamp(22px, 2vw, 32px);
  color: var(--primary);
}
.sp-deco {
  position: absolute; right: 14px; top: 12px;
  width: 44px; height: 44px; opacity: .1; pointer-events: none;
  color: var(--primary);
}

/* 指标排版 */
.sp-label {
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: .02em;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.sp-label svg { opacity: .55; flex: none; }
.sp-value {
  font-size: clamp(17px, 1.5vw, 24px);
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: -0.02em;
  overflow: hidden; text-overflow: ellipsis;
}
.sp-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

/* 窄屏：两列换行 */
@media (max-width: 1080px) {
  .stat-panel { grid-template-columns: repeat(2, 1fr); }
  .stat-panel .sp-cell + .sp-cell { border-left: none; }
  .stat-panel .sp-cell:nth-child(even) { border-left: 1px solid var(--border); }
  .stat-panel .sp-cell:nth-child(n+3) { border-top: 1px solid var(--border); }
  .stat-panel .sp-main { grid-column: 1 / -1; border-bottom: 1px solid var(--border); }
}

/* ===== 旧版迷你卡（保留兼容其他页面引用）===== */
.stat-mini-card {
  flex: 1 1 130px; min-width: 130px; max-width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 14px;
  text-align: center;
  transition: box-shadow 0.2s;
  overflow: hidden;
}
.stat-mini-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.stat-mini-num {
  display: block;
  font-size: clamp(14px, 1.3vw, 22px);
  font-weight: 700;
  color: var(--accent, var(--primary));
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: -0.02em;
}
.stat-mini-num.large { font-size: clamp(13px, 1.1vw, 18px); letter-spacing: -0.03em; }
.stat-mini-label {
  display: block;
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 2px;
}
.split-company-card { transition: box-shadow 0.2s; }
.split-company-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.split-company-head { transition: background 0.15s; }
.split-company-head:hover { background: var(--border) !important; }
.mini-table { border-collapse: collapse; }
.mini-table th, .mini-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.mini-table th { background: var(--bg-2); font-weight: 600; font-size: 12px; color: var(--text-2); }
.mini-table tr:hover td { background: var(--bg-2); }

/* 供应商详情弹窗 */
.sup-detail-info { font-size: 14px; line-height: 2; }

/* 费用管理表单网格 */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; }

@media (max-width: 768px) {
  .grid2 { grid-template-columns: 1fr; }
}

/* =====================================================================
   数据座舱 V2 · 面板式重设计（Stripe 风格：整体感 / 层级 / 主次分明）
   ===================================================================== */

/* ---- 核心指标：英雄面板 ---- */
.dash-hero {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  background: var(--surface);
}
.dash-hero .dh-main {
  position: relative;
  padding: 24px 28px;
  background: linear-gradient(135deg, #7200b3 0%, #a100ff 55%, #b92eff 100%);
  color: #fff;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  overflow: hidden;
}
.dash-hero .dh-main::before {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.18) 0%, transparent 70%);
}
.dash-hero .dh-main::after {
  content: ''; position: absolute; right: 30px; bottom: -60px;
  width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.10) 0%, transparent 70%);
}
.dh-main .dh-label { font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.82); letter-spacing: .04em; display: flex; align-items: center; gap: 6px; }
.dh-main .dh-value { font-size: clamp(26px, 2.4vw, 36px); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.dh-main .dh-sub { font-size: 12px; color: rgba(255,255,255,.72); display: flex; gap: 12px; flex-wrap: wrap; }
.dh-main .dh-sub b { color: #fff; font-weight: 600; }
.dh-main .dh-trend { position: absolute; right: 20px; bottom: 18px; font-size: 11.5px; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.16); backdrop-filter: blur(4px); color: #fff; }
.dash-hero .dh-cell {
  padding: 22px 24px;
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  border-left: 1px solid var(--border);
  position: relative;
  transition: background .15s;
  min-width: 0;
}
.dash-hero .dh-cell:hover { background: var(--surface-2); }
.dh-cell .dh-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.dh-cell .dh-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.dh-cell .dh-value { font-size: clamp(19px, 1.7vw, 26px); font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.dh-cell .dh-sub { font-size: 11.5px; color: var(--muted); }
/* 语义配色：收入=品牌紫 / 报销成本=琥珀 / 支出成本=玫红 / 周报=天蓝 */
.dh-cell.tone-income .dh-icon  { background: var(--primary-50);  color: var(--primary); }
.dh-cell.tone-income .dh-value { color: var(--primary-700); }
.dh-cell.tone-reim .dh-icon   { background: var(--warn-bg);     color: var(--warn); }
.dh-cell.tone-reim .dh-value  { color: #b45309; }
.dh-cell.tone-exp .dh-icon    { background: #fdf2f8;            color: #db2777; }
.dh-cell.tone-exp .dh-value   { color: #be185d; }
.dh-cell.tone-week .dh-icon   { background: #f0f9ff;            color: var(--info); }
.dh-cell.tone-week .dh-value  { color: #0369a1; }

/* ---- 座舱卡片头 ---- */
.dash-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dash-card-head h2 { font-size: 15px; font-weight: 700; color: var(--text); margin: 0; display: flex; align-items: center; gap: 8px; }
.dash-card-head h2 .dc-ico {
  width: 26px; height: 26px; border-radius: 8px; background: var(--primary-50); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.dash-card-head .dc-aux { font-size: 12px; color: var(--muted); }

/* ---- 待办清单（行式，无小方块堆叠）---- */
.dash-todo-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 2px; border-bottom: 1px solid var(--border);
}
.dash-todo-row:last-child { border-bottom: none; }
.dash-todo-row .dt-ico {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.dash-todo-row .dt-main { flex: 1; min-width: 0; }
.dash-todo-row .dt-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.dash-todo-row .dt-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.dash-todo-row .dt-num { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.dash-todo-row .dt-btn {
  flex: none; font-size: 12px; padding: 5px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer;
  transition: all .15s;
}
.dash-todo-row .dt-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }

/* ---- 区块小标题（统一行式）---- */
.dash-sec-title {
  font-size: 12px; font-weight: 700; color: var(--text-2);
  letter-spacing: .05em; margin: 14px 0 8px;
  display: flex; align-items: center; gap: 8px;
}
.dash-sec-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---- 概览行（市场/执行/费收卡片的指标行，替代小方块堆叠）---- */
.dash-kpi-row { display: flex; align-items: stretch; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.dash-kpi-row .dk-item {
  flex: 1; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; justify-content: center;
  min-width: 0;
}
.dash-kpi-row .dk-item + .dk-item { border-left: 1px solid var(--border); }
.dash-kpi-row .dk-value { font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.dash-kpi-row .dk-label { font-size: 11.5px; color: var(--text-2); }
.dash-kpi-row .dk-item.tone-purple .dk-value { color: var(--primary-700); }
.dash-kpi-row .dk-item.tone-green  .dk-value { color: #047857; }
.dash-kpi-row .dk-item.tone-amber  .dk-value { color: #b45309; }
.dash-kpi-row .dk-item.tone-rose   .dk-value { color: #be185d; }
.dash-kpi-row .dk-item.tone-slate  .dk-value { color: var(--text-2); }
.dash-kpi-row .dk-item.tone-sky    .dk-value { color: #0369a1; }

/* ---- 明细行（统一行式列表）---- */
.dash-li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 2px; border-bottom: 1px dashed var(--border);
}
.dash-li:last-child { border-bottom: none; }
.dash-li .dl-name { flex: 1; min-width: 0; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-li .dl-amt { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-chip {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.dash-chip.on  { background: var(--success-bg); color: #047857; }
.dash-chip.off { background: var(--surface-2);  color: var(--muted); }
.dash-chip.hot { background: #fdf2f8;           color: #be185d; }

/* ---- 公司对比条（品牌渐变）---- */
.dash-co-row { margin: 12px 0; }
.dash-co-row .dc-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; margin-bottom: 5px; }
.dash-co-row .dc-name { font-weight: 600; color: var(--text); }
.dash-co-row .dc-cnt { color: var(--muted); font-size: 11.5px; margin-left: 6px; font-weight: 400; }
.dash-co-row .dc-amt { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--primary-700); }
.dash-co-row .dc-bar { height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.dash-co-row .dc-bar > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary-600), var(--primary)); transition: width .5s ease; }

/* ---- 毛利排行（渐变条 + 名次徽章）---- */
.dash-rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--border); }
.dash-rank-row:last-child { border-bottom: none; }
.dash-rank-badge {
  width: 24px; height: 24px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 800;
}
.dash-rank-badge.r1 { background: linear-gradient(135deg,#fde68a,#f59e0b); color: #78350f; }
.dash-rank-badge.r2 { background: linear-gradient(135deg,#e2e8f0,#cbd5e1); color: #334155; }
.dash-rank-badge.r3 { background: linear-gradient(135deg,#fed7aa,#fb923c); color: #7c2d12; }
.dash-rank-badge.rn { background: var(--surface-2); color: var(--muted); }
.dash-rank-row .dr-main { flex: 1; min-width: 0; }
.dash-rank-row .dr-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-rank-row .dr-bar { height: 5px; border-radius: 99px; background: var(--surface-2); margin-top: 5px; overflow: hidden; }
.dash-rank-row .dr-bar > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary-600), var(--primary)); }
.dash-rank-row .dr-side { text-align: right; flex: none; }
.dash-rank-row .dr-pct { font-size: 14.5px; font-weight: 750; font-variant-numeric: tabular-nums; }
.dash-rank-row .dr-profit { font-size: 11px; color: var(--muted); }
/* 毛利梯度色：≥40% 深绿 / ≥15% 翠绿 / ≥0 琥珀 / <0 玫红 */
.pct-l1 { color: #047857; } .pct-l2 { color: #059669; } .pct-l3 { color: #b45309; } .pct-l4 { color: #be185d; }

/* ---- 响应式 ---- */
@media (max-width: 1080px) {
  .dash-hero { grid-template-columns: 1fr 1fr; }
  .dash-hero .dh-main { grid-column: 1 / -1; }
  .dash-hero .dh-cell:nth-child(odd) { border-left: none; }
}
@media (max-width: 640px) {
  .dash-hero { grid-template-columns: 1fr; }
  .dash-hero .dh-cell { border-left: none; border-top: 1px solid var(--border); }
}

/* ---- KPI 数值防溢出兜底（金额超长时自动缩字号，配合万元缩写双保险）---- */
.dash-kpi-row .dk-value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
@container (width <= 120px) {
  .dash-kpi-row .dk-value { font-size: 13px !important; }
}

/* ---- 更新日志：历史版本折叠 ---- */
.changelog-collapse {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}
.changelog-collapse > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text);
  transition: background .15s;
  user-select: none;
}
.changelog-collapse > summary::-webkit-details-marker { display: none; }
.changelog-collapse > summary:hover { background: var(--surface-2); }
.changelog-collapse > summary .chev {
  margin-left: auto;
  transition: transform .25s;
  color: var(--muted);
  display: flex;
}
.changelog-collapse[open] > summary .chev { transform: rotate(180deg); }
.changelog-collapse > summary .ver-count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg);
  padding: 2px 10px;
  border-radius: 99px;
}
.changelog-collapse .collapse-body { padding: 0 6px 6px; }
