/* ==========================================================================
   Shortwood Medical Centre — Operations Portal
   Design system aligned to TechDiscovery (wow.css + td-polish.css rules).
   Desktop >=1101px: fixed 264px sidebar. <=1100px: top bar + drawer.
   Phone <=700px: single-column forms, stacked table rows (data-label cards).
   ========================================================================== */
:root{
  --brand-900:#0a2259;--brand-800:#0f3d91;--brand-700:#1d4fb8;--brand-600:#2563eb;--brand-500:#3b82f6;--brand-100:#dbe7ff;--brand-50:#eef4ff;
  --accent:#7c3aed;--cyan:#06b6d4;--green:#10b981;--amber:#f59e0b;--orange:#f97316;--red:#dc2626;
  --ink:#0f172a;--ink-2:#334155;--muted:#64748b;--faint:#94a3b8;
  --bg:#f4f6fb;--surface:#fff;--surface-2:#f8fafc;--line:#e5eaf2;--line-2:#eef2f7;
  --ok-bg:#e7f8f0;--ok-fg:#0f7a55;--warn-bg:#fff6e0;--warn-fg:#8a5a00;--danger-bg:#fdecec;--danger-fg:#b42318;--info-bg:#eef4ff;--info-fg:#1d4fb8;
  --r-sm:8px;--r:12px;--r-lg:16px;--r-xl:20px;--gap:16px;--pad:20px;--control-h:42px;--side-w:264px;--bar-h:60px;
  --shadow-sm:0 1px 2px rgba(15,23,42,.05);--shadow:0 1px 2px rgba(15,23,42,.04),0 6px 20px rgba(15,23,42,.05);--shadow-lg:0 20px 50px rgba(15,23,42,.14);
  --side-bg:#fff;--side-ink:#0f172a;--side-muted:#64748b;--side-hover:#f1f5fb;
  --scope-ring:#1d4fb8;--scope-tint:#eaf1ff;--hero-grad:linear-gradient(125deg,#0a2a6e 0%,#2563eb 62%,#7c3aed 100%);
}
/* Scope accents (independent of Appearance) */
[data-scope=my]{--scope-ring:#1d4fb8;--scope-tint:#eaf1ff;--hero-grad:linear-gradient(125deg,#0a2a6e 0%,#2563eb 62%,#7c3aed 100%)}
[data-scope=team]{--scope-ring:#6d28d9;--scope-tint:#f1ebff;--hero-grad:linear-gradient(125deg,#312e81,#7c3aed)}
[data-scope=hr]{--scope-ring:#047857;--scope-tint:#e8f7f1;--hero-grad:linear-gradient(125deg,#164e63,#0d9488)}
[data-scope=lead]{--scope-ring:#b45309;--scope-tint:#fff7e6;--hero-grad:linear-gradient(125deg,#78350f,#d97706)}
[data-scope=acct]{--scope-ring:#334155;--scope-tint:#eef2f6;--hero-grad:linear-gradient(125deg,#0f172a,#475569)}
[data-scope=admin]{--scope-ring:#c2410c;--scope-tint:#fff0e8;--hero-grad:linear-gradient(125deg,#7c2d12,#ea580c)}

/* Appearance themes (brand palette only) */
body[data-theme=blue]{--brand-800:#1e3a8a;--brand-700:#1e40af;--brand-600:#1d4ed8;--brand-500:#2563eb;--brand-100:#dbeafe;--brand-50:#eff6ff}
body[data-theme=purple]{--brand-800:#4c1d95;--brand-700:#5b21b6;--brand-600:#7c3aed;--brand-500:#8b5cf6;--brand-100:#ede9fe;--brand-50:#f5f3ff;--info-fg:#5b21b6;--info-bg:#f5f3ff}
body[data-theme=teal]{--brand-800:#115e59;--brand-700:#0f766e;--brand-600:#0d9488;--brand-500:#14b8a6;--brand-100:#ccfbf1;--brand-50:#f0fdfa;--info-fg:#0f766e;--info-bg:#f0fdfa}
body[data-theme=orange]{--brand-800:#9a3412;--brand-700:#c2410c;--brand-600:#ea580c;--brand-500:#f97316;--brand-100:#ffedd5;--brand-50:#fff7ed;--info-fg:#9a3412;--info-bg:#fff7ed}
body[data-theme=dark]{--bg:#111827;--surface:#1f2937;--surface-2:#273244;--line:#374151;--line-2:#2b3646;--ink:#f3f4f6;--ink-2:#d1d5db;--muted:#cbd5e1;--faint:#94a3b8;
  --side-bg:#172131;--side-ink:#e5e7eb;--side-muted:#9ca3af;--side-hover:#223047;--brand-50:#1e2a44;--brand-100:#2b3a5c;--brand-800:#bfd3ff;--info-bg:#1e2a44;--info-fg:#bfd3ff;
  --ok-bg:#12352a;--ok-fg:#6ee7b7;--warn-bg:#3a2e12;--warn-fg:#fcd34d;--danger-bg:#3b1a1a;--danger-fg:#fca5a5;--scope-tint:#223047}
body[data-theme=dark] [data-scope]{--scope-tint:#223047}
body[data-theme=contrast]{--ink:#000;--ink-2:#000;--muted:#1f2937;--line:#1f2937;--line-2:#374151;--brand-600:#0033a0;--brand-800:#001a57;--bg:#fff;--side-muted:#111827}
body[data-theme=contrast] .btn,body[data-theme=contrast] .badge{outline:1px solid currentColor}

*{box-sizing:border-box}
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%}
body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;font-size:14px;line-height:1.5;color:var(--ink);background:var(--bg);-webkit-font-smoothing:antialiased}
a{color:var(--brand-600);text-decoration:none}a:hover{text-decoration:underline}
h1,h2,h3,h4{color:var(--ink);letter-spacing:-.01em;margin:0}
h1{font-size:24px;font-weight:800}h2{font-size:17px;font-weight:750}h3{font-size:15px;font-weight:700}
p{margin:0 0 10px}small{color:var(--muted)}
.muted{color:var(--muted)}.num{font-variant-numeric:tabular-nums}.right{text-align:right}.nowrap{white-space:nowrap}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.ico{width:18px;height:18px;flex:0 0 18px}

/* ---- Layout shell ---- */
.app{display:grid;grid-template-columns:var(--side-w) minmax(0,1fr);min-height:100vh}
.side{position:sticky;top:0;height:100vh;display:flex;flex-direction:column;background:var(--side-bg);color:var(--side-ink);border-right:1px solid var(--line);padding:18px 12px 12px;overflow:hidden;z-index:60}
.side-brand{display:flex;align-items:center;gap:11px;padding:4px 8px 16px;border-bottom:1px solid var(--line);margin-bottom:10px}
.brand-mark{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:var(--hero-grad);color:#fff;font-weight:800;font-size:13px;letter-spacing:.04em;box-shadow:0 6px 16px rgba(37,99,235,.25)}
.side-brand b{display:block;font-size:14.5px;line-height:1.2;color:var(--side-ink)}.side-brand small{font-size:11.5px;color:var(--side-muted)}
.side-nav{flex:1;overflow-y:auto;padding:2px 2px 12px;scrollbar-width:thin}
.nav-group{margin-bottom:4px}
.nav-head{width:100%;display:flex;align-items:center;gap:10px;padding:10px 10px;border:0;background:none;border-radius:10px;cursor:pointer;
  font:700 11.5px/1.2 Inter,system-ui,sans-serif;letter-spacing:.08em;text-transform:uppercase;color:var(--side-muted)}
.nav-head:hover{background:var(--side-hover)}
.nav-head .dot{width:8px;height:8px;border-radius:50%;background:var(--scope-ring);flex:0 0 8px}
.nav-head .chev{margin-left:auto;width:16px;height:16px;transition:transform .2s}
.nav-head[aria-expanded=true]{color:var(--side-ink)}.nav-head[aria-expanded=true] .chev{transform:rotate(180deg)}
.nav-items{padding:2px 0 8px}
.nav-items a{display:flex;align-items:center;gap:11px;padding:8px 10px 8px 12px;margin:1px 0;border-radius:10px;color:var(--side-ink);font-weight:550;font-size:13.5px;text-decoration:none}
.nav-items a .ico{color:var(--side-muted)}
.nav-items a:hover{background:var(--side-hover)}
.nav-items a.active{background:var(--scope-tint);color:var(--scope-ring);font-weight:700}
.nav-items a.active .ico{color:var(--scope-ring)}
.nav-items a em{margin-left:auto;font-style:normal;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:var(--scope-ring);color:#fff;font-size:11px;font-weight:700;display:grid;place-items:center}
.side-foot{border-top:1px solid var(--line);padding:10px 8px 2px;font-size:11px;color:var(--side-muted)}
.side-close{display:none}
.side-scrim{display:none}

.workspace{min-width:0;display:flex;flex-direction:column}
.app-header{position:sticky;top:0;z-index:40;display:flex;align-items:center;gap:12px;height:var(--bar-h);padding:0 28px;background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:saturate(1.4) blur(8px);border-bottom:1px solid transparent}
.app-header .crumbs{font-size:12.5px;color:var(--muted);display:flex;gap:8px;align-items:center;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.app-header .crumbs b{color:var(--ink);font-weight:650}
.menu-btn{display:none;width:40px;height:40px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);cursor:pointer;place-items:center}
.menu-btn svg{width:20px;height:20px}
.hdr-right{margin-left:auto;display:flex;align-items:center;gap:10px}
.bell{position:relative;width:40px;height:40px;border-radius:10px;display:grid;place-items:center;color:var(--ink-2);border:1px solid var(--line);background:var(--surface)}
.bell:hover{text-decoration:none;background:var(--surface-2)}
.bell em{position:absolute;top:-5px;right:-5px;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--red);color:#fff;font:700 10.5px/18px Inter,sans-serif;font-style:normal;text-align:center}

/* Account popover */
.acct{position:relative}
.acct>summary{list-style:none;display:flex;align-items:center;gap:10px;cursor:pointer;padding:4px 6px 4px 4px;border-radius:12px;border:1px solid var(--line);background:var(--surface)}
.acct>summary::-webkit-details-marker{display:none}
.acct>summary:hover{background:var(--surface-2)}
.avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--hero-grad);color:#fff;font-weight:750;font-size:12.5px;letter-spacing:.02em;flex:0 0 34px}
.avatar.lg{width:46px;height:46px;flex-basis:46px;font-size:15px}
.acct-meta{display:flex;flex-direction:column;line-height:1.2;text-align:left;max-width:180px}
.acct-meta b{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.acct-meta span{font-size:11.5px;color:var(--muted)}
.acct .chev{width:16px;height:16px;color:var(--muted)}
.acct-pop{position:absolute;right:0;top:52px;z-index:70;width:290px;background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow-lg);padding:14px}
.acct-id{display:flex;gap:12px;align-items:center;padding-bottom:12px;border-bottom:1px solid var(--line)}
.acct-id b{display:block}.acct-id small{display:block;line-height:1.35}
.acct-sec{padding:12px 0;border-bottom:1px solid var(--line)}
.acct-sec h4{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-bottom:8px}
.swatches{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.swatches form{margin:0}
.swatch{width:100%;display:flex;flex-direction:column;align-items:center;gap:4px;padding:6px 2px;border:1px solid var(--line);border-radius:10px;background:var(--surface);cursor:pointer;font:600 10.5px/1.2 Inter,sans-serif;color:var(--ink-2)}
.swatch i{width:20px;height:20px;border-radius:50%;display:block;border:2px solid rgba(255,255,255,.7);box-shadow:0 0 0 1px var(--line)}
.swatch.on{border-color:var(--brand-600);box-shadow:0 0 0 2px var(--brand-100)}
.acct-links a{display:flex;gap:10px;align-items:center;padding:9px 8px;border-radius:9px;color:var(--ink);font-weight:550}
.acct-links a:hover{background:var(--surface-2);text-decoration:none}
.acct-links a.logout{color:var(--danger-fg)}

.main{min-width:0;padding:22px 32px 56px;max-width:1480px;width:100%}

/* ---- Flash ---- */
.flash{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border-radius:12px;margin:0 0 14px;font-weight:550;border:1px solid transparent}
.flash.success{background:var(--ok-bg);color:var(--ok-fg);border-color:color-mix(in srgb,var(--ok-fg) 20%,transparent)}
.flash.danger{background:var(--danger-bg);color:var(--danger-fg);border-color:color-mix(in srgb,var(--danger-fg) 20%,transparent)}
.flash.info{background:var(--info-bg);color:var(--info-fg);border-color:color-mix(in srgb,var(--info-fg) 20%,transparent)}

/* ---- Workspace hero ---- */
.workspace-hero{position:relative;overflow:hidden;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:20px;align-items:center;padding:24px 28px;margin:0 0 var(--gap);border-radius:var(--r-xl);background:var(--hero-grad);color:#fff;box-shadow:var(--shadow)}
.workspace-hero::after{content:"";position:absolute;right:-60px;top:-80px;width:260px;height:260px;border-radius:50%;background:rgba(255,255,255,.08);pointer-events:none}
.hero-eyebrow{font-size:11px;font-weight:750;letter-spacing:.12em;text-transform:uppercase;opacity:.8;margin-bottom:6px}
.workspace-hero h2{color:#fff;font-size:26px;font-weight:800;margin:0 0 4px}
.workspace-hero p{margin:0;opacity:.88;max-width:640px}
.hero-metrics{display:flex;gap:10px;margin:0;flex-wrap:wrap;justify-content:flex-end;position:relative;z-index:1}
.hero-metrics div{min-width:104px;padding:10px 14px;border-radius:12px;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.18)}
.hero-metrics dt{font-size:11px;opacity:.82;font-weight:600}.hero-metrics dd{margin:2px 0 0;font-size:22px;font-weight:800;font-variant-numeric:tabular-nums}
.hero-actions{display:flex;gap:10px;margin-top:14px;flex-wrap:wrap}
.hero-actions .btn{background:#fff;color:var(--brand-800)}.hero-actions .btn.ghost{background:rgba(255,255,255,.14);color:#fff;border-color:rgba(255,255,255,.3)}

/* ---- Page head (non-hero pages) ---- */
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin:4px 0 18px;flex-wrap:wrap}
.page-head .eyebrow{font-size:11px;font-weight:750;letter-spacing:.12em;text-transform:uppercase;color:var(--scope-ring);margin-bottom:4px}
.page-head p{margin:4px 0 0;color:var(--muted)}
.page-actions{display:flex;gap:10px;flex-wrap:wrap}
.back-link{display:inline-flex;align-items:center;gap:6px;font-weight:600;color:var(--muted);margin-bottom:10px}

/* ---- Cards ---- */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);padding:var(--pad);box-shadow:var(--shadow);margin-bottom:var(--gap);min-width:0}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 14px;flex-wrap:wrap}
.card-head p{margin:2px 0 0;color:var(--muted);font-size:13px}
.card.flush{padding:0}.card.flush>.card-head{padding:var(--pad) var(--pad) 0}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--gap)}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--gap)}
.grid2>.card,.grid3>.card{margin-bottom:0}
.stack-gap>*+*{margin-top:var(--gap)}

.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:var(--gap);margin-bottom:var(--gap)}
.stat-card{display:flex;gap:14px;align-items:center;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);padding:18px 20px;box-shadow:var(--shadow);min-width:0;color:var(--ink);text-decoration:none;transition:transform .12s,box-shadow .12s}
a.stat-card:hover{text-decoration:none;transform:translateY(-1px);box-shadow:var(--shadow-lg)}
.stat-icon{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;background:var(--scope-tint);color:var(--scope-ring);flex:0 0 44px}
.stat-icon .ico{width:22px;height:22px}
.stat-card strong{display:block;font-size:24px;font-weight:800;line-height:1.1;font-variant-numeric:tabular-nums}
.stat-card span{display:block;font-size:13px;color:var(--muted);font-weight:550}
.stat-card.alert .stat-icon{background:var(--danger-bg);color:var(--danger-fg)}
.stat-card.warn .stat-icon{background:var(--warn-bg);color:var(--warn-fg)}

/* ---- Buttons ---- */
.btn,button.btn,a.btn{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:6px;height:40px;min-height:40px;padding:0 16px;border:1px solid transparent;border-radius:10px;background:var(--brand-600);color:#fff;font:600 13.5px/1 Inter,system-ui,sans-serif;text-decoration:none;cursor:pointer;white-space:nowrap;transition:background .15s,border-color .15s,box-shadow .15s,transform .05s}
.btn:hover{background:var(--brand-700);text-decoration:none}.btn:active{transform:translateY(1px)}
.btn:focus-visible,.nav-head:focus-visible,.nav-items a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--brand-500);outline-offset:2px}
.btn.secondary{background:var(--surface);color:var(--brand-800);border-color:var(--line)}.btn.secondary:hover{background:var(--surface-2);border-color:var(--brand-100)}
.btn.danger{background:#dc2626}.btn.danger:hover{background:#b91c1c}
.btn.success{background:#059669}.btn.success:hover{background:#047857}
.btn.ghost{background:transparent;color:var(--brand-700);border-color:transparent}
.btn.small,td .btn{height:34px;min-height:34px;padding:0 14px;font-size:13px}
.btn .ico{width:16px;height:16px;flex-basis:16px}
.btn[disabled]{opacity:.6;cursor:not-allowed}
.actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.actions form{margin:0;display:inline-flex}

/* ---- Badges ---- */
.badge{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:999px;background:var(--info-bg);color:var(--info-fg);font-size:11.5px;font-weight:650;white-space:nowrap;line-height:1.5}
.badge.ok{background:var(--ok-bg);color:var(--ok-fg)}.badge.warn{background:var(--warn-bg);color:var(--warn-fg)}.badge.danger{background:var(--danger-bg);color:var(--danger-fg)}
.badge.neutral{background:var(--surface-2);color:var(--muted);border:1px solid var(--line)}
.badge-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}

/* ---- Forms ---- */
label{font-weight:600;font-size:13px;color:var(--ink-2)}
.field{display:grid;gap:6px;min-width:0}
.field>small{font-weight:500}
input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea{width:100%;min-height:var(--control-h);padding:9px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font:500 14px/1.4 Inter,system-ui,sans-serif}
input[type=file]{width:100%;padding:8px;border:1px dashed var(--line);border-radius:10px;background:var(--surface-2);color:var(--ink-2);font:500 13px Inter,sans-serif}
textarea{min-height:96px;resize:vertical}
input:focus,select:focus,textarea:focus{border-color:var(--brand-500);box-shadow:0 0 0 3px var(--brand-100);outline:0}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 18px}
.form-grid.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.form-grid.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.form-grid .full{grid-column:1/-1}
.form-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;padding-top:6px}
.form-section{padding:16px 0;border-top:1px solid var(--line)}.form-section:first-child{border-top:0;padding-top:0}
.form-section h3{margin-bottom:12px}
.check{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);font-weight:550;cursor:pointer;margin:0 8px 8px 0}
.check input{width:16px;height:16px;accent-color:var(--brand-600)}
.help{font-size:12.5px;color:var(--muted);font-weight:500}
.td-row-form{display:grid;grid-template-columns:minmax(180px,1.4fr) minmax(160px,1.2fr) minmax(140px,1fr) minmax(140px,1fr) auto;gap:14px;align-items:end}

/* ---- Tables (TechDiscovery standard) ---- */
.table-card{padding:0;overflow:hidden}
.table-card>.card-head{padding:var(--pad) var(--pad) 0;margin-bottom:12px}
.table-toolbar{display:flex;align-items:flex-end;gap:12px;padding:0 var(--pad) 14px;flex-wrap:wrap}
.table-toolbar .tb-search{flex:1 1 260px;max-width:420px;position:relative}
.table-toolbar .tb-search .ico{position:absolute;left:12px;top:12px;color:var(--faint);width:18px;height:18px}
.table-toolbar .tb-search input{padding-left:38px}
.table-toolbar .tb-date{display:grid;gap:4px;font-size:11.5px;font-weight:650;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;width:160px}
.table-toolbar .tb-reset{margin-left:auto}
.table-toolbar .tb-count{font-size:12.5px;color:var(--muted);align-self:center}
.table-wrap{overflow-x:auto;border-top:1px solid var(--line)}
table{width:100%;border-collapse:collapse}
th{background:var(--surface-2);color:var(--muted);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;white-space:nowrap;text-align:left;padding:11px 14px;border-bottom:1px solid var(--line)}
td{padding:12px 14px;border-bottom:1px solid var(--line-2);text-align:left;font-size:13.5px;vertical-align:middle}
tbody tr:last-child td{border-bottom:0}
tbody tr:hover td{background:color-mix(in srgb,var(--scope-tint) 45%,transparent)}
td b{font-weight:650}td small{display:block;font-size:12px;line-height:1.35}
td.num,th.num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
th.cell-actions,td.cell-actions{text-align:right;white-space:nowrap;width:1%}
td.cell-actions .actions{justify-content:flex-end;flex-wrap:nowrap}
td.empty{text-align:center;color:var(--muted);padding:28px 14px}
tr.no-match td{text-align:center;color:var(--muted);padding:24px}
tfoot td{background:var(--brand-50);border-top:2px solid var(--brand-100);color:var(--brand-800);font-weight:800}
.table-link{font-weight:650}
.inline-input{min-height:34px!important;height:34px;padding:5px 10px!important;font-size:13px!important;max-width:220px}
table.plain td,table.plain th{padding:9px 0;background:none}
table.plain tbody tr:hover td{background:none}

/* ---- Detail lists ---- */
.detail-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:14px 22px;margin:0}
.detail-grid div{min-width:0}
.detail-grid dt{font-size:11.5px;font-weight:650;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.detail-grid dd{margin:3px 0 0;font-weight:600;overflow-wrap:anywhere}
.list-row{display:flex;justify-content:space-between;gap:14px;align-items:center;padding:11px 0;border-bottom:1px solid var(--line-2)}
.list-row:last-child{border-bottom:0}.list-row b{display:block;font-weight:650}.list-row small{display:block}
.money-row{display:flex;justify-content:space-between;padding:9px 0;border-bottom:1px dashed var(--line)}
.money-row:last-child{border-bottom:0}.money-row b{font-variant-numeric:tabular-nums}
.money-row.total{border-top:2px solid var(--line);border-bottom:0;margin-top:4px;padding-top:12px;font-size:15px}
.net-pay{display:flex;justify-content:space-between;align-items:center;background:var(--hero-grad);color:#fff;border:0}
.net-pay span{font-weight:700;letter-spacing:.1em;font-size:12px;opacity:.85}.net-pay strong{font-size:28px;font-weight:800}
.notice{padding:14px 16px;border-radius:12px;background:var(--info-bg);color:var(--info-fg);font-weight:550;margin:0 0 14px}
.notice.warn{background:var(--warn-bg);color:var(--warn-fg)}
.score-banner{display:flex;justify-content:space-between;align-items:center;margin-top:16px;padding:16px 18px;border-radius:14px;background:var(--scope-tint);color:var(--scope-ring);font-weight:700}
.score-banner strong{font-size:24px}
.comment{padding:14px 0;border-bottom:1px solid var(--line-2)}.comment:last-of-type{border-bottom:0}
.comment-head{display:flex;gap:10px;align-items:center;margin-bottom:6px}.comment p{white-space:pre-wrap;margin:0 0 0 44px}
.avatar.sm{width:34px;height:34px;flex-basis:34px;font-size:12px}
.empty-state{text-align:center;padding:36px 16px;color:var(--muted)}
.empty-state .ico{width:36px;height:36px;color:var(--faint);margin-bottom:8px}

/* Skill cards (appraisal) */
.skill-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:14px;margin-bottom:16px}
.skill-card{border:1px solid var(--line);border-radius:14px;padding:14px;background:var(--surface-2);display:grid;gap:10px}
.skill-card small{font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--scope-ring);font-size:10.5px}
.score-pills{display:flex;gap:6px}.score-pills label{flex:1}
.score-pills input{position:absolute;opacity:0}
.score-pills span{display:grid;place-items:center;height:38px;border:1px solid var(--line);border-radius:10px;background:var(--surface);font-weight:700;cursor:pointer}
.score-pills input:checked+span{background:var(--brand-600);color:#fff;border-color:var(--brand-600)}
.score-pills input:focus-visible+span{outline:2px solid var(--brand-500);outline-offset:2px}

/* ---- Native charts ---- */
.bars{display:grid;gap:10px}
.bar-row{display:grid;grid-template-columns:minmax(110px,180px) minmax(0,1fr) auto;gap:12px;align-items:center;font-size:13px}
.bar-track{height:10px;border-radius:999px;background:var(--surface-2);border:1px solid var(--line);overflow:hidden}
.bar-fill{height:100%;border-radius:999px;background:linear-gradient(90deg,var(--brand-500),var(--accent))}
.cols{display:flex;align-items:flex-end;gap:12px;height:170px;padding-top:10px}
.col{flex:1;display:flex;flex-direction:column;align-items:center;gap:6px;height:100%;justify-content:flex-end;min-width:0}
.col i{display:block;width:100%;max-width:46px;border-radius:8px 8px 3px 3px;background:linear-gradient(180deg,var(--brand-500),var(--brand-700));min-height:3px}
.col b{font-size:11px;font-variant-numeric:tabular-nums;color:var(--ink-2)}.col span{font-size:11.5px;color:var(--muted);font-weight:600}

/* ---- Confirm modal ---- */
.modal{position:fixed;inset:0;z-index:100;display:none;align-items:center;justify-content:center;padding:16px;background:rgba(15,23,42,.5)}
.modal.open{display:flex}
.modal-box{width:min(440px,100%);background:var(--surface);border-radius:16px;box-shadow:var(--shadow-lg);padding:22px}
.modal-box h3{margin-bottom:8px}.modal-box .form-actions{justify-content:flex-end;margin-top:14px}

/* ---- Login (TechDiscovery split screen) ---- */
.login-page{background:var(--surface)}
.login-shell{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);min-height:100vh}
.login-visual{position:relative;overflow:hidden;background:linear-gradient(135deg,#0a2259 0%,#1d4fd8 55%,#5b3fd6 100%);color:#fff;display:flex;align-items:center;padding:56px}
.login-visual::before{content:"";position:absolute;inset:auto -120px -160px auto;width:420px;height:420px;border-radius:50%;background:rgba(255,255,255,.07)}
.login-visual::after{content:"";position:absolute;left:-80px;top:-100px;width:300px;height:300px;border-radius:50%;background:rgba(6,182,212,.18)}
.login-visual-inner{position:relative;z-index:1;max-width:520px}
.login-mark{display:inline-flex;align-items:center;gap:12px;margin-bottom:40px;font-weight:750}
.login-mark .brand-mark{background:rgba(255,255,255,.16);box-shadow:none;border:1px solid rgba(255,255,255,.25)}
.login-eyebrow{font-size:12px;font-weight:750;letter-spacing:.16em;opacity:.8;margin-bottom:14px}
.login-visual h1{color:#fff;font-size:48px;line-height:1.05;font-weight:800;margin:0 0 18px}.login-visual h1 span{color:#7dd3fc}
.login-visual p{opacity:.85;font-size:16px;max-width:440px}
.login-feature-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-top:34px}
.login-feature-grid div{display:flex;flex-direction:column;gap:8px;padding:14px 12px;border-radius:14px;background:rgba(255,255,255,.09);border:1px solid rgba(255,255,255,.14);font-size:12.5px;font-weight:650}
.login-feature-grid svg{width:22px;height:22px}
.login-form-side{display:flex;align-items:center;justify-content:center;padding:40px 24px;background:var(--bg)}
.login-card{width:min(420px,100%);background:var(--surface);border:1px solid var(--line);border-radius:20px;box-shadow:var(--shadow-lg);padding:34px}
.login-kicker{font-size:11.5px;font-weight:750;letter-spacing:.14em;color:var(--brand-600);margin-bottom:8px}
.login-card h2{font-size:26px;font-weight:800;margin:0 0 6px}.login-copy{color:var(--muted);margin-bottom:22px}
.login-card .field{margin-bottom:16px}.login-card .btn{width:100%;height:46px;margin-top:6px}
.password-wrap{position:relative}.password-wrap input{padding-right:64px}
.password-toggle{position:absolute;right:8px;top:7px;height:28px;padding:0 10px;border:0;border-radius:8px;background:var(--surface-2);color:var(--brand-700);font:600 12px Inter,sans-serif;cursor:pointer}

/* ---- Letter print ---- */
.letter-page{background:#e9eef5;min-height:100vh;padding:24px}
.letter-bar{max-width:820px;margin:0 auto 14px;display:flex;gap:10px;justify-content:space-between;flex-wrap:wrap}
.letter{max-width:820px;margin:0 auto;background:#fff;color:#111827;padding:64px 72px;border-radius:6px;box-shadow:0 10px 30px rgba(15,23,42,.12);font:15px/1.65 Georgia,"Times New Roman",serif}
.letterhead{display:flex;justify-content:space-between;gap:20px;padding-bottom:18px;border-bottom:3px solid #0f3d91;margin-bottom:28px;font-family:Inter,sans-serif}
.letterhead b{font-size:20px;color:#0f3d91}.letterhead small{display:block;color:#475569;font-size:12px;line-height:1.5}
.letter .ref{font-family:Inter,sans-serif;font-size:12px;color:#475569;margin-bottom:18px}
.letter h3{font-family:Inter,sans-serif;font-size:15px;text-decoration:underline;margin:0 0 16px;color:#111827}
.letter p{margin:0 0 14px}
.sig{margin-top:56px}.sig-line{width:240px;border-top:1px solid #111827;margin-bottom:6px}
@media print{.letter-page{background:#fff;padding:0}.letter-bar{display:none}.letter{box-shadow:none;padding:24px 32px;max-width:none}}

/* ---- Tablet: drawer navigation ---- */
@media (max-width:1100px){
  .app{grid-template-columns:minmax(0,1fr)}
  .side{position:fixed;inset:0 auto 0 0;width:min(300px,86vw);height:100%;transform:translateX(-102%);visibility:hidden;transition:transform .25s ease,visibility .25s;box-shadow:var(--shadow-lg);padding-top:18px}
  body.nav-open .side{transform:none;visibility:visible}
  .side-close{display:grid;place-items:center;position:absolute;top:16px;right:12px;width:36px;height:36px;border:0;border-radius:10px;background:var(--surface-2);color:var(--ink);cursor:pointer}
  .side-close svg{width:20px;height:20px}
  .side-scrim{display:block;position:fixed;inset:0;z-index:55;background:rgba(15,23,42,.45);opacity:0;visibility:hidden;transition:opacity .25s,visibility .25s}
  body.nav-open .side-scrim{opacity:1;visibility:visible}
  .menu-btn{display:grid}
  .app-header{padding:0 20px;background:var(--surface);border-bottom-color:var(--line)}
  .main{padding:20px 20px 48px;max-width:none}
  .grid3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .td-row-form{grid-template-columns:repeat(2,minmax(0,1fr))}
  .form-grid.cols-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .workspace-hero{grid-template-columns:minmax(0,1fr)}.hero-metrics{justify-content:flex-start}
  .login-shell{grid-template-columns:minmax(0,1fr)}.login-visual{padding:36px 28px}.login-visual h1{font-size:36px}.login-feature-grid{display:none}
}

/* ---- Phone: stacked table rows, single-column forms ---- */
@media (max-width:700px){
  :root{--pad:16px;--gap:14px}
  body{font-size:15px}
  .main{padding:16px 14px 40px}
  .app-header{padding:0 12px;gap:8px}
  .app-header .crumbs{display:none}
  .acct-meta,.acct>summary .chev{display:none}
  .acct>summary{border:0;padding:0;background:none}
  .acct-pop{position:fixed;left:10px;right:10px;top:64px;width:auto}
  .card{border-radius:14px}
  .workspace-hero{padding:20px 18px;border-radius:16px}.workspace-hero h2{font-size:22px}.hero-metrics dd{font-size:20px}
  .hero-metrics div{min-width:0;flex:1 1 42%}
  .page-head h1{font-size:21px}.page-actions{width:100%}.page-actions .btn{flex:1 1 auto}
  .grid2,.grid3,.form-grid,.form-grid.cols-3,.form-grid.cols-4,.td-row-form{grid-template-columns:minmax(0,1fr)}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .stat-card{padding:14px;gap:10px;flex-direction:column;align-items:flex-start}.stat-icon{width:36px;height:36px;flex-basis:36px}.stat-card strong{font-size:21px}
  .btn{min-height:44px;height:44px}.btn.small,td .btn{min-height:40px;height:40px}
  .form-actions .btn{flex:1 1 auto}
  input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea{font-size:16px}
  .table-toolbar{display:grid;grid-template-columns:1fr 1fr;align-items:end}
  .table-toolbar .tb-search{grid-column:1/-1;max-width:none}
  .table-toolbar .tb-date{width:auto}
  .table-toolbar .tb-reset{grid-column:1/-1;margin-left:0;width:100%}
  .table-toolbar .tb-count{grid-column:1/-1}
  .table-wrap{overflow:visible}
  table.stack,table.stack tbody,table.stack tfoot{display:block}
  table.stack thead{display:none}
  table.stack tr{display:block;padding:12px var(--pad);border-bottom:1px solid var(--line)}
  table.stack tbody tr:last-child{border-bottom:0}
  table.stack tbody tr:hover td{background:none}
  table.stack td{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;padding:5px 0!important;border:0;font-size:14px;text-align:right;white-space:normal;width:auto}
  table.stack td::before{content:attr(data-label);flex:0 0 auto;max-width:45%;font-size:11.5px;font-weight:650;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);text-align:left;padding-top:2px}
  table.stack td:not([data-label])::before,table.stack td[data-label=""]::before{display:none}
  table.stack td:first-child{font-weight:650;font-size:15px}
  table.stack td:first-child::before{display:none}
  table.stack td:first-child{text-align:left}
  table.stack td:empty{display:none}
  table.stack td[colspan]{justify-content:center;text-align:center}
  table.stack td.num{text-align:right}
  table.stack td.cell-actions{justify-content:flex-start;padding-top:10px!important;margin-top:6px;border-top:1px dashed var(--line)}
  table.stack td.cell-actions::before{display:none}
  table.stack td.cell-actions .actions{flex-wrap:wrap;justify-content:flex-start;width:100%}
  table.stack td.cell-actions .actions .btn,table.stack td.cell-actions .actions form{flex:1 1 auto}
  table.stack td.cell-actions .actions form .btn{width:100%}
  table.stack td .inline-input{max-width:none}
  table.stack tfoot tr{background:var(--brand-50)}
  table.stack small{text-align:inherit}
  .bar-row{grid-template-columns:minmax(0,1fr) auto}.bar-row .bar-track{grid-column:1/-1;grid-row:2}
  .comment p{margin-left:0}
  .letter{padding:28px 22px}.letterhead{flex-direction:column}
  .login-visual{display:none}.login-form-side{padding:20px 14px}.login-card{padding:26px 20px}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
@media print{.side,.app-header,.table-toolbar,.page-actions,.cell-actions{display:none!important}.app{display:block}.main{padding:0}.card{box-shadow:none}}
.table-card>.table-toolbar:first-child{padding-top:var(--pad)}
/* ---- refinements after visual QA ---- */
.nav-head{text-align:left}
.grid2,.grid3{margin-bottom:var(--gap)}
.stat-card>div:last-child{min-width:0}
.stat-card strong{font-size:clamp(18px,1.7vw,24px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hero-actions .btn{background:#fff;color:#0f3d91;border-color:#fff}
.hero-actions .btn:hover{background:#eef4ff}
.hero-actions .btn.ghost{background:rgba(255,255,255,.14);color:#fff;border-color:rgba(255,255,255,.35)}
.swatch i[style*="#1f2937"]{box-shadow:0 0 0 1px #9ca3af}
@media (max-width:700px){
  .table-toolbar{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .table-toolbar>*{min-width:0}
  .table-toolbar input{min-width:0}
  table.stack td:first-child{display:block}
  table.stack td:first-child small{text-align:left;margin-top:2px}
  table.stack td.cell-actions>.btn,table.stack td.cell-actions>form{flex:1 1 auto}
  table.stack td.cell-actions>form .btn{width:100%}
  .stat-card strong{font-size:19px}
}
.bar-row{grid-template-columns:minmax(110px,180px) minmax(0,1fr) 118px}.bar-row b{text-align:right}
@media (max-width:700px){.bar-row{grid-template-columns:minmax(0,1fr) auto}}
.table-toolbar .tb-search input{padding-left:38px!important}

/* =====================================================================
   Release 7.1 — UI refresh
   ===================================================================== */

/* ---- Split layout: records left (~75%), form right (~25%) ---- */
.split{display:grid;grid-template-columns:minmax(0,3fr) minmax(300px,1fr);gap:var(--gap);align-items:start}
.split-main{min-width:0}
.split-side{min-width:0;position:sticky;top:calc(var(--bar-h) + 12px)}
.split-side .card{margin-bottom:var(--gap)}
.split-side .form-grid,.split-side .form-grid.cols-3,.split-side .form-grid.cols-4{grid-template-columns:minmax(0,1fr)}
.split-side .form-actions .btn{flex:1 1 auto}
.split-side .card-head h2{font-size:16px}
.side-note{font-size:12.5px;color:var(--muted);margin:-6px 0 12px}
@media (max-width:1280px){
  .split{grid-template-columns:minmax(0,1fr)}
  .split-side{position:static;order:-1}
  .split-side .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .split-side .form-grid .full,.split-side .file-wrap{grid-column:1/-1}
}
@media (max-width:700px){.split-side .form-grid{grid-template-columns:minmax(0,1fr)}}

/* ---- File picker ---- */
.file-wrap.full{grid-column:1/-1}
.file-field{display:grid;gap:6px}
.file-drop{position:relative;display:flex;align-items:center;gap:12px;min-height:58px;padding:10px 12px;border:1.5px dashed var(--line);
  border-radius:12px;background:var(--surface-2);cursor:pointer;transition:border-color .15s,background .15s;font-weight:500}
.file-drop:hover,.file-drop.drag{border-color:var(--brand-500);background:var(--brand-50)}
.file-drop:focus-within{border-color:var(--brand-500);box-shadow:0 0 0 3px var(--brand-100)}
.file-drop input[type=file]{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;padding:0;border:0}
.file-drop .file-ico{width:36px;height:36px;flex:0 0 36px;border-radius:10px;display:grid;place-items:center;background:var(--surface);color:var(--brand-600);border:1px solid var(--line)}
.file-drop .file-ico .ico{transform:rotate(180deg)}
.file-drop .file-text{min-width:0;flex:1;display:flex;flex-direction:column;line-height:1.3}
.file-drop .file-text b{font-size:13.5px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.file-drop .file-text small{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.file-drop .file-btn{pointer-events:none;flex:0 0 auto}
.file-drop.has-file{border-style:solid;border-color:var(--ok-fg);background:var(--ok-bg)}
.file-drop.has-file .file-ico{color:var(--ok-fg)}
.file-current{font-size:12.5px;color:var(--muted)}
.split-side .file-drop .file-btn{display:none}

/* ---- Tables: never scroll sideways; long values end in … with full text on hover ---- */
.table-wrap{overflow-x:hidden}
table.data{width:100%;table-layout:auto}
table.data th{overflow:hidden;text-overflow:ellipsis}
table.data td:not(.cell-actions):not(.empty):not([colspan]){max-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
table.data td:not(.cell-actions) > b,table.data td:not(.cell-actions) > small,table.data td:not(.cell-actions) > a:not(.btn),table.data td:not(.cell-actions) > span:not(.badge){display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
table.data td > .badge{max-width:100%;overflow:hidden;text-overflow:ellipsis}
table.data td.num,table.data th.num{max-width:none!important;width:1%}
table.data th.cell-actions,table.data td.cell-actions{width:1%;white-space:nowrap}
table.data td[title]{cursor:help}
@media (max-width:700px){
  table.data td:not(.cell-actions):not(.empty):not([colspan]){max-width:none;white-space:normal;overflow:visible}
  table.data td > b,table.data td > small,table.data td > a,table.data td > span:not(.badge){white-space:normal;overflow:visible}
}

/* ---- Confirm modal comment ---- */
.modal-box .field{margin-top:6px}
.modal-box textarea{min-height:84px}

/* ---- Profile ---- */
.profile-hero{position:relative;overflow:hidden;display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:22px;align-items:center;
  padding:26px 28px;margin-bottom:var(--gap);border-radius:var(--r-xl);background:var(--hero-grad);color:#fff;box-shadow:var(--shadow)}
.profile-hero::after{content:"";position:absolute;right:-70px;top:-90px;width:280px;height:280px;border-radius:50%;background:rgba(255,255,255,.08)}
.profile-hero .avatar{width:84px;height:84px;flex-basis:84px;font-size:28px;background:rgba(255,255,255,.18);border:2px solid rgba(255,255,255,.45);box-shadow:none}
.profile-hero h2{color:#fff;font-size:26px;margin:0 0 2px}
.profile-hero p{margin:0;opacity:.9}
.profile-hero .chips{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.chip{display:inline-flex;align-items:center;gap:6px;padding:4px 11px;border-radius:999px;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.25);font-size:12px;font-weight:650;color:#fff}
.chip .ico{width:14px;height:14px}
.profile-facts{position:relative;z-index:1;display:grid;grid-template-columns:repeat(2,minmax(110px,auto));gap:10px}
.profile-facts div{padding:10px 14px;border-radius:12px;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.18)}
.profile-facts dt{font-size:11px;opacity:.82;font-weight:650}.profile-facts dd{margin:2px 0 0;font-size:17px;font-weight:800}
.info-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--gap);margin-bottom:var(--gap)}
.info-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);padding:18px 20px;box-shadow:var(--shadow);min-width:0}
.info-card h3{display:flex;align-items:center;gap:10px;font-size:14px;margin-bottom:12px}
.info-card h3 .ic{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;background:var(--scope-tint);color:var(--scope-ring)}
.info-card h3 .ic .ico{width:17px;height:17px}
.kv{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 14px;margin:0}
.kv dt{color:var(--muted);font-size:13px}.kv dd{margin:0;font-weight:650;text-align:right;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.kv dd a{font-weight:650}
.leave-bars{display:grid;gap:12px}
.leave-bar-head{display:flex;justify-content:space-between;font-size:13px;margin-bottom:5px}
.leave-bar-head b{font-variant-numeric:tabular-nums}
.meter{height:8px;border-radius:999px;background:var(--surface-2);border:1px solid var(--line);overflow:hidden}
.meter i{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,var(--brand-500),var(--accent))}
.meter i.over{background:var(--red)}
@media (max-width:1100px){.info-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.profile-hero{grid-template-columns:auto minmax(0,1fr)}.profile-facts{grid-column:1/-1;grid-template-columns:repeat(4,minmax(0,1fr))}}
@media (max-width:700px){.info-grid{grid-template-columns:minmax(0,1fr)}.profile-hero{grid-template-columns:minmax(0,1fr);text-align:left;padding:20px}
  .profile-hero .avatar{width:64px;height:64px;font-size:22px}.profile-facts{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* ---- Leave decisions ---- */
.decide{display:flex;gap:8px;justify-content:flex-end}
.decide form{margin:0}
.comment-cell{color:var(--muted)}

/* ---- Config: grouped lists with inline rename ---- */
.cfg-group{margin-bottom:22px}
.cfg-group>h3{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin:0 0 10px}
.ref-row{display:flex;align-items:center;gap:8px;padding:6px 0;border-bottom:1px solid var(--line-2)}
.ref-row:last-of-type{border-bottom:0}
.ref-row form{margin:0;display:flex;gap:6px;align-items:center}
.ref-row .rename{flex:1;min-width:0}
.ref-row .rename input{min-height:34px!important;height:34px;padding:5px 10px!important;font-size:13px!important;border-color:transparent;background:transparent}
.ref-row .rename input:hover{border-color:var(--line)}
.ref-row .rename input:focus{background:var(--surface);border-color:var(--brand-500)}
.ref-row .rename .btn{display:none}
.ref-row .rename:focus-within .btn{display:inline-flex}
.ref-row.inactive .rename input{color:var(--muted);text-decoration:line-through}

/* ---- Check In / Out ---- */
.clock-card{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}

.clock-face{display:flex;align-items:center;gap:14px;min-width:0}
.clock-ico{width:46px;height:46px;flex:0 0 46px;border-radius:14px;display:grid;place-items:center;background:var(--scope-tint);color:var(--scope-ring)}
.clock-ico .ico{width:24px;height:24px}
.clock-in .clock-ico{background:var(--ok-bg);color:var(--ok-fg)}
.clock-label{font-size:11.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.clock-face b{display:block;font-size:16px}.clock-face small{display:block}
.clock-card form{margin:0}.clock-card .btn{min-width:130px;height:44px}
.split-side .clock-card{flex-direction:column;align-items:stretch}.split-side .clock-card .btn{width:100%}
.steps{margin:0;padding-left:20px;display:grid;gap:8px;font-size:13.5px}.steps b{margin-right:4px}.steps span{color:var(--muted)}

/* ---- HR request conversation ---- */
.comment-head b{display:block;line-height:1.2}.comment-head small{display:block;margin-top:2px}
.status-row{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap}
.status-row .field{width:220px;flex:0 0 auto}
.close-card{border-left:4px solid var(--faint)}
/* file picker never widens its form column */
.file-wrap,.file-field,.file-drop,.form-grid>*{min-width:0}
.file-drop{max-width:100%;overflow:hidden}
/* short columns are sized to their content and never truncated (set by smc.js) */
@media (min-width:701px){
  table.data td.fit,table.data th.fit{max-width:none!important;width:1%;white-space:nowrap}
  table.data td.fit > b,table.data td.fit > small,table.data td.fit > a,table.data td.fit > span:not(.badge){overflow:visible}
}
@media (max-width:700px){.td-row-form{grid-template-columns:minmax(0,1fr)!important}.td-row-form .btn{width:100%}}
.ro-note{display:flex;gap:10px;align-items:center}.ro-note .ico{flex:0 0 18px}

/* ---- Users & Access grid ---- */
.access-grid th.grid-col,.access-grid td.grid-col{text-align:center;width:1%;white-space:nowrap}
.access-grid th.grid-col{font-size:10.5px;white-space:normal;line-height:1.25;min-width:84px;max-width:110px!important}
.tick{display:inline-grid;place-items:center;cursor:pointer;position:relative}
.tick input{position:absolute;opacity:0;width:26px;height:26px;margin:0;cursor:pointer}
.tick span{width:24px;height:24px;border-radius:7px;border:1.5px solid var(--line);background:var(--surface);display:grid;place-items:center;transition:all .12s}
.tick input:checked + span{background:var(--brand-600);border-color:var(--brand-600)}
.tick input:checked + span::after{content:"";width:6px;height:11px;border:solid #fff;border-width:0 2.5px 2.5px 0;transform:rotate(45deg) translate(-1px,-1px)}
.tick input:focus-visible + span{outline:2px solid var(--brand-500);outline-offset:2px}
.tick input:disabled + span{opacity:.55;cursor:not-allowed}
.team-only{display:block;font-size:10.5px;color:var(--scope-ring);font-weight:650;margin-top:3px}
.inactive-row td{opacity:.6}
.grid-save{position:sticky;bottom:0;display:flex;gap:14px;align-items:center;justify-content:space-between;padding:14px var(--pad);
  background:color-mix(in srgb,var(--surface) 94%,transparent);backdrop-filter:blur(6px);border-top:1px solid var(--line);flex-wrap:wrap}
@media (max-width:700px){
  .access-grid td.grid-col{justify-content:space-between;width:auto;text-align:right}
  .access-grid th.grid-col{max-width:none!important}
  .grid-save .btn{width:100%}
}
@media (min-width:701px){
  .access-grid table.data th.grid-col{white-space:normal!important;max-width:92px!important;min-width:70px;width:1%;line-height:1.25}
  .access-grid table.data td:first-child{min-width:200px}
  .access-grid table.data td:nth-child(2){min-width:150px}
}
@media (min-width:701px){
  .access-grid table.data th.grid-col{min-width:104px!important;max-width:118px!important;overflow:visible;text-overflow:clip;letter-spacing:.04em}
}
@media (min-width:701px) and (max-width:1280px){
  .access-grid table.data th.grid-col{min-width:82px!important;max-width:92px!important;font-size:9.5px;letter-spacing:.02em}
  .access-grid table.data td:first-child{min-width:140px}
  .access-grid table.data td:nth-child(2){min-width:0}
}

/* =====================================================================
   Release 7.3
   ===================================================================== */
/* Form alignment: every field sits at the top of its row; hints below never push neighbours down */
.form-grid{align-items:start}
.field{align-content:start}
.field > input:not([type=checkbox]):not([type=radio]):not([type=file]),.field > select{height:var(--control-h)}
.field > small,.field > a,.field > .help{line-height:1.35}
/* bell pulse when a new notification arrives */
@keyframes smc-pulse{0%{transform:scale(1)}30%{transform:scale(1.35)}60%{transform:scale(.95)}100%{transform:scale(1)}}
.bell em.pulse{animation:smc-pulse .6s ease}
.masked{letter-spacing:.12em;color:var(--faint)}
.num.nowrap,td.nowrap{white-space:nowrap!important}
/* ---- Share with ---- */
.seg{display:inline-flex;flex-wrap:wrap;gap:4px;padding:4px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2)}
.seg-opt{position:relative;cursor:pointer;margin:0}
.seg-opt input{position:absolute;opacity:0}
.seg-opt span{display:block;padding:7px 14px;border-radius:9px;font-weight:600;font-size:13px;color:var(--ink-2)}
.seg-opt input:checked + span{background:var(--surface);color:var(--brand-700);box-shadow:var(--shadow-sm)}
.seg-opt input:focus-visible + span{outline:2px solid var(--brand-500);outline-offset:2px}
.people-pick{margin-top:10px;border:1px solid var(--line);border-radius:12px;padding:10px;background:var(--surface)}
.people-tools{display:flex;gap:10px;align-items:center;margin-bottom:8px;flex-wrap:wrap}
.people-tools input[type=search]{flex:1;min-width:140px}
.people-list{max-height:240px;overflow:auto;display:grid;gap:2px}
.person-opt{display:flex;gap:10px;align-items:center;padding:6px 8px;border-radius:9px;cursor:pointer;font-weight:500;margin:0}
.person-opt:hover{background:var(--surface-2)}
.person-opt input{width:16px;height:16px;accent-color:var(--brand-600);flex:0 0 16px}
.person-opt b{display:block;font-size:13px}.person-opt small{display:block;font-size:11.5px}
.split-side .seg{display:flex}.split-side .seg-opt{flex:1}.split-side .seg-opt span{text-align:center;padding:7px 6px}

/* ===== Release 7.3: Accountant › Reports ===== */
.rpt-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:var(--gap)}
.rpt-card{position:relative;display:flex;flex-direction:column;gap:6px;min-width:0;padding:20px 20px 18px;border-radius:var(--r-lg);background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow);color:var(--ink);text-decoration:none;overflow:hidden;transition:transform .14s,box-shadow .14s,border-color .14s}
.rpt-card::before{content:"";position:absolute;inset:0 0 auto 0;height:4px;background:linear-gradient(90deg,#14306e,#2fb5a3)}
.rpt-card:hover,.rpt-card:focus-visible{transform:translateY(-2px);box-shadow:var(--shadow-lg);border-color:#9fd9cf}
.rpt-card-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}
.rpt-ico{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:linear-gradient(135deg,#eaf7f5,#e6ecf8);color:#14306e}
.rpt-ico .ico{width:21px;height:21px}
.rpt-go{color:var(--faint);font-size:18px;transition:transform .14s,color .14s}.rpt-card:hover .rpt-go{transform:translateX(3px);color:#0f766e}
.rpt-card h2{margin:0;font-size:16px;font-weight:750;letter-spacing:-.01em}
.rpt-card>p{margin:0;color:var(--muted);font-size:13px;line-height:1.45;min-height:38px}
.rpt-fig{margin-top:10px;padding-top:12px;border-top:1px dashed var(--line);min-width:0}
.rpt-fig span,.rpt-fig2 span{display:block;font-size:11px;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);font-weight:650}
.rpt-fig strong{display:block;font-size:22px;font-weight:800;color:#14306e;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.25}
.rpt-fig small{color:var(--muted);font-size:12px}
.rpt-fig2{display:flex;justify-content:space-between;gap:8px;align-items:baseline;font-size:13px}
.rpt-fig2 b{font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body[data-theme=dark] .rpt-fig strong,body[data-theme=dark] .rpt-ico{color:#bfd3ff}
body[data-theme=dark] .rpt-ico{background:#223047}

.rpt-period{display:flex;flex-wrap:wrap;gap:12px 18px;align-items:center;padding:14px 16px}
.rpt-presets{display:flex;flex-wrap:wrap;gap:6px}
.rpt-presets a{padding:7px 12px;border-radius:999px;border:1px solid var(--line);color:var(--ink-2);text-decoration:none;font-size:13px;font-weight:600;background:var(--surface)}
.rpt-presets a:hover{border-color:#9fd9cf}
.rpt-presets a.on{background:#14306e;border-color:#14306e;color:#fff}
.rpt-custom{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.rpt-custom label{display:flex;gap:6px;align-items:center;font-size:12.5px;color:var(--muted);font-weight:600}
.rpt-custom input{height:36px;width:auto;min-width:0}
.rpt-range,.rpt-asof{margin-left:auto;display:flex;gap:6px;align-items:center;color:var(--ink-2);font-size:13px;font-weight:600}
.rpt-asof{margin-left:0}.rpt-range .ico,.rpt-asof .ico{width:16px;height:16px;color:#0f766e}

.rpt-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--gap);margin:0 0 var(--gap)}
.rpt-kpis>div{background:var(--surface);border:1px solid var(--line);border-top:3px solid #2fb5a3;border-radius:var(--r);padding:14px 16px;box-shadow:var(--shadow-sm);min-width:0}
.rpt-kpis>div:first-child{border-top-color:#14306e}
.rpt-kpis dt{font-size:11px;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);font-weight:650}
.rpt-kpis dd{margin:4px 0 2px;font-size:clamp(17px,1.6vw,22px);font-weight:800;color:var(--ink);font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rpt-kpis small{color:var(--muted);font-size:12px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.rpt-charts{margin-bottom:var(--gap)}.rpt-charts>.card{margin-bottom:0}.rpt-charts:not(.grid2)>.card{margin-bottom:0}
.rpt-chart{margin:0}
.rpt-chart figcaption{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;font-weight:750;font-size:14px;margin-bottom:12px;color:var(--ink)}
.rpt-chart.empty p{color:var(--muted);margin:0}
.rpt-legend{font-weight:600;font-size:12px;color:var(--muted);display:flex;gap:6px;align-items:center}
.rpt-legend i{display:inline-block;width:10px;height:10px;border-radius:3px;background:#14306e}.rpt-legend i.b{background:#2fb5a3;margin-left:8px}
.rpt-cols{display:flex;align-items:stretch;gap:8px;height:200px;overflow-x:auto;padding-bottom:2px}
.rpt-col{flex:1 1 0;min-width:34px;display:flex;flex-direction:column;align-items:center;gap:4px}
.rpt-col .bar-wrap{flex:1;width:100%;display:flex;align-items:flex-end;justify-content:center}
.rpt-col .bar{width:min(42px,80%);min-height:2px;border-radius:6px 6px 2px 2px;background:linear-gradient(180deg,#2fb5a3,#14306e)}
.rpt-col .val{font-size:10.5px;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.rpt-col .lab{font-size:11.5px;color:var(--ink-2);font-weight:600;white-space:nowrap}
.rpt-rows{display:grid;gap:8px}
.rpt-row{display:grid;grid-template-columns:minmax(90px,30%) 1fr auto;gap:10px;align-items:center;font-size:13px;min-width:0}
.rpt-row .lab{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ink-2);font-weight:600}
.rpt-row .track{position:relative;height:14px;border-radius:7px;background:var(--surface-2);overflow:hidden;display:grid;gap:2px}
.rpt-row .bar{height:100%;min-width:2px;border-radius:7px;background:linear-gradient(90deg,#14306e,#2fb5a3)}
.rpt-row .track:has(.bar.b){height:18px}.rpt-row .bar.b{background:#2fb5a3}
.rpt-row .val{font-variant-numeric:tabular-nums;font-weight:700;white-space:nowrap;font-size:12.5px}

.rpt-wrap{border-top:0;overflow-x:hidden}
/* Report tables always fit the card: fixed columns, long values end in "…" (full value on hover). */
table.rpt-table{table-layout:fixed;width:100%}
table.rpt-table th{white-space:normal;line-height:1.25;vertical-align:bottom;overflow:hidden;text-overflow:ellipsis;word-break:normal;overflow-wrap:anywhere}
table.rpt-table td,table.rpt-table td.num,table.rpt-table td.fit{max-width:none!important;width:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
table.rpt-table th,table.rpt-table th.num,table.rpt-table th.fit{max-width:none!important;width:auto;white-space:normal!important;overflow-wrap:normal;word-break:normal}
table.rpt-table td.empty{white-space:normal}
table.rpt-table.dense{font-size:12.5px}
table.rpt-table.dense th,table.rpt-table.dense td{padding-left:6px;padding-right:6px}
table.rpt-table.dense th{font-size:10px;letter-spacing:.03em}
table.rpt-table tr.hl td{background:var(--warn-bg)}
table.rpt-table tfoot td{font-weight:800;background:var(--surface-2);border-top:2px solid var(--line)}
.rpt-note{display:flex;gap:8px;align-items:flex-start;color:var(--muted);font-size:13px;margin:0 0 10px}.rpt-note .ico{width:16px;height:16px;flex:0 0 16px;margin-top:2px}
.rpt-switch{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
.rpt-switch a{display:inline-flex;gap:6px;align-items:center;padding:7px 12px;border-radius:10px;border:1px solid var(--line);background:var(--surface);color:var(--ink-2);text-decoration:none;font-size:13px;font-weight:600}
.rpt-switch a:hover{border-color:#9fd9cf;color:#0f766e}.rpt-switch .ico{width:15px;height:15px}
@media (max-width:1100px){.rpt-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:640px){.rpt-kpis{grid-template-columns:1fr 1fr;gap:10px}.rpt-range{margin-left:0}.rpt-row{grid-template-columns:minmax(70px,34%) 1fr auto}.rpt-card>p{min-height:0}}
.rpt-card:hover,.rpt-card:hover *{text-decoration:none}
.rpt-cols{justify-content:center}.rpt-col{flex:0 1 84px}
@media (max-width:700px){
  table.rpt-table.stack colgroup{display:none}
  table.rpt-table.stack td,table.rpt-table.stack td.num{white-space:normal;overflow:visible;text-overflow:clip;display:flex}
  table.rpt-table.stack tfoot td:empty{display:none}
}

/* ===== Release 7.4: phone cards (stacked tables) — label on the left, value on the right, never overlapping ===== */
@media (max-width:700px){
  table.stack td,table.stack td.num,table.stack td.fit,table.stack td.nowrap,table.stack td.cell-actions,
  table.data.stack td:not(.cell-actions):not(.empty):not([colspan]){width:auto!important;max-width:none!important;min-width:0;overflow:visible!important;text-overflow:clip;white-space:normal!important}
  table.stack td{display:grid!important;grid-template-columns:minmax(88px,38%) minmax(0,1fr);column-gap:14px;align-items:start;text-align:right}
  table.stack td::before{grid-column:1;max-width:none;white-space:normal;line-height:1.3;overflow-wrap:break-word}
  table.stack td > *{grid-column:2;min-width:0;justify-self:end;max-width:100%}
  table.stack td > b,table.stack td > small,table.stack td > a:not(.btn),table.stack td > span:not(.badge){white-space:normal!important;overflow:visible!important;text-overflow:clip;overflow-wrap:anywhere;text-align:right}
  /* rows with no label (the title line, empty cells, action buttons) use the full width */
  table.stack td:first-child,table.stack td:not([data-label]),table.stack td[data-label=""],table.stack td[colspan]{grid-template-columns:minmax(0,1fr)}
  table.stack td:first-child > *,table.stack td:not([data-label]) > *,table.stack td[data-label=""] > *{grid-column:1;justify-self:start;text-align:left}
  table.stack td:first-child > b,table.stack td:first-child > small,table.stack td:first-child > a:not(.btn),table.stack td:first-child > span:not(.badge){text-align:left}
  table.stack td.cell-actions{grid-template-columns:minmax(0,1fr)}
  table.stack td.cell-actions::before{display:none}
  table.stack td.cell-actions > *{grid-column:1;justify-self:stretch}
  table.stack td.cell-actions .actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-start}
}

/* ===== Release 7.4: date and time boxes on iPhone stay inside their card ===== */
input[type=date],input[type=time],input[type=datetime-local],input[type=month]{min-width:0;max-width:100%;width:100%;box-sizing:border-box;-webkit-appearance:none;appearance:none;text-align:left;display:block}
input[type=date]::-webkit-date-and-time-value,input[type=time]::-webkit-date-and-time-value,input[type=datetime-local]::-webkit-date-and-time-value{text-align:left;margin:0}
.rpt-custom input[type=date]{width:auto;display:inline-block}
.table-toolbar .tb-date input[type=date]{width:100%;min-width:0}
@media (max-width:700px){
  .table-toolbar{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important}
  .table-toolbar .tb-date{min-width:0;width:100%}
  .table-toolbar .tb-date input[type=date]{min-height:44px}
  .rpt-custom{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);width:100%}
  .rpt-custom label{min-width:0;display:grid;gap:4px}
  .rpt-custom input[type=date]{width:100%;display:block;min-height:44px}
  .rpt-custom .btn{grid-column:1/-1}
}
@media (max-width:700px){
  table.stack td{overflow-wrap:anywhere;word-break:normal}
  .stat-card>div:last-child{width:100%;max-width:100%;min-width:0}
  .stat-card strong{white-space:normal;overflow-wrap:anywhere;font-size:clamp(16px,4.6vw,21px)}
}
@supports (-webkit-touch-callout:none){
  input[type=date][data-empty]::before{content:"Any date";color:var(--faint)}
  input[type=date][data-empty]:focus::before{content:""}
}
@media (max-width:700px){
  /* an action cell that only holds "—" (nothing to do) is hidden on phones */
  table.stack td.cell-actions:has(> .muted:only-child),table.stack td.cell-actions:has(> .actions > .muted:only-child){display:none!important}
}

/* Release 7.4.1: Back is a real button, matching the others */
.btn.back-link{display:inline-flex;width:auto;color:var(--brand-800);font-weight:600;margin:0 0 14px;gap:6px}
@media (max-width:700px){.btn.back-link{flex:0 0 auto}}

/* Release 7.4.1: more breathing room between the last field and the buttons below it */
.form-actions{padding-top:0;margin-top:22px}
.modal-box .form-actions{margin-top:18px}
.field + .btn,.field + button.btn,.form-grid + .btn,.form-grid + button.btn,textarea + .btn,.field + .actions{margin-top:20px}
.status-row .btn,.status-row button.btn,.td-row-form .btn{margin-top:0}
@media (max-width:700px){.form-actions{margin-top:20px}}
.field .hint{display:block;margin-top:4px;color:var(--muted);font-size:12.5px}
@media (min-width:701px){.split-main table.data td:first-child{min-width:170px}}
[data-scope=desk]{--scope-ring:#0f766e;--scope-tint:#e6f6f3;--hero-grad:linear-gradient(125deg,#14306e,#0f766e 70%,#2fb5a3)}

/* ===== Release 7.5: Front Desk ===== */
.fd-group{font-size:13px;font-weight:750;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin:6px 0 12px}
.fd-cards{margin-bottom:26px}
.fd-card.warn .rpt-ico{background:var(--warn-bg);color:var(--warn-fg)}.fd-card.alert .rpt-ico{background:var(--danger-bg);color:var(--danger-fg)}
.fd-hint{color:var(--danger-fg);font-weight:700}
.fd-sub{margin:22px 0 10px;padding-top:16px;border-top:1px dashed var(--line)}.fd-sub h3{margin:0 0 4px;font-size:15px}.fd-sub p{margin:0;color:var(--muted);font-size:13px}
.fd-list{list-style:none;margin:0;padding:0;display:grid;gap:8px}.fd-list li{display:flex;justify-content:space-between;gap:10px;font-size:13.5px}.fd-list small{color:var(--muted)}
.fd-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.fd-summary>div{border:1px solid var(--line);border-radius:var(--r);padding:12px 14px;min-width:0}
.fd-summary span{display:block;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:650}
.fd-summary b{display:block;font-size:20px;font-weight:800;margin:4px 0 2px;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fd-summary small{color:var(--muted);font-size:12px}
.check-list{display:grid;gap:8px}
tr.is-selected td{background:var(--scope-tint)}
tr.is-void td{opacity:.6}
.text-bad{color:var(--danger-fg)}
.seg-opt{display:inline-flex;align-items:center;gap:6px;font-weight:600;font-size:13.5px;padding:6px 10px;border-radius:999px;cursor:pointer}
@media (max-width:700px){.fd-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}
.check-list .check{width:100%}
@media (max-width:700px){
  .fd-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .fd-card{padding:14px 14px 12px;gap:4px}
  .fd-card>p,.fd-card .rpt-go{display:none}
  .fd-card .rpt-ico{width:36px;height:36px}
  .fd-card h2{font-size:14px;line-height:1.25}
  .fd-card .rpt-fig{margin-top:6px;padding-top:8px}
  .fd-card .rpt-fig strong{font-size:18px}
  .fd-card .rpt-fig small{font-size:11.5px;line-height:1.3;display:block}
}

/* Release 7.6: Front Desk is a single menu link */
.nav-head.nav-link{text-decoration:none;color:var(--side-muted)}
.nav-head.nav-link:hover{color:var(--side-ink)}
.nav-head.nav-link.active{background:var(--scope-tint);color:var(--side-ink)}
.menu-order{list-style:none;margin:0;padding:0;display:grid;gap:8px;max-width:640px}
.menu-order li{display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:var(--r);padding:8px 10px 8px 12px;background:var(--surface);flex-wrap:wrap}
.menu-order .mo-n{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;background:var(--scope-tint);font-weight:700;font-size:12.5px;flex:0 0 26px}
.menu-order small{color:var(--muted);font-size:12px}
.menu-order .mo-btns{margin-left:auto;display:flex;gap:6px}.menu-order .mo-btns form{margin:0}

/* ===== Release 7.7: pop-up views ===== */
.modal.open{display:flex}
.peek-box{width:min(760px,100%);max-height:calc(100vh - 32px);overflow:auto;padding:0;display:flex;flex-direction:column}
.peek-head{display:flex;justify-content:space-between;gap:12px;padding:18px 22px 12px;border-bottom:1px solid var(--line);position:sticky;top:0;background:var(--surface);z-index:1}
.peek-head h3{margin:0;font-size:18px}.peek-head p{margin:4px 0 0;color:var(--muted);font-size:13px}
.peek-body{padding:16px 22px}
.peek-actions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap;padding:12px 22px 18px;border-top:1px solid var(--line);position:sticky;bottom:0;background:var(--surface)}
.peek-loading{padding:40px;text-align:center;color:var(--muted)}
.peek-kv{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 18px;margin:0 0 14px}
.peek-kv div{min-width:0}.peek-kv .wide{grid-column:1/-1}
.peek-kv dt{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:650}
.peek-kv dd{margin:3px 0 0;font-weight:600;overflow-wrap:anywhere}
.peek-h{margin:16px 0 8px;font-size:13px;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.peek-table{width:100%;border-collapse:collapse;font-size:13.5px;table-layout:fixed}
.peek-table th{font-size:10.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);text-align:left;padding:6px 8px;border-bottom:1px solid var(--line)}
.peek-table td{padding:7px 8px;border-bottom:1px solid var(--line-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.peek-table .num{text-align:right}
.peek-note{background:var(--surface-2);border-radius:var(--r-sm);padding:10px 12px;margin:0 0 12px;font-size:13.5px}.peek-note.bad{background:var(--danger-bg);color:var(--danger-fg)}
.peek-file{border:1px solid var(--line);border-radius:var(--r);overflow:hidden;margin-top:6px}
.peek-file-head{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:8px 12px;background:var(--surface-2);border-bottom:1px solid var(--line)}
.peek-file img{display:block;max-width:100%;max-height:60vh;margin:0 auto;object-fit:contain}
.peek-file iframe,.peek-pdf iframe{display:block;width:100%;height:60vh;border:0;background:#fff}
.peek-file.empty{padding:16px;text-align:center}
.peek-pdf{border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
.peek-card .peek-pdf iframe{height:75vh}
body.peek-open{overflow:hidden}
a[data-peek]{cursor:pointer}
@media (max-width:700px){
  .peek-modal{padding:0;align-items:stretch}
  .peek-box{width:100%;max-height:100vh;height:100%;border-radius:0}
  .peek-kv{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .peek-actions .btn{flex:1 1 auto}
  .peek-file iframe,.peek-pdf iframe{height:55vh}
}
small.lock{display:inline-block!important;margin-left:6px;padding:1px 8px;border-radius:999px;background:var(--warn-bg);color:var(--warn-fg);font-size:11px;font-weight:700;vertical-align:middle}

/* ===== Release 7.8 ===== */
.fd-flow{display:flex;align-items:stretch;gap:8px;margin:0 0 22px;flex-wrap:nowrap}
.fd-step{flex:1 1 0;min-width:0;display:flex;flex-direction:column;gap:2px;padding:14px 16px;border-radius:var(--r-lg);background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow-sm);color:var(--ink);text-decoration:none;border-top:4px solid #2fb5a3}
a.fd-step:hover{border-color:#9fd9cf;box-shadow:var(--shadow)}
.fd-step:first-child{border-top-color:#14306e}.fd-step.alert{border-top-color:var(--danger-fg)}
.fd-step-name{font-size:11px;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);font-weight:700}
.fd-step strong{font-size:24px;font-weight:800;color:#14306e;line-height:1.15;font-variant-numeric:tabular-nums}
.fd-step.alert strong{color:var(--danger-fg)}
.fd-step small{color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fd-arrow{align-self:center;color:var(--faint);font-size:20px;flex:0 0 auto}
body[data-theme=dark] .fd-step strong{color:#bfd3ff}
.card-toggles{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px}
.card-toggle{width:100%}
.mini-progress{height:8px;border-radius:4px;background:var(--surface-2);overflow:hidden;min-width:80px;margin:4px 0}
.mini-progress span{display:block;height:100%;background:linear-gradient(90deg,#14306e,#2fb5a3);border-radius:4px}
.mini-progress.big{height:10px;margin:0 0 16px}
.steps{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.steps li{display:grid;gap:2px}.steps form{margin:0}
.step-btn{width:100%;display:flex;align-items:flex-start;gap:12px;text-align:left;padding:12px 14px;border:1px solid var(--line);border-radius:var(--r);background:var(--surface);cursor:pointer;font:inherit;color:var(--ink);min-height:48px}
.step-btn:hover{border-color:#9fd9cf}.step-btn.static{cursor:default}
.step-btn .tick{flex:0 0 28px;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;border:2px solid var(--line);font-weight:800;font-size:13px;color:var(--muted)}
.step-btn .step-text{padding-top:3px;line-height:1.4}
.steps li.done .step-btn{background:var(--ok-bg);border-color:transparent}
.steps li.done .tick{background:#0f766e;border-color:#0f766e;color:#fff}
.steps li.done .step-text{color:var(--ink-2)}
.step-meta{color:var(--muted);font-size:12px;padding-left:54px}
@media (max-width:900px){.fd-flow{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.fd-arrow{display:none}}
/* Release 7.8: the access grid has 7 menus — keep every column on screen */
@media (min-width:701px){
  .access-grid table.data th.grid-col{min-width:76px!important;max-width:96px!important;font-size:10px;letter-spacing:.03em;padding-left:4px;padding-right:4px}
  .access-grid table.data td.grid-col{padding-left:4px;padding-right:4px}
  .access-grid table.data td:first-child{min-width:170px}
  .access-grid table.data td:nth-child(2){min-width:120px}
}
@media (min-width:701px) and (max-width:1280px){
  .access-grid table.data th.grid-col{min-width:64px!important;max-width:80px!important;font-size:9.5px}
  .access-grid table.data td:first-child{min-width:130px}
  .access-grid table.data td:nth-child(2){min-width:0}
}

/* ==========================================================================
   Release 7.9: help, the TechDiscovery way — ? icons, How it works, FAQs
   ========================================================================== */
.faq-btn{display:inline-flex;align-items:center;gap:6px;height:40px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:var(--surface);color:var(--ink-2);font-weight:700;font-size:14px;white-space:nowrap}
.faq-btn .ico{width:18px;height:18px}
.faq-btn:hover{border-color:var(--brand-600);color:var(--brand-700);text-decoration:none}
@media (max-width:700px){.faq-btn{height:36px;padding:0 10px;font-size:13px}.faq-btn span{display:none}.faq-btn{width:40px;justify-content:center;padding:0;border-radius:10px}}
.help-switch{margin:4px 0 6px}
.help-switch button{display:flex;align-items:center;gap:8px;width:100%;min-height:38px;padding:6px 10px;border:1px solid var(--line);border-radius:10px;background:transparent;color:var(--ink);font:550 14px/1.2 inherit;cursor:pointer}
.help-switch button:hover{background:var(--surface-2)}
.help-switch button b{margin-left:auto;font-weight:700;color:var(--brand-600)}
.help-switch button[aria-pressed=false] b{color:var(--faint)}
.help-mini{display:inline-grid;place-items:center;width:18px;height:18px;border-radius:999px;border:1.5px solid currentColor;font-size:11px;font-weight:700;opacity:.7}

/* the ? icon and its card */
.smc-help{display:inline-grid;place-items:center;width:16px;height:16px;min-width:16px;margin:0 0 0 6px;padding:0;border-radius:999px;border:1px solid currentColor;background:transparent;box-shadow:none;color:var(--faint);font:600 10px/1 Inter,system-ui,sans-serif;vertical-align:middle;cursor:pointer;opacity:.75;text-transform:none;letter-spacing:0;transition:opacity .15s,color .15s,box-shadow .15s;flex:0 0 auto}
.smc-help:hover,.smc-help:focus-visible,.smc-help[aria-expanded=true]{opacity:1;color:var(--brand-600);box-shadow:0 0 0 3px rgba(37,99,235,.18);outline:none}
.page-head h1 .smc-help{width:18px;height:18px;min-width:18px;font-size:11px;vertical-align:4px}
.workspace-hero .smc-help{color:rgba(255,255,255,.85);width:18px;height:18px;font-size:11px}
.workspace-hero .smc-help:hover,.workspace-hero .smc-help[aria-expanded=true]{color:#fff;box-shadow:0 0 0 3px rgba(255,255,255,.25)}
.hero-metrics dt .smc-help,th .smc-help{width:14px;height:14px;min-width:14px;font-size:9px;margin-left:4px}
label .smc-help{margin-right:4px}
.smc-help-card{position:absolute;z-index:2147483000;max-width:calc(100vw - 24px);padding:14px 16px;border-radius:14px;background:var(--surface);color:var(--ink-2);border:1px solid var(--line);box-shadow:0 18px 44px rgba(15,23,42,.2);font:400 13.5px/1.55 Inter,system-ui,sans-serif;text-align:left;text-transform:none;letter-spacing:normal;white-space:normal}
.smc-help-card p{margin:0}.smc-help-card p+p{margin-top:10px}
.smc-help-card b{font-weight:700;color:var(--ink)}
.smc-help-card .smc-help-more{color:var(--muted);font-size:13px}
.smc-help-card .smc-help-edit{display:inline-block;margin-top:10px;font-size:12px;font-weight:600}

/* How it works */
.hiw{margin:0 0 var(--gap);border:1px solid var(--line);border-radius:var(--r-lg);background:var(--surface);box-shadow:var(--shadow-sm);overflow:hidden}
.hiw>summary{display:flex;align-items:center;gap:10px;padding:12px 16px;cursor:pointer;list-style:none;color:var(--ink)}
.hiw>summary::-webkit-details-marker{display:none}.hiw>summary::marker{content:""}
.hiw>summary small{color:var(--muted);font-weight:500}
.hiw>summary .chev{width:18px;height:18px;margin-left:auto;color:var(--faint);transition:transform .2s}
.hiw[open]>summary{border-bottom:1px solid var(--line-2);background:var(--scope-tint)}
.hiw[open]>summary .chev{transform:rotate(180deg)}
.hiw-ico{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:999px;background:var(--scope-tint);color:var(--scope-ring);font-weight:800;font-size:13px;flex:none}
.hiw[open] .hiw-ico{background:var(--scope-ring);color:#fff}
.hiw-steps{list-style:none;margin:0;padding:14px 16px 16px;display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px;counter-reset:none}
.hiw-steps li{display:flex;gap:10px;align-items:flex-start;font-size:13.5px;line-height:1.5;color:var(--ink-2);min-width:0}
.hiw-steps li b{color:var(--ink)}
.hiw-n{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:999px;background:var(--scope-tint);color:var(--scope-ring);font-weight:800;font-size:12px;flex:none}
@media (max-width:700px){.hiw-steps{grid-template-columns:minmax(0,1fr)}}

/* FAQs */
.faq-pop{display:flex;flex-direction:column;gap:16px;--faq-b:var(--brand-600);--faq-b8:var(--brand-800);--faq-bg:var(--brand-50);--faq-b1:var(--brand-100)}
.faq-hero{position:relative;overflow:hidden;border-radius:16px;padding:20px 20px 18px;color:#fff;background:var(--hero-grad);box-shadow:0 10px 26px rgba(15,23,42,.16)}
.faq-hero::after{content:"";position:absolute;width:220px;height:220px;right:-70px;top:-110px;border-radius:50%;background:rgba(255,255,255,.10)}
.faq-hero-t{display:flex;flex-direction:column;gap:2px;margin-bottom:14px;position:relative;z-index:1}
.faq-hero-t b{font-size:21px;letter-spacing:-.01em}.faq-hero-t span{opacity:.85;font-size:13px}
.faq-sbox{position:relative;display:block;z-index:1;margin:0}
.faq-sbox svg{position:absolute;left:14px;top:50%;width:18px;height:18px;transform:translateY(-50%);fill:none;stroke:#64748b;stroke-width:2;stroke-linecap:round;pointer-events:none}
.faq-pop .faq-sbox .faq-search{width:100%;margin:0;height:46px;padding:0 14px 0 42px;border:0;border-radius:12px;background:#fff;color:#0f172a;font-size:15px;box-shadow:0 4px 14px rgba(15,23,42,.18)}
.faq-pop .faq-sbox .faq-search:focus{outline:3px solid rgba(255,255,255,.55);outline-offset:1px}
.faq-chips{display:flex;flex-wrap:wrap;gap:8px}
.faq-chip{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 12px;border-radius:999px;border:1px solid var(--line);background:var(--surface);color:var(--ink-2);font:600 13px/1 inherit;cursor:pointer;transition:background .15s,border-color .15s,color .15s}
.faq-chip span{min-width:20px;height:20px;padding:0 6px;border-radius:999px;display:inline-grid;place-items:center;background:var(--line-2);color:#475569;font-size:11px}
.faq-chip:hover{border-color:var(--faq-b);color:var(--faq-b)}
.faq-chip.is-on{background:var(--faq-b);border-color:var(--faq-b);color:#fff}.faq-chip.is-on span{background:rgba(255,255,255,.22);color:#fff}
.faq-body{display:flex;flex-direction:column;gap:18px}
.faq-topic{margin:0}.faq-topic[hidden]{display:none}
.faq-th{display:flex;align-items:center;gap:10px;margin:0 0 10px}
.faq-th h4{margin:0;font-size:15px;font-weight:700;color:var(--ink)}
.faq-count{margin-left:auto;font-size:12px;font-weight:600;color:var(--muted)}
.faq-ico{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;flex:none}
.faq-ico svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.faq-ico-0{background:#e0ecff;color:#1d4fd8}.faq-ico-1{background:#ede9fe;color:#6d28d9}.faq-ico-2{background:#dcfce7;color:#15803d}
.faq-ico-3{background:#fef3c7;color:#b45309}.faq-ico-4{background:#cffafe;color:#0e7490}.faq-ico-5{background:#fce7f3;color:#be185d}
.faq-list{display:flex;flex-direction:column;gap:8px}
.faq-pop .faq-q{margin:0;padding:0;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:0 1px 2px rgba(15,23,42,.04);transition:border-color .15s,box-shadow .15s;overflow:hidden}
.faq-pop .faq-q[hidden]{display:none}
.faq-pop .faq-q:hover{border-color:var(--faq-b1);box-shadow:0 6px 16px rgba(15,23,42,.08)}
.faq-pop .faq-q summary{display:flex;align-items:center;gap:12px;padding:14px 16px;list-style:none;cursor:pointer;font-weight:600;color:var(--ink)}
.faq-pop .faq-q summary::-webkit-details-marker{display:none}.faq-pop .faq-q summary::marker{content:""}
.faq-qt{flex:1;min-width:0}
.faq-chev{width:18px;height:18px;flex:none;fill:none;stroke:#94a3b8;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;transition:transform .2s}
.faq-pop .faq-q[open]{border-color:var(--faq-b);box-shadow:0 8px 22px rgba(37,99,235,.12)}
.faq-pop .faq-q[open] summary{color:var(--faq-b8);background:var(--faq-bg)}
.faq-pop .faq-q[open] .faq-chev{transform:rotate(180deg);stroke:var(--faq-b)}
.faq-pop .faq-a{padding:4px 16px 16px;border-left:3px solid var(--faq-b);color:var(--ink-2);line-height:1.6;font-size:14px}
.faq-pop .faq-a p{margin:10px 0 0}.faq-pop .faq-a ul{margin:8px 0 0 18px;padding:0}.faq-pop .faq-a li{margin:4px 0}
.faq-none{display:flex;flex-direction:column;gap:4px;align-items:center;text-align:center;padding:28px 12px;border:1px dashed var(--line);border-radius:12px;color:var(--muted)}
.faq-none[hidden]{display:none}.faq-none b{color:var(--ink)}
.faq-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px 14px;border-radius:12px;background:var(--line-2);color:#475569;font-size:13px}
@media (max-width:640px){.faq-hero{padding:16px}.faq-hero-t b{font-size:18px}.faq-pop .faq-q summary{padding:12px 14px}}

/* Administration › FAQs and Help text */
.faq-edit{border:1px solid var(--line);border-radius:12px;padding:10px 14px;margin:0 0 10px;background:var(--surface)}
.faq-edit>summary{cursor:pointer;line-height:1.5}
.faq-edit[open]>summary{margin-bottom:12px}
.faq-edit-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}.faq-edit-actions form{margin:0}
.form-grid.one,.split-side .form-grid.one{grid-template-columns:minmax(0,1fr)}
.ht-search{display:grid;grid-template-columns:minmax(0,1fr) 200px auto auto;gap:10px;align-items:center}
@media (max-width:700px){.ht-search{grid-template-columns:minmax(0,1fr)}}
.ht-table td{vertical-align:top}.ht-table td:first-child{width:30%}.ht-table td small{display:block;color:var(--muted);margin-top:2px}
.ht-steps{margin:0;padding-left:18px}.ht-steps li{margin:2px 0}
.ht-edit>summary{list-style:none;cursor:pointer;display:inline-flex}.ht-edit>summary::-webkit-details-marker{display:none}
.ht-edit form{margin-top:8px;min-width:260px;text-align:left}.ht-edit textarea{width:100%}
.ht-edit .form-actions{justify-content:flex-start;margin-top:8px}
.ht-kind{display:block;font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.ht-item{display:block;margin-top:2px}
table.data.ht-table td.ht-text{white-space:normal;overflow:visible;text-overflow:clip;max-width:none}
.ht-body{white-space:normal;line-height:1.5}
.ht-body b{display:inline}
table.data.ht-table td .ht-edit textarea{white-space:pre-wrap}
.faq-pop .faq-sbox input.faq-search{padding-left:42px}
.ht-text .ht-edit{margin-top:8px}.ht-text .ht-edit form{max-width:640px}
.ht-text .ht-edit textarea{min-height:110px}
.ht-edit .hint{white-space:normal!important;overflow:visible!important}

/* Release 7.10: test accounts and Reset to basic */
.test-banner{margin:0 0 var(--gap);padding:10px 14px;border-radius:12px;background:repeating-linear-gradient(135deg,#fff6e0 0 14px,#fdecc8 14px 28px);border:1px solid #f3c969;color:#7a4b00;font-size:13.5px}
.test-banner b{letter-spacing:.06em;margin-right:4px}
.test-badge{margin-left:6px;font-size:10px;letter-spacing:.05em;vertical-align:2px}
table.data td:not(.cell-actions) > .test-badge{display:inline-block}
.danger-zone{border-color:#f5c2c0}.danger-zone h2{color:var(--danger-fg)}.danger-zone p{color:var(--ink-2);font-size:14px;line-height:1.55;margin:0}
.reset-warn{margin:0 0 var(--gap);padding:14px 16px;border-radius:14px;background:var(--danger-bg);color:var(--danger-fg);border:1px solid #f5c2c0;font-size:14px;line-height:1.5}
.reset-group{border:1px solid var(--line);border-radius:10px;margin:0 0 8px;background:var(--surface)}
.reset-group>summary{display:flex;justify-content:space-between;gap:10px;padding:10px 14px;cursor:pointer}
.reset-group>summary span{font-weight:700;color:var(--danger-fg)}
.reset-group ul{list-style:none;margin:0;padding:4px 14px 10px;display:grid;gap:4px;font-size:13.5px}
.reset-group li{display:flex;justify-content:space-between;gap:10px;color:var(--ink-2)}
.reset-people{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:6px;font-size:13.5px}
.reset-people small{color:var(--muted)}
.reset-keep{margin:0;padding-left:18px;display:grid;gap:6px;font-size:14px;color:var(--ink-2)}
.reset-card label.check{display:flex;align-items:flex-start;line-height:1.45;margin:0}
.reset-card label.check input{margin-top:3px}

/* Release 7.10.3: mandatory fields — a faint red tint while empty, a red asterisk on the label. Clears once filled. */
:root{--req-bg:#fff6f6;--req-line:#f3c4c4;--req-mark:#c53030}
body.app input:required:not([type=checkbox]):not([type=radio]):not([type=file]):invalid,
body.app select:required:invalid,body.app textarea:required:invalid{background:var(--req-bg);border-color:var(--req-line)}
body.app input:required:invalid:focus,body.app select:required:invalid:focus,body.app textarea:required:invalid:focus{border-color:var(--brand-500);box-shadow:0 0 0 3px var(--brand-100)}
body.app .file-drop:has(input[type=file]:required:invalid){background:var(--req-bg);border-color:var(--req-line)}
.req-mark{color:var(--req-mark);font-weight:700;margin-left:3px}
.req-legend{font-size:12.5px;color:var(--muted);margin:0 0 10px}.req-legend .req-mark{margin:0 2px 0 0}
/* Release 7.10.3: Help text editor on phones — one full-width column, no side labels */
@media (max-width:700px){
  table.stack.ht-table td{display:block!important;text-align:left;max-width:none!important;width:auto!important;overflow:visible!important}
  table.stack.ht-table td::before{display:none;content:none}
  table.stack.ht-table td,table.stack.ht-table td *{text-align:left!important;justify-content:flex-start!important}
  .ht-edit form{min-width:0}
  .ht-text .ht-edit form{max-width:100%}
}
