:root {
  --bg: #eef2f6;
  --card: #ffffff;
  --line: #d5dde8;
  --line-soft: #e8eef4;
  --text: #142033;
  --muted: #5f6e82;
  --brand: #0a3d66;
  --brand-2: #135c88;
  --brand-soft: #e8f1f8;
  --danger: #9f1d1d;
  --danger-soft: #f8e8e8;
  --ok: #0b6b3a;
  --ok-soft: #e6f5ed;
  --warn: #8a5a00;
  --warn-soft: #fff4df;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(10, 30, 55, 0.04), 0 10px 28px rgba(10, 30, 55, 0.06);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "Cascadia Mono", "Sarasa Mono SC", Consolas, "Courier New", monospace;
  font-family: var(--font);
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: #072844;
  color: #fff;
}
.topbar .brand { font-weight: 700; letter-spacing: 0.04em; }
.topbar a { color: #c9dceb; text-decoration: none; margin-left: 16px; }
.topbar a:hover { color: #fff; }

/* —— 侧栏壳 —— */
.app-shell { background: var(--bg); }
.shell {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}
.sidebar {
  width: 236px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #072844 0%, #061f35 100%);
  color: #e8f1fa;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(145deg, #1a6aa8, #0a3d66);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.sidebar-brand strong { display: block; font-size: 15px; letter-spacing: .04em; }
.sidebar-brand em {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: #8fa8bf;
  margin-top: 3px;
  letter-spacing: .08em;
}
.side-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px 16px;
}
.nav-group { margin-bottom: 4px; }
.nav-group > summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #8fa8bf;
  letter-spacing: .08em;
  user-select: none;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after {
  content: "▾";
  float: right;
  opacity: .55;
  font-size: 11px;
}
.nav-group:not([open]) > summary::after { content: "▸"; }
.nav-group > summary:hover { background: rgba(255,255,255,.06); color: #d7e8f8; }
.nav-sub { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 8px 4px; }
.nav-sub a {
  color: #c5d8ea;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
}
.nav-sub a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav-sub a.active {
  background: rgba(26, 106, 168, .9);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #7ec4f0;
}
.sidebar-foot {
  padding: 14px 16px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12px;
}
.sidebar-foot .user-chip { margin: 0 0 8px; color: #cfe3f5; display: block; }
.logout-link { color: #8fa8bf; text-decoration: none; }
.logout-link:hover { color: #fff; }

.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar-compact {
  padding: 12px 24px;
  gap: 12px;
  justify-content: flex-start;
  position: sticky;
  top: 0;
  z-index: 20;
  background: #072844;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.topbar-compact .topbar-title {
  font-size: 14px;
  font-weight: 600;
  color: #d7e8f8;
  letter-spacing: .04em;
}
.nav-toggle {
  display: none;
  border: 0;
  background: rgba(255,255,255,.1);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
}
.brand-mobile { display: none; font-weight: 700; font-size: 14px; }

.wrap { max-width: 1360px; margin: 0 auto; padding: 28px 24px 72px; width: 100%; }

@media (max-width: 960px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 8px 0 24px rgba(0,0,0,.18);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .brand-mobile { display: block; }
  .topbar-compact .topbar-title { display: none; }
}

/* 权限矩阵 */
.settings-split { align-items: start; }
.perm-matrix-wrap { max-height: min(70vh, 720px); overflow: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.perm-matrix { box-shadow: none; border-radius: 0; }
.perm-matrix th, .perm-matrix td { white-space: nowrap; text-align: center; vertical-align: middle; }
.perm-matrix .sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #f4f7fb;
  text-align: left;
  min-width: 140px;
  box-shadow: 2px 0 0 var(--line);
}
.perm-matrix tbody .sticky-col { background: #fff; }
.perm-matrix .role-head { background: #e8f0f7; border-left: 1px solid var(--line); }
.perm-matrix .act-head { font-size: 11px; padding: 6px 4px; color: var(--muted); }
.perm-cell { padding: 6px 4px !important; }
.perm-check { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.perm-check input { width: 16px; height: 16px; accent-color: var(--brand); }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text);
}
.page-desc {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  padding: 8px 16px;
  text-decoration: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 560;
  letter-spacing: .02em;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:hover { background: #f5f8fb; text-decoration: none; color: var(--text); }
.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.danger {
  color: var(--danger);
  border-color: #e3b6b6;
  background: #fff;
}
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}
.btn.ghost:hover { color: var(--brand); border-color: #b7c9db; }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 5px; }
.btn.btn-block { width: 100%; margin-top: 8px; padding: 11px 16px; font-size: 15px; letter-spacing: .2em; }
.btn.link, button.link {
  background: none; border: none; color: var(--brand); cursor: pointer; padding: 0;
}
button.link.danger { color: var(--danger); }
.inline-form { display: inline; margin: 0; }

.flash {
  padding: 11px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
  border: 1px solid transparent;
  font-size: 13px;
}
.flash-ok { background: var(--ok-soft); color: var(--ok); border-color: #b7dfc8; }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: #e8bcbc; }

.table-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}
.table th, .table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}
.table th {
  background: #f3f6fa;
  color: #4a5a6d;
  font-weight: 650;
  font-size: 12px;
  letter-spacing: .06em;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { font-variant-numeric: tabular-nums; text-align: right; }
.table th.num { text-align: right; }
.table .money { font-weight: 600; color: var(--text); }
.table .mono { font-family: var(--mono); font-size: 12px; color: #3d4f63; }
.table .empty, .table .muted {
  color: var(--muted);
  text-align: center;
  padding: 40px 28px;
}
.table .col-actions {
  white-space: nowrap;
  text-align: right;
}
.table th.col-actions { text-align: right; }
.table .col-actions .btn { margin-left: 6px; }
.table .col-actions .btn:first-child { margin-left: 0; }
.doc-link {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12.5px;
}
.doc-link:hover { text-decoration: underline; color: var(--brand-2); }

.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.4;
}
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-muted { background: #eef1f5; color: #667788; }
.tag-danger { background: var(--danger-soft); color: var(--danger); }

.card-form { display: flex; flex-direction: column; gap: 16px; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  box-shadow: var(--shadow);
}
.panel h2 {
  margin: 0 0 14px;
  font-size: .95rem;
  color: var(--brand);
  font-weight: 700;
  letter-spacing: .06em;
  padding-left: 10px;
  border-left: 3px solid var(--brand);
}
.item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.item-head h2 { margin: 0; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.field.full { grid-column: 1 / -1; }
.field > span {
  color: #4a5a6d;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .04em;
}
.field input, .field select, .field textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  font: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:hover, .field select:hover, .field textarea:hover {
  border-color: #b7c9db;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(19, 92, 136, .15);
}
.field input[readonly] { background: #f3f6fa; color: var(--muted); }

.amount-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 14px;
  margin: 14px 0;
  padding: 14px;
  background: #f4f8fc;
  border-radius: 6px;
  border: 1px solid #c9dae9;
}

.sum-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 16px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #f7fafc;
  border-radius: 0 0 6px 6px;
  font-size: 14px;
}
.sum-bar strong { color: var(--brand); margin-left: 4px; font-variant-numeric: tabular-nums; }
.sum-bar .hint { color: var(--muted); font-size: 12px; }

.spec-block {
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px 12px;
  background: #fafbfc;
}
.spec-block summary {
  cursor: pointer;
  font-weight: 600;
  color: #334155;
  padding: 4px 0 8px;
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding-top: 2px;
}
.radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.radio:has(input:checked) {
  border-color: var(--brand-2);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.radio input { accent-color: var(--brand); }

.doc-no-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.doc-no-row input { flex: 1; font-family: var(--mono); }

.badge-urgent {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.inline-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  font-size: 13px;
  color: var(--muted);
}
.n-input {
  width: 64px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.form-footer.sticky-summary {
  position: sticky;
  bottom: 0;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 -8px 24px rgba(10, 30, 55, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 10;
}
.footer-sum {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  font-size: 14px;
}
.footer-sum strong { color: var(--brand); font-variant-numeric: tabular-nums; }

/* —— 登录 —— */
.login-page {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(26, 106, 168, .22), transparent 55%),
    linear-gradient(160deg, #072844 0%, #0a3d66 42%, #eef2f6 42%);
}
.login-page .wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 8vh 20px 48px;
}
.login-shell {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 28px;
  align-items: stretch;
}
.login-hero {
  color: #eef6fc;
  padding: 36px 8px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(145deg, #1a6aa8, #0a3d66);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: .08em;
  margin-bottom: 18px;
  box-shadow: 0 10px 30px rgba(0, 20, 40, .25);
}
.login-hero h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: .12em;
  font-weight: 700;
}
.login-hero p {
  margin: 10px 0 0;
  color: #9eb6cc;
  letter-spacing: .18em;
  font-size: 13px;
}
.login-box {
  margin: 0;
}
.login-box h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  color: var(--text);
  border: 0;
  padding: 0;
  letter-spacing: .08em;
}
.login-box .muted { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.quick-login {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.quick-login .muted { width: 100%; margin: 0 0 4px; }
.quick-login .btn.sm { font-size: 12px; padding: 6px 10px; }
@media (max-width: 800px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-hero { padding: 12px 4px 0; }
  .login-hero h1 { font-size: 1.55rem; }
}

.account-hint { color: var(--muted); font-size: 13px; line-height: 1.7; padding-left: 18px; }
.user-chip { color: #cfe3f5; margin-left: 12px; font-size: 13px; }
.flow-list { margin: 0; padding-left: 18px; }
.flow-list li { margin-bottom: 8px; }
.flow-actions .inline-flow { margin-bottom: 14px; }
.footer-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-head .footer-actions {
  justify-content: flex-end;
  max-width: 62%;
}
.line-doc { display: inline-block; margin-left: 8px; color: var(--muted); font-weight: 500; font-size: 12px; }
.hint-inline {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}
.status-readonly { padding-top: 2px; }
.flow-tip {
  margin: 0 0 14px;
  padding: 10px 12px;
  background: #eef6fc;
  border: 1px solid #c5daf0;
  border-left: 3px solid var(--brand);
  border-radius: 6px;
  color: var(--brand);
  font-size: 13px;
  line-height: 1.55;
}

.status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.status-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.status-tab em {
  font-style: normal;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef2f6;
  color: #4a5a6d;
  font-size: 12px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.status-tab:hover { border-color: #b7c9db; color: var(--brand); text-decoration: none; }
.status-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.status-tab.active em { background: rgba(255,255,255,.2); color: #fff; }

.table tbody tr.row-draft td:first-child { box-shadow: inset 3px 0 0 #94a3b8; }
.table tbody tr.row-progress td:first-child { box-shadow: inset 3px 0 0 #d4a017; }
.table tbody tr.row-done td:first-child { box-shadow: inset 3px 0 0 #0b6b3a; }
.table tbody tr.row-rejected td:first-child { box-shadow: inset 3px 0 0 #9f1d1d; }

.footer-actions-stack {
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-submit-box {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 12px;
  background: #f4f8fc;
  border: 1px solid #c9dae9;
  border-radius: 6px;
}
.footer-submit-box .field {
  margin: 0;
  min-width: 220px;
}
.filter-bar { margin-bottom: 16px; }
.filter-bar .field-grid { align-items: end; }

.muted { color: var(--muted); font-size: 13px; }
code {
  font-family: var(--mono);
  font-size: 12px;
  background: #eef2f6;
  padding: 1px 6px;
  border-radius: 4px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.kpi-warn { border-color: #f3c2bf; background: #fff8f7; }
.kpi-label { color: var(--muted); font-size: 12px; }
.kpi-value { font-size: 1.7rem; font-weight: 700; color: var(--brand); margin: 4px 0; font-variant-numeric: tabular-nums; }
.kpi-warn .kpi-value { color: var(--danger); }
.kpi-sub { color: var(--muted); font-size: 12px; }
.split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
@media (max-width: 800px) {
  .split-2 { grid-template-columns: 1fr; }
}
.panel .table {
  box-shadow: none;
  border: 0;
}
.panel > .table,
.panel > .table-wrap > .table {
  margin: 0 -4px;
}

.photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 14px;
}
.photo-item {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 8px;
  overflow: hidden;
  background: #eef2f6;
  border: 1px solid #d5dde6;
  display: block;
}
.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.photo-add {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 112px;
  border: 1px dashed #9aafc2;
  border-radius: 8px;
  color: var(--brand);
  cursor: pointer;
  background: #f7fafc;
  font-size: 13px;
}
.photo-add input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.table-wrap { overflow-x: auto; }
.item-table input {
  width: 100%;
  min-width: 88px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
}
.item-table td { vertical-align: middle; }

.period-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 1100px) {
  .period-grid { grid-template-columns: 1fr; }
}
.th-income { color: #b45309; }
.th-expense { color: #334155; }
.th-balance { background: #fef08a; }
.cashbook-table th.th-income { background: #ffedd5; }
.cashbook-table th.th-expense { background: #e2e8f0; }
.cashbook-table td.th-balance,
.cashbook-table th.th-balance { background: #fef08a; }

/* —— 首页大屏数据看板 —— */
.wrap-board {
  max-width: 1560px;
  padding-top: 16px;
  padding-bottom: 32px;
}
.board-screen {
  background: #061824;
  min-height: 100vh;
}
.board-screen .wrap-screen {
  max-width: none;
  margin: 0;
  padding: 18px 22px 28px;
}
.board {
  color: #e8f2fa;
  --board-card: rgba(12, 42, 66, 0.88);
  --board-line: rgba(120, 170, 210, 0.22);
  --board-accent: #3db8ff;
  --board-ok: #3ecf8e;
  --board-warn: #f0b429;
  --board-danger: #ff6b6b;
}
.board-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.board-brand {
  display: flex;
  gap: 14px;
  align-items: center;
}
.board-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(145deg, #1a6bb0, #0f4c81);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: .06em;
  box-shadow: 0 0 0 1px rgba(61, 184, 255, .35), 0 8px 24px rgba(0, 40, 80, .35);
}
.board-brand h1 {
  margin: 0;
  font-size: clamp(1.15rem, 1.6vw, 1.55rem);
  font-weight: 700;
  letter-spacing: .02em;
  color: #f4f9fd;
}
.board-brand p {
  margin: 4px 0 0;
  color: #8fb0c8;
  font-size: 13px;
}
.board-meta { text-align: right; }
.board-clock {
  font-variant-numeric: tabular-nums;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--board-accent);
  letter-spacing: .04em;
}
.board-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.board-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 12px;
  background: rgba(61, 184, 255, .18);
  color: #d7efff;
  border: 1px solid rgba(61, 184, 255, .35);
}
.board-btn:hover { background: rgba(61, 184, 255, .28); color: #fff; }
.board-btn.ghost {
  background: transparent;
  border-color: rgba(143, 176, 200, .35);
  color: #9eb6cc;
}

.board-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.board-kpi {
  background: var(--board-card);
  border: 1px solid var(--board-line);
  border-radius: 12px;
  padding: 14px 14px 12px;
  position: relative;
  overflow: hidden;
}
.board-kpi::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: rgba(143, 176, 200, .35);
}
.board-kpi.accent::before { background: linear-gradient(90deg, #1a6bb0, #3db8ff); }
.board-kpi.warn::before { background: linear-gradient(90deg, #b54708, #f0b429); }
.board-kpi.ok::before { background: linear-gradient(90deg, #067647, #3ecf8e); }
.board-kpi.money::before { background: linear-gradient(90deg, #7c3aed, #c4b5fd); }
.board-kpi-label { color: #8fb0c8; font-size: 12px; }
.board-kpi-value {
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  font-weight: 700;
  margin: 6px 0 2px;
  font-variant-numeric: tabular-nums;
  color: #f5fbff;
  line-height: 1.1;
}
.board-kpi.warn .board-kpi-value { color: var(--board-warn); }
.board-kpi.ok .board-kpi-value { color: var(--board-ok); }
.board-kpi.money .board-kpi-value { color: #d8c7ff; }
.board-kpi-sub { color: #6f8ea6; font-size: 11px; }

.board-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.board-alert {
  text-decoration: none;
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.board-alert-info {
  background: rgba(61, 184, 255, .12);
  color: #9ed4ff;
  border-color: rgba(61, 184, 255, .28);
}
.board-alert-warn {
  background: rgba(240, 180, 41, .12);
  color: #ffd27a;
  border-color: rgba(240, 180, 41, .28);
}
.board-alert-danger {
  background: rgba(255, 107, 107, .12);
  color: #ffb0b0;
  border-color: rgba(255, 107, 107, .3);
}

.board-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 12px;
}
.board-panel {
  background: var(--board-card);
  border: 1px solid var(--board-line);
  border-radius: 12px;
  padding: 14px 16px 16px;
  min-height: 0;
}
.board-funnel { grid-column: 1 / -1; }
.board-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.board-panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  color: #eef6fc;
}
.board-panel-head span { color: #6f8ea6; font-size: 12px; }
.board-empty { color: #6f8ea6; font-size: 13px; margin: 8px 0; }

.funnel-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.funnel-step {
  flex: 1 1 0;
  min-width: 110px;
  text-align: center;
  background: rgba(8, 28, 44, .55);
  border: 1px solid rgba(61, 184, 255, .18);
  border-radius: 10px;
  padding: 14px 8px 12px;
}
.funnel-count {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--board-accent);
  font-variant-numeric: tabular-nums;
}
.funnel-label { margin-top: 4px; font-size: 12px; color: #c5d8e8; }
.funnel-amt { margin-top: 4px; font-size: 11px; color: #8fb0c8; }
.funnel-arrow {
  display: flex;
  align-items: center;
  color: #3a6280;
  font-size: 1.4rem;
  flex: 0 0 auto;
}

.finance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.finance-grid > div {
  background: rgba(8, 28, 44, .45);
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(120, 170, 210, .12);
}
.finance-grid em {
  display: block;
  font-style: normal;
  color: #8fb0c8;
  font-size: 12px;
}
.finance-grid strong {
  display: block;
  margin: 4px 0 2px;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  color: #f3f8fc;
}
.finance-grid strong.pos { color: var(--board-ok); }
.finance-grid strong.neg { color: #ff9b7a; }
.finance-grid span { color: #6f8ea6; font-size: 11px; }

.board-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.board-bars li {
  display: grid;
  grid-template-columns: minmax(72px, 26%) 1fr 36px;
  gap: 8px;
  align-items: center;
}
.bar-label {
  font-size: 12px;
  color: #c5d8e8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}
a.bar-label:hover { color: var(--board-accent); }
.bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(8, 28, 44, .7);
  overflow: hidden;
}
.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #12639a, #3db8ff);
}
.board-bars.series .bar-track i {
  background: linear-gradient(90deg, #0f766e, #2dd4bf);
}
.board-bars.pipe .bar-track i {
  background: linear-gradient(90deg, #6d28d9, #a78bfa);
}
.bar-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: #e8f2fa;
  font-weight: 600;
}

.board-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.board-table th,
.board-table td {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(120, 170, 210, .12);
  text-align: left;
}
.board-table th { color: #8fb0c8; font-weight: 560; }
.board-table td { color: #d7e8f4; }
.board-table a { color: #7ec8ff; text-decoration: none; }
.board-table a:hover { text-decoration: underline; }
.board-table .mono { font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.board-table .num { text-align: right; font-variant-numeric: tabular-nums; }

.board-foot {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: #6f8ea6;
  font-size: 12px;
}
.board-foot em { color: var(--board-warn); font-style: normal; }

/* 嵌入普通壳时，看板仍用深色卡片，与浅色背景对比 */
.app-shell .wrap-board .board {
  background: linear-gradient(180deg, #0a2a42 0%, #071e30 100%);
  border-radius: 14px;
  padding: 16px 16px 12px;
  border: 1px solid rgba(26, 107, 176, .35);
  box-shadow: 0 12px 40px rgba(8, 30, 50, .18);
}

@media (max-width: 1200px) {
  .board-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .board-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-grid { grid-template-columns: 1fr; }
  .board-meta { text-align: left; width: 100%; }
  .board-actions { justify-content: flex-start; }
}

