/* ============================================================================
 * Eric Insight · Personal Business Assistant
 * 蓝紫色调主题样式
 * ==========================================================================*/

:root {
  --brand-1: #4f46e5;   /* indigo-600 */
  --brand-2: #7c3aed;   /* violet-600 */
  --brand-3: #8b5cf6;   /* violet-500 */
  --brand-4: #a855f7;   /* purple-500 */
  --brand-deep: #1e1b4b;/* indigo-950 */
  --brand-mid: #312e81; /* indigo-900 */
  --ink: #1e2340;
  --ink-2: #5b6077;
  --ink-3: #9095ab;
  --bg: #f3f4fb;
  --card: #ffffff;
  --line: #e5e7f5;
  --line-2: #eceef9;
  --head-bg: #eef0ff;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(30, 35, 64, .05), 0 8px 24px -12px rgba(79, 70, 229, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 13px; color: var(--ink); }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c9cdea; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 通用 ---------------- */
.pos { color: var(--ok) !important; font-weight: 600; }
.neg { color: var(--danger) !important; font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  transition: all .18s ease; white-space: nowrap; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff; box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .55);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost {
  background: #fff; color: var(--brand-1); border-color: #d8dcf5;
}
.btn-ghost:hover { background: #f4f4ff; border-color: #b9c0ef; }
.btn-danger-ghost { background: #fff; color: var(--danger); border-color: #f3d3d3; }
.btn-danger-ghost:hover { background: #fef2f2; }
.btn-ok {
  background: linear-gradient(135deg, #059669, #10b981); color: #fff;
  box-shadow: 0 6px 16px -6px rgba(16, 185, 129, .5);
}
.btn-ok:hover { filter: brightness(1.08); }
.btn-ghost-light { background: rgba(255,255,255,.1); color: #e0e7ff; border-color: rgba(255,255,255,.18); }
.btn-ghost-light:hover { background: rgba(255,255,255,.18); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-xs { padding: 3px 10px; font-size: 11.5px; border-radius: 7px; }

.select {
  appearance: none; -webkit-appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 30px 7px 12px; font-weight: 500; cursor: pointer;
  transition: border-color .15s;
}
.select:focus { outline: none; border-color: var(--brand-3); box-shadow: 0 0 0 3px rgba(139, 92, 246, .15); }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--line-2);
}
.card-pad { padding: 18px 20px; }
.card-title {
  font-size: 15px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.card-title .tick { width: 4px; height: 16px; border-radius: 4px;
  background: linear-gradient(180deg, var(--brand-1), var(--brand-4)); }

/* ---------------- 登录页 ---------------- */
#login-view {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #312e81 0%, #4f46e5 45%, #7c3aed 100%);
  overflow: hidden;
}
.login-bg { position: absolute; inset: 0; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; }
.b1 { width: 420px; height: 420px; background: #a855f7; top: -120px; left: -100px; }
.b2 { width: 380px; height: 380px; background: #38bdf8; bottom: -140px; right: -80px; opacity: .3; }
.b3 { width: 260px; height: 260px; background: #f0abfc; bottom: 60px; left: 16%; opacity: .25; }

.login-card {
  position: relative; z-index: 2; width: 400px; max-width: calc(100vw - 32px);
  background: rgba(255,255,255,.97); border-radius: 20px;
  box-shadow: 0 24px 60px -18px rgba(15, 10, 60, .55);
  padding: 36px 36px 26px;
  animation: rise .5s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.login-logo { text-align: center; margin-bottom: 22px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
  color: #fff; font-weight: 800; font-size: 17px; letter-spacing: .5px;
  box-shadow: 0 8px 18px -6px rgba(99, 82, 232, .6);
}
.brand-mark.lg { width: 58px; height: 58px; font-size: 21px; border-radius: 16px; margin-bottom: 10px; }
.login-title { font-size: 22px; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(120deg, var(--brand-1), var(--brand-4));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.login-sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.login-designed {
  margin-top: 10px; display: inline-block; font-size: 11px; font-weight: 500;
  letter-spacing: .6px; color: var(--brand-3); opacity: .85;
  padding: 3px 10px; border: 1px solid rgba(99,102,241,.22);
  border-radius: 999px; background: rgba(99,102,241,.06);
}

.login-form { display: flex; flex-direction: column; gap: 14px; }
.f-field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.f-field input, .form-input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  transition: all .15s; background: #fbfbff;
}
.f-field input:focus, .form-input:focus { outline: none; border-color: var(--brand-3);
  box-shadow: 0 0 0 3px rgba(139,92,246,.15); background: #fff; }
.login-err { color: var(--danger); font-size: 12.5px; background: #fef2f2; border: 1px solid #f5c6c6;
  border-radius: 8px; padding: 7px 10px; }
.login-hint { margin-top: 20px; border-top: 1px dashed var(--line); padding-top: 14px; }
.hint-title { font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
.hint-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer; transition: background .15s;
}
.hint-row:hover { background: #f1f2fd; }
.hint-badge { font-size: 11px; font-weight: 700; color: #fff; padding: 1px 8px; border-radius: 6px; }
.hint-badge.tb { background: var(--brand-1); }
.hint-badge.rg { background: var(--brand-2); }
.hint-badge.pc { background: var(--brand-4); }

/* ---------------- 主布局 ---------------- */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 244px; z-index: 20;
  background: linear-gradient(180deg, var(--brand-deep) 0%, #2a236b 60%, var(--brand-mid) 100%);
  color: #e0e7ff; display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 16px; }
.brand-name { font-weight: 800; font-size: 16px; color: #fff; letter-spacing: .3px; }
.brand-sub { font-size: 10.5px; color: #a5b4fc; letter-spacing: .4px; }
.brand-designed {
  font-size: 9.5px; color: #818cf8; letter-spacing: .5px; margin-top: 3px;
  opacity: .9; white-space: nowrap;
}

.nav { flex: 1; padding: 6px 12px; overflow-y: auto; }
.nav-group { font-size: 11px; color: #818cf8; letter-spacing: 1px; padding: 12px 10px 6px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: 2px 0;
  border-radius: 10px; color: #c7d2fe; font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: all .15s; border: none; background: transparent; width: 100%; text-align: left;
}
.nav-item svg { flex: none; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active {
  background: linear-gradient(135deg, rgba(79,70,229,.9), rgba(124,58,237,.85));
  color: #fff; box-shadow: 0 6px 14px -6px rgba(0,0,0,.4);
}
.side-foot { padding: 14px 14px 16px; border-top: 1px solid rgba(255,255,255,.09); }
.user-mini { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
}
.user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-role { font-size: 11px; color: #a5b4fc; }

.main { margin-left: 244px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,.88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-2);
  padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.page-title { font-size: 17px; font-weight: 800; }
.page-sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.view { padding: 22px 24px 48px; flex: 1; }

/* ---------------- KPI ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-card { position: relative; overflow: hidden; padding: 16px 16px 14px; }
.kpi-card::after {
  content: ""; position: absolute; right: -26px; top: -26px; width: 90px; height: 90px;
  border-radius: 50%; opacity: .14; background: var(--kpi-c, var(--brand-1));
}
.kpi-label { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 7px; font-weight: 600; }
.kpi-icon { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center;
  justify-content: center; background: color-mix(in srgb, var(--kpi-c, var(--brand-1)) 14%, white); }
.kpi-value { font-size: 21px; font-weight: 800; margin-top: 8px; letter-spacing: -.3px; }
.kpi-value small { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-left: 2px; }
.kpi-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; border-radius: 12px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
.tbl th {
  background: var(--head-bg); color: #3d4470; font-weight: 700; font-size: 12.5px;
  padding: 9px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line);
}
.tbl th:first-child, .tbl td:first-child { text-align: left; position: sticky; left: 0; }
.tbl th:first-child { background: var(--head-bg); }
.tbl td:first-child { background: #fff; }
.tbl tbody tr:hover td:first-child { background: #f9f8ff; }
.tbl th.ta-l, .tbl td.ta-l { text-align: left; }
.tbl td {
  padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--line-2);
  white-space: nowrap; color: var(--ink);
}
.tbl tbody tr:hover td { background: #f9f8ff; }
.tbl .row-head { color: var(--ink-2); font-weight: 600; background: #fbfbff; }
.tbl .row-total td {
  background: #f4f2ff; font-weight: 800; color: #3f3a7a; border-top: 2px solid #d9d6fa;
}
.tbl .row-total td:first-child { background: #f4f2ff; }
.tbl .muted { color: var(--ink-3); }
.tbl .derived { color: var(--brand-1); font-weight: 700; background: rgba(79,70,229,.05); }

.cell-input {
  width: 96px; border: 1px solid transparent; border-radius: 7px;
  padding: 4px 8px; text-align: right; background: transparent;
  transition: all .15s; -moz-appearance: textfield; appearance: textfield;
}
.cell-input::-webkit-outer-spin-button, .cell-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.cell-input:hover { border-color: var(--line); background: #fff; }
.cell-input:focus { outline: none; border-color: var(--brand-3); background: #fff;
  box-shadow: 0 0 0 3px rgba(139,92,246,.12); }
.cell-input.cell-w { width: 150px; text-align: left; }
.cell-input.cell-mid { width: 118px; }

/* ---------------- 固定成本 · 年总成本自动拆分 ---------------- */
.annual-split-card { margin-bottom: 14px; }
.annual-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px 16px; margin: 12px 0;
}
.annual-item {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 9px;
  padding: 7px 10px; background: #fbfbfe;
}
.annual-label { font-size: 12.5px; font-weight: 600; color: var(--ink-1); white-space: nowrap; }
.annual-input { flex: 1; min-width: 0; width: auto; border: 1px solid var(--line); background: #fff; }
.annual-preview { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.annual-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* 月份行编辑模式高亮 */
.tbl tr.row-editing td { background: #fffbf0; }
.tbl tr.row-editing td:first-child { background: #fffbf0; }
.tbl tr.row-editing td .cell-input { background: #fff; border-color: var(--brand-3); }
.tbl tr.row-editing .edit-month { background: #f4f4ff; border-color: var(--brand-2); color: var(--brand-2); }

/* ---------------- 徽标 ---------------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.badge-total { background: #e0e7ff; color: #4338ca; }
.badge-regional { background: #ede9fe; color: #6d28d9; }
.badge-principal { background: #f3e8ff; color: #a21caf; }
.badge-direct { background: #fef3c7; color: #b45309; }
.badge-direct::before { content: "↗"; font-weight: 900; }
.badge-ok { background: #d1fae5; color: #047857; }
.badge-frozen { background: #ffedd5; color: #c2410c; }
.badge-frozen::before { content: "🔒 "; font-size: 10px; }
.badge-soft { background: #f1f2f7; color: var(--ink-2); }

/* ---------------- 芯片 ---------------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 999px; padding: 5px 14px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--brand-3); color: var(--brand-2); }
.chip.active {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff; border-color: transparent; box-shadow: 0 4px 10px -3px rgba(99,82,232,.5);
}

/* ---------------- 其他组件 ---------------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }

/* 冻结操作条（总览页） */
.freeze-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(120deg, #eef0ff, #f5f0ff);
  border: 1px solid #ddd3fa; border-radius: 14px; padding: 14px 18px; margin-bottom: 16px;
}
.freeze-title { font-size: 14.5px; font-weight: 800; color: #3f3a7a; }
.freeze-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* 只读提示（冻结后） */
.frozen-note { background: #fff7ed; border-color: #fed7aa; }
.frozen-note b { color: #c2410c; }

/* 年度汇总：分校行 + 月份折叠 */
.sum-row { border: 1px solid var(--line-2); border-radius: 12px; margin-bottom: 10px; overflow: hidden; background: #fff; }
.sum-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px; cursor: pointer; transition: background .15s;
}
.sum-head:hover { background: #f8f8ff; }
.sum-arrow { color: var(--brand-2); font-size: 13px; width: 14px; flex: none; transition: transform .15s; }
.sum-name { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 800; min-width: 170px; }
.sum-year { font-size: 11.5px; color: var(--ink-3); }
.sum-num { display: flex; flex-direction: column; gap: 1px; background: #f8f8fe; border-radius: 8px; padding: 5px 10px; min-width: 86px; }
.sum-num .l { font-size: 10.5px; color: var(--ink-3); }
.sum-num .v { font-size: 13.5px; font-weight: 800; }
.sum-detail { border-top: 1px dashed var(--line-2); background: #fbfbff; padding: 4px 14px 14px; }
.sum-tbl { min-width: 1080px; }
.hint-note {
  font-size: 12px; color: var(--ink-3); background: #f7f7fd; border: 1px dashed #d8dbf3;
  border-radius: 10px; padding: 9px 12px; margin-bottom: 14px; line-height: 1.7;
}
.hint-note b { color: var(--brand-2); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1180px) { .grid-2 { grid-template-columns: 1fr; } }

.campus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.campus-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.campus-head { display: flex; align-items: center; gap: 10px; }
.campus-name { font-size: 15px; font-weight: 800; flex: 1; }
.campus-city { font-size: 11.5px; color: var(--ink-3); }
.campus-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.campus-kpi { background: #f8f8fe; border-radius: 10px; padding: 8px 10px; }
.campus-kpi .k { font-size: 11px; color: var(--ink-3); }
.campus-kpi .v { font-size: 14.5px; font-weight: 800; margin-top: 1px; }

/* 层级图 */
.hier { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 10px; }
.hier-box {
  min-width: 150px; text-align: center; border-radius: 12px; padding: 10px 20px;
  font-weight: 700; font-size: 13.5px; color: #fff;
}
.hier-box.total { background: linear-gradient(135deg, #4338ca, #6d28d9); }
.hier-box.regional { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.hier-box.principal { background: linear-gradient(135deg, #8b5cf6, #c084fc); }
.hier-box.campus { background: linear-gradient(135deg, #4f46e5, #818cf8); }
.hier-box.direct { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #78350f; }
.hier-arrow { color: #b0b6d8; font-size: 14px; line-height: 1; }
.hier-note { font-size: 11.5px; color: var(--ink-3); margin-top: 8px; text-align: center; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; background: rgba(24, 20, 60, .5);
  backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadein .18s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 16px; width: 560px; max-width: 100%; max-height: 86vh;
  display: flex; flex-direction: column; box-shadow: 0 30px 70px -20px rgba(20,15,70,.5);
  animation: rise .2s ease;
}
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; }
.modal-title { font-size: 15.5px; font-weight: 800; flex: 1; }
.modal-close { border: none; background: none; font-size: 18px; color: var(--ink-3); padding: 2px 8px; border-radius: 8px; }
.modal-close:hover { background: #f1f2f7; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* 自检 */
.test-item { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px dashed var(--line-2); font-size: 12.5px; }
.test-item:last-child { border-bottom: none; }
.test-ic { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #fff; margin-top: 1px; }
.test-ic.ok { background: var(--ok); }
.test-ic.fail { background: var(--danger); }
.test-detail { color: var(--ink-3); font-size: 11.5px; }
.test-sum { font-size: 13px; font-weight: 700; padding: 8px 12px; border-radius: 10px; margin-bottom: 10px; }
.test-sum.ok { background: #d1fae5; color: #047857; }
.test-sum.fail { background: #fee2e2; color: #b91c1c; }

/* toast */
#toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #2b2657; color: #fff; font-size: 13px; font-weight: 600;
  padding: 10px 18px; border-radius: 10px; box-shadow: 0 12px 30px -8px rgba(30,20,90,.5);
  animation: rise .22s ease; max-width: 70vw;
}
.toast.err { background: #dc2626; }
.toast.ok { background: linear-gradient(135deg, #059669, #10b981); }

/* 空态 */
.empty { text-align: center; color: var(--ink-3); padding: 40px 0; font-size: 13px; }
.empty .big { font-size: 30px; margin-bottom: 8px; }

/* 数据管理页 */
.dm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.dm-card .card-title { margin-bottom: 8px; }
.dm-card p { font-size: 12.5px; color: var(--ink-2); margin-bottom: 12px; line-height: 1.7; }
.dm-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.form-note { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.6; }

/* ---------------- 每日填报 ---------------- */
.f-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.daily-tbl { min-width: 1360px; }
.flow-tbl { min-width: 920px; }
.flow-tbl th, .flow-tbl td { vertical-align: middle; }
.cell-select {
  width: 128px; border: 1px solid transparent; border-radius: 7px;
  padding: 4px 6px; background: transparent; color: var(--ink);
  transition: all .15s; cursor: pointer;
}
.cell-select:hover { border-color: var(--line); background: #fff; }
.cell-select:focus { outline: none; border-color: var(--brand-3); background: #fff; }
.cell-input.cell-hq { color: #7c3aed; font-weight: 600; }

/* 月度完成率表 */
.rate-tbl { min-width: 620px; }
.rate-tbl td { text-align: right; }
.rate-badge {
  display: inline-block; min-width: 58px; text-align: center;
  font-size: 12px; font-weight: 800; border-radius: 999px; padding: 2px 10px;
}
.rate-badge.rate-ok { background: #d1fae5; color: #047857; }
.rate-badge.rate-mid { background: #fef3c7; color: #b45309; }
.rate-badge.rate-low { background: #fee2e2; color: #b91c1c; }
.rate-badge.rate-na { background: #f1f2f7; color: var(--ink-3); }
.rate-track { height: 8px; background: #eef0f8; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.rate-fill { height: 100%; border-radius: 999px; min-width: 2px; transition: width .4s ease; }
.rate-fill.rate-ok { background: linear-gradient(90deg, #059669, #10b981); }
.rate-fill.rate-mid { background: linear-gradient(90deg, #d97706, #f59e0b); }
.rate-fill.rate-low { background: linear-gradient(90deg, #dc2626, #ef4444); }
.rate-fill.rate-na { background: #cbd0e4; }

/* 本月盈亏预览 */
.pnl-line { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; padding: 6px 2px 12px; }
.pnl-term {
  flex: 1; min-width: 168px; background: #f8f8fe; border: 1px solid var(--line-2);
  border-radius: 12px; padding: 10px 14px;
}
.pnl-term .l { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.pnl-term .v { font-size: 19px; font-weight: 800; margin-top: 3px; letter-spacing: -.2px; }
.pnl-term .s { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.pnl-term.pnl-res { background: linear-gradient(135deg, #eef2ff, #f5f0ff); border-color: #ddd3fa; }
.pnl-term.pnl-res .l { color: #6d28d9; }
.pnl-op { align-self: center; font-size: 18px; font-weight: 800; color: #b4b9d8; padding: 0 2px; }

/* 每日填报弹窗 */
.daily-form-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.df-title { font-size: 15px; font-weight: 800; color: var(--brand-deep); }
.df-date { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.df-sec {
  font-size: 13px; font-weight: 800; color: #3d4470; background: var(--head-bg);
  border-left: 3px solid var(--brand-2); border-radius: 8px;
  padding: 7px 12px; margin: 6px 0 10px; display: flex; align-items: center; justify-content: space-between;
}
.df-sec .df-sum { font-size: 12px; font-weight: 600; color: var(--brand-1); }
.df-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; margin-bottom: 12px; }
.df-m { background: #f8f8fe; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; }
.df-m.custom { border-color: #e9d5ff; background: #faf5ff; }
.df-m.custom .dm-label { color: #7c3aed; }
.dm-label { font-size: 12px; color: var(--ink-2); font-weight: 600; margin-bottom: 5px; }

/* 系统设置 */
.set-chipbox { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.set-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 12px 4px 14px; font-size: 12.5px; font-weight: 600;
}
.set-chip i { font-style: normal; font-size: 10.5px; font-weight: 500; opacity: .8; }
.set-chip.base { background: #f1f2f7; color: var(--ink-2); border: 1px dashed #d5d8ea; }
.set-chip.base.hq { background: #eef2ff; color: #4338ca; border-style: solid; }
.set-chip.custom { background: #faf5ff; color: #6d28d9; border: 1px solid #e9d5ff; }
.set-x {
  border: none; background: rgba(255,255,255,.7); color: #7c3aed; width: 18px; height: 18px;
  border-radius: 50%; font-size: 12px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.set-x:hover { background: #ede9fe; }
.set-add {
  border: 1px dashed #c4b5fd; color: var(--brand-2); border-radius: 999px; padding: 4px 14px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all .15s; background: #fff;
}
.set-add:hover { background: #f5f3ff; border-color: var(--brand-3); }

@media (max-width: 900px) {
  .sidebar { width: 68px; }
  .brand-text, .nav-item span, .user-meta, .side-foot .btn { display: none; }
  .main { margin-left: 68px; }
  .nav-item { justify-content: center; }
  .topbar { padding: 10px 14px; }
  .view { padding: 16px 14px 40px; }
}
