/* ============================================================================
   theme-report.css — "Manager Report 公文" · COMMITTEE-GRADE OFFICIAL SKIN
   ----------------------------------------------------------------------------
   Load order: AFTER tokens.css and base.css. Light-mode focused; the explicit
   dark toggle (:root[data-theme="dark"] in tokens.css) is untouched and still
   wins because its selector is more specific than the :root remap below and
   every component override consumes tokens, never raw colours. There is NO
   OS auto-dark media query anywhere in this file — light is the only default.

   The look (ported from the manager-report-ui 公文体 contract): near-black
   ink on near-white paper (pure #000 on #fff is banned — it shimmers for
   older eyes), an authoritative navy as the single accent, VISIBLE 1px
   hairline borders instead of shadows (borders survive the printer), squared
   4/5/6px radii (pills read consumer; this must read "record"), and
   semantic colours chosen to stay distinguishable in greyscale print.

   Contrast (WCAG 2.x, computed with relative-luminance math — not eyeballed):
     ink   #1A1D21 on bg #FCFCFD  = 16.50:1   (body ≥ 7:1 MUST — passes)
     ink   #1A1D21 on surface #FFFFFF = 16.91:1
     muted #3A4149 on bg #FCFCFD  = 10.08:1
     faint #5C636A on bg #FCFCFD  =  5.94:1   (on raise #F4F6F8 = 5.62:1)
     primary #14395E vs white     = 11.82:1   (btn-fg #FFFFFF on primary)
     primary-ink #14395E on primary-soft #E8EEF5 = 10.12:1
     success #0B6E4F vs white     =  6.25:1   (ink-on-soft #E6F2ED = 5.45:1)
     attention #8A5A00 vs white   =  5.93:1   (ink-on-soft #FBF1DF = 5.29:1)
     danger #8C2F26 vs white      =  8.24:1
   Every text pair clears WCAG AA (4.5:1); body text clears 7:1.
   ========================================================================== */

/* ---------- 1 · TOKENS — the 公文 palette (a remap of the PLATFORM names) */
:root {
  /* paper & ink: near-black on near-white — calm, no halation, prints identically */
  --bg:       #FCFCFD;   /* the page — paper, not screen-white */
  --surface:  #FFFFFF;   /* cards, table bodies */
  --raise:    #F4F6F8;   /* table headers, recessed panels */
  --line:     #D8DCE0;   /* VISIBLE hairline — it does the work shadows used to */

  --ink:      #1A1D21;   /* body text — 16.50:1 on bg */
  --muted:    #3A4149;   /* secondary text — 10.08:1 on bg */
  --faint:    #5C636A;   /* the floor: 5.94:1 on bg — nothing lighter may carry text */

  /* ONE accent: committee navy — authoritative, legible in greyscale print */
  --primary:      #14395E;
  --primary-soft: #E8EEF5;
  --primary-ink:  #14395E;   /* 10.12:1 on primary-soft */

  /* semantics — NEVER used alone; always paired with text (base + version CSS) */
  --success:       #0B6E4F;  /* 6.25:1 with white */
  --success-soft:  #E6F2ED;
  --success-ink:   #0B6E4F;  /* 5.45:1 on success-soft */
  --attention:     #8A5A00;  /* 5.93:1 with white */
  --attention-soft:#FBF1DF;
  --attention-ink: #8A5A00;  /* 5.29:1 on attention-soft */
  --danger:        #8C2F26;  /* 8.24:1 with white */
  --focus:         #14395E;
  --btn-fg:        #FFFFFF;  /* 11.82:1 on navy */

  /* shape: squared record-grade radii; the "shadow" is a hairline, effectively none */
  --r-sm: 4px; --r-md: 5px; --r-lg: 6px; --r-pill: 6px;
  --shadow: 0 0 0 1px color-mix(in srgb, var(--line) 55%, transparent);

  /* type: system stack, HK-first CJK fallbacks retained (tender MUST) */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Noto Sans HK", "PingFang HK", "PingFang TC", "PingFang SC",
               "Noto Sans TC", "Noto Sans SC", "Noto Sans",
               "Microsoft JhengHei", "Microsoft YaHei", sans-serif;
}
/* NOTE: dark tokens are deliberately NOT redefined here — the explicit toggle
   (:root[data-theme="dark"] in tokens.css) outranks the :root block above,
   so dark mode keeps working exactly as before, behind the toggle only. */

/* ---------- 2 · GLOBAL — every figure lines up ---------- */
body { font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1.page { font-weight: 700; letter-spacing: -.01em; }

/* ---------- 3 · TOPBAR & RAIL — flat, hairline, navy tick ---------- */
.topbar { box-shadow: none; border-bottom: 1px solid var(--line); }
.logo { background: var(--primary); border-radius: var(--r-sm); }
.rail { background: var(--bg); border-right: 1px solid var(--line); }
.rail a.on { box-shadow: inset 2px 0 0 var(--primary); }

/* ---------- 4 · CARDS & PANELS — 1px borders instead of shadows ---------- */
.card, .statcard, .step, .childhead, .evcard, .kidcard, .kidcount, .alertbox {
  box-shadow: none;
  border: 1px solid var(--line);
}
.tblwrap { box-shadow: none; }
.statcard::before { width: 3px; }
@media (hover:hover) and (pointer:fine) {
  .card.click:hover { border-color: var(--primary); box-shadow: none; transform: none; }
}

/* ---------- 5 · TABLES — the product. Header recessed, labels tracked ---- */
.tbl th { background: var(--raise); color: var(--muted); letter-spacing: .05em; }
.tbl th, .tbl td { padding: 11px 14px; }

/* ---------- 6 · BUTTONS & FORMS — squared, decisive, navy focus ---------- */
.btn { font-weight: 600; letter-spacing: .01em; box-shadow: none; }
.btn.ghost { border-color: color-mix(in srgb, var(--faint) 55%, var(--line)); }
input[type=text], input[type=search], textarea, select {
  border-color: color-mix(in srgb, var(--faint) 45%, var(--line));
}
.check input { accent-color: var(--primary); }

/* ---------- 7 · PILLS, TAGS, CHIPS — hairline-edged so status survives print */
.pill.ok   { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success-ink) 35%, transparent); }
.pill.warn { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--attention-ink) 35%, transparent); }
.pill.info { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-ink) 30%, transparent); }
.pill.prov { border-style: solid; }
.tag { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-ink) 25%, transparent); }
.prov-chip { background: var(--surface); }

/* ---------- 8 · CONTROLS & VIZ — exact, unanimated authority ---------- */
.langs { border: 1px solid var(--line); background: var(--raise); }
.langs button.on { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.themebtn { border: 1px solid var(--line); background: var(--surface); }
.toast { box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 20%, transparent); }
.bartrack, .sigbar, .meter { background: var(--raise); }
.sparkfill { opacity: .5; }
.legend .sw { border-radius: 2px; }
.notice { border-radius: var(--r-sm); }
.letterhead .lh-mark { background: var(--primary); border-radius: var(--r-sm); }
.report-summary { border-left: 3px solid var(--primary); }

/* end theme-report.css */
