/* ==========================================================================
   Kanash Attendance — "depth glass" design system
   Layers, from back to front:
     1. the tenant's body colour (--page-bg, from /tenant-theme.css) under an ambient aurora
        (core/ambient.js: a small WebGL shader, or static CSS light on calm pages),
     2. translucent surfaces with a rim highlight and layered shadows (cards, tables, forms),
     3. real glass (backdrop blur) only where it earns its cost: header, modals, overlays, hero panels,
     4. 3D interactions driven by CSS custom properties that core/fx.js writes from the pointer:
        tilt (--rx/--ry), glare (--mx/--my), parallax (--px/--py) and a cursor spotlight (--sx/--sy).
   <html data-theme="dark|light"> is chosen by the server for contrast with the tenant colour.
   Everything degrades: no backdrop-filter -> solid surfaces; reduced motion -> no animation.
   ========================================================================== */

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #0a0d14;
  --surface: #121826;
  --surface-raised: #182033;
  --surface-sunken: #0d121c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f1f5f9;
  --text-secondary: #a8b3c4;
  --text-muted: #8590a6;
  --accent: #10b981;
  --accent-strong: #059669;
  --accent-ink: #ffffff;
  --accent-soft: rgba(16, 185, 129, 0.14);
  --info: #06b6d4;
  --info-soft: rgba(6, 182, 212, 0.14);
  --info-text: #67e8f9;
  --good: #0ca30c;
  --warning: #fab219;
  --critical: #d03b3b;
  --good-text: #34d399;
  --warning-text: #fbbf24;
  --critical-text: #fca5a5;
  --good-soft: rgba(12, 163, 12, 0.16);
  --warning-soft: rgba(250, 178, 25, 0.16);
  --critical-soft: rgba(208, 59, 59, 0.18);
  --focus-ring: #38bdf8;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --overlay: rgba(4, 7, 13, 0.72);
  /* charts (validated: series on #121826) */
  --chart-surface: #121826;
  --chart-grid: #222a3a;
  --chart-axis: #3a4458;
  --chart-ink: #a8b3c4;
  --chart-series-1: #3987e5;
  --chart-series-2: #d95926;
  --chart-context: #5f6a7e;

  /* depth */
  --glass: color-mix(in oklab, var(--surface) 72%, transparent);
  --glass-strong: color-mix(in oklab, var(--surface) 86%, transparent);
  --glass-border: rgba(255, 255, 255, 0.09);
  --rim: rgba(255, 255, 255, 0.08);
  --rim-strong: rgba(255, 255, 255, 0.16);
  --card-top: color-mix(in oklab, var(--surface-raised) 90%, transparent);
  --card-bottom: color-mix(in oklab, var(--surface) 84%, transparent);
  --elev-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 16px -6px rgba(0, 0, 0, 0.4);
  --elev-2: 0 1px 2px rgba(0, 0, 0, 0.25), 0 12px 32px -10px rgba(0, 0, 0, 0.55), 0 32px 64px -24px rgba(0, 0, 0, 0.5);
  --elev-3: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px -12px rgba(0, 0, 0, 0.6), 0 60px 120px -30px rgba(0, 0, 0, 0.65);
  --ambient-1: #10b981;
  --ambient-2: #06b6d4;
  --ambient-3: #8b5cf6;
  --ambient-strength: 0.55;
  --grid-line: rgba(148, 163, 184, 0.10);
  --spot: rgba(16, 185, 129, 0.10);
  --field-bg: color-mix(in oklab, var(--surface-sunken) 82%, transparent);
  --gradient-text: linear-gradient(120deg, #ffffff 0%, #a7f3d0 45%, #67e8f9 100%);
}

[data-theme="light"] {
  color-scheme: light;
  --page-bg: #f4f6f9;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-sunken: #f1f4f8;
  --border: rgba(15, 23, 42, 0.10);
  --border-strong: rgba(15, 23, 42, 0.20);
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #5b6678;
  --accent: #059669;
  --accent-strong: #047857;
  --accent-ink: #ffffff;
  --accent-soft: rgba(5, 150, 105, 0.12);
  --info: #0891b2;
  --info-soft: rgba(8, 145, 178, 0.10);
  --info-text: #0e7490;
  --good-text: #047857;
  --warning-text: #92400e;
  --critical-text: #b91c1c;
  --good-soft: rgba(12, 163, 12, 0.12);
  --warning-soft: rgba(250, 178, 25, 0.18);
  --critical-soft: rgba(208, 59, 59, 0.12);
  --focus-ring: #0284c7;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.10);
  --overlay: rgba(15, 23, 42, 0.55);
  /* charts (validated: series on #ffffff) */
  --chart-surface: #ffffff;
  --chart-grid: #e8ebf0;
  --chart-axis: #c3c9d4;
  --chart-ink: #52514e;
  --chart-series-1: #2a78d6;
  --chart-series-2: #eb6834;
  --chart-context: #9aa3b2;

  --glass: rgba(255, 255, 255, 0.66);
  --glass-strong: rgba(255, 255, 255, 0.84);
  --glass-border: rgba(15, 23, 42, 0.08);
  --rim: rgba(255, 255, 255, 0.9);
  --rim-strong: rgba(255, 255, 255, 1);
  --card-top: rgba(255, 255, 255, 0.92);
  --card-bottom: rgba(255, 255, 255, 0.80);
  --elev-1: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 16px -8px rgba(15, 23, 42, 0.14);
  --elev-2: 0 1px 2px rgba(15, 23, 42, 0.06), 0 14px 32px -12px rgba(15, 23, 42, 0.18), 0 32px 64px -28px rgba(15, 23, 42, 0.16);
  --elev-3: 0 2px 4px rgba(15, 23, 42, 0.06), 0 24px 48px -16px rgba(15, 23, 42, 0.24), 0 60px 120px -40px rgba(15, 23, 42, 0.24);
  --ambient-1: #34d399;
  --ambient-2: #22d3ee;
  --ambient-3: #a78bfa;
  --ambient-strength: 0.32;
  --grid-line: rgba(15, 23, 42, 0.07);
  --spot: rgba(5, 150, 105, 0.08);
  --field-bg: rgba(255, 255, 255, 0.78);
  --gradient-text: linear-gradient(120deg, #0f172a 0%, #047857 55%, #0e7490 100%);
}

:root {
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* from the Kanash Labs site: an editorial serif for display headings, a grotesk for small tracked labels */
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-label: "Space Grotesk", "Outfit", system-ui, sans-serif;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --gutter: 24px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  /* primary actions: emerald -> cyan, dark enough for white text (>= 5:1) */
  --grad-primary: linear-gradient(135deg, #047857 0%, #0f766e 50%, #0e7490 100%);
  --grad-primary-hover: linear-gradient(135deg, #059669 0%, #0d9488 50%, #0891b2 100%);
  --grad-out: linear-gradient(135deg, #0e7490 0%, #4338ca 100%);
  --grad-danger: linear-gradient(135deg, #b91c1c 0%, #be123c 100%);
  --glow-accent: 0 10px 30px -10px rgba(16, 185, 129, 0.7);
  --glow-info: 0 10px 30px -10px rgba(99, 102, 241, 0.7);
}

/* The Backoffice is Kanash's own platform: it wears the Kanash Labs blue. */
[data-realm="backoffice"] {
  --accent: #4f7cff;
  --accent-strong: #3b63e8;
  --accent-soft: rgba(79, 124, 255, 0.15);
  --info: #22d3ee;
  --ambient-1: #3b82f6;
  --ambient-2: #6366f1;
  --ambient-3: #22d3ee;
  --spot: rgba(79, 124, 255, 0.12);
  --grad-primary: linear-gradient(135deg, #2f55e4 0%, #3b4fd8 50%, #4f46e5 100%);
  --grad-primary-hover: linear-gradient(135deg, #3b63f0 0%, #4a5ce8 50%, #6366f1 100%);
  --glow-accent: 0 10px 30px -10px rgba(79, 124, 255, 0.75);
  --gradient-text: linear-gradient(120deg, #ffffff 0%, #c7d2fe 50%, #93c5fd 100%);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.015em; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--info-text); }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.gradient-text {
  background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
.kicker {
  display: inline-flex; flex-direction: column; gap: 8px; margin: 0 0 10px;
  font-family: var(--font-label); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--text-muted);
}
.kicker::after { content: ""; width: 32px; height: 1px; background: linear-gradient(90deg, var(--accent), transparent); }
.credit a { color: inherit; font-weight: 600; text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); text-underline-offset: 3px; }
.credit a:hover { color: var(--text); }

/* --------------------------------------------------------------- ambient background */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s ease; }
.ambient.gl .ambient-canvas { opacity: 1; }
.ambient .blob {
  position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%;
  opacity: var(--ambient-strength); will-change: transform;
}
.ambient .b1 { left: -25vmax; top: -30vmax; background: radial-gradient(closest-side, color-mix(in srgb, var(--ambient-1) 55%, transparent), transparent); }
.ambient .b2 { right: -30vmax; top: -10vmax; background: radial-gradient(closest-side, color-mix(in srgb, var(--ambient-2) 45%, transparent), transparent); }
.ambient .b3 { left: 10vmax; bottom: -45vmax; background: radial-gradient(closest-side, color-mix(in srgb, var(--ambient-3) 40%, transparent), transparent); }
.ambient.gl .blob { display: none; }
[data-ambient="live"] .ambient .b1 { animation: drift-a 26s ease-in-out infinite alternate; }
[data-ambient="live"] .ambient .b2 { animation: drift-b 32s ease-in-out infinite alternate; }
[data-ambient="live"] .ambient .b3 { animation: drift-c 38s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate3d(14vmax, 8vmax, 0) scale(1.1); } }
@keyframes drift-b { to { transform: translate3d(-12vmax, 10vmax, 0) scale(0.92); } }
@keyframes drift-c { to { transform: translate3d(10vmax, -12vmax, 0) scale(1.08); } }
.ambient .floor {
  position: absolute; left: -50%; right: -50%; bottom: -6%; height: 46%;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px; transform: perspective(520px) rotateX(64deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 85%); mask-image: linear-gradient(to top, #000 0%, transparent 85%);
  display: none;
}
[data-ambient="live"] .ambient .floor { display: block; }
.ambient .grain {
  position: absolute; inset: -50%; opacity: 0.06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* --------------------------------------------------------------- 3D primitives (driven by core/fx.js) */
[data-tilt] {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; --px: 0; --py: 0; --hyp: 0; --lift: 0px; --tilt-scale: 1;
  transform: perspective(var(--perspective, 1000px)) rotateX(var(--rx)) rotateY(var(--ry)) translateZ(var(--lift)) scale(var(--tilt-scale));
  transition: transform 0.7s var(--ease-out), box-shadow 0.4s ease;
  will-change: transform;
}
[data-tilt].is-tilting { transition: transform 0.12s linear, box-shadow 0.4s ease; --tilt-scale: 1.015; }
.glare {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  background: radial-gradient(farthest-corner circle at var(--mx) var(--my), rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.06) 30%, transparent 60%);
  mix-blend-mode: soft-light; opacity: 0; transition: opacity 0.4s ease;
}
.is-tilting > .glare, .is-tilting .idcard-glare { opacity: 1; }

/* --------------------------------------------------------------- layout */
.app-header {   /* a floating glass capsule, like the Kanash Labs navigation */
  position: sticky; top: max(10px, env(safe-area-inset-top)); z-index: 20;
  align-self: center; width: calc(100% - 2 * var(--gutter)); max-width: 1280px; margin-top: 12px;
  display: flex; align-items: center; gap: 16px;
  padding: 9px 12px 9px 14px; border-radius: 22px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--rim), 0 18px 40px -22px rgba(0, 0, 0, 0.7);
  view-transition-name: app-header;
}
.app-header::after {
  content: ""; position: absolute; left: 24px; right: 24px; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 70%, transparent) 30%, color-mix(in srgb, var(--info) 70%, transparent) 70%, transparent);
  opacity: 0.7;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; color: inherit; }
.brand-mark {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; overflow: hidden;
  background: var(--grad-primary); color: #fff; border: 1px solid var(--rim-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.2), var(--glow-accent);
  font-weight: 800; letter-spacing: 0.02em; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}
/* Uploaded logos keep their own shape (square marks and wide wordmarks alike). A transparent logo sits on
   the plate its ink needs (LIGHT plate for dark ink, DARK plate for light ink), so it reads on every theme. */
.brand-logo {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  height: 40px; max-width: 176px; border-radius: 10px; overflow: hidden;
}
.brand-logo img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-logo.backdrop-light, .brand-logo.backdrop-dark { padding: 5px 10px; }
.brand-logo.backdrop-light { background: #ffffff; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.10); }
.brand-logo.backdrop-dark { background: #0f172a; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.brand-text { min-width: 0; display: flex; flex-direction: column; }
.brand-name { font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-nav {
  display: flex; gap: 4px; margin-left: 8px; padding: 4px; border-radius: 14px;
  background: color-mix(in oklab, var(--surface-sunken) 60%, transparent); border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
}
.app-nav a {
  position: relative; padding: 7px 14px; border-radius: 10px;
  color: var(--text-secondary); text-decoration: none; font-weight: 500; font-size: 0.92rem; white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.app-nav a:hover { color: var(--text); background: color-mix(in oklab, var(--surface-raised) 60%, transparent); }
.app-nav a[aria-current="page"] {
  color: var(--text); background: var(--card-top);
  box-shadow: inset 0 1px 0 var(--rim-strong), 0 4px 14px -6px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--glass-border);
}
.app-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: 2px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--info)); box-shadow: 0 0 10px var(--accent);
}
.header-spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; }
.user-chip .who { text-align: right; line-height: 1.2; white-space: nowrap; }
.user-chip .who small { display: block; color: var(--text-muted); font-size: 0.75rem; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-weight: 700; font-size: 0.8rem; color: #fff; background: var(--grad-out);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 0 2px var(--glass-border);
}

.app-main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 26px max(var(--gutter), env(safe-area-inset-left)) 48px; }
.app-main.narrow { max-width: 760px; }
.app-main.wide { max-width: 1440px; }
.app-header.wide { max-width: 1392px; }
@media (max-width: 1320px) {   /* the menu needs the room: the signed-in name stays for screen readers and the tooltip */
  .user-chip .who { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* --------------------------------------------------------------- light / dark switch (core/theme.js) */
.theme-slot:empty, .theme-corner:empty { display: none; }
.theme-slot { display: flex; }
.theme-toggle {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px;
  background: color-mix(in oklab, var(--surface-sunken) 60%, transparent); border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
}
.theme-toggle button {
  all: unset; box-sizing: border-box; position: relative; cursor: pointer; display: grid; place-items: center;
  width: 30px; height: 28px; border-radius: 9px; color: var(--text-muted);
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.theme-toggle button:hover { color: var(--text); }
.theme-toggle button[aria-checked="true"] {
  color: var(--text); background: var(--card-top);
  box-shadow: inset 0 1px 0 var(--rim-strong), 0 2px 8px -2px rgba(0, 0, 0, 0.35);
}
.theme-toggle button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle button[data-value="auto"] svg path:last-child, .theme-toggle button[data-value="dark"] svg path { fill: currentColor; stroke: none; }
.theme-toggle button[data-value="dark"] svg path { stroke: currentColor; stroke-width: 1; }
.theme-toggle .theme-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.theme-corner { position: fixed; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); z-index: 30; }
.theme-corner .theme-toggle { background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.app-footer {
  padding: 16px var(--gutter) max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--glass-border);
  background: color-mix(in oklab, var(--surface) 40%, transparent);
  color: var(--text-muted); font-size: 0.85rem;
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
}
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.page-head .lead { color: var(--text-secondary); margin-top: 6px; }
.page-head h1 { font-family: var(--font-display); font-size: clamp(1.7rem, 3vw, 2.35rem); font-weight: 700; letter-spacing: -0.02em; }
.breadcrumb { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }

/* page entrance: content rises into place (cards are staggered by core/fx.js via --i) */
.app-main > :not(.spoof-warning), .auth-card, .reveal { animation: rise 0.6s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }
.settled, .settled * { animation: none !important; }

/* --------------------------------------------------------------- surfaces */
.card {
  position: relative; isolation: isolate;
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  min-width: 0;
  box-shadow: inset 0 1px 0 var(--rim), var(--elev-1);
}
.card::before {   /* cursor spotlight (core/fx.js sets --sx/--sy) */
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(520px circle at var(--sx, -999px) var(--sy, -999px), var(--spot), transparent 42%);
  opacity: 0; transition: opacity 0.35s ease;
}
.card:hover::before { opacity: 1; }
.card::after {   /* top hairline highlight */
  content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--rim-strong) 30%, color-mix(in srgb, var(--accent) 40%, transparent) 60%, transparent);
  opacity: 0.6;
}
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--rim-strong), inset 0 -1px 0 rgba(0, 0, 0, 0.12), var(--elev-2);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head .sub { color: var(--text-muted); font-size: 0.85rem; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 18px 22px 0; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--border-strong), transparent); margin: 16px 0; border: 0; }

/* --------------------------------------------------------------- buttons */
.btn {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; min-height: 42px;
  border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 0.9rem; line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform 0.18s var(--ease-out), box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}
.btn:hover:not(:disabled):not([aria-disabled="true"]) { transform: translateY(-1px); }
.btn:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(1px) scale(0.99); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--grad-primary); color: var(--accent-ink); text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -2px 0 rgba(0, 0, 0, 0.18), var(--glow-accent), 0 1px 2px rgba(0, 0, 0, 0.2);
}
.btn-primary:hover:not(:disabled) { background: var(--grad-primary-hover); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), inset 0 -2px 0 rgba(0, 0, 0, 0.18), 0 14px 34px -10px rgba(16, 185, 129, 0.85); }
.btn-primary:active:not(:disabled) { box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3); }
.btn-secondary {
  background: linear-gradient(180deg, color-mix(in oklab, var(--surface-raised) 92%, transparent), color-mix(in oklab, var(--surface-sunken) 92%, transparent));
  color: var(--text); border-color: var(--border-strong);
  box-shadow: inset 0 1px 0 var(--rim), 0 2px 8px -4px rgba(0, 0, 0, 0.4);
}
.btn-secondary:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong)); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: color-mix(in oklab, var(--surface-raised) 70%, transparent); color: var(--text); }
.btn-danger { background: var(--grad-danger); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 10px 24px -10px rgba(220, 38, 38, 0.7); }
.btn-danger:hover:not(:disabled) { filter: brightness(1.08); }
.btn-outline-danger { background: transparent; color: var(--critical-text); border-color: color-mix(in srgb, var(--critical) 55%, transparent); }
.btn-outline-danger:hover:not(:disabled) { background: var(--critical-soft); }
.btn-sm { padding: 6px 12px; min-height: 32px; font-size: 0.8rem; border-radius: 10px; }
.btn-lg { padding: 14px 24px; min-height: 54px; font-size: 1rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn .spinner { width: 14px; height: 14px; }
.icon-btn { width: 40px; padding: 0; }
.btn-sm.icon-btn { width: 32px; }

/* --------------------------------------------------------------- forms */
.form { display: flex; flex-direction: column; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.span-2 { grid-column: span 2; }
.field label, .field .label { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.field .required::after { content: " *"; color: var(--critical-text); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 13px;
  border-radius: 12px; border: 1px solid var(--border-strong);
  background: var(--field-bg); color: var(--text);
  font: inherit; font-size: 0.95rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.16);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.input::placeholder { color: color-mix(in srgb, var(--text-muted) 80%, transparent); }
.textarea { min-height: 84px; resize: vertical; }
.input:hover, .select:hover { border-color: color-mix(in srgb, var(--text-muted) 70%, transparent); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--focus-ring);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12), 0 0 0 4px color-mix(in srgb, var(--focus-ring) 22%, transparent);
}
.input[readonly] { color: var(--text-secondary); background: color-mix(in oklab, var(--surface-sunken) 50%, transparent); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--critical); box-shadow: 0 0 0 4px var(--critical-soft); }
.input-icon { position: relative; }
.input-icon > .input { padding-left: 40px; }
.input-icon > .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; font-size: 0.95rem; }
.hint { font-size: 0.8rem; color: var(--text-muted); }
.field-error { font-size: 0.8rem; color: var(--critical-text); min-height: 0; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.color-input { display: flex; gap: 8px; align-items: center; }
.color-input input[type="color"] { width: 48px; height: 44px; padding: 3px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--field-bg); }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding-top: 4px; }

/* 12-hour time picker (hour : minutes AM/PM) and the weekly working-hours editor (employee form) */
.time-picker { display: flex; align-items: center; gap: 4px; min-width: 0; }
.time-picker .select { width: auto; min-width: 0; flex: 1 1 0; padding-inline: 10px 8px; }
.time-picker .select:last-child { flex: 0 0 auto; }
.time-picker > span { color: var(--text-muted); font-weight: 600; }
.schedule-editor { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.schedule-common { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.schedule-days { display: flex; flex-direction: column; border: 1px solid var(--glass-border); border-radius: 14px; overflow: hidden; }
.schedule-day {
  display: grid; grid-template-columns: 96px 92px minmax(0, 1fr) auto minmax(0, 1fr) 118px; gap: 8px; align-items: center;
  padding: 8px 12px; transition: background 0.2s ease, opacity 0.2s ease;
}
.schedule-day + .schedule-day { border-top: 1px solid var(--border); }
.schedule-day .day-name { font-weight: 600; }
.schedule-day .day-name .short { display: none; }
.schedule-day .to { color: var(--text-muted); font-size: 0.85rem; }
.schedule-day .day-length { text-align: right; }
.schedule-day.off { background: color-mix(in oklab, var(--surface-sunken) 55%, transparent); }
.schedule-day.off .time-picker, .schedule-day.off .to { opacity: 0.45; }
.day-toggle {
  all: unset; cursor: pointer; text-align: center; padding: 7px 10px; border-radius: 10px; font-size: 0.8rem; font-weight: 700;
  border: 1px solid var(--border-strong); color: var(--text-secondary);
}
.day-toggle[aria-pressed="true"] { background: var(--good-soft); color: var(--good-text); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.day-toggle:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
/* A day's second shift (split shift): its own line under the day, aligned with the first shift's times. */
.second-shift { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.second-shift .second-label { flex: 0 0 196px; color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; text-align: right; padding-right: 4px; }
.second-shift .time-picker { flex: 1 1 0; }
.second-shift .to { color: var(--text-muted); font-size: 0.85rem; }
.second-shift .remove-second { flex: 0 0 118px; text-align: right; }
.second-shift .add-second { margin-left: 204px; }
.schedule-day.off .second-shift { opacity: 0.45; }
.link-button {
  all: unset; cursor: pointer; color: var(--info-text); font-size: 0.82rem; font-weight: 600; border-radius: 6px; padding: 2px 4px;
}
.link-button:hover:not(:disabled) { text-decoration: underline; }
.link-button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.link-button:disabled { cursor: default; opacity: 0.6; }
@media (max-width: 1180px) {   /* narrower form column: day, length and toggle above the two times */
  .schedule-day { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-areas: "name name length length toggle toggle" "start start start end end end"; }
  .schedule-day .day-name { grid-area: name; }
  .schedule-day .day-length { grid-area: length; text-align: center; }
  .schedule-day .day-toggle { grid-area: toggle; justify-self: end; }
  .schedule-day > div.time-picker:nth-of-type(1) { grid-area: start; }
  .schedule-day > div.time-picker:nth-of-type(2) { grid-area: end; }
  .schedule-day .to { display: none; }
  .second-shift { flex-wrap: wrap; }
  .second-shift .second-label { flex: 1 1 100%; text-align: left; padding: 0; }
  .second-shift .time-picker { flex: 1 1 calc(50% - 8px); }
  .second-shift .to { display: none; }
  .second-shift .remove-second { flex: 1 1 100%; text-align: left; }
  .second-shift .add-second { margin-left: 0; }
}
@media (max-width: 640px) {
  .second-shift .time-picker { flex: 1 1 100%; }
  .schedule-common { grid-template-columns: minmax(0, 1fr); }
  .schedule-day { grid-template-areas: "name name length length toggle toggle" "start start start start start start" "end end end end end end"; }
  .schedule-day .day-name .long { display: none; }
  .schedule-day .day-name .short { display: inline; }
}
fieldset { border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 18px; margin: 0; min-width: 0; background: color-mix(in oklab, var(--surface-sunken) 30%, transparent); }
legend { padding: 0 8px; font-weight: 700; color: var(--text-secondary); font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; }
.form-section { display: flex; flex-direction: column; gap: 14px; }
.form-section + .form-section { padding-top: 18px; border-top: 1px dashed var(--glass-border); }
.form-section-title { display: flex; align-items: center; gap: 10px; font-family: var(--font-label); font-size: 0.76rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-muted); }
.form-section-title .num {
  width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 0.75rem;
  background: var(--accent-soft); color: var(--good-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* --------------------------------------------------------------- feedback */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: color-mix(in oklab, var(--surface-sunken) 70%, transparent);
  font-size: 0.9rem;
}
.alert-icon {
  flex: none; font-weight: 800; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.8rem; background: color-mix(in srgb, currentColor 14%, transparent);
}
.alert.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.alert.success { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.alert.warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 40%, transparent); }
.alert.error { background: var(--critical-soft); border-color: color-mix(in srgb, var(--critical) 45%, transparent); }
.alert.info .alert-icon { color: var(--info-text); }
.alert.success .alert-icon { color: var(--good-text); }
.alert.warning .alert-icon { color: var(--warning-text); }
.alert.error .alert-icon { color: var(--critical-text); }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap;
  background: color-mix(in oklab, var(--surface-sunken) 80%, transparent); color: var(--text-secondary); border: 1px solid var(--border);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.badge.good { background: var(--good-soft); color: var(--good-text); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.badge.warning { background: var(--warning-soft); color: var(--warning-text); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.badge.critical { background: var(--critical-soft); color: var(--critical-text); border-color: color-mix(in srgb, var(--critical) 30%, transparent); }
.badge.info { background: var(--info-soft); color: var(--info-text); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor;
  animation: spin 0.8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.state {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 44px 20px; text-align: center; color: var(--text-secondary);
}
.state .state-icon {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 1.6rem; line-height: 1;
  background: linear-gradient(145deg, var(--card-top), color-mix(in oklab, var(--surface-sunken) 90%, transparent));
  box-shadow: inset 0 1px 0 var(--rim-strong), var(--elev-1); transform: perspective(300px) rotateX(10deg);
}
.state h3 { color: var(--text); font-size: 1.1rem; }
.loading-veil { opacity: 0.55; transition: opacity 0.2s ease; pointer-events: none; }

/* --------------------------------------------------------------- tables */
.table-wrap { width: 100%; overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th {
  text-align: left; font-family: var(--font-label); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
  background: color-mix(in oklab, var(--surface-sunken) 35%, transparent);
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.2s ease, box-shadow 0.2s ease; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: color-mix(in oklab, var(--accent-soft) 60%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.table tbody tr.clickable:focus-visible { outline-offset: -2px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {   /* phones: every row becomes a small card with labelled values (ui.js stackable) */
  .table.stackable thead { display: none; }
  .table.stackable, .table.stackable tbody, .table.stackable tr, .table.stackable td { display: block; width: 100%; }
  .table.stackable tr { padding: 14px 16px; border-bottom: 1px solid var(--border); }
  .table.stackable tbody tr:last-child { border-bottom: 0; }
  .table.stackable td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; text-align: right; }
  .table.stackable td::before {
    content: attr(data-label); flex: none; text-align: left; color: var(--text-muted);
    font-family: var(--font-label); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  }
  .table.stackable td:first-child { display: block; text-align: left; padding-bottom: 8px; }
  .table.stackable td:first-child::before, .table.stackable td[data-label=""]::before { display: none; }
  .table.stackable td .row { justify-content: flex-end; }
  .table.stackable td > .select { width: auto; min-width: 190px; }
  .table.stackable .cell-person .cell-sub { max-width: none; white-space: normal; }
}
.table th.sortable button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.table th.sortable button:focus-visible { outline: 2px solid var(--focus-ring); }
.cell-title { font-weight: 600; color: var(--text); }

/* Attendance stations on the System page: name, state and a Sign out button per station account. */
.station-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.station-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.station-row + .station-row { border-top: 1px solid var(--border); }
.station-row > div { flex: 1; min-width: 0; }
.station-row .badge { margin-top: 6px; white-space: normal; text-align: left; }
.station-row .btn { flex-shrink: 0; }
.cell-sub { font-size: 0.8rem; color: var(--text-muted); }
.cell-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-person > div { min-width: 0; }
.cell-person .cell-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 180px; }
.toolbar .grow { flex: 1; min-width: 200px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--text-muted); }
.pagination .row { gap: 6px; }

/* --------------------------------------------------------------- avatars */
.avatar {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; flex: none;
  color: #fff; overflow: hidden; position: relative;
  background: linear-gradient(135deg, hsl(var(--hue, 160) 70% 42%), hsl(calc(var(--hue, 160) + 40) 75% 38%));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -2px 0 rgba(0, 0, 0, 0.2), var(--elev-1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.sm { width: 38px; height: 38px; border-radius: 12px; font-size: 0.8rem; }
.avatar.xs { width: 30px; height: 30px; border-radius: 50%; font-size: 0.7rem; }

/* --------------------------------------------------------------- stat tiles & meters */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpis.bento { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; }
.kpis.bento .wide { grid-column: span 2; }
@media (max-width: 1100px) { .kpis.bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.announce {   /* Kanash-style announcement pill */
  align-self: flex-start; display: inline-flex; align-items: center; gap: 12px; padding: 6px 6px 6px 16px; border-radius: 999px;
  color: var(--text); text-decoration: none; font-size: 0.92rem; font-weight: 500;
  background: color-mix(in oklab, var(--surface-sunken) 80%, transparent); border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--rim), 0 10px 26px -14px rgba(0, 0, 0, 0.7);
  transition: border-color 0.2s ease, transform 0.2s var(--ease-out);
}
.announce:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); transform: translateY(-1px); }
.announce-go {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; padding-left: 0;
  background: var(--grad-primary); color: #fff; box-shadow: var(--glow-accent); transition: transform 0.2s var(--ease-out);
}
.announce:hover .announce-go { transform: translateX(2px); }
.stat {
  position: relative; isolation: isolate; overflow: hidden;
  background: linear-gradient(160deg, var(--card-top), var(--card-bottom));
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0;
  box-shadow: inset 0 1px 0 var(--rim), var(--elev-1);
}
.stat::after {   /* accent light leaking from the corner */
  content: ""; position: absolute; right: -30%; top: -60%; width: 80%; height: 120%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--tone, var(--accent)) 22%, transparent), transparent);
}
.stat[data-tilt]:hover { box-shadow: inset 0 1px 0 var(--rim-strong), var(--elev-2); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-icon {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 1rem; flex: none;
  background: color-mix(in srgb, var(--tone, var(--accent)) 16%, transparent); color: var(--tone, var(--accent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone, var(--accent)) 30%, transparent), 0 6px 14px -8px var(--tone, var(--accent));
  transform: translateZ(20px);
}
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.stat-value { font-size: 1.85rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-note { font-size: 0.78rem; color: var(--text-muted); }
.stat.tone-good { --tone: #10b981; }
.stat.tone-info { --tone: #06b6d4; }
.stat.tone-violet { --tone: #8b5cf6; }
.stat.tone-warning { --tone: #f59e0b; }
.stat.tone-critical { --tone: #ef4444; }
.meter { height: 8px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2); }
.meter > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--info)); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent); }
.meter.warning { background: var(--warning-soft); }
.meter.warning > span { background: var(--warning); box-shadow: none; }
.meter.critical { background: var(--critical-soft); }
.meter.critical > span { background: var(--critical); box-shadow: none; }

/* --------------------------------------------------------------- tabs / segmented */
.segmented {
  display: inline-flex; padding: 4px; gap: 2px; border-radius: 12px;
  background: color-mix(in oklab, var(--surface-sunken) 75%, transparent); border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
}
.segmented button {
  all: unset; cursor: pointer; padding: 7px 14px; border-radius: 9px;
  font-weight: 600; font-size: 0.85rem; color: var(--text-secondary); transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--card-top); color: var(--text); box-shadow: inset 0 1px 0 var(--rim-strong), 0 2px 8px -2px rgba(0, 0, 0, 0.35); }
.segmented button:focus-visible { outline: 2px solid var(--focus-ring); }
/* multi-select weekday picker (shift dialog): every pressed day must read as clearly "on" */
.segmented.day-picker { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); width: 100%; }
.segmented.day-picker button { min-width: 0; padding-inline: 4px; text-align: center; }
.segmented.day-picker button[aria-pressed="true"] {
  background: var(--grad-primary); color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 4px 12px -4px rgba(16, 185, 129, 0.7);
}
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-row .range-label { font-weight: 600; min-width: 170px; text-align: center; }

/* --------------------------------------------------------------- charts */
.chart-card .chart-box { position: relative; height: 280px; }
.chart-card .chart-box.tall { height: 340px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 0.8rem; color: var(--text-secondary); }
.chart-legend .key { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .swatch { width: 12px; height: 12px; border-radius: 3px; }
.chart-legend .swatch.line { height: 2px; width: 16px; border-radius: 1px; }
.chart-legend .swatch.dot { width: 9px; height: 9px; border-radius: 50%; }
.status-bar { display: flex; gap: 2px; height: 30px; border-radius: 8px; overflow: hidden; background: var(--surface-sunken); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25); }
.status-bar > span { display: flex; align-items: center; justify-content: center; min-width: 2px; font-size: 0.75rem; font-weight: 700; color: #0b0b0b; }
.status-bar > .present { background: var(--good); color: #fff; }
.status-bar > .incomplete { background: var(--warning); }
.status-bar > .absent { background: var(--critical); color: #fff; }
.status-bar > .in-progress { background: var(--info); color: #fff; }
.status-bar > span.muted { color: var(--text-muted); font-weight: 500; }

/* --------------------------------------------------------------- dialogs & toasts */
dialog.modal {
  width: min(540px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl); background: var(--glass-strong); color: var(--text);
  -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
  box-shadow: inset 0 1px 0 var(--rim-strong), var(--elev-3);
}
dialog.modal[open] { animation: modal-in 0.35s var(--ease-spring); }
@keyframes modal-in { from { opacity: 0; transform: perspective(800px) rotateX(-12deg) translateY(18px) scale(0.96); } }
dialog.modal::backdrop { background: var(--overlay); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog.modal.wide { width: min(720px, calc(100vw - 32px)); }
.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--glass-border); background: color-mix(in oklab, var(--surface-sunken) 50%, transparent); }
.secret-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--border-strong);
  background: var(--field-bg); font-family: var(--font-mono); font-size: 1rem; word-break: break-all;
}
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  padding: 12px 14px; border-radius: 14px; background: var(--glass-strong); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 var(--rim), var(--elev-2); font-size: 0.9rem; display: flex; gap: 10px; align-items: flex-start;
  animation: toast-in 0.35s var(--ease-spring);
}
.toast.success { border-left: 4px solid var(--good); }
.toast.error { border-left: 4px solid var(--critical); }
.toast.info { border-left: 4px solid var(--info); }
@keyframes toast-in { from { transform: translateY(12px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* --------------------------------------------------------------- auth pages */
.auth-wrap { flex: 1; display: grid; place-items: center; padding: 40px 16px; perspective: 1400px; }
.auth-scene { width: min(980px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 40px; align-items: center; }
.auth-visual { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.auth-visual .claim { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
.auth-visual .orb { width: min(360px, 80vw); aspect-ratio: 1; }
.auth-visual .kicker { color: var(--good-text); margin: 0; align-items: center; }
.auth-visual .kicker::after { margin: 0 auto; }
.auth-visual .claim { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; line-height: 1.2; max-width: 22ch; }
.auth-visual .facts-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.auth-card { width: min(420px, 100%); justify-self: center; }
.auth-card .card { padding: 30px; border-radius: var(--radius-xl); }
.auth-card .card.glass { background: var(--glass); }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; text-align: center; }
.auth-brand .brand-mark { width: 64px; height: 64px; border-radius: 18px; font-size: 1.4rem; }
.auth-brand .brand-logo { height: 76px; max-width: min(300px, 100%); border-radius: 16px; }
.auth-brand .brand-logo.backdrop-light, .auth-brand .brand-logo.backdrop-dark { padding: 12px 18px; }
@media (max-width: 560px) { .app-header .brand-logo { max-width: 120px; height: 36px; } }
.auth-brand .tagline { color: var(--text-secondary); font-size: 0.92rem; }
.auth-brand h1 { font-family: var(--font-display); font-size: 1.85rem; letter-spacing: -0.01em; }
.state h1 { font-family: var(--font-display); }
.orb { display: block; position: relative; }
.orb canvas { width: 100%; height: 100%; display: block; }

/* --------------------------------------------------------------- attendance station */
.station { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.station-hero { position: relative; isolation: isolate; text-align: center; padding: 36px 28px 30px; overflow: hidden; border-radius: var(--radius-xl); }
.station-hero::before, .auth-visual::before {   /* faint tech grid, fading out from the centre */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--ambient-2) 14%, transparent) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--ambient-2) 14%, transparent) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 35%, #000 0%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 35%, #000 0%, transparent 70%);
}
.auth-visual { position: relative; isolation: isolate; padding: 20px; }
.station-hero .orb { width: 132px; height: 132px; margin: -6px auto 4px; }
.station-status { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--good-text); }
.station-status .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); animation: pulse 2s ease-out infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.station-clock {
  font-size: clamp(2.8rem, 8vw, 5rem); font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1.05; margin-top: 6px;
  background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 8px 24px color-mix(in srgb, var(--accent) 25%, transparent));
}
.station-date { color: var(--text-secondary); margin-top: 6px; font-size: 1.05rem; }
.station-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 30px; perspective: 1200px; }
.action-tile {
  --perspective: 900px; --tone-a: #10b981; --tone-b: #06b6d4;
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 200px; padding: 24px 20px; border-radius: 24px;
  border: 1px solid color-mix(in srgb, var(--tone-a) 40%, transparent);
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--tone-a) 26%, transparent), transparent 60%),
    linear-gradient(180deg, var(--card-top), var(--card-bottom));
  color: var(--text); text-decoration: none; font-size: 1.25rem; font-weight: 700;
  box-shadow: inset 0 1px 0 var(--rim-strong), inset 0 -1px 0 rgba(0, 0, 0, 0.2), var(--elev-2), 0 20px 40px -24px var(--tone-a);
  transform-style: preserve-3d;
}
.action-tile.out { --tone-a: #6366f1; --tone-b: #06b6d4; }
/* Breaks (when the tenant turns them on): a smaller pair under check-in / check-out, two across on every screen */
.station-actions .break-row { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.action-tile.break { --tone-a: #f59e0b; --tone-b: #f97316; min-height: 128px; font-size: 1.08rem; padding: 18px 14px; }
.action-tile.break.back { --tone-a: #0ea5e9; --tone-b: #22c55e; }
.action-tile.break .glyph { width: 52px; height: 52px; font-size: 1.1rem; }
.action-tile:hover { border-color: color-mix(in srgb, var(--tone-a) 70%, transparent); box-shadow: inset 0 1px 0 var(--rim-strong), var(--elev-3), 0 30px 60px -24px var(--tone-a); }
.action-tile:focus-visible { outline-offset: 4px; }
.action-tile .glyph {
  position: relative; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem; color: #fff;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.45), transparent 45%), linear-gradient(145deg, var(--tone-a), var(--tone-b));
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.25), inset 0 2px 4px rgba(255, 255, 255, 0.35), 0 14px 30px -10px var(--tone-a);
  transform: translateZ(46px) translate(calc(var(--px, 0) * 6px), calc(var(--py, 0) * 6px));
  transition: transform 0.6s var(--ease-out);
}
.action-tile .glyph::after {   /* orbiting ring around the 3D sphere */
  content: ""; position: absolute; inset: -9px; border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--tone-b) 55%, transparent); transform: rotateX(70deg);
  animation: ring-spin 6s linear infinite;
}
@keyframes ring-spin { to { transform: rotateX(70deg) rotateZ(360deg); } }
.action-tile .tile-title { transform: translateZ(30px); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); }
.action-tile small { font-weight: 500; font-size: 0.86rem; color: var(--text-muted); transform: translateZ(20px); }
.action-tile .tile-go {
  position: absolute; right: 16px; bottom: 14px; font-size: 1rem; color: var(--text-muted); transform: translateZ(24px);
  transition: transform 0.3s var(--ease-out), color 0.3s ease;
}
.action-tile:hover .tile-go { color: var(--tone-a); transform: translateZ(24px) translateX(4px); }
.feed { display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow-y: auto; padding-right: 2px; }
.feed-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 14px; background: color-mix(in oklab, var(--surface-sunken) 55%, transparent); border: 1px solid var(--glass-border);
  transition: transform 0.25s var(--ease-out), border-color 0.25s ease, background 0.25s ease;
}
.feed-item .who { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.feed-item .who strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-item .who span { font-size: 0.78rem; color: var(--text-muted); }
.feed-item.fresh { animation: feed-in 0.6s var(--ease-spring); }
@keyframes feed-in { from { opacity: 0; transform: translateX(16px) scale(0.98); } }

/* --------------------------------------------------------------- camera / verification */
.verify { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.camera-frame { position: relative; padding: 10px; border-radius: 26px; }
.camera-stage {
  position: relative; aspect-ratio: 4 / 3; width: 100%;
  border-radius: var(--radius-lg); overflow: hidden; background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), inset 0 0 60px rgba(0, 0, 0, 0.5);
}
.camera-stage video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.camera-stage .scanline {
  position: absolute; left: 0; right: 0; top: 0; height: 22%; pointer-events: none;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 22%, transparent) 85%, color-mix(in srgb, var(--accent) 70%, transparent) 100%);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 80%, transparent); mix-blend-mode: screen;
  animation: scan 2.8s ease-in-out infinite;
}
@keyframes scan { 0% { transform: translateY(-100%); } 100% { transform: translateY(460%); } }
.camera-stage .corner { position: absolute; width: 34px; height: 34px; border: 3px solid color-mix(in srgb, var(--accent) 85%, white); pointer-events: none; filter: drop-shadow(0 0 6px var(--accent)); }
.camera-stage .corner.tl { left: 14px; top: 14px; border-right: 0; border-bottom: 0; border-top-left-radius: 12px; }
.camera-stage .corner.tr { right: 14px; top: 14px; border-left: 0; border-bottom: 0; border-top-right-radius: 12px; }
.camera-stage .corner.bl { left: 14px; bottom: 14px; border-right: 0; border-top: 0; border-bottom-left-radius: 12px; }
.camera-stage .corner.br { right: 14px; bottom: 14px; border-left: 0; border-top: 0; border-bottom-right-radius: 12px; }
.face-guide { position: absolute; inset: 0; pointer-events: none; }
.face-guide ellipse { fill: none; stroke: rgba(255, 255, 255, 0.85); stroke-width: 3; stroke-dasharray: 10 8; transition: stroke 0.25s ease; animation: dash 18s linear infinite; }
.face-guide.ok ellipse { stroke: var(--accent); stroke-dasharray: none; filter: drop-shadow(0 0 8px var(--accent)); }
.face-guide.warn ellipse { stroke: var(--warning); }
@keyframes dash { to { stroke-dashoffset: -360; } }
.camera-hint {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px);
  padding: 10px 20px; border-radius: 999px; background: rgba(8, 12, 20, 0.7); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  font-weight: 600; font-size: 1rem; text-align: center; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.camera-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 3.6rem; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6), 0 0 24px var(--accent); animation: nudge 1s ease-in-out infinite;
}
.camera-arrow.left { left: 18px; }
.camera-arrow.right { right: 18px; }
@keyframes nudge { 0%, 100% { transform: translate(0, -50%); } 50% { transform: translate(var(--nudge, -8px), -50%); } }
.camera-arrow.right { --nudge: 8px; }
.camera-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #cbd5e1; text-align: center; padding: 24px; background: radial-gradient(circle at 50% 40%, rgba(16, 185, 129, 0.12), transparent 60%); }
.steps { display: flex; flex-direction: column; gap: 8px; }
.step {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px;
  border: 1px solid var(--glass-border); background: color-mix(in oklab, var(--surface-sunken) 55%, transparent); color: var(--text-secondary); font-weight: 500;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s var(--ease-out);
}
.step .num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border-strong); font-size: 0.8rem; font-weight: 700; flex: none; }
.step.current { border-color: color-mix(in srgb, var(--accent) 70%, transparent); color: var(--text); background: var(--accent-soft); transform: translateX(4px); box-shadow: 0 8px 20px -12px var(--accent); }
.step.current .num { background: var(--grad-primary); color: #fff; border-color: transparent; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.step.done { color: var(--text); }
.step.done .num { background: var(--good-soft); color: var(--good-text); border-color: transparent; }
.progress { height: 6px; border-radius: 999px; background: color-mix(in oklab, var(--surface-sunken) 80%, transparent); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25); }
.progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--info)); box-shadow: 0 0 12px var(--accent); transition: width 0.35s var(--ease-out); }

.result-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 20px; border-radius: var(--radius); }
.result-card .result-icon {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; font-weight: 800;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.15), 0 10px 24px -10px currentColor;
}
.result-card.success .result-icon { background: var(--good-soft); color: var(--good-text); }
.result-card.info .result-icon { background: var(--info-soft); color: var(--info-text); }
.result-card.error .result-icon { background: var(--critical-soft); color: var(--critical-text); }
.result-card.error { background: color-mix(in oklab, var(--critical-soft) 50%, transparent); border: 1px solid color-mix(in srgb, var(--critical) 25%, transparent); }
.result-card .greeting { font-size: 1.45rem; font-weight: 700; }
.result-card .details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; width: 100%; text-align: left; margin-top: 6px; }
.result-card .details dt { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.result-card .details dd { margin: 0; font-weight: 600; }
.spoof-warning {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 50% 40%, rgba(127, 29, 29, 0.85), rgba(40, 4, 4, 0.94)); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.spoof-warning .panel {
  width: min(640px, 100%); background: linear-gradient(180deg, #2a0d0d, #170606); color: #fff; border: 1px solid #ef4444; border-radius: var(--radius-xl);
  padding: 30px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.3), 0 0 60px -10px rgba(239, 68, 68, 0.6), 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: alarm-in 0.5s var(--ease-spring);
}
@keyframes alarm-in { from { opacity: 0; transform: perspective(900px) rotateX(18deg) scale(0.92); } }
.spoof-warning .panel .title { display: flex; align-items: center; gap: 12px; font-size: 1.5rem; font-weight: 800; color: #fecaca; }
.spoof-warning .panel .title .sign { width: 50px; height: 50px; flex: none; border-radius: 50%; background: #ef4444; color: #fff; display: grid; place-items: center; font-size: 1.6rem; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.25), 0 0 30px #ef4444; }
.spoof-warning .panel p { color: #fde2e2; font-size: 1.02rem; line-height: 1.6; }
.spoof-warning .panel ul { margin: 0; padding-left: 20px; color: #fecaca; }

/* --------------------------------------------------------------- employee ID card (core/idcard.js) */
.idcard-scene { --card-w: 340px; width: var(--card-w); max-width: 100%; perspective: 1400px; flex: none; }
.idcard {
  --perspective: 1400px; --flip: 0deg;
  position: relative; display: grid; width: 100%; aspect-ratio: 54 / 86;
  font-size: calc(var(--card-w) / 22); color: #f8fafc; outline: none;
  transform-style: preserve-3d;
  transform: perspective(var(--perspective)) rotateX(var(--rx)) rotateY(calc(var(--ry) + var(--flip))) translateZ(var(--lift)) scale(var(--tilt-scale));
}
.idcard.is-flipped { --flip: 180deg; }
.idcard[tabindex] { cursor: pointer; }
.idcard.is-flipping { transition: transform 0.9s var(--ease-spring) !important; }
.idcard:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 6px; border-radius: 1.2em; }
.idcard-face {
  grid-area: 1 / 1; position: relative; isolation: isolate; border-radius: 1.1em; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; padding: 1.1em 1.05em 0.9em;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(16, 185, 129, 0.45), transparent 55%),
    radial-gradient(100% 60% at 100% 10%, rgba(6, 182, 212, 0.35), transparent 60%),
    radial-gradient(90% 70% at 60% 110%, rgba(139, 92, 246, 0.35), transparent 60%),
    linear-gradient(160deg, #0f2a33 0%, #0b1424 55%, #120f2a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.10),
    0 2px 4px rgba(0, 0, 0, 0.3), 0 30px 60px -20px rgba(0, 0, 0, 0.7), 0 60px 90px -50px rgba(16, 185, 129, 0.55);
}
.idcard-back { transform: rotateY(180deg); justify-content: space-between; }
.idcard-face::before {   /* fine guilloche pattern, like a printed security card */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.35; pointer-events: none;
  background:
    repeating-radial-gradient(circle at 110% -10%, transparent 0 0.6em, rgba(255, 255, 255, 0.06) 0.6em calc(0.6em + 1px)),
    repeating-linear-gradient(115deg, transparent 0 1.4em, rgba(255, 255, 255, 0.03) 1.4em calc(1.4em + 1px));
}
.idcard-holo {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit;
  background-image:
    repeating-linear-gradient(110deg, #ff7773 0%, #ffed5f 7%, #a8ff5f 14%, #83fff7 21%, #7894ff 28%, #d875ff 35%, #ff7773 42%),
    repeating-linear-gradient(45deg, rgba(14, 21, 46, 0.7) 0%, rgba(200, 220, 255, 0.5) 4%, rgba(14, 21, 46, 0.7) 8%);
  background-size: 400% 400%, 260% 260%;
  background-position: var(--hx, 50%) var(--hy, 50%), calc(100% - var(--hx, 50%)) calc(100% - var(--hy, 50%));
  background-blend-mode: overlay;
  mix-blend-mode: color-dodge; filter: brightness(0.55) contrast(1.6) saturate(1.3);
  opacity: calc(0.12 + var(--hyp, 0) * 0.5);
  -webkit-mask-image: linear-gradient(160deg, #000 0%, transparent 38%, transparent 62%, #000 100%);
  mask-image: linear-gradient(160deg, #000 0%, transparent 38%, transparent 62%, #000 100%);
  transition: opacity 0.4s ease;
}
.idcard-glare {
  position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  background: radial-gradient(farthest-corner circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.12) 22%, transparent 55%);
  mix-blend-mode: overlay; opacity: 0; transition: opacity 0.4s ease;
}
.idcard-shine {   /* idle light sweep, for touch screens with no pointer */
  position: absolute; inset: -40%; z-index: 3; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.16) 48%, rgba(255, 255, 255, 0.28) 50%, rgba(255, 255, 255, 0.16) 52%, transparent 60%);
  transform: translateX(-60%); animation: shine 5.5s ease-in-out 1.2s infinite;
}
@keyframes shine { 0%, 55% { transform: translateX(-60%); } 85%, 100% { transform: translateX(60%); } }
.is-tilting .idcard-shine { animation-play-state: paused; opacity: 0; }
.idcard-slot { width: 3.2em; height: 0.55em; border-radius: 1em; background: rgba(2, 6, 14, 0.85); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(255, 255, 255, 0.15); margin-bottom: 0.7em; flex: none; }
.idcard-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 0.6em; z-index: 1; transform: translate(calc(var(--px, 0) * 2px), calc(var(--py, 0) * 2px)); }
.idcard-org { display: flex; align-items: center; gap: 0.5em; min-width: 0; font-weight: 700; font-size: 0.78em; letter-spacing: 0.02em; }
.idcard-org > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idcard-org .brand-mark { width: 2.2em; height: 2.2em; border-radius: 0.6em; font-size: 0.85em; }
.idcard-org .brand-logo { height: 2.2em; max-width: 7em; border-radius: 0.5em; }
.idcard-org .brand-logo.backdrop-light, .idcard-org .brand-logo.backdrop-dark { padding: 0.25em 0.5em; }
.idcard-chip {
  width: 2.3em; height: 1.75em; border-radius: 0.35em; flex: none;
  background: linear-gradient(135deg, #f8e3a3 0%, #d4a84a 45%, #f3d684 60%, #b98a2d 100%);
  box-shadow: inset 0 0 0 1px rgba(80, 50, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.4);
  position: relative;
}
.idcard-chip::after { content: ""; position: absolute; inset: 0.3em 0.45em; border: 1px solid rgba(80, 50, 0, 0.35); border-radius: 0.2em; }
.idcard-kicker { margin-top: 0.75em; font-family: var(--font-label); font-size: 0.52em; font-weight: 600; letter-spacing: 0.32em; text-transform: uppercase; color: rgba(167, 243, 208, 0.85); z-index: 1; }
.idcard-photo {
  position: relative; z-index: 1; margin-top: 0.55em; width: 7.2em; height: 7.2em; border-radius: 50%; flex: none;
  padding: 0.22em; background: conic-gradient(from 210deg, #10b981, #22d3ee, #818cf8, #e879f9, #10b981);
  box-shadow: 0 0.6em 1.4em -0.4em rgba(0, 0, 0, 0.7), 0 0 1.4em -0.2em rgba(34, 211, 238, 0.55);
  transform: translate(calc(var(--px, 0) * 7px), calc(var(--py, 0) * 7px));
  transition: transform 0.6s var(--ease-out);
}
.idcard-photo img, .idcard-photo .idcard-initials {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 30%; display: grid; place-items: center;
  background: #0b1424; border: 0.15em solid #0b1424; font-size: 2em; font-weight: 800; color: #e2e8f0; letter-spacing: 0.02em;
}
.idcard-name {
  z-index: 1; margin-top: 0.55em; font-family: var(--font-display); font-size: 1.36em; font-weight: 700; letter-spacing: -0.005em; line-height: 1.15; text-align: center;
  max-width: 100%; overflow-wrap: anywhere; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  transform: translate(calc(var(--px, 0) * 4px), calc(var(--py, 0) * 4px));
}
.idcard-title {
  z-index: 1; margin-top: 0.4em; padding: 0.28em 0.8em; border-radius: 1em; font-size: 0.62em; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  background: rgba(16, 185, 129, 0.18); color: #a7f3d0; box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.45);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.idcard-fields { z-index: 1; width: 100%; margin: 0.9em 0 0; display: grid; gap: 0.38em; }
.idcard-fields > div {
  display: grid; grid-template-columns: 4.6em minmax(0, 1fr); align-items: baseline; gap: 0.5em;
  padding: 0.32em 0.6em; border-radius: 0.55em; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.idcard-fields dt { font-family: var(--font-label); font-size: 0.5em; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(203, 213, 225, 0.7); }
.idcard-fields dd { margin: 0; font-size: 0.66em; font-weight: 600; color: #f1f5f9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idcard-fields dd.missing { color: #fbbf24; font-style: italic; }
.idcard-meta { z-index: 1; width: 100%; margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 0.6em; padding: 0 0.2em; }
.idcard-since { display: flex; flex-direction: column; gap: 0.2em; }
.idcard-since small { font-family: var(--font-label); font-size: 0.48em; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(203, 213, 225, 0.65); }
.idcard-since span { font-size: 0.66em; font-weight: 600; color: #e2e8f0; }
.idcard-holoseal {   /* the little hologram square printed on real ID cards */
  width: 2.6em; height: 2.6em; border-radius: 0.6em; flex: none; position: relative; overflow: hidden;
  background: conic-gradient(from calc(var(--hyp, 0) * 180deg), #a7f3d0, #93c5fd, #c4b5fd, #f9a8d4, #fde68a, #a7f3d0);
  box-shadow: inset 0 0 0 0.12em rgba(255, 255, 255, 0.45), 0 0.3em 0.8em rgba(0, 0, 0, 0.4); opacity: 0.85;
}
.idcard-holoseal::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; color: rgba(11, 20, 36, 0.75); font-size: 1.1em; }
.idcard-foot { z-index: 1; width: 100%; margin-top: 0.7em; padding-top: 0.6em; display: flex; align-items: flex-end; justify-content: space-between; gap: 0.6em; border-top: 1px dashed rgba(255, 255, 255, 0.12); }
.idcard-barcode { height: 1.9em; flex: 1; max-width: 60%; border-radius: 0.15em; background: repeating-linear-gradient(90deg, #e2e8f0 0 2px, transparent 2px 4px); opacity: 0.85; }
.idcard-foot .code { font-family: var(--font-mono); font-size: 0.6em; color: rgba(226, 232, 240, 0.8); letter-spacing: 0.08em; }
.idcard-stamp {   /* status pill pinned to the photo ring: "Checked in · 9:02 AM" */
  position: relative; z-index: 4; margin-top: -0.95em; padding: 0.42em 0.95em; border-radius: 1em; white-space: nowrap;
  font-family: var(--font-label); font-size: 0.52em; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #052e1c;
  background: linear-gradient(90deg, #34d399, #a7f3d0 50%, #34d399); box-shadow: 0 0 0 0.25em #0b1424, 0 6px 16px rgba(0, 0, 0, 0.45);
}
.idcard-stamp.out { color: #f8fafc; background: linear-gradient(90deg, #4f46e5, #818cf8 50%, #4f46e5); }
.idcard-stamp.info { color: #082f49; background: linear-gradient(90deg, #22d3ee, #a5f3fc 50%, #22d3ee); }
.idcard-stamp.warn { color: #451a03; background: linear-gradient(90deg, #f59e0b, #fde68a 50%, #f59e0b); }
.idcard-back .back-title { z-index: 1; font-size: 0.6em; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(167, 243, 208, 0.85); }
.idcard-back .back-body { z-index: 1; width: 100%; display: grid; gap: 0.45em; }
.idcard-back .back-note { z-index: 1; font-size: 0.6em; line-height: 1.45; color: rgba(226, 232, 240, 0.75); text-align: center; }
.idcard-back .seal {
  z-index: 1; width: 4.4em; height: 4.4em; border-radius: 50%; display: grid; place-items: center; font-size: 1em; font-weight: 800;
  background: conic-gradient(from 0deg, #10b981, #22d3ee, #818cf8, #e879f9, #fbbf24, #10b981);
  box-shadow: inset 0 0 0 0.3em rgba(11, 20, 36, 0.85), 0 0 1.4em -0.3em rgba(34, 211, 238, 0.7); color: #fff;
}
.idcard-hint { margin-top: 12px; text-align: center; font-size: 0.8rem; color: var(--text-muted); }
.idcard.compact .idcard-fields > div:nth-child(n + 3) { display: none; }
/* small cards (phones, previews) keep their small print readable */
.idcard-fields dd, .idcard-since span { font-size: max(0.66em, 9.5px); }
.idcard-fields dt, .idcard-since small { font-size: max(0.5em, 7.5px); }
.idcard-title, .idcard-foot .code { font-size: max(0.6em, 8.5px); }
.idcard-stamp, .idcard-kicker { font-size: max(0.52em, 8px); }
.idcard-org { font-size: max(0.78em, 10.5px); }

/* lanyard + drop-in for the check-in / check-out welcome */
.lanyard { position: relative; display: flex; flex-direction: column; align-items: center; transform-origin: 50% -40vh; }
.lanyard-strap {
  width: 34px; height: 30vh; margin-top: -30vh; border-radius: 0 0 4px 4px;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.0) 0 22px, rgba(255, 255, 255, 0.10) 22px 24px),
    linear-gradient(90deg, #047857, #0e7490 50%, #047857);
  box-shadow: inset 2px 0 3px rgba(255, 255, 255, 0.2), inset -2px 0 3px rgba(0, 0, 0, 0.3), 0 8px 18px rgba(0, 0, 0, 0.3);
}
.lanyard.out .lanyard-strap { background: repeating-linear-gradient(180deg, transparent 0 22px, rgba(255, 255, 255, 0.10) 22px 24px), linear-gradient(90deg, #3730a3, #0e7490 50%, #3730a3); }
.lanyard-clip {
  width: 30px; height: 30px; margin-top: -2px; margin-bottom: -14px; z-index: 2; border-radius: 6px 6px 14px 14px;
  background: linear-gradient(180deg, #f1f5f9, #94a3b8 60%, #cbd5e1); box-shadow: inset 0 1px 0 #fff, 0 4px 8px rgba(0, 0, 0, 0.4);
}
.lanyard.drop { animation: badge-drop 1.5s var(--ease-out) both; }
.lanyard.drop.settled-swing { animation: badge-sway 5s ease-in-out infinite; }
@keyframes badge-drop {
  0% { transform: translateY(-110vh) rotate(-8deg); }
  45% { transform: translateY(0) rotate(7deg); }
  62% { transform: rotate(-5deg); }
  78% { transform: rotate(2.5deg); }
  90% { transform: rotate(-1deg); }
  100% { transform: rotate(0); }
}
@keyframes badge-sway { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }

/* --------------------------------------------------------------- welcome overlay (verify page) */
.welcome {
  position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; padding: 24px; overflow: auto; color: var(--text);
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%),
    radial-gradient(circle at 75% 70%, color-mix(in srgb, #6366f1 22%, transparent), transparent 55%), var(--overlay);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  animation: fade-in 0.4s ease both;
}
.welcome.out { background: radial-gradient(circle at 30% 30%, color-mix(in srgb, #6366f1 26%, transparent), transparent 55%), radial-gradient(circle at 75% 70%, color-mix(in srgb, var(--info) 20%, transparent), transparent 55%), var(--overlay); }
@keyframes fade-in { from { opacity: 0; } }
.welcome-stage { width: min(1040px, 100%); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 48px; align-items: center; }
.welcome-copy { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.welcome-copy > * { animation: rise 0.7s var(--ease-out) both; }
.welcome-copy > :nth-child(2) { animation-delay: 0.35s; }
.welcome-copy > :nth-child(3) { animation-delay: 0.5s; }
.welcome-copy > :nth-child(4) { animation-delay: 0.65s; }
.welcome-copy > :nth-child(5) { animation-delay: 0.8s; }
.welcome-copy > :nth-child(n + 6) { animation-delay: 0.95s; }
.welcome-title { font-family: var(--font-display); font-size: clamp(2rem, 4.4vw, 3.4rem); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.welcome-line { font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: var(--text); line-height: 1.5; max-width: 36ch; }
.welcome-line .emoji { font-size: 1.2em; }
.welcome-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 0.9rem;
  background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--rim), var(--elev-1);
}
.chip .k { color: var(--text-muted); font-weight: 500; }
.chip.good { color: var(--good-text); background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.welcome-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.countdown { display: inline-flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 0.9rem; }
.countdown svg { width: 34px; height: 34px; transform: rotate(-90deg); }
.countdown circle { fill: none; stroke-width: 3; }
.countdown .track { stroke: var(--border-strong); }
.countdown .bar { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 94.25; stroke-dashoffset: 0; animation: countdown var(--duration, 10s) linear forwards; }
@keyframes countdown { to { stroke-dashoffset: 94.25; } }
.welcome .server-note { color: var(--text-secondary); font-size: 0.92rem; }
.confetti { position: fixed; inset: 0; z-index: 46; pointer-events: none; width: 100%; height: 100%; }

/* --------------------------------------------------------------- employee pages */
.profile { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.profile-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 32px; align-items: center; }
.profile-hero .idcard-scene { --card-w: 300px; }
.profile-info { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.profile-info h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.4rem); letter-spacing: -0.02em; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 4px; }
.facts > div { padding: 10px 12px; border-radius: 12px; background: color-mix(in oklab, var(--surface-sunken) 50%, transparent); border: 1px solid var(--glass-border); min-width: 0; }
.facts dt { font-family: var(--font-label); font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.16em; font-weight: 600; }
.facts dd { margin: 3px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.tenant-preview { border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; box-shadow: var(--elev-1); }
.tenant-preview .bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.tenant-preview .body { padding: 18px 12px; font-size: 0.85rem; }
.tenant-preview .foot { padding: 8px 12px; font-size: 0.75rem; }

.preview-panel { position: sticky; top: 92px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.preview-panel .idcard-scene { --card-w: 300px; }
.preview-label { font-family: var(--font-label); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.3em; text-transform: uppercase; color: var(--text-muted); }

.photo-field { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.photo-drop {
  position: relative; width: 116px; height: 116px; border-radius: 50%; flex: none; cursor: pointer; overflow: hidden;
  display: grid; place-items: center; text-align: center; color: var(--text-secondary); font-size: 0.78rem; font-weight: 600;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%), var(--field-bg);
  border: 2px dashed color-mix(in srgb, var(--accent) 45%, var(--border-strong));
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s ease, transform 0.3s var(--ease-spring), box-shadow 0.2s ease;
}
.photo-drop:hover, .photo-drop.dragover { border-color: var(--accent); transform: scale(1.04); box-shadow: 0 0 0 6px var(--accent-soft); }
.photo-drop:focus-within { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.photo-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-drop .plus { display: block; font-size: 1.6rem; line-height: 1; color: var(--accent); margin-bottom: 4px; }
.photo-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

.cropper { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.crop-viewport {
  position: relative; width: min(320px, 70vw); aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; touch-action: none; cursor: grab;
  background: #05080f; box-shadow: inset 0 0 0 1px var(--glass-border), var(--elev-2);
}
.crop-viewport.dragging { cursor: grabbing; }
.crop-viewport img { position: absolute; left: 50%; top: 50%; max-width: none; user-select: none; -webkit-user-drag: none; transform-origin: 0 0; }
.crop-viewport::after {   /* round ID-card mask preview */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 46%, transparent 38%, rgba(2, 6, 14, 0.55) 38.5%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15);
}
.crop-zoom { display: flex; align-items: center; gap: 10px; width: min(320px, 70vw); }
.crop-zoom input { flex: 1; accent-color: var(--accent); }

.view-toggle { margin-left: auto; }
/* Employees "Cards" view: every employee's real ID card (core/idcard.js), as shown at check-in. */
.id-grid {
  --grid-card: min(280px, calc(100vw - 72px));
  display: grid; grid-template-columns: repeat(auto-fill, var(--grid-card)); justify-content: center;
  gap: 30px 22px; padding: 24px 16px 28px;
}
.id-grid .idcard-scene { --card-w: var(--grid-card); }
.id-tile { display: flex; flex-direction: column; align-items: center; gap: 12px; color: inherit; text-decoration: none; border-radius: 1.2em; }
.id-tile:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 8px; }
.id-tile .idcard { transition: transform 0.7s var(--ease-out), filter 0.3s ease; }
.id-tile .idcard.is-tilting { transition: transform 0.12s linear, filter 0.3s ease; }
.id-tile:hover .idcard { --lift: 18px; }
.id-tile .idcard-shine { display: none; }           /* no idle light sweep on a grid of twenty cards */
.id-tile.inactive .idcard-face { filter: grayscale(0.85) brightness(0.78); }
.id-tile-meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.id-cell { display: flex; flex-direction: column; align-items: center; gap: 8px; }
/* Mark attendance dialog (core/manual-attendance.js) */
.attendance-when { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.attendance-when[hidden] { display: none; }
.attendance-when .input[type=date] { width: auto; min-width: 160px; }
#attendance-employee { min-height: 9.5em; }
.marked-by { display: block; color: var(--text-muted); font-size: 0.78rem; white-space: nowrap; }
.session-times { display: flex; flex-direction: column; gap: 6px; }
.idcard-stamp.danger { color: #fff; background: linear-gradient(90deg, #dc2626, #f87171 50%, #dc2626); }

/* --------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .grid-sidebar, .station, .verify { grid-template-columns: minmax(0, 1fr); }
  .preview-panel { position: static; }
}
@media (max-width: 960px) {
  .welcome-stage { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 24px; }
  .welcome .idcard-scene { --card-w: min(280px, 72vw); }
  .welcome-copy { align-items: center; text-align: center; }
  .welcome-line { max-width: none; }
  .lanyard-strap { height: 14vh; margin-top: -14vh; }
  .auth-scene { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .auth-visual .orb { width: 200px; }
  .auth-visual .claim, .auth-visual .facts-row { display: none; }
}
@media (max-width: 860px) {
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .profile-hero { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .profile-info { width: 100%; }
}
@media (min-width: 1680px) {   /* big desktop and wall screens: use the room */
  .app-main, .app-header { max-width: 1480px; }
  body { font-size: 16px; }
}
@media (max-width: 900px) {   /* tablets: nav moves under the brand row */
  .app-header { flex-wrap: wrap; row-gap: 10px; }
  .app-header .brand { flex: 1; }
  .app-header .header-spacer { display: none; }
  .app-nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none; }
  .app-nav::-webkit-scrollbar { display: none; }
  .app-nav a { flex: 1 0 auto; text-align: center; }
}
@media (max-width: 720px) {
  :root { --gutter: 12px; }
  .app-header { gap: 10px; padding: 8px 8px 8px 10px; border-radius: 18px; margin-top: 8px; }
  .brand { flex: 1; }
  .brand-logo { max-width: 104px; height: 34px; }
  .user-chip .who { display: none; }
  .user-chip { gap: 6px; }
  /* 16px stops iOS Safari zooming into a field on focus */
  .input, .select, .textarea { font-size: 16px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .field.span-2 { grid-column: auto; }
  .station-actions { grid-template-columns: minmax(0, 1fr); }
  .action-tile { min-height: 140px; }
  .station-actions .break-row { gap: 12px; }
  .action-tile.break { min-height: 112px; }
  .result-card .details { grid-template-columns: minmax(0, 1fr); }
  .toolbar .input, .toolbar .select { min-width: 0; width: 100%; }
  .view-toggle { margin-left: 0; }
  .filter-row .range-label { min-width: 0; }
  h1 { font-size: 1.4rem; }
  .idcard-scene { --card-w: min(300px, calc(100vw - 64px)); }
  .profile-hero .idcard-scene, .preview-panel .idcard-scene { --card-w: min(280px, calc(100vw - 64px)); }
}
@media (max-width: 480px) {
  .welcome { padding: 16px 12px; }
  .welcome .idcard-scene { --card-w: min(264px, 70vw); }
  .welcome-title { font-size: 1.9rem; }
  .welcome-chips { justify-content: center; }
}
@media (max-width: 420px) {
  .brand-sub { display: none; }
  .user-avatar { display: none; }
  .page-head .row { width: 100%; }
  .page-head .row > .btn { flex: 1; }
}
@media (hover: none) {
  .card::before { display: none; }
}
@media (pointer: coarse) {   /* fingers, not cursors: 44px targets */
  .theme-toggle button { width: 40px; height: 38px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; padding: 8px 14px; }
  .segmented button { padding: 10px 16px; }
  .app-nav a { padding: 10px 14px; }
}
@media (max-height: 560px) and (orientation: landscape) {   /* phones on their side */
  .welcome { place-items: start center; }
  .welcome-stage { grid-template-columns: auto minmax(0, 1fr); gap: 20px; }
  .welcome .idcard-scene { --card-w: 220px; }
  .lanyard-strap { display: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .app-header, dialog.modal, .toast { background: var(--surface); }
  .welcome { background: var(--overlay); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-tilt] { transform: none !important; }
  .idcard.is-flipped { transform: rotateY(180deg) !important; }
}
@media (forced-colors: active) {
  .gradient-text, .page-head h1, .station-clock, .welcome-title, .profile-info h1 { background: none; color: CanvasText; }
}

/* --------------------------------------------------------------- page transitions (Chromium, Safari 18.2+) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 0.14s ease both; }
::view-transition-new(root) { animation: vt-in 0.24s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px) scale(0.995); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px) scale(0.995); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* --------------------------------------------------------------- utilities */
.toolbar.inset { padding: 16px 16px 0; margin-bottom: 0; }
.toolbar.inset + * { margin-top: 14px; }
.mt-xs { margin-top: 4px; }
.mt-lg { margin-top: 22px; }
.mb-0 { margin-bottom: 0 !important; }
.justify-end { justify-content: flex-end; }
.pre-line { white-space: pre-line; overflow-wrap: anywhere; }
.center-note { text-align: center; margin-top: 16px; font-size: 0.85rem; }
.grow { flex: 1; min-width: 0; }
a.feed-item { color: inherit; text-decoration: none; }
a.feed-item:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); transform: translateX(3px); }
.camera-stage.finished video, .camera-stage.finished .face-guide { visibility: hidden; }
.camera-stage.finished .camera-hint, .camera-stage.finished .scanline, .camera-stage.finished .corner { display: none; }
.kpis.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .kpis.kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs:empty { display: none; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }

/* ------------------------------------------------------------------ pick several employees (Departments) */
.pick-all { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-weight: 600; cursor: pointer; }
.pick-list {
  max-height: min(46vh, 380px); overflow-y: auto; margin-top: 6px; border: 1px solid var(--glass-border);
  border-radius: 14px; background: color-mix(in oklab, var(--surface-sunken) 45%, transparent);
}
.pick-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; min-height: 48px; }
.pick-row + .pick-row { border-top: 1px solid var(--glass-border); }
.pick-row:hover { background: color-mix(in oklab, var(--accent) 6%, transparent); }
.pick-row .who { display: flex; flex-direction: column; min-width: 0; }
.pick-row .who span { font-size: 0.8rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row input, .pick-all input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.pick-none { padding: 14px; margin: 0; }
.pick-filter { font-weight: 500; }

/* ------------------------------------------------------------------ a drop-down of checkboxes (core/multi-select.js) */
.multi { position: relative; display: flex; min-width: 0; }
.multi-button {
  display: flex; align-items: center; gap: 8px; width: auto; max-width: 100%; height: 44px; min-height: 0; text-align: left;
  cursor: pointer;
  padding-right: 34px; white-space: nowrap; color: var(--text);
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.multi-button .multi-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.multi-button.active { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.multi-panel {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 45; width: max(100%, 280px); max-width: calc(100vw - 32px);
  display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--rim), var(--elev-2);
}
.multi-panel[hidden] { display: none; }
.multi-panel.to-left { left: auto; right: 0; }
.multi-search { min-height: 38px; padding-block: 7px; }
.multi-list { display: flex; flex-direction: column; max-height: min(48vh, 340px); overflow-y: auto; overscroll-behavior: contain; }
.multi-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; cursor: pointer; min-height: 40px;
}
.multi-row[hidden] { display: none; }
.multi-row:hover { background: color-mix(in oklab, var(--accent) 7%, transparent); }
.multi-row input { width: 18px; height: 18px; flex: none; margin: 0; accent-color: var(--accent); }
.multi-who { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.multi-name { font-size: 0.88rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-sub { font-size: 0.74rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-meta { flex: none; font-size: 0.74rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.multi-none { margin: 4px 8px; }
.multi-foot { display: flex; align-items: center; gap: 10px; padding-top: 8px; border-top: 1px solid var(--glass-border); }
.multi-status { flex: 1; font-size: 0.78rem; color: var(--text-muted); }
.switch-row { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; font-weight: 500; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; flex: none; }
/* Manager permissions: one row per permission (a switch for admins, a badge for a manager) */
.perm-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--glass-border); font-weight: 500; }
.perm-row:last-child { border-bottom: 0; }
.perm-row input { margin-top: 2px; }
.perm-row .badge { flex: none; margin-top: 1px; min-width: 88px; justify-content: center; }
.perm-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.perm-text .hint { font-weight: 400; }
.dept-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.dept-check {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--glass-border); background: color-mix(in oklab, var(--surface-sunken) 45%, transparent);
  cursor: pointer; font-weight: 500;
}
.dept-check:has(input:checked) { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 12%, transparent); }
.dept-check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.dept-add { align-self: flex-start; margin-top: 2px; }
.dept-actions { justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.modal .warn-box { margin-top: 12px; }

/* ------------------------------------------------------------------ a warning inside a dialog (Schedule, Departments) */
.warn-box { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; font-size: 0.86rem; }
.warn-box.critical { background: var(--critical-soft); border: 1px solid color-mix(in srgb, var(--critical) 40%, transparent); }
.warn-box.warning { background: var(--warning-soft); border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent); }
.warn-box .bang { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; font-weight: 800; background: color-mix(in srgb, currentColor 14%, transparent); }
.warn-box.critical .bang { color: var(--critical-text); }
.warn-box.warning .bang { color: var(--warning-text); }


/* ------------------------------------------------------------------ this week's days (Employees list) */
.hours-cell { display: flex; flex-direction: column; gap: 5px; }
.status-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.week-strip { display: inline-grid; grid-template-columns: repeat(7, 19px); gap: 2px; }
.week-strip .wd {
  height: 20px; border-radius: 5px; display: grid; place-items: center; font-family: var(--font-label); font-size: 0.66rem;
  font-weight: 700; color: var(--text-muted); border: 1px dashed var(--border-strong);
}
.week-strip .wd.on {
  color: var(--good-text); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

/* ------------------------------------------------------------------ an employee's schedule (profile, read-only) */
#plan { margin-block: 18px; }
.plan-head { justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.plan-weeks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.plan-week { border: 1px solid var(--glass-border); border-radius: 16px; overflow: hidden; }
.plan-week-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 14px;
  background: color-mix(in oklab, var(--surface-sunken) 55%, transparent); }
.plan-days { list-style: none; margin: 0; padding: 0; }
.plan-days li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px; font-size: 0.9rem; }
.plan-days li + li { border-top: 1px solid var(--glass-border); }
.plan-days .plan-day { color: var(--text-secondary); white-space: nowrap; }
.plan-days .plan-hours { font-family: var(--font-mono); font-size: 0.82rem; text-align: right; }
.plan-days li.on .plan-hours { color: var(--text); font-weight: 600; }
.plan-days li.off .plan-hours { color: var(--text-muted); }
.plan-days li.leave .plan-hours { color: var(--warning-text); font-family: inherit; }
.plan-days li.today { background: color-mix(in oklab, var(--accent) 7%, transparent); }
.plan-leave ul { margin: 0; padding-left: 18px; }

/* ------------------------------------------------------------------ registered attendance devices (Settings) and
   station alerts (System & audit): a station password used from a device that is not registered */
.nav-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--critical); color: #fff; font-size: 0.72rem; font-weight: 700; line-height: 1; vertical-align: 1px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--critical) 25%, transparent); }
.device-row .cell-title .badge { margin: 0 0 0 4px; vertical-align: middle; }
.device-row .cell-sub + .cell-sub { margin-top: 2px; }
.device-actions { flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.alert-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.alert-item { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px; border-radius: 14px; background: var(--critical-soft); border: 1px solid color-mix(in srgb, var(--critical) 45%, transparent); }
.alert-item.seen { background: transparent; border-color: var(--border); }
.alert-photo { width: 96px; height: 96px; border-radius: 12px; overflow: hidden; background: var(--surface-sunken); display: grid; place-items: center; color: var(--text-muted); font-size: 0.72rem; text-align: center; padding: 6px; }
.alert-photo img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.alert-photo-large { max-width: min(90vw, 640px); max-height: 70vh; border-radius: 12px; display: block; }
.alert-body { min-width: 0; }
.alert-title { font-weight: 700; color: var(--critical-text); }
.alert-item.seen .alert-title { color: var(--text); }
.alert-meta { font-size: 0.82rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }
.alert-match { margin-top: 8px; font-weight: 600; }
.table tr.row-alert td { background: var(--critical-soft); }
.station-blocked { margin: 28px auto 0; max-width: 560px; }
.mb-md { margin-bottom: 16px; }
@media (max-width: 720px) {
  .alert-item { grid-template-columns: 72px minmax(0, 1fr); }
  .alert-photo { width: 72px; height: 72px; }
  .alert-item > .btn { grid-column: 1 / -1; justify-self: start; }
  .device-row { flex-wrap: wrap; }
  .device-actions { width: 100%; justify-content: flex-start; }
}

/* ------------------------------------------------------------------ feature modules (Backoffice) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { padding: 3px 10px; font-size: 0.78rem; box-shadow: none; }
.feature-choices[aria-invalid="true"] { outline: 2px solid var(--critical); outline-offset: 4px; border-radius: 12px; }

/* ------------------------------------------------------------------ payroll (the Payroll feature) */
.payroll-steps { align-self: flex-start; }
.payroll-steps button { display: inline-flex; align-items: center; gap: 8px; }
.step-num { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 0.75rem; font-weight: 700; background: var(--surface); border: 1px solid var(--border-strong); }
.payroll-steps button[aria-pressed="true"] .step-num { background: var(--grad-primary); color: #fff; border-color: transparent; }
.payroll-sheet tr.excluded td { opacity: 0.55; }
.payroll-sheet tfoot td { border-top: 2px solid var(--border-strong); padding: 13px 16px; }
.payroll-sheet .chips .chip { white-space: nowrap; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.employer-block { display: flex; flex-direction: column; gap: 1px; font-style: normal; overflow-wrap: anywhere; }
.table.compact td, .table.compact th { padding: 8px 10px; }
.card-pad { padding: 0 22px 22px; }
.statement-group h3 { font-size: 0.95rem; margin: 6px 0 6px; }
.statement-totals > div:nth-child(5) { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.next-payroll h2 { font-size: 1.5rem; }
.pay-section .facts { margin-bottom: 12px; }
.pay-items { list-style: none; margin: 0; padding: 0; }
.pay-items li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.pay-items li:first-child { border-top: 0; }
.pay-items .row { flex-wrap: nowrap; }
.report-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.report-filters .field { margin: 0; }
@media (max-width: 720px) {
  .pay-items li { flex-wrap: wrap; }
  .payroll-steps { width: 100%; }
  .payroll-steps button { flex: 1; justify-content: center; }
}
.statement-dialog .table td.num, .statement-dialog .table th.num { white-space: nowrap; }
.nowrap-row { flex-wrap: nowrap; gap: 4px; }
.stat-value.money { font-size: clamp(1.15rem, 1.6vw, 1.45rem); white-space: nowrap; }
@media (max-width: 640px) {
  .table.stackable tfoot { display: block; }
  .payroll-sheet.stackable tfoot td:empty { display: none; }
  .payroll-sheet.stackable tfoot td { border: 0; padding: 5px 0; }
}

/* ------------------------------------------------------------------ payroll taxes (docs/TAXES.md): Pay settings'
   Taxes card, an employee's Tax withholding card, tax lines on a payroll and the Taxes report */
.tax-place-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.tax-place-line strong { overflow-wrap: anywhere; }
.tax-group h3 { font-size: 1rem; margin: 0; }
.tax-group > .hint { display: block; margin: 2px 0 4px; }
.tax-list { list-style: none; margin: 0; padding: 0; }
.tax-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.tax-row:first-child { border-top: 0; }
.tax-row.off .tax-title strong, .tax-row.off .tax-summary { color: var(--text-muted); }
.tax-side { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.tax-apply { min-height: 36px; font-size: 0.85rem; }
.tax-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tax-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.tax-summary { overflow-wrap: anywhere; }
.tax-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 0.8rem; color: var(--text-muted); }
.tax-meta a { overflow-wrap: anywhere; }
.tax-rate { margin-top: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--glass-border);
  background: color-mix(in oklab, var(--surface-sunken) 50%, transparent); display: flex; flex-direction: column; gap: 10px; }
.tax-rate.quiet { margin-top: 4px; padding: 0; border: 0; background: none; }
.tax-rate-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.tax-rate-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 10px 12px; align-items: end; }
.tax-rate-form[hidden] { display: none; }
.tax-rate-form > div:first-child:not(.field) { grid-column: 1 / -1; }
.tax-rate-form .field { margin: 0; }
.tax-rate-actions { flex-wrap: nowrap; gap: 6px; }
.tax-rate-history { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; }
.tax-rate-history li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; border-top: 1px solid var(--border); }
.tax-rate-history li:first-child { border-top: 0; }
.tax-rate-history .badge { margin-left: 6px; }
.tax-group-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; }
.tax-group-head > div { min-width: 0; }
.tax-group-head .hint { display: block; margin: 2px 0 4px; }
.tax-own-actions { gap: 6px; margin-top: 4px; }
.tax-none { margin: 4px 0 0; }
.tax-withholding { margin-top: 0; }
.tax-forms { gap: 14px; }
.tax-form { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--glass-border);
  background: color-mix(in oklab, var(--surface-sunken) 40%, transparent); display: flex; flex-direction: column; gap: 10px; }
.tax-form-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tax-form-head h3 { margin: 0; font-size: 1rem; }
.tax-form-status { margin: 0; }
.check-link { font-weight: 600; white-space: nowrap; }
.tax-hint { margin: 6px 0 0; }
.cell-title .badge { margin-left: 8px; vertical-align: middle; }
.card-pad-x { padding: 0 22px; }
.tax-report { gap: 6px; padding-bottom: 8px; }
.tax-report h3 { font-size: 1rem; margin: 8px 0 0; }
.tax-report tr.totals td { border-top: 2px solid var(--border-strong); }
@media (max-width: 720px) {
  .tax-row { flex-wrap: wrap; }
  .tax-rate-form { grid-template-columns: minmax(0, 1fr); }
  .tax-form { padding: 12px; }
}

/* ------------------------------------------------------------------ Biometric consent (enrollment + profile) */
.consent-employee { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.consent-employee dt { color: var(--text-muted); font-size: 0.85rem; }
.consent-employee dd { margin: 0; color: var(--text); }
.policy-box { max-height: 340px; overflow-y: auto; border: 1px solid var(--border-strong); border-radius: 12px;
  padding: 16px 18px; background: var(--surface-sunken); }
.policy-box h3 { margin: 16px 0 6px; font-size: 0.95rem; color: var(--text); }
.policy-box h3:first-child { margin-top: 0; }
.policy-box p { margin: 0 0 8px; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.55; }
.policy-box.read { border-color: var(--accent); }
.consent-ack { display: flex; gap: 10px; align-items: flex-start; color: var(--text-secondary); font-size: 0.92rem; }
.consent-ack input { margin-top: 3px; }
.sig-wrap { display: flex; flex-direction: column; gap: 8px; }
.sig-label { color: var(--text-muted); font-size: 0.85rem; }
.sig-pad { width: 100%; height: 200px; background: #ffffff; border: 1px dashed var(--border-strong);
  border-radius: 12px; touch-action: none; cursor: crosshair; display: block; }
.consent-signed { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.consent-signed img { background: #fff; border: 1px solid var(--border); border-radius: 8px; max-width: 320px;
  max-height: 120px; padding: 6px; }
.consent-method { border: 1px solid var(--border-strong); border-radius: 12px; padding: 12px 14px; display: flex;
  flex-direction: column; gap: 8px; margin: 0; }
.consent-method legend { padding: 0 6px; color: var(--text-muted); font-size: 0.85rem; }
.consent-method label { display: flex; gap: 10px; align-items: flex-start; color: var(--text-secondary);
  font-size: 0.92rem; cursor: pointer; }
.consent-method input { margin-top: 3px; }
.consent-doc { display: flex; gap: 10px; align-items: center; border: 1px dashed var(--border-strong);
  border-radius: 8px; padding: 12px 16px; }
.consent-doc-icon { font-size: 1.4rem; }
