/* KBH Hub design system (restyle 2026-12, built with tasteskill 2.5 + fontpool).
   Kind: software (an internal operations app). One system for hub and modules:
   - Type: Switzer (Indian Type Foundry, self-hosted variable 100-900), a neo-grotesk close to the old
     Helvetica Neue metrics so no layout moves. Headings 600 with tight tracking, text 400, labels 500.
   - Colour: the interface stays 90-95% neutral on one warm near-black ink; KBH's blue (#1a56a3, the
     logo blue darkened to 6.9:1) is the one accent: primary buttons, links, focus, current state.
     Logo green is a small brand mark only. Flat grounds, no gradients, no blur.
   - Radius: soft (controls 8, panels 12, cards 20). One card recipe: white, 1px ink hairline.
   - Motion (tasteskill motion.md): hover 150ms in / 120ms out, press 90ms, one ease-out; buttons step
     1px up and press 1px down at .985; linked cards lift 2px; focus ring 2px, never animated.
   Layout (sizes, spacing, grids) is unchanged from the previous design on purpose. */
:root {
  --ink: #16181d; --ink2: #23262d; --body: #3a3e46;
  --soft: #4d525b;   /* 7.6:1 on white */
  --dim: #686d76;    /* 5.0:1, smallest allowed for labels */
  --muted: var(--dim);
  --line: color-mix(in oklab, var(--ink) 14%, white); --line-soft: color-mix(in oklab, var(--ink) 8%, white);
  --line-strong: color-mix(in oklab, var(--ink) 26%, white);
  --bg: #f6f6f4; --surface: #ffffff; --surface-2: #f1f1ee;
  --brand-blue: #5aa1fd; --brand-green: #9ec863; --brand-gray: #5c5c5c;
  --accent: #1a56a3; --accent-dark: color-mix(in oklab, var(--accent) 86%, var(--ink));
  --accent-soft: color-mix(in oklab, var(--accent) 9%, white); --accent-soft2: color-mix(in oklab, var(--accent) 5%, white);
  --danger: #b42318; --danger-soft: #fdf1f0; --ok: #2f6b1a; --ok-soft: #edf5e7; --warn: #92400e;
  --success: var(--ok);
  --font: "Switzer", "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
  /* Shapes by kind, not one radius everywhere: surfaces near-square, things you press slightly rounded,
     floating layers softer, fully round only for tokens (pills, counts, avatars, icon chips). */
  --r-sm: 6px;      /* controls: buttons, inputs, nav rows */
  --r-md: 3px;      /* inner panels, segmented bars, rows */
  --r-lg: 3px;      /* cards, tables, tiles */
  --r-float: 10px;  /* menus, dialogs, sheets */
  --r-chip: 2px;    /* small marks inside panels */
  --radius: var(--r-lg);
  --shadow-card: none;
  --shadow-hover: 0 8px 24px color-mix(in oklab, var(--ink) 10%, transparent);
  --shadow-pop: 0 14px 36px color-mix(in oklab, var(--ink) 14%, transparent);
  --ease: cubic-bezier(.2, .8, .2, 1); --m-in: 150ms; --m-out: 120ms; --m-press: 90ms; --m-panel: 200ms;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 14px/1.5 var(--font); color: var(--ink); background: var(--bg); word-spacing: .06em; letter-spacing: -.012em; -webkit-font-smoothing: antialiased; }
body.has-bg { background: var(--bg); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color var(--m-out) var(--ease), text-decoration-color var(--m-out) var(--ease); }
a:hover { color: var(--accent-dark); transition-duration: var(--m-in); }
/* Text links with no class of their own (running text, table cells): rest on a faint hairline, the line darkens on hover. */
a:not([class]) { text-decoration-line: underline; text-decoration-color: color-mix(in oklab, currentColor 30%, transparent); }
a:not([class]):hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; transition: none; }
/* Numbers line up in tables, stats and money. */
table, .stats, .num, td { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
svg { display: block; }

/* ===================== Shell ===================== */
/* Page boot: pages start as <body class="booting"> and kbh.shell() removes it once the menu is built.
   Until then the raw page stays hidden behind an empty sidebar (or top bar on small screens), so the
   page never flashes unstyled. If a script fails, the page shows anyway after 4 s. */
body.booting { background: var(--bg); }
body.booting #content { visibility: hidden; animation: kbh-reveal 0s 4s forwards; }
body.booting::before { content: ""; position: fixed; top: 0; left: 0; bottom: 0; width: 240px; background: var(--surface); border-right: 1px solid var(--line-soft); }
@keyframes kbh-reveal { to { visibility: visible; } }
.mainpad { animation: kbh-fade .2s ease-out; }
@keyframes kbh-fade { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .mainpad { animation: none; } }
.shell { display: flex; min-height: 100vh; }
.sbar { width: 240px; flex: none; position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; padding: 20px 0 16px; z-index: 30; }
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 0 16px 22px; text-decoration: none; }
.sb-brand img { width: 56px; height: auto; flex: none; }
.sb-brand .sb-word { font: 600 13px/1.3 var(--font); letter-spacing: -.01em; white-space: nowrap; color: var(--ink2); text-transform: none; }
.sb-brand .sb-word small { display: block; font-weight: 400; letter-spacing: .02em; text-transform: none; font-size: 11px; color: var(--dim); margin-top: 2px; }
.sb-brand.module .sb-word { letter-spacing: 0; text-transform: none; font-size: 15px; color: var(--ink); }
.sb-brand.module .sb-word small { font: 400 11.5px var(--font); letter-spacing: 0; text-transform: none; color: var(--dim); margin-top: 3px; }
.sb-search { margin: 0 16px 22px; display: flex; align-items: center; gap: 9px; height: 36px; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--r-sm); padding: 0 11px; transition: border-color var(--m-out) var(--ease), background var(--m-out) var(--ease); }
.sb-search:hover { border-color: var(--line); }
.sb-search svg { stroke: var(--dim); flex: none; }
.sb-search input { border: 0; background: transparent; font: 400 13px var(--font); color: var(--ink); width: 100%; min-width: 0; padding: 0; min-height: 0; }
.sb-search input::placeholder { color: var(--dim); }
.sb-search input:focus { outline: none; box-shadow: none; }
.sb-search:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 16%, transparent); }
.sb-label { font: 500 12.5px var(--font); letter-spacing: 0; color: var(--dim); padding: 0 20px 10px; text-transform: none; }
.sb-label.gap { padding-top: 26px; }
.sb-nav { padding: 0 16px; display: flex; flex-direction: column; gap: 3px; }
.navrow { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 11px; border-radius: var(--r-sm); position: relative; text-decoration: none; color: var(--body); font: 400 14px var(--font); transition: background var(--m-out) var(--ease), color var(--m-out) var(--ease); cursor: pointer; border: 0; background: none; width: 100%; text-align: left; }
.navrow svg { stroke: var(--dim); flex: none; transition: stroke var(--m-out) var(--ease); }
.navrow:hover { background: var(--surface-2); color: var(--ink); transition-duration: var(--m-in); }
.navrow:hover svg { stroke: var(--ink2); }
.navrow.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.navrow.on svg { stroke: var(--accent); }
.navrow.on::before { content: ""; position: absolute; left: -16px; top: 7px; width: 3px; height: 28px; background: var(--accent); border-radius: 0 3px 3px 0; }
.navrow .nr-count { margin-left: auto; font-size: 12px; color: var(--dim); }
.navrow.back { color: var(--soft); font-size: 13px; min-height: 38px; margin-top: 12px; }
.sb-foot { margin-top: auto; padding: 16px 12px 0; position: relative; }
.upill { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: none; transition: border-color var(--m-out) var(--ease), background var(--m-out) var(--ease); padding: 6px 10px 6px 6px; cursor: pointer; font: inherit; text-align: left; }
.upill .u-name { font: 600 13px/1.2 var(--font); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upill .u-role { font: 400 11.5px var(--font); color: var(--dim); margin-top: 2px; }
.upill .u-text { flex: 1; min-width: 0; }
.upill:hover { border-color: var(--line-strong); background: var(--surface-2); transition-duration: var(--m-in); }
.upill svg { stroke: var(--dim); flex: none; }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--accent); color: #fff; font: 600 12px/34px var(--font); text-align: center; }
.avatar.lg { width: 76px; height: 76px; font-size: 26px; line-height: 76px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; line-height: 26px; }
.umenu { position: absolute; left: 12px; right: 12px; bottom: 64px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-float); box-shadow: var(--shadow-pop); padding: 6px; opacity: 0; transform: translateY(6px); transform-origin: bottom left; pointer-events: none; transition: opacity var(--m-out) var(--ease), transform var(--m-out) var(--ease); }
.umenu.open { opacity: 1; transform: none; pointer-events: auto; transition-duration: var(--m-panel); }
.umenu button, .umenu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; background: none; border-radius: var(--r-sm); font: 500 13px var(--font); color: var(--body); cursor: pointer; text-decoration: none; transition: background var(--m-out) var(--ease); }
.umenu button:hover, .umenu a:hover { background: var(--surface-2); color: var(--ink); transition-duration: var(--m-in); }
.umenu .danger { color: var(--danger); }
.umenu .danger:hover { background: var(--danger-soft); }
.umenu svg { stroke: currentColor; flex: none; }

.mainwrap { flex: 1; min-width: 0; }
.mainpad { max-width: 1400px; margin: 0 auto; padding: 44px 44px 60px; }

/* Mobile top bar + drawer */
.mbar { display: none; }
.scrim { display: none; }
@media (max-width: 1024px) {
  .mbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 40; height: 60px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--line-soft); }
  .mbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: linear-gradient(90deg, var(--brand-blue) 0 70%, var(--brand-green) 70% 100%); }
  .mbar button { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; }
  .mbar button svg { stroke: var(--body); }
  .mbar img { height: 26px; width: auto; }
  .mbar .mb-title { font: 600 15px var(--font); color: var(--ink); border-left: 2px solid var(--line); padding-left: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .shell { display: block; }
  body.booting::before { right: 0; bottom: auto; width: auto; height: 60px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .sbar { position: fixed; top: 0; left: 0; height: 100vh; width: 270px; transform: translateX(-100%); transition: transform 240ms var(--ease); z-index: 45; box-shadow: var(--shadow-pop); }
  .sbar.open { transform: none; }
  .scrim.show { display: block; position: fixed; inset: 0; background: color-mix(in oklab, var(--ink) 40%, transparent); z-index: 44; }
  .mainpad { padding: 24px 16px 48px; }
}

/* ===================== Type ===================== */
.eyebrow { font: 500 13px var(--font); letter-spacing: 0; color: var(--soft); text-transform: none; }
.h-xl { font: 600 54px/1.05 var(--font); letter-spacing: -.025em; color: var(--ink); margin: 12px 0 0; }
.h-xl .dot, .h-lg .dot { color: var(--brand-green); }
.h-lg { font: 600 36px/1.1 var(--font); letter-spacing: -.02em; color: var(--ink); margin: 8px 0 0; }
.h-sec { font: 600 20px var(--font); letter-spacing: -.015em; color: var(--ink); margin: 6px 0 18px; }
.sub { color: var(--soft); font-size: 15px; margin: 10px 0 0; }
.muted { color: var(--soft); }
@media (max-width: 640px) { .h-xl { font-size: 36px; } .h-lg { font-size: 30px; } }

/* ===================== Cards & controls ===================== */
.glass { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.dcard { padding: 24px; }
.dcard + .dcard { margin-top: 18px; }
.card-title { font: 600 14px var(--font); color: var(--ink); margin: 0 0 4px; }
label { display: block; font: 500 13px var(--font); color: var(--ink2); margin: 16px 0 6px; }
input, select, textarea { width: 100%; font: 400 15px var(--font); color: var(--ink); padding: 11px 14px; min-height: 46px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease); }
input:hover:not(:focus):not(:disabled), select:hover:not(:focus):not(:disabled), textarea:hover:not(:focus):not(:disabled) { border-color: var(--line-strong); }
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 16%, transparent); }
/* Checkboxes and radios take the standard ring (the field ring above is too faint on a 20px box). */
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: none; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--soft); cursor: not-allowed; }
input[type=file]::file-selector-button { font: 500 13px var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); cursor: pointer; transition: background var(--m-out) var(--ease); }
input[type=file]::file-selector-button:hover { background: var(--surface-2); }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--accent); flex: none; }
/* Buttons: one pair. Primary = the one filled accent; secondary (.ghost) = outline. Hover steps the fill
   14% toward the ink and lifts 1px; press sinks 1px and scales .985 (tasteskill motion.md). */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r-sm); border: 1px solid var(--accent); background: var(--accent); color: #fff; font: 500 14px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: none;
  transition: background-color var(--m-out) var(--ease), border-color var(--m-out) var(--ease), color var(--m-out) var(--ease), transform var(--m-out) var(--ease); }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; transition-duration: var(--m-in); }
@media (hover: hover) and (pointer: fine) { .btn:hover:not(:disabled) { transform: translateY(-1px); } }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); transition-duration: var(--m-press); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: none; font-weight: 500; }
.btn.ghost:hover { background: color-mix(in oklab, var(--surface) 94%, var(--ink)); border-color: color-mix(in oklab, var(--ink) 40%, white); color: var(--ink); }
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in oklab, var(--danger) 28%, white); box-shadow: none; }
.btn.danger:hover { background: color-mix(in oklab, var(--danger-soft) 86%, var(--danger)); color: var(--danger); border-color: color-mix(in oklab, var(--danger) 45%, white); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.msg { margin-top: 14px; padding: 11px 14px; border-radius: var(--r-sm); display: none; font-size: 14px; }
.msg.show { display: block; }
.msg.err { background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in oklab, var(--danger) 20%, white); }
.msg.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid color-mix(in oklab, var(--ok) 22%, white); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font: 500 12px var(--font); background: var(--surface-2); color: var(--body); white-space: nowrap; box-shadow: inset 0 0 0 1px color-mix(in oklab, currentColor 12%, transparent); }
.pill .pdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--accent-soft); color: var(--accent); }
.empty { text-align: center; padding: 56px 16px; }
.empty strong { display: block; font-size: 16px; color: var(--ink); }
.empty span { color: var(--soft); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mt { margin-top: 16px; }
.staging-badge { position: fixed; right: 12px; bottom: 12px; background: var(--warn); color: #fff; font: 600 13px var(--font); padding: 6px 12px; border-radius: 999px; z-index: 99; pointer-events: none; }

/* ===================== Home ===================== */
.home-head { margin-bottom: 26px; }
.mbar-card { display: flex; align-items: center; gap: 20px; padding: 16px 18px; flex-wrap: wrap; }
.mod-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ibox { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; flex: none; }
.ibox svg { stroke: var(--accent); }
.mod-id strong { display: block; font: 600 15px var(--font); color: var(--ink); }
.mod-id span { font-size: 13px; color: var(--soft); }
.searchbox { flex: 1 1 260px; max-width: 360px; display: flex; align-items: center; gap: 10px; height: 42px; background: #f4f5f8; border-radius: 10px; padding: 0 12px; }
.searchbox svg { stroke: var(--dim); flex: none; }
.searchbox input { border: 0; background: transparent; padding: 0; min-height: 0; font-size: 14px; }
.searchbox input:focus { box-shadow: none; }
.searchbox:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.ftabs { margin-left: auto; display: flex; gap: 2px; background: var(--surface-2); border-radius: var(--r-md); padding: 4px; overflow-x: auto; max-width: 100%; }
.ftab { display: flex; align-items: center; gap: 7px; padding: 0 12px; min-height: 36px; border-radius: var(--r-chip); border: 0; background: none; cursor: pointer; font: 400 13px var(--font); color: var(--soft); white-space: nowrap; text-decoration: none; transition: color var(--m-out) var(--ease), background var(--m-out) var(--ease); }
.ftab .c { font-size: 11.5px; color: var(--dim); padding: 1px 6px; border-radius: 999px; }
/* Short labels in a wrapping bar: Switzer's own word space keeps their widths at the old font's, so no tab changes row. */
.ftab { word-spacing: normal; letter-spacing: -.02em; }
.ftab:hover { color: var(--ink); background: color-mix(in oklab, var(--surface-2) 70%, var(--surface)); transition-duration: var(--m-in); }
.ftab.on { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: 0 0 0 1px var(--line-soft), 0 1px 2px color-mix(in oklab, var(--ink) 6%, transparent); }
.ftab.on .c { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 34px; margin-top: 28px; align-items: start; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.scard { display: flex; flex-direction: column; text-decoration: none; color: inherit; overflow: hidden; transition: box-shadow .2s, transform .2s; }
.scard:hover { box-shadow: 0 12px 28px rgba(15, 23, 42, .1); transform: translateY(-2px); }
.scanvas { position: relative; height: 186px; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, rgba(232, 240, 251, .55), rgba(255, 255, 255, 0)); border-bottom: 1px solid var(--line-soft); }
.scanvas .cat { position: absolute; top: 16px; left: 18px; }
.shalo { position: absolute; width: 132px; height: 132px; border-radius: 50%; border: 1px solid #dfe6f0; transition: transform .25s, opacity .25s; }
.scard:hover .shalo { transform: scale(1.08); opacity: .7; }
.stile { position: relative; width: 56px; height: 56px; border-radius: 15px; display: flex; align-items: center; justify-content: center; background: linear-gradient(145deg, #2f6fc2, #174e94); box-shadow: 0 10px 22px rgba(23, 78, 148, .32), inset 0 1px 0 rgba(255, 255, 255, .18); transition: transform .25s; }
.stile svg { stroke: #fff; }
.scard:hover .stile { transform: translateY(-6px) scale(1.03); }
.sbody { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.sname { font: 600 17px var(--font); color: var(--ink); }
.sblurb { color: var(--soft); font-size: 14px; }
.sfoot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.sfoot .stat { color: var(--ink2); font-weight: 500; }
.sfoot .open { color: var(--accent); font-weight: 600; }

.pulse { padding: 22px 22px 18px; }
.pulse-head { display: flex; justify-content: space-between; align-items: flex-start; }
.bell { width: 36px; height: 36px; border: 1px solid #e3e6ea; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #fff; }
.bell svg { stroke: var(--soft); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #e6e8ec; border-radius: 12px; margin: 18px 0 22px; background: #fff; }
.stats > div { padding: 14px 12px; min-width: 0; }
.stats > div + div { border-left: 1px solid #e6e8ec; }
.stats b { display: block; font: 700 22px var(--font); letter-spacing: -.02em; color: var(--ink); }
.stats span { font-size: 12px; color: var(--soft); white-space: nowrap; }
.todo-head { display: flex; justify-content: space-between; align-items: baseline; }
.todo-head strong { font: 600 14px var(--font); }
.todo-head span { font-size: 12.5px; color: var(--soft); }
.todo-empty { margin: 12px 0 4px; padding: 14px; border: 1px dashed #d8dde5; border-radius: 12px; color: var(--soft); font-size: 13px; }
.tip { margin-top: 22px; border-radius: 14px; padding: 18px; color: var(--ink); background: linear-gradient(135deg, #dbe9fd 0%, #e8f2dc 100%); border: 1px solid #d7e3f3; }
.tip .tip-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tip .tip-ic { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .8); display: flex; align-items: center; justify-content: center; }
.tip .tip-ic svg { stroke: var(--accent); }
.tip strong { display: block; font-size: 15px; margin-bottom: 6px; }
.tip p { margin: 0; font-size: 13px; color: var(--body); }
@media (max-width: 1180px) { .home-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .mbar-card { gap: 14px; }
  .searchbox { max-width: none; flex-basis: 100%; }
  .ftabs { margin-left: 0; width: 100%; }
  .cards { grid-template-columns: 1fr; }
  .scanvas { height: 150px; }
}

/* ===================== Page header (settings, modules) ===================== */
.phead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.who-pill { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 999px; padding: 6px 14px 6px 6px; font-size: 13px; color: var(--soft); box-shadow: var(--shadow-card); }
.who-pill b { color: var(--ink); }

/* ===================== Settings ===================== */
.set-grid { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 24px; align-items: start; }
.snav-card { padding: 12px; }
.snav { display: flex; align-items: flex-start; gap: 11px; width: 100%; padding: 11px 12px; border-radius: 11px; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; }
.snav svg { stroke: var(--dim); flex: none; margin-top: 2px; }
.snav .l { font: 600 13.5px var(--font); color: var(--ink2); }
.snav .s { font: 400 12px/1.4 var(--font); color: var(--soft); margin-top: 2px; }
.snav:hover { background: #f4f5f8; }
.snav.on { background: var(--accent-soft); }
.snav.on svg { stroke: var(--accent); }
.snav.on .l { color: var(--accent); }
.snav-sep { height: 1px; background: var(--line-soft); margin: 8px 12px; }
.snav-label { padding: 10px 12px 4px; }
.pane-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.profile-top { display: flex; align-items: center; gap: 18px; margin-top: 16px; padding-bottom: 20px; margin-bottom: 4px; border-bottom: 1px solid var(--line-soft); }
.profile-top strong { display: block; font-size: 17px; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font: 500 12.5px var(--font); letter-spacing: 0; text-transform: none; color: var(--soft); padding: 0 10px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 13px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; font-size: 14px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background var(--m-out) var(--ease); }
@media (hover: hover) and (pointer: fine) { .tbl tbody tr:hover { background: color-mix(in oklab, var(--surface-2) 55%, transparent); transition-duration: var(--m-in); } }
.tbl .ucell { display: flex; align-items: center; gap: 10px; }
.tbl .ucell small { display: block; color: var(--soft); font-size: 12.5px; }
.tblwrap { overflow-x: auto; }
dl.kv { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; margin: 0; }
dl.kv dt { color: var(--soft); }
dl.kv dd { margin: 0; color: var(--ink); font-weight: 500; }
@media (max-width: 1100px) { .pane-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .set-grid { grid-template-columns: 1fr; }
  .snav-card { display: flex; overflow-x: auto; gap: 4px; padding: 8px; }
  .snav-card .snav { width: auto; flex: none; }
  .snav .s, .snav-sep, .snav-label { display: none; }
  .tbl.responsive thead { display: none; }
  .tbl.responsive tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
  .tbl.responsive td { display: block; border: 0; padding: 3px 4px; }
  dl.kv { grid-template-columns: 1fr; gap: 2px; }
  dl.kv dd { margin-bottom: 10px; }
}

/* Modal */
dialog.modal { border: 1px solid var(--line-soft); border-radius: var(--r-float); padding: 0; width: min(560px, 94vw); box-shadow: var(--shadow-pop); }
dialog.modal::backdrop { background: color-mix(in oklab, #16181d 42%, transparent); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.modal-body { padding: 6px 22px 22px; }
.icon-btn { width: 38px; height: 38px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background var(--m-out) var(--ease), border-color var(--m-out) var(--ease); }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-strong); transition-duration: var(--m-in); }
.icon-btn svg { stroke: var(--soft); }
.check { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-weight: 500; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

/* ===================== Sign-in pages ===================== */
body.auth-bg { background: radial-gradient(900px 420px at 50% -8%, #e3edfb 0%, rgba(227, 237, 251, 0) 70%), radial-gradient(700px 360px at 50% 105%, #eef5e6 0%, rgba(238, 245, 230, 0) 70%), #f5f7fa; min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border-radius: 22px; box-shadow: 0 20px 50px rgba(15, 23, 42, .08); border: 1px solid #eef0f4; padding: 44px 40px 36px; }
.auth-logo { display: block; width: 190px; max-width: 70%; height: auto; margin: 0 auto 22px; }
.auth-card h1 { text-align: center; font: 500 26px var(--font); letter-spacing: -.01em; margin: 0; }
.auth-card .auth-sub { text-align: center; color: var(--soft); margin: 6px 0 26px; }
.field { position: relative; margin-top: 14px; }
.field > svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); stroke: var(--dim); pointer-events: none; }
.field input { padding-left: 46px; min-height: 52px; border-radius: 12px; }
.field .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border: 0; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.field .eye svg { stroke: var(--dim); }
.field.pw input { padding-right: 52px; }
.remember { display: flex; justify-content: center; align-items: center; gap: 9px; margin: 18px 0 22px; font: 500 14px var(--font); color: var(--accent); }
.auth-card .btn { width: 100%; min-height: 52px; border-radius: 12px; font-size: 15px; }
.auth-links { text-align: center; margin-top: 26px; font-size: 14px; }
.auth-links a { color: var(--soft); text-decoration: none; }
.auth-links a:hover { color: var(--accent); text-decoration: underline; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 12.5px; color: var(--dim); }
@media (max-width: 480px) { .auth-card { padding: 34px 22px 28px; border-radius: 18px; } }

/* Settings > Users: module access with a per-module role */
.app-access { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; margin-top: 8px; }
.app-access .check { margin: 0; }
@media (max-width: 560px) { .app-access { grid-template-columns: 1fr; } }

/* Switzer (Indian Type Foundry, via Fontshare; installed with fontpool) */
@font-face {
  font-family: 'Switzer';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/shared/fonts/switzer-100-900-normal-2a46d022.woff2') format('woff2');
  /* Line box matched to Helvetica/Arial (the previous face), so swapping the font moves no layout. */
  ascent-override: 90.5%; descent-override: 21.2%; line-gap-override: 3.3%;
}

/* Reduced motion: colours still change; nothing steps, lifts or slides. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-property: color, background-color, border-color, opacity, box-shadow, text-decoration-color, stroke !important; animation: none !important; }
  .btn:hover, .btn:active { transform: none !important; }
}
