/* ============================================================
   管理端：浅色、扁平、信息优先
   ============================================================ */
body.theme-admin { background: var(--bg); color: var(--ink); }

.admin-shell { display: grid; grid-template-columns: 214px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; padding: 16px 10px 14px;
  border-right: 1px solid var(--line); background: #fff;
  display: flex; flex-direction: column; z-index: 100;
}
.sidebar-brand { display: flex; flex-direction: column; gap: 1px; padding: 4px 10px 18px; }
.sidebar-brand .mark { display: none; }
.sidebar-brand b { display: block; font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.sidebar-brand span { display: block; font-size: 10.5px; color: var(--faint); }
.nav-label { font-size: 10px; letter-spacing: .08em; color: var(--faint); padding: 14px 10px 5px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 6px;
  color: #4b5563; font-size: 13px; font-weight: 400; margin-bottom: 1px;
  transition: background .12s, color .12s; text-decoration: none;
}
.nav-item svg { width: 16px; height: 16px; flex: none; color: #8a929c; }
.nav-item:hover { background: #f4f6f5; color: var(--ink); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 500; }
.nav-item.active svg { color: var(--accent); }
.nav-item.active::before { display: none; }
.nav-item .count { margin-left: auto; font-size: 10.5px; color: var(--faint); }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.sidebar-user { display: flex; align-items: center; gap: 8px; padding: 4px 2px; }
.sidebar-user .avatar { width: 28px; height: 28px; font-size: 11px; }
.sidebar-user .who b { display: block; font-size: 12px; font-weight: 500; }
.sidebar-user .who span { display: block; font-size: 10px; color: var(--faint); }
.sidebar-version { font-size: 10px; color: #b6bcc3; padding: 8px 4px 0; }

.admin-main { min-width: 0; }
.admin-topbar {
  position: sticky; top: 0; z-index: 60; height: 54px;
  display: flex; align-items: center; gap: 12px; padding: 0 26px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.admin-topbar .page-crumb { font-size: 12.5px; color: var(--muted); }
.admin-topbar .page-crumb b { color: var(--ink); font-weight: 500; }
.admin-topbar .spacer { flex: 1; }
.admin-topbar .quick {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted);
}
.admin-topbar .quick .dot { background: var(--green); }
.hamburger { display: none; border: 1px solid var(--line); background: #fff; width: 32px; height: 32px; border-radius: 6px; color: var(--ink); place-items: center; }
.hamburger svg { width: 17px; height: 17px; }
.admin-content { padding: 22px 26px 48px; max-width: 1480px; margin: 0 auto; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .eyebrow { display: none; }
.page-head h1 { font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.page-head p { color: var(--muted); font-size: 12.5px; margin-top: 5px; max-width: 760px; line-height: 1.7; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi {
  position: relative; padding: 15px 16px 13px; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff; min-height: 100px;
  display: flex; flex-direction: column;
}
.kpi::after { display: none; }
.kpi .k-label { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.kpi .k-label svg { width: 14px; height: 14px; color: #8a929c; }
.kpi .k-value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi .k-value small { font-size: 12px; color: var(--faint); font-weight: 400; margin-left: 3px; }
.kpi .k-foot { margin-top: auto; font-size: 11px; color: var(--faint); padding-top: 8px; }
.kpi .mini { display: none; }

/* panels */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.dash-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.panel-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  background: #fff;
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head h3 { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.panel-head h3 svg { width: 15px; height: 15px; color: var(--muted); }
.panel-head .sub { font-size: 11px; color: var(--faint); margin-top: 2px; }
.panel-head .actions { display: flex; gap: 6px; }

.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.activity-item:last-child { border-bottom: 0; }
.activity-item .ic { width: 26px; height: 26px; border-radius: 6px; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; flex: none; }
.activity-item .ic svg { width: 13px; height: 13px; }
.activity-item .txt { min-width: 0; flex: 1; }
.activity-item .txt b { font-weight: 500; }
.activity-item .txt span { display: block; color: var(--faint); font-size: 10.5px; margin-top: 1px; }
.activity-item .time { font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }

.health-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.health-item { padding: 10px 11px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); }
.health-item .k { font-size: 10.5px; color: var(--faint); }
.health-item .v { font-size: 14px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.health-item .v.ok { color: var(--green); }
.health-item .v.warn { color: var(--amber); }
.meter { height: 5px; border-radius: 3px; background: #edf0ef; overflow: hidden; margin-top: 7px; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.meter i.warn { background: var(--amber); }

/* campaigns */
.campaign-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.campaign-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: #fff; }
.campaign-card:hover { border-color: var(--line-strong); }
.campaign-card .cc-top { display: flex; align-items: flex-start; gap: 10px; }
.campaign-card .cc-name { font-size: 14px; font-weight: 600; line-height: 1.4; }
.campaign-card .cc-meta { font-size: 11px; color: var(--faint); margin-top: 3px; }
.campaign-card .cc-progress { margin: 14px 0 10px; }
.campaign-card .cc-bar { height: 5px; border-radius: 3px; background: #edf0ef; overflow: hidden; }
.campaign-card .cc-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.cc-bar { height: 5px; border-radius: 3px; background: #edf0ef; overflow: hidden; }
.cc-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.campaign-card .cc-stats { display: flex; gap: 16px; margin-top: 8px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.campaign-card .cc-stats b { color: var(--ink); font-size: 12.5px; font-variant-numeric: tabular-nums; margin-right: 2px; }
.campaign-card .cc-actions { display: flex; gap: 6px; padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--line); }

/* filters */
.filterbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.filterbar .select, .filterbar .input { width: auto; min-width: 130px; height: 34px; padding-top: 0; padding-bottom: 0; font-size: 12.5px; }
.filterbar .search { position: relative; min-width: 210px; }
.filterbar .search .input { width: 100%; padding-left: 32px; }
.filterbar .search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--faint); }
.filterbar .label-inline { font-size: 11px; color: var(--faint); }
.filterbar .spacer { flex: 1; }

/* tables */
.table-wrap { border: 1px solid var(--line); border-radius: 8px; overflow: auto; background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 720px; }
table.data thead th {
  position: sticky; top: 0; z-index: 1; text-align: left; font-weight: 500; font-size: 10.5px;
  letter-spacing: .04em; color: var(--muted); padding: 9px 12px;
  background: #f8f9f8; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data tbody td { padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: #fafbfa; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .sub { display: block; font-size: 10.5px; color: var(--faint); margin-top: 1px; }
table.data .strong { color: var(--ink); font-weight: 500; }
.table-empty { padding: 34px; text-align: center; color: var(--faint); font-size: 12.5px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.pager b { color: var(--ink); font-weight: 500; }

/* light tables inside modals */
.table-wrap.light { background: #fff; }
.table-wrap.light table.data { color: var(--ink-2); }
.table-wrap.light table.data thead th { background: #f8f9f8; color: var(--muted); }
.table-wrap.light table.data tbody td { color: var(--ink-2); }
.table-wrap.light table.data tbody tr:hover td { background: #fafbfa; }

/* stats */
.stats-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.compare-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff; }
.compare-card::after { display: none; }
.compare-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-top: 14px; }
.compare-side { text-align: center; }
.compare-side .who { font-size: 11px; color: var(--muted); }
.compare-side .big { font-size: 36px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.compare-side .ci { font-size: 10.5px; color: var(--faint); margin-top: 3px; }
.compare-side .tag { margin-top: 7px; display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; }
.compare-vs { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); font-size: 9.5px; color: var(--faint); }
.compare-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.compare-foot .delta { font-weight: 600; font-size: 12px; }
.compare-foot .delta.pos { color: var(--green); }
.compare-foot .delta.neg { color: var(--red); }

.chart-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: #fff; min-width: 0; }
.chart-card .chart-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.chart-card .chart-title h3 { font-size: 13px; font-weight: 600; }
.chart-card .chart-title p { font-size: 10.5px; color: var(--faint); margin-top: 2px; line-height: 1.5; }
.chart-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 10.5px; color: var(--muted); margin-bottom: 4px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.chart-wrap { width: 100%; overflow: hidden; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-note { font-size: 10px; color: var(--faint); line-height: 1.6; margin-top: 6px; }
.chart-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.chart-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.mini-kpi-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.mini-kpi { flex: 1; min-width: 84px; padding: 8px 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.mini-kpi .k { font-size: 9.5px; color: var(--faint); }
.mini-kpi .v { font-size: 15px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* svg chart text */
svg .axis-label { font-size: 10px; fill: #8a929c; }
svg .value-label { font-size: 10.5px; fill: #374151; font-weight: 500; }
svg .grid-line { stroke: #edf0ef; stroke-width: 1; }
svg .axis-line { stroke: #d5d9d6; stroke-width: 1; }
svg text { font-family: var(--font-sans); }

/* wizard */
.wizard-steps { display: flex; gap: 5px; margin-bottom: 18px; flex-wrap: wrap; }
.wizard-step { display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 6px; border-radius: 6px; border: 1px solid var(--line); font-size: 11.5px; color: var(--faint); background: #fff; }
.wizard-step .n { width: 19px; height: 19px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 10px; }
.wizard-step.active { border-color: #9cc8c2; color: var(--accent-2); background: var(--accent-soft); }
.wizard-step.active .n { background: var(--accent); color: #fff; }
.wizard-step.done { color: var(--green); border-color: #cfe5d6; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-section { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; background: #fff; }
.form-section .fs-title { font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
.form-section .fs-title svg { width: 14px; height: 14px; color: var(--muted); }
.form-section .fs-sub { font-size: 10.5px; color: var(--faint); margin-bottom: 12px; line-height: 1.5; }
.form-section > .check { display: flex; }
.form-section > .check + .check { margin-top: 8px; }

.doctor-picker { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 7px; }
.doctor-pick-row {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) 74px 82px 70px;
  align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 12px;
}
.doctor-pick-row:last-child { border-bottom: 0; }
.doctor-pick-row:hover { background: #fafbfa; }
.doctor-pick-row .who b { display: block; font-size: 12px; font-weight: 500; }
.doctor-pick-row .who span { display: block; font-size: 10px; color: var(--faint); }
.doctor-pick-row .input { height: 28px; padding: 0 7px; font-size: 11.5px; border-radius: 5px; }
.doctor-pick-row input[type=checkbox] { accent-color: var(--accent); width: 14px; height: 14px; }

.preview-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.preview-stat { padding: 10px 12px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface-2); }
.preview-stat .k { font-size: 10px; color: var(--faint); }
.preview-stat .v { font-size: 18px; font-weight: 600; margin-top: 1px; font-variant-numeric: tabular-nums; }
.warnings { display: flex; flex-direction: column; gap: 5px; margin: 10px 0; }
.warning-item { display: flex; gap: 7px; padding: 7px 10px; border-radius: 6px; background: var(--amber-soft); border: 1px solid #f0e0bf; color: #92400e; font-size: 11px; line-height: 1.5; }
.warning-item svg { width: 13px; height: 13px; flex: none; margin-top: 1px; }

/* case preview */
.preview-record { background: #fff; color: var(--ink); border-radius: 8px; padding: 22px 24px; border: 1px solid var(--line); }
.preview-record h2 { font-size: 19px; font-weight: 600; margin-bottom: 12px; }
.preview-record h4 { color: var(--accent-2); font-size: 12.5px; font-weight: 600; margin: 13px 0 4px; }
.preview-record p { font-size: 13.5px; line-height: 1.85; text-align: justify; margin-bottom: 5px; }
.preview-record .truth-line { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* audit */
.audit-action { font-family: var(--font-mono); font-size: 11px; color: var(--blue); }
.audit-detail { font-size: 10.5px; color: var(--faint); max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-overlay { display: none; position: fixed; inset: 0; z-index: 99; background: rgba(15, 23, 42, .3); }
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .stats-hero { grid-template-columns: 1fr; }
  .chart-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1024px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; width: 240px; transform: translateX(-102%);
    transition: transform .22s var(--ease); z-index: 101; box-shadow: 12px 0 30px rgba(16, 24, 40, .12);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .admin-topbar { padding: 0 14px; }
  .hamburger { display: grid; }
  .admin-content { padding: 18px 14px 44px; }
  .campaign-grid { grid-template-columns: 1fr; }
  .chart-grid-2 { grid-template-columns: 1fr; }
}
/* stats: completed doctors vs model */
.metric-panel { padding: 20px 22px; }
.metric-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.metric-table th {
  text-align: left; font-size: 10.5px; font-weight: 500; letter-spacing: .06em;
  color: var(--muted); padding: 0 12px 8px; border-bottom: 1px solid var(--line);
}
.metric-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.metric-table tr:last-child td { border-bottom: 0; }
.metric-name b { display: inline-block; min-width: 42px; font-size: 13px; color: var(--ink); }
.metric-name span { font-size: 11px; color: var(--faint); }
.metric-doc, .metric-model { font-size: 27px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.metric-doc { color: var(--accent); }
.metric-model { color: #64748b; }
.metric-delta { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric-delta.positive { color: var(--green); }
.metric-delta.negative { color: var(--red); }
.metric-note { margin-top: 12px; font-size: 10.5px; color: var(--faint); line-height: 1.6; }
.metric-warning {
  display: flex; align-items: center; gap: 7px; margin-top: 12px; padding: 9px 12px;
  border: 1px solid #eadfc6; border-radius: 6px; background: var(--amber-soft);
  color: #8a5a12; font-size: 11.5px;
}
.doctor-stats { display: flex; flex-direction: column; gap: 7px; }
.doc-stat { border: 1px solid var(--line); border-radius: 7px; background: #fff; overflow: hidden; }
.doc-stat summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0,1fr) auto 20px;
  align-items: center; gap: 14px; padding: 11px 13px; font-size: 12.5px;
}
.doc-stat summary::-webkit-details-marker { display: none; }
.doc-stat summary:hover { background: #fafbfa; }
.ds-name b { font-size: 13px; font-weight: 600; }
.ds-name span { display: block; font-size: 10.5px; color: var(--faint); margin-top: 1px; }
.ds-quick { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ds-open { color: var(--faint); display: grid; place-items: center; transition: transform .15s; }
.doc-stat[open] .ds-open { transform: rotate(180deg); }
.doc-stat-body { border-top: 1px solid var(--line); padding: 12px 13px 13px; background: #fcfdfc; }
.doc-legend { display: flex; gap: 14px; font-size: 10.5px; color: var(--muted); margin-bottom: 8px; }
.doc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.doctor { background: var(--accent); }
.dot.model { background: #94a3b8; }
.doc-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.doc-metric { border: 1px solid var(--line); border-radius: 6px; padding: 8px 9px; background: #fff; }
.dm-name { font-size: 10px; color: var(--faint); }
.dm-name span { margin-left: 4px; }
.dm-values { display: flex; align-items: baseline; gap: 7px; margin-top: 3px; }
.dm-doc { font-size: 18px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.dm-model { font-size: 12px; color: #64748b; font-variant-numeric: tabular-nums; }
.dm-delta { margin-top: 2px; font-size: 10.5px; }
.doc-counts { margin-top: 9px; font-size: 10.5px; color: var(--faint); line-height: 1.6; }
.doc-counts span { margin-left: 12px; }

/* batch pool */
.wiz-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.wiz-aside { position: sticky; top: 80px; }
.batch-options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.batch-option {
  display: flex; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid var(--line);
  border-radius: 7px; background: #fff; transition: border-color .12s, background .12s;
}
.batch-option.selected { border-color: #9cc8c2; background: var(--accent-soft); }
.batch-option label { display: flex; align-items: flex-start; gap: 8px; flex: 1; min-width: 0; cursor: pointer; }
.batch-option input { accent-color: var(--accent); margin-top: 2px; flex: none; }
.bo-main { min-width: 0; }
.bo-main b { display: block; font-size: 12px; font-weight: 500; line-height: 1.35; }
.bo-meta { display: block; font-size: 10.5px; color: var(--faint); margin-top: 2px; }
.batch-del { border: 0; background: none; color: var(--faint); padding: 5px; border-radius: 4px; flex: none; }
.batch-del:hover { color: var(--red); background: var(--red-soft); }
.pool-toolbar { display: flex; align-items: center; gap: 7px; margin-top: 10px; flex-wrap: wrap; }
.format-help { margin-top: 10px; border: 1px solid var(--line); border-radius: 7px; background: #fafbfa; }
.format-help summary { cursor: pointer; padding: 8px 10px; font-size: 11.5px; color: var(--muted); }
.format-body { padding: 0 12px 12px; font-size: 11.5px; color: var(--muted); line-height: 1.75; }
.format-body p { margin-bottom: 8px; }
.format-table { width: 100%; border-collapse: collapse; margin: 4px 0 8px; font-size: 11px; }
.format-table th, .format-table td { text-align: left; padding: 5px 7px; border-bottom: 1px solid var(--line); vertical-align: top; }
.format-table th { color: var(--faint); font-weight: 500; background: #f4f6f5; }
.case-picker-toolbar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 9px; }
.case-picker-list { border: 1px solid var(--line); border-radius: 7px; max-height: 52vh; overflow: auto; background: #fff; }
.case-pick-group + .case-pick-group { border-top: 1px solid var(--line); }
.cpg-title {
  position: sticky; top: 0; z-index: 1; padding: 7px 10px; background: #f6f8f7;
  font-size: 10.5px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line);
}
.cpg-title span { font-weight: 400; color: var(--faint); margin-left: 4px; }
.case-pick-row {
  display: grid; grid-template-columns: 22px 110px 52px minmax(0,1fr) 52px;
  align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid #f1f4f2;
  font-size: 11.5px; cursor: pointer;
}
.case-pick-row:last-child { border-bottom: 0; }
.case-pick-row:hover { background: #fafbfa; }
.case-pick-row input { accent-color: var(--accent); }
.cp-code { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); }
.cp-patient { color: var(--faint); font-size: 10.5px; }
.cp-truth { text-align: right; }
.doc-case { white-space: nowrap; }

@media (max-width: 1280px) {
  .wiz-layout { grid-template-columns: minmax(0, 1fr) 290px; }
  .doc-metrics { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1024px) {
  .wiz-layout { grid-template-columns: 1fr; }
  .wiz-aside { position: static; }
}
@media (max-width: 760px) {
  .batch-options { grid-template-columns: 1fr; }
  .doc-stat summary { grid-template-columns: minmax(0,1fr) 20px; }
  .ds-quick { display: none; }
  .doc-metrics { grid-template-columns: 1fr 1fr; }
  .metric-doc, .metric-model { font-size: 21px; }
  .metric-table th, .metric-table td { padding-left: 6px; padding-right: 6px; }
  .case-pick-row { grid-template-columns: 20px 88px 44px minmax(0,1fr); }
  .case-pick-row .cp-truth { display: none; }
  .doc-counts span { display: block; margin-left: 0; }
}

@media (max-width: 760px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { min-height: 92px; padding: 12px; }
  .kpi .k-value { font-size: 22px; }
  .page-head h1 { font-size: 20px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .chart-grid-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .preview-summary { grid-template-columns: 1fr 1fr; }
  .compare-side .big { font-size: 30px; }
  .compare-grid { gap: 6px; }
  .compare-vs { width: 28px; height: 28px; font-size: 8.5px; }
  .doctor-pick-row { grid-template-columns: 22px minmax(0, 1fr); }
  .doctor-pick-row .input { grid-column: span 2; }
  .filterbar .select, .filterbar .input { min-width: 0; width: 100%; }
  .filterbar .search { min-width: 0; width: 100%; }
  .filterbar .label-inline { display: none; }
  .table-wrap { border-radius: 8px; }
  .admin-topbar .quick { display: none; }
}
