/* =========================================================================
 * 鼎云集团 · 财务工作台  —  Design System
 * ========================================================================= */
:root {
  --bg: #f2f5f8;
  --bg-2: #eaeff4;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --ink: #10202e;
  --ink-2: #44586a;
  --ink-3: #6d8091;
  --muted: #93a3b1;
  --line: #e3e9ef;
  --line-2: #eef2f6;
  --brand: #14527a;
  --brand-2: #2a7fa8;
  --brand-soft: #e8f1f7;
  --gold: #c8902c;
  --gold-soft: #fbf3e3;
  --red: #c0503f;
  --red-soft: #fbeeec;
  --green: #2f7d63;
  --green-soft: #e9f4f0;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 32, 46, .05), 0 8px 24px -16px rgba(16, 32, 46, .18);
  --shadow-lg: 0 12px 40px -12px rgba(16, 32, 46, .22);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; font-size: inherit; color: inherit; }
::selection { background: #cfe4f1; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---------------- Top bar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1480px; margin: 0 auto; padding: 0 26px;
  height: 62px; display: flex; align-items: center; gap: 26px;
}
.brand { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(140deg, #1b6a95 0%, #0f3f5e 100%);
  color: #fff; display: grid; place-items: center;
  font-size: 14px; font-weight: 700; letter-spacing: -.5px;
  box-shadow: 0 4px 10px -4px rgba(20, 82, 122, .6);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 14px; font-weight: 650; letter-spacing: .2px; }
.brand-sub { font-size: 10.5px; color: var(--muted); letter-spacing: .8px; text-transform: uppercase; }

.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav-item {
  padding: 7px 14px; border-radius: 8px; font-size: 13.5px;
  color: var(--ink-2); font-weight: 500; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.company-select {
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--line); background: #fff;
  border-radius: 8px; padding: 7px 32px 7px 11px;
  font-size: 13px; color: var(--ink-2); max-width: 250px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' stroke='%236d8091' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  cursor: pointer;
}
.company-select:focus { outline: 2px solid #cfe4f1; outline-offset: 1px; }

.lang-toggle {
  display: flex; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; background: #fff;
}
.lang-toggle button {
  padding: 6px 11px; font-size: 12px; color: var(--ink-3); font-weight: 600;
  letter-spacing: .3px; transition: .15s;
}
.lang-toggle button.active { background: var(--brand); color: #fff; }

/* ---------------- Layout ---------------- */
.page { max-width: 1480px; margin: 0 auto; padding: 26px 26px 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 23px; font-weight: 680; letter-spacing: -.4px; margin: 0 0 4px; }
.page-desc { font-size: 13px; color: var(--ink-3); margin: 0; }
.head-side { display: flex; align-items: center; gap: 10px; }

.breadcrumb { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.breadcrumb a:hover { color: var(--brand); }

/* ---------------- Cards ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 16px 20px 0;
}
.card-title { font-size: 14.5px; font-weight: 640; letter-spacing: -.1px; margin: 0; display: flex; align-items: center; gap: 8px; }
.card-title .dot { width: 3px; height: 13px; border-radius: 2px; background: var(--brand-2); display: inline-block; }
.card-body { padding: 18px 20px 20px; }
.card-sub { font-size: 12px; color: var(--muted); font-weight: 400; }

.grid { display: grid; gap: 16px; }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); }

/* ---------------- Hero ---------------- */
.hero {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 22px 26px; border-radius: var(--radius);
  background: linear-gradient(115deg, #0f3f5e 0%, #1a5c82 48%, #2a7fa8 100%);
  color: #fff; box-shadow: 0 14px 34px -18px rgba(15, 63, 94, .75);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -80px;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.12), transparent 65%);
}
.hero-left { position: relative; z-index: 1; }
.hero-hi { font-size: 12px; opacity: .72; letter-spacing: .6px; text-transform: uppercase; margin-bottom: 8px; }
.hero-title { font-size: 26px; font-weight: 660; letter-spacing: -.5px; margin: 0 0 6px; }
.hero-desc { font-size: 13px; opacity: .82; margin: 0; max-width: 620px; }
.hero-meta { display: flex; gap: 26px; position: relative; z-index: 1; }
.hero-stat { text-align: right; }
.hero-stat .v { font-size: 21px; font-weight: 660; letter-spacing: -.4px; }
.hero-stat .k { font-size: 11.5px; opacity: .7; margin-top: 2px; }

/* ---------------- Calendar ---------------- */
.cal-card { display: flex; flex-direction: column; }
.cal-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 0; flex: 1; }
.cal-month { padding: 16px 20px 10px; display: flex; flex-direction: column; }
.cal-month + .cal-month { border-left: 1px solid var(--line-2); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-month-label { font-size: 14px; font-weight: 640; }
.cal-month-label span { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.cal-nav { display: flex; gap: 4px; }
.cal-nav button {
  width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center;
  color: var(--ink-3); border: 1px solid var(--line); background: #fff; font-size: 12px;
}
.cal-nav button:hover { background: var(--surface-2); color: var(--brand); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: auto repeat(6, 1fr); gap: 2px; flex: 1; }
.cal-dow {
  font-size: 10.5px; color: var(--muted); text-align: center;
  padding: 4px 0 6px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
}
.cal-dow.we { color: #b98b8b; }
.cal-cell {
  min-height: 34px; border-radius: 8px; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding-top: 3px; font-size: 12.5px; color: var(--ink-2); cursor: default;
  transition: background .12s; border: 1px solid transparent;
}
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.out { color: #c3cdd6; }
.cal-cell .d { width: 21px; height: 21px; line-height: 21px; text-align: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.cal-cell.today .d { background: var(--brand); color: #fff; font-weight: 650; }
.cal-cell.has-task { cursor: pointer; }
.cal-cell .dots { display: flex; gap: 3px; margin-top: 3px; }
.cal-cell .dot-t { width: 4px; height: 4px; border-radius: 50%; background: var(--brand-2); }
.cal-cell .dot-t.done { background: #c3cdd6; }
.cal-cell .dot-t.warn { background: var(--gold); }
.cal-cell.sel { background: var(--brand-soft); border-color: #cbe2ef; }
.cal-legend { display: flex; gap: 14px; margin-top: 12px; font-size: 11px; color: var(--muted); }
.cal-legend i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 4px; vertical-align: 1px; }

/* ---------------- Todo ---------------- */
.todo-panel { display: flex; flex-direction: column; height: 100%; }
.todo-tabs { display: flex; gap: 3px; background: var(--surface-2); padding: 3px; border-radius: 9px; }
.todo-tabs button {
  padding: 5px 12px; border-radius: 7px; font-size: 12px; color: var(--ink-3);
  font-weight: 550; transition: .15s; white-space: nowrap;
}
.todo-tabs button.active { background: #fff; color: var(--brand); box-shadow: 0 1px 2px rgba(16,32,46,.08); }
.todo-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 386px; }
.todo-item {
  display: flex; gap: 11px; padding: 11px 2px; border-bottom: 1px dashed var(--line-2);
  align-items: flex-start; cursor: pointer;
}
.todo-item:last-child { border-bottom: none; }
.todo-chk {
  width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid #c8d4de;
  flex: 0 0 auto; margin-top: 2px; display: grid; place-items: center; transition: .15s;
}
.todo-chk svg { opacity: 0; }
.todo-item.done .todo-chk { background: var(--green); border-color: var(--green); }
.todo-item.done .todo-chk svg { opacity: 1; }
.todo-body { flex: 1; min-width: 0; }
.todo-txt { font-size: 13px; color: var(--ink); line-height: 1.45; }
.todo-item.done .todo-txt { color: var(--muted); text-decoration: line-through; }
.todo-meta { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; align-items: center; }
.tag {
  display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 10px;
  font-weight: 600; letter-spacing: .2px;
}
.tag.cn { background: var(--brand-soft); color: var(--brand); }
.tag.hk { background: var(--gold-soft); color: #96651a; }
.tag.fin { background: #eef5ec; color: #3d6b3a; }
.tag.due { background: var(--red-soft); color: var(--red); }
.todo-add {
  display: flex; gap: 8px; margin-top: auto; padding-top: 14px;
}
.todo-add input {
  flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px;
  font-size: 13px; background: #fff; min-width: 0;
}
.todo-add input:focus { outline: 2px solid #cfe4f1; outline-offset: 0; border-color: #cfe4f1; }
.btn-sm {
  padding: 8px 13px; border-radius: 8px; background: var(--brand); color: #fff;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.btn-sm:hover { background: #0f4262; }
.btn-ghost {
  padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; font-size: 12.5px; color: var(--ink-2); font-weight: 550;
}
.btn-ghost:hover { background: var(--surface-2); border-color: #d3dee7; }

/* ---------------- Modules ---------------- */
.modules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.module {
  position: relative; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); padding: 22px; cursor: pointer; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.module:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #cfe0ec; }
.module-ico {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  margin-bottom: 14px;
}
.module:nth-child(1) .module-ico { background: #eaf2f8; color: #276b93; }
.module:nth-child(2) .module-ico { background: #f2f0e8; color: #8a7434; }
.module:nth-child(3) .module-ico { background: #e9f2ee; color: #2f7d63; }
.module-name { font-size: 16px; font-weight: 650; margin: 0 0 5px; }
.module-desc { font-size: 12.5px; color: var(--ink-3); margin: 0 0 16px; line-height: 1.6; min-height: 40px; }
.module-foot { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.module-kpis { display: flex; gap: 16px; color: var(--ink-3); }
.module-kpis b { display: block; color: var(--ink); font-size: 14px; font-weight: 640; }
.module-go { color: var(--brand); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.module.soon { opacity: .78; }
.module-badge {
  position: absolute; top: 18px; right: 18px; font-size: 10px; padding: 2px 7px;
  border-radius: 20px; background: var(--surface-2); color: var(--muted); font-weight: 600;
}

/* ---------------- KPI ---------------- */
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 15px 17px; box-shadow: var(--shadow);
}
.kpi-k { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.kpi-v { font-size: 24px; font-weight: 660; letter-spacing: -.6px; margin: 6px 0 2px; }
.kpi-v .unit { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi-sub { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.up { color: var(--red); }
.down { color: var(--green); }

/* ---------------- Charts ---------------- */
.chart-wrap { position: relative; width: 100%; }
.chart-svg { display: block; width: 100%; overflow: visible; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 4px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); }
.legend-swatch { width: 9px; height: 9px; border-radius: 2.5px; }
.axis-label { font-size: 10.5px; fill: var(--muted); font-family: var(--font); }
.grid-line { stroke: #eef2f6; stroke-width: 1; }
.bar-hover { fill: transparent; cursor: pointer; }

.tooltip {
  position: fixed; z-index: 200; pointer-events: none; opacity: 0;
  transform: translate(-50%, -112%); transition: opacity .12s;
  background: #10202e; color: #fff; border-radius: 9px; padding: 9px 12px;
  font-size: 12px; line-height: 1.6; white-space: nowrap;
  box-shadow: 0 10px 28px -8px rgba(16, 32, 46, .5);
}
.tooltip.show { opacity: 1; }
.tooltip .tt-title { font-weight: 650; margin-bottom: 5px; font-size: 12px; opacity: .9; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 18px; }
.tooltip .tt-row span:first-child { opacity: .7; }
.tooltip .tt-row b { font-variant-numeric: tabular-nums; font-weight: 600; }
.tooltip .tt-sep { height: 1px; background: rgba(255,255,255,.15); margin: 5px 0; }

/* ---------------- Metric grid ---------------- */
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric {
  border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px;
  background: var(--surface); cursor: pointer; transition: .15s; position: relative;
}
.metric:hover { border-color: #c9dceb; background: var(--surface-2); }
.metric-k { font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.metric-v { font-size: 19px; font-weight: 660; letter-spacing: -.4px; margin-top: 5px; }
.metric-v small { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.metric-bar { height: 3px; border-radius: 2px; background: var(--line-2); margin-top: 9px; overflow: hidden; }
.metric-bar i { display: block; height: 100%; border-radius: 2px; background: var(--brand-2); }
.metric-hint { font-size: 10.5px; color: var(--muted); margin-top: 5px; }
.metric.special { background: linear-gradient(180deg, #fbfdff, #f5f9fc); border-color: #d7e6f0; }

.sub-rates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.sub-rate { padding: 4px 12px 4px 0; }
.sub-rate .k { font-size: 10.5px; color: var(--muted); }
.sub-rate .v { font-size: 12.5px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.section-label {
  font-size: 11px; font-weight: 650; color: var(--muted); letter-spacing: .8px;
  text-transform: uppercase; margin: 22px 0 10px; display: flex; align-items: center; gap: 8px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }

/* ---------------- Tables ---------------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 11px; font-weight: 650; color: var(--muted);
  letter-spacing: .4px; text-transform: uppercase; padding: 8px 10px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); }
.table tr:last-child td { border-bottom: none; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .row-total td { font-weight: 650; color: var(--ink); background: var(--surface-2); border-top: 1px solid var(--line); }
.table .row-bold td { font-weight: 620; color: var(--ink); }
.table .indent { padding-left: 24px; }
.table-hover tbody tr:hover td { background: #fafcfe; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab {
  padding: 10px 16px 11px; font-size: 13.5px; color: var(--ink-3); font-weight: 550;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: .15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 620; }

/* ---------------- Upload ---------------- */
.upload-zone {
  border: 1.5px dashed #cddae5; border-radius: 12px; padding: 22px;
  text-align: center; background: var(--surface-2); cursor: pointer; transition: .15s;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--brand-2); background: #f0f7fb; }
.upload-zone .ico { color: var(--brand-2); margin-bottom: 8px; }
.upload-zone .t1 { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.upload-zone .t2 { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11.5px; color: var(--ink-3); font-weight: 550; }
.field input, .field select {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
  font-size: 13px; background: #fff; min-width: 150px;
}
.field input:focus, .field select:focus { outline: 2px solid #cfe4f1; outline-offset: 0; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: 20px; font-size: 11px; font-weight: 600;
}
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--gold-soft); color: #96651a; }
.pill.err { background: var(--red-soft); color: var(--red); }
.pill.info { background: var(--brand-soft); color: var(--brand); }

/* ---------------- Modal / Drawer ---------------- */
.overlay {
  position: fixed; inset: 0; background: rgba(16, 32, 46, .38); z-index: 150;
  opacity: 0; pointer-events: none; transition: opacity .2s;
  backdrop-filter: blur(2px);
}
.overlay.show { opacity: 1; pointer-events: auto; }
.modal {
  position: fixed; z-index: 160; left: 50%; top: 50%;
  transform: translate(-50%, -48%) scale(.98); opacity: 0; pointer-events: none;
  width: min(920px, calc(100vw - 48px)); max-height: 86vh; overflow: auto;
  background: #fff; border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(16,32,46,.4);
  transition: .2s ease;
}
.modal.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal-head {
  position: sticky; top: 0; background: #fff; z-index: 2;
  padding: 18px 22px 14px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.modal-title { font-size: 16px; font-weight: 650; margin: 0; }
.modal-sub { font-size: 12px; color: var(--muted); margin: 3px 0 0; }
.modal-close {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  color: var(--ink-3); flex: 0 0 auto;
}
.modal-close:hover { background: var(--surface-2); color: var(--ink); }
.modal-body { padding: 20px 22px 24px; }

/* ---------------- Misc ---------------- */
.note {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 14px; font-size: 12px; color: var(--ink-3); line-height: 1.7;
}
.note b { color: var(--ink-2); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 13px; }
.divider { height: 1px; background: var(--line-2); margin: 16px 0; }
.flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.flow-step { background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px; }
.flow-step.on { background: var(--brand-soft); border-color: #cbe2ef; color: var(--brand); font-weight: 600; }
.flow-arrow { color: #c3cdd6; }

.footer-note {
  margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

/* ---------------- English tweaks ---------------- */
body.lang-en .page-title { letter-spacing: -.2px; }
body.lang-en .table th { letter-spacing: .2px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1180px) {
  .g-main { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .modules { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .page { padding: 18px 14px 60px; }
  .topbar-inner { padding: 0 14px; gap: 12px; }
  .nav { display: none; }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero-meta { gap: 20px; }
  .cal-panel { grid-template-columns: 1fr; }
  .cal-month + .cal-month { border-left: none; border-top: 1px solid var(--line-2); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sub-rates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3, .g-2 { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .page-title { font-size: 20px; }
  .company-select { max-width: 150px; }
}

.metric-v .u { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 3px; letter-spacing: 0; }

.tax-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 12px; }
.pick-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1180px) { .pick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .tax-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------------- 登录 ---------------- */
body.auth-mode { background: #eef2f6; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(420px, 100%); background: #fff; border: 1px solid var(--line);
  border-radius: 18px; padding: 34px 34px 26px; box-shadow: 0 24px 60px -28px rgba(16, 32, 46, .35);
}
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 26px; }
.login-name { font-size: 14px; font-weight: 650; }
.login-sub { font-size: 10px; color: var(--muted); letter-spacing: 1.1px; }
.login-title { font-size: 21px; font-weight: 680; margin: 0 0 6px; letter-spacing: -.3px; }
.login-desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.7; margin: 0 0 22px; }
.login-field { margin-bottom: 13px; }
.login-field label { display: block; font-size: 12px; color: var(--ink-3); font-weight: 550; margin-bottom: 5px; }
.login-field input {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 12px; font-size: 14px; background: #fff;
}
.login-field input:focus { outline: 2px solid #cfe4f1; border-color: #bcd8e9; }
.login-err { min-height: 18px; font-size: 12px; color: var(--red); margin: 2px 0 8px; }
.login-btn {
  width: 100%; padding: 11px; border-radius: 9px; background: var(--brand); color: #fff;
  font-size: 14px; font-weight: 650; transition: .15s;
}
.login-btn:hover { background: #0f4262; }
.login-btn:disabled { opacity: .6; cursor: default; }
.login-foot { margin-top: 20px; font-size: 11px; color: var(--muted); text-align: center; }

.user-chip {
  display: flex; align-items: center; gap: 7px; padding: 5px 6px 5px 10px;
  border: 1px solid var(--line); border-radius: 20px; background: #fff;
  font-size: 12px; color: var(--ink-2);
}
.user-chip .av {
  width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft);
  color: var(--brand); display: grid; place-items: center; font-size: 11px; font-weight: 700;
}
.user-chip button { color: var(--muted); font-size: 11.5px; padding: 2px 6px; border-radius: 5px; }
.user-chip button:hover { background: var(--surface-2); color: var(--red); }

/* =========================================================================
 * 公司账套 / 记账中心
 * ========================================================================= */
.co-tabs { display: flex; gap: 4px; margin: 18px 0 14px; background: #fff; border: 1px solid var(--line);
  border-radius: 11px; padding: 4px; width: fit-content; }
.co-tab { padding: 7px 16px; border-radius: 8px; font-size: 13px; color: var(--ink-3); font-weight: 550; transition: .14s; }
.co-tab:hover { color: var(--ink); background: var(--surface-2); }
.co-tab.active { background: var(--brand); color: #fff; }

.co-newrow { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.co-newrow label { font-size: 12px; color: var(--ink-3); font-weight: 550; }

.co-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.co-slot { border: 1px dashed #cdd9e3; border-radius: 11px; padding: 14px 16px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; background: #fcfdfe; transition: .15s; }
.co-slot:hover { border-color: var(--brand-2); background: #f7fbfe; }
.co-slot-t { font-size: 13px; font-weight: 620; color: var(--ink); }
.co-slot-d { font-size: 11px; color: var(--muted); line-height: 1.5; min-height: 30px; }
.co-slot-state { font-size: 11.5px; color: var(--brand-2); font-weight: 600; }

.co-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 20px;
  border: 1.5px dashed #c9d8e4; border-radius: 13px; margin: 14px; cursor: pointer;
  background: linear-gradient(180deg, #fbfdff, #f6fafd); transition: .16s; }
.co-drop:hover, .co-drop.over { border-color: var(--brand-2); background: #f2f9fd; }
.co-drop-ic { color: var(--brand-2); display: flex; }
.co-drop-t { font-size: 14px; font-weight: 620; color: var(--ink); }
.co-drop-d { font-size: 11.5px; color: var(--muted); }

.co-field { display: flex; flex-direction: column; gap: 5px; }
.co-field label { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.co-input { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 12.5px;
  background: #fff; color: var(--ink-2); font-family: inherit; }
.co-input:focus { outline: 2px solid #d6e8f3; border-color: #b9d6e8; }

.co-sum { display: flex; align-items: center; gap: 26px; padding: 12px 20px; background: #fff;
  border: 1px solid var(--line); border-radius: 13px; margin: 14px 0; flex-wrap: wrap; }
.co-sum-item { display: flex; flex-direction: column; gap: 2px; }
.co-sum-k { font-size: 10.5px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.co-sum-v { font-size: 17px; font-weight: 660; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.co-big { font-size: 17px; font-weight: 660; color: var(--ink); font-variant-numeric: tabular-nums; }

.co-seg { display: flex; gap: 2px; background: var(--surface-2); border-radius: 8px; padding: 2px; }
.co-seg-b { padding: 4px 11px; border-radius: 6px; font-size: 11.5px; color: var(--ink-3); font-weight: 560; }
.co-seg-b.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16,32,46,.08); }

.co-tx td { padding: 7px 10px; font-size: 12.5px; }
.co-tx th { font-size: 10.5px; }
.co-td-date { font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; }
.co-td-cp { color: var(--ink-2); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-td-reason { font-size: 11px; color: var(--muted); }
.co-in { color: var(--green); font-weight: 600; }
.co-out { color: var(--red); font-weight: 600; }
.co-inline { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 6px;
  padding: 4px 6px; font-size: 12.5px; color: var(--ink-2); font-family: inherit; }
.co-inline:hover { border-color: var(--line); background: #fff; }
.co-inline:focus { outline: none; border-color: #b9d6e8; background: #fff; box-shadow: 0 0 0 2px #eaf4fa; }
.co-acct { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 5px 6px;
  font-size: 12px; background: #fff; color: var(--ink-2); font-family: inherit; max-width: 230px; }
.co-acct:focus { outline: 2px solid #d6e8f3; }
.co-x { color: var(--muted); font-size: 12px; width: 22px; height: 22px; border-radius: 5px; }
.co-x:hover { background: var(--red-soft); color: var(--red); }
.co-tx tr.row-off td { opacity: .38; text-decoration: line-through; }

.co-toast { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(10px);
  background: #17313f; color: #fff; padding: 10px 18px; border-radius: 9px; font-size: 12.5px;
  opacity: 0; pointer-events: none; transition: .22s; z-index: 300; box-shadow: var(--shadow-lg); }
.co-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 1080px) {
  .co-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 记账中心：参数栏与引导 */
.co-field .company-select { min-width: 208px; }
.co-field #coMaker { width: 130px; }
.co-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.co-step { display: flex; gap: 11px; align-items: flex-start; }
.co-step-n { width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  font-size: 11.5px; font-weight: 700; display: grid; place-items: center; flex: none; margin-top: 1px; }
.co-step-t { font-size: 13px; font-weight: 640; color: var(--ink); margin-bottom: 3px; }
.co-step-d { font-size: 11.5px; color: var(--muted); line-height: 1.65; }
@media (max-width: 900px) { .co-steps { grid-template-columns: 1fr; } }

.co-upbar { display: flex; align-items: center; gap: 16px; padding: 11px 20px; }
.co-drop-sm { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 12px;
  font-weight: 600; color: var(--brand-2); padding: 5px 11px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; transition: .15s; }
.co-drop-sm:hover { border-color: var(--brand-2); background: #f5fafd; }
.co-inline { border-bottom: 1px dashed #d5e0e8; border-radius: 6px 6px 0 0; }
