/* ==========================================================================
   CAB Feed brand theme. Change the colours HERE to restyle the whole app.
   Loaded after app.css, so these values win. Navy + red + yellow follow the
   CAB Feed paper forms (revised Oct 2026).
   ========================================================================== */
:root {
  /* brand */
  --brand-navy: #1f3a6e;
  --brand-navy-2: #16305c;
  --brand-red: #c8102e;
  --brand-yellow: #f2b705;

  /* app tokens built from the brand */
  --primary: var(--brand-navy);
  --primary-2: var(--brand-navy-2);
  --primary-soft: #e8edf6;
  --accent: var(--brand-yellow);
  --accent-soft: #fdf5d9;
  --bg: #f3f5f9;
  --bg-2: #e9edf4;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --border: #d9dfea;
  --text: #1b2333;
  --text-2: #4b5568;
  --text-3: #7c8698;
  --ok: #1e8e3e; --ok-soft: #e4f4e8;
  --warn: #b97400; --warn-soft: #fdf3dc;
  --bad: var(--brand-red); --bad-soft: #fbe6e9;
  --info: var(--brand-navy); --info-soft: #e8edf6;
  --hero: linear-gradient(120deg, var(--brand-navy) 0%, var(--brand-navy-2) 70%, #2a4a85 100%);
  /* hues for workstations / charts: navy, red, yellow first, then supporting tones */
  --h1: #1f3a6e; --h1s: #e8edf6;
  --h2: #c8102e; --h2s: #fbe6e9;
  --h3: #b98900; --h3s: #fdf5d9;
  --h4: #2e7d6b; --h4s: #e2f2ee;
  --h5: #4a6fa5; --h5s: #e7eef8;
  --h6: #8a4f7d; --h6s: #f4e9f1;
  --h7: #d4622a; --h7s: #fbebe2;
  --h8: #3b8ea5; --h8s: #e3f1f5;
  --h9: #5b5f97; --h9s: #ebebf5;

  /* standard type: one system font family, 14px body, fixed scale */
  --font: 'Segoe UI', Arial, Helvetica, sans-serif;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --radius: 10px;
  --radius-sm: 8px;
}
:root[data-theme='dark'] {
  --primary: #7f9fd8; --primary-2: #6a8bc8; --primary-soft: #1e2c4a; --accent: #f2c94c; --accent-soft: #3a3214;
  --bg: #0f1626; --bg-2: #151e33; --surface: #18223a; --surface-2: #1d2843; --border: #2b3756;
  --text: #edf1f8; --text-2: #b0bbd2; --text-3: #7d89a6; --bad: #ff6b81; --bad-soft: #43202a; --info: #7f9fd8; --info-soft: #1e2c4a;
  --hero: linear-gradient(120deg, #1f3a6e 0%, #16305c 70%, #2a4a85 100%);
  --h1s: #1e2c4a; --h2s: #43202a; --h3s: #3a3214; --h4s: #15342c; --h5s: #1f2c44; --h6s: #34213a; --h7s: #3d2618; --h8s: #163540; --h9s: #24264a;
}

/* ---- standard font sizes everywhere ---- */
body { font-family: var(--font); font-size: var(--fs-base); line-height: 1.45; }
h1, .topbar h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
h4 { font-size: var(--fs-sm); }
.small, .sh-name > span, .chip { font-size: var(--fs-sm); }
.tiny, .sf > span, .trio label > span, .sum-mini em, table.mini th, table.mx th { font-size: var(--fs-xs); }
.btn, .input, select, textarea, .nav a, .kv, table.sheet, table.mini, table.mx, .table { font-size: var(--fs-base); }
table.sheet thead th, table.sheet .ci, table.sheet tfoot td { font-size: var(--fs-sm); }
table.sheet thead th.grp, .blk h4 { font-size: var(--fs-xs); }
.blk .kv, .input.sm, table.mini.dt .ci, table.mx .input.sm, .seg.yn button { font-size: var(--fs-sm); }
.sum-mini b, .sh-name b { font-size: var(--fs-md); }
.kpi .k-value { font-family: var(--font); }

/* ---- brand accents ---- */
.btn.primary { background: var(--brand-navy); box-shadow: none; }
.btn.primary:hover { background: var(--brand-navy-2); filter: none; }
.nav a.active { background: var(--primary-soft); color: var(--brand-navy); box-shadow: inset 3px 0 0 var(--brand-red); }
.nav a.active .ni { background: var(--brand-navy); box-shadow: none; }
table.sheet thead th.grp { background: var(--brand-navy); color: #fff; border-color: var(--brand-navy-2); }
table.sheet thead tr:nth-child(2) th { background: #e8edf6; color: var(--brand-navy); }
:root[data-theme='dark'] table.sheet thead tr:nth-child(2) th { background: #1e2c4a; color: #dfe6f3; }
table.sheet th.run { background: var(--brand-navy); color: #fff; }
.sheet-head { border-top: 3px solid var(--brand-navy); box-shadow: inset 0 -2px 0 var(--brand-yellow), var(--shadow-sm); }
.blk h4 { color: var(--brand-navy); border-bottom: 2px solid var(--brand-yellow); padding-bottom: 3px; }
:root[data-theme='dark'] .blk h4 { color: #cfdaf0; }
.seg.yn button.on { background: var(--brand-navy); }
.seg.yn button.on[data-v="N"] { background: var(--brand-red); }
.auto-tag { font-style: normal; font-weight: 600; font-size: 9px; color: var(--brand-red); text-transform: uppercase; }
.mx-cap { font-size: var(--fs-xs); font-weight: 700; color: var(--text-2); margin: 6px 0 2px; text-transform: uppercase; letter-spacing: 0.03em; }
.kv.stack { flex-direction: column; align-items: stretch; } .kv.stack > .input.sm { width: 100% !important; }

/* ---- print: navy / red like the paper forms ---- */
.sheet-read.print .ps-head { border: 0; border-bottom: 3px solid var(--brand-navy); box-shadow: 0 2px 0 var(--brand-red); padding: 4px 0 8px; }
.sheet-read.print .ps-title b { color: var(--brand-navy); font-size: 16px; letter-spacing: 0.02em; }
.sheet-read.print .ps-band { display: inline-block; margin: 4px auto 0; background: var(--brand-navy); color: #fff; padding: 2px 18px; border-radius: 4px; font-size: 12px; }
.sheet-read.print table.sheet thead th.grp, .sheet-read.print table.sheet thead th.run { background: var(--brand-navy) !important; color: #fff !important; }
.sheet-read.print table.sheet thead tr:nth-child(2) th { background: #e8edf6 !important; color: var(--brand-navy) !important; }
.sheet-read.print table.sheet th, .sheet-read.print table.sheet td { border-color: #8a9bbd; }
.sheet-read.print table.sheet tbody tr:nth-child(even) td { background: #f3f6fb !important; }
.sheet-read.print .blk { border-color: var(--brand-navy); }
.sheet-read.print .blk h4 { color: var(--brand-navy); border-bottom: 1.5px solid var(--brand-yellow); }
.print-sheet .sig { grid-template-columns: 1fr 1fr; }
.print-sheet .sig div { border-top-color: var(--brand-navy); }
.print-sheet .ps-foot { display: flex; justify-content: space-between; border-top: 3px solid var(--brand-navy); box-shadow: 0 -2px 0 var(--brand-yellow); padding-top: 4px; }
@media print { * { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
