/* ===== Design tokens ===== */
:root{
  --bg:#f3f7fa;
  --card:#ffffff;
  --ink:#0b1f3a;
  --ink-soft:#2b405b;
  --muted:#62758a;
  --line:#dbe5ec;
  --line-soft:#eaf0f4;
  --brand:#0c2545;
  --brand2:#2d9ed3;
  --brand3:#f5a623;
  --brand-soft:#eaf7fc;
  --ok:#149c66;
  --warn:#f59e0b;
  --bad:#dc2626;
  --purple:#7c3aed;
  --blue:#2563eb;
  --teal:#0f766e;
  --brown:#92400e;
  --orange:#ea580c;
  --pink:#db2777;
  --indigo:#4f46e5;
  --cyan:#0891b2;
  --gray:#6b7280;
  --lime:#65a30d;
  --fuchsia:#c026d3;
  --rose:#e11d48;
  --radius:22px;
  --radius-sm:12px;
  --space-1:6px;
  --space-2:10px;
  --space-3:14px;
  --space-4:18px;
  --space-5:24px;
  --space-6:32px;
  --content-max:1180px;
  --shadow-sm:0 1px 2px rgba(20,31,50,.04);
  --shadow-md:0 10px 28px rgba(12,37,69,.08);
  --shadow-lg:0 28px 70px rgba(5,24,48,.18);
  --ease-out:cubic-bezier(0.23,1,0.32,1);
  --ease-drawer:cubic-bezier(0.32,0.72,0,1);
}
:root[data-theme="dark"]{
  --bg:#0f1621;
  --card:#171f2d;
  --ink:#e8edf5;
  --ink-soft:#c3cddb;
  --muted:#8b9bb0;
  --line:#2a3547;
  --line-soft:#232d3d;
  --brand:#7fc4ee;
  --brand2:#4db3e8;
  --brand-soft:#16283a;
  --shadow-sm:0 1px 2px rgba(0,0,0,.3);
  --shadow-md:0 10px 28px rgba(0,0,0,.35);
  --shadow-lg:0 28px 70px rgba(0,0,0,.5);
}
:root[data-theme="dark"] body{background:var(--bg);color:var(--ink)}
:root[data-theme="dark"] .stat,:root[data-theme="dark"] .kpi{background:#1c2636}
:root[data-theme="dark"] .accountability-track{background:#2a3547}
:root[data-theme="dark"] input,:root[data-theme="dark"] select,:root[data-theme="dark"] textarea{background:#1c2636;color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .notice{background:#2b2410;border-color:#4a3c14;color:#e8cf7a}
:root[data-theme="dark"] .notice-summary small{color:#c2a758}
:root[data-theme="dark"] .notice-details{border-top-color:#4a3c14}
/* .notice .link-btn (line ~271) is a hardcoded #7a4a06 -- a dark amber that
   reads fine on the light notice background but measures ~2:1 (fails WCAG AA)
   against the notice's own dark-mode background, since both land in the same
   dark-yellow range. Reuse the notice's own light-yellow text color instead. */
:root[data-theme="dark"] .notice .link-btn{color:#e8cf7a}
/* Same bug, same fix, different element: .approvals-legend dd is a hardcoded
   dark-brown (#754b0b) meant for the light notice background -- ~2:1 against
   the notice's own dark-mode background, same as the .link-btn case above. */
:root[data-theme="dark"] .approvals-legend dd{color:#e8cf7a}
/* .distance-warn's light-mode #b45309 (below) was darkened for AA contrast on
   white; that same darker shade would just look muddy on the dark card
   background where the brighter --warn already reads fine (~7.7:1), so only
   light mode needs the override. */
:root[data-theme="dark"] .distance-warn{color:var(--warn)}
/* A batch of hardcoded near-white backgrounds never got a dark-mode counterpart,
   so dark mode's light ink text (--ink/--ink-soft/--muted are all light colors)
   landed on them nearly invisible. table/th are the big one -- every data table
   in the app inherited this. */
:root[data-theme="dark"] table{background:var(--card)}
:root[data-theme="dark"] th{background:#1c2636;color:var(--muted)}
:root[data-theme="dark"] tbody tr:nth-child(even) td{background:#182030}
:root[data-theme="dark"] tbody tr:hover td{background:#22314a}
:root[data-theme="dark"] .utility-output{background:#1c2636}
:root[data-theme="dark"] input:disabled,:root[data-theme="dark"] select:disabled,:root[data-theme="dark"] textarea:disabled{background:#161d29;color:var(--muted)}
:root[data-theme="dark"] .profile-grid .stat,:root[data-theme="dark"] .snapshot-item{background:#1c2636}
:root[data-theme="dark"] .cal-head{background:#1c2636;color:var(--muted)}
:root[data-theme="dark"] .cal-day.other{background:#141b27}
:root[data-theme="dark"] .cal-day.weekend{background:#1a2233}
:root[data-theme="dark"] .cal-day.holiday{background:#2a1a2e}
:root[data-theme="dark"] .cal-day.selected{background:#22314a;outline-color:var(--ink)}
:root[data-theme="dark"] .cal-day:hover{background:#1e2836}
:root[data-theme="dark"] .recovery-login,:root[data-theme="dark"] .security-item,:root[data-theme="dark"] .approvals-progress{background:#1c2636}
:root[data-theme="dark"] .recovery-codes-panel{background:#2b2410;border-color:#4a3c14;color:#e8cf7a}
:root[data-theme="dark"] .strength-meter{background:#232d3d}
:root[data-theme="dark"] .hamburger-btn,:root[data-theme="dark"] .icon-btn{background:#1c2636}
:root[data-theme="dark"] .icon-btn:hover{background:#232d3d}
:root[data-theme="dark"] .nav-btn:hover{background:#1c2636}
:root[data-theme="dark"] .setting-row>.ui-icon,:root[data-theme="dark"] .icon-disc{background:#16283a}
:root[data-theme="dark"] .demo-note{background:#16283a;border-color:#1c3a5e;color:var(--ink)}
:root[data-theme="dark"] .sidebar,:root[data-theme="dark"] .mobile-topbar{background:var(--card)}
:root[data-theme="dark"] .nav-btn:hover{background:#1c2636;color:var(--brand)}
:root[data-theme="dark"] .nav-btn.active{background:linear-gradient(90deg,#16283a,#1a3247);border-color:#234b68}
:root[data-theme="dark"] .setting-row{background:var(--card)}
:root[data-theme="dark"] .setting-row:hover{background:linear-gradient(90deg,#1c2636,var(--card))}
:root[data-theme="dark"] .appItem{background:var(--card)}
:root[data-theme="dark"] .hero-card{background:linear-gradient(160deg,#171f2d 0%,#16283a 100%);border-color:#234b68}
/* button.ghost/danger keep a hardcoded white background regardless of theme --
   fine for danger (red-on-white still passes AA), but ghost's text color is
   the *dark-mode* --brand (a light blue meant for dark surfaces), so white-bg
   + light-blue-text measured ~1.9:1, nowhere near readable. Ghost buttons are
   the app's default secondary action everywhere, so this was a big one. */
:root[data-theme="dark"] button.ghost,:root[data-theme="dark"] .button.ghost{background:#1c2636;border-color:#2a3f52}
:root[data-theme="dark"] button.ghost:hover,:root[data-theme="dark"] .button.ghost:hover{background:var(--brand-soft)}
:root[data-theme="dark"] button.danger,:root[data-theme="dark"] .button.danger{background:#1c2636;color:#f87171;border-color:#4a2020}
:root[data-theme="dark"] button.danger:hover,:root[data-theme="dark"] .button.danger:hover{background:#241a1a}
:root[data-theme="dark"] .cal-day{background:var(--card)}
/* --bad (#dc2626) reads fine as red-on-white (button.danger) or white-on-red
   (pill/toast), so it stays as-is globally -- but as plain text directly on
   the dark page/card background it drops to ~3.5:1, under WCAG AA's 4.5:1.
   Only the direct-on-background text uses need a brighter red here. */
:root[data-theme="dark"] .msg.err,:root[data-theme="dark"] .err,:root[data-theme="dark"] .distance-bad{color:#f87171}
@media (prefers-reduced-motion: reduce){
  .modal-overlay,.modal-box,.sidebar,.sidebar-overlay{transition-duration:.01ms!important}
}

/* ===== Reset & base ===== */
*{box-sizing:border-box}
html,body{min-height:100%;min-height:100dvh}
body{
  margin:0;
  background:var(--bg);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  color:var(--ink);
  -webkit-font-smoothing:antialiased;
  overflow:hidden;
}
.hidden{display:none!important}
.mc-preview-img{max-width:220px;max-height:220px;border-radius:var(--radius-sm);border:1px solid var(--line);margin-top:8px;display:block;object-fit:cover}
.mc-thumb{max-width:140px;max-height:140px;border-radius:var(--radius-sm);border:1px solid var(--line);object-fit:cover}
.attachment-preview{margin:6px 0}
.modal-overlay{
  position:fixed;inset:0;background:rgba(15,20,30,.55);display:flex;align-items:center;justify-content:center;padding:16px;z-index:1000;
  opacity:1;transition:opacity 200ms var(--ease-out);
}
.modal-box{
  background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow-lg);padding:20px;width:min(480px,100%);max-height:90vh;overflow-y:auto;
  transform:scale(1);transition:transform 200ms var(--ease-out);
}
.modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.modal-head h3{margin:0}
.cal-day.clickable{cursor:pointer}
h1,h2,h3{font-weight:800;letter-spacing:-.01em}
h1{font-size:clamp(24px,2vw,30px);line-height:1.15;margin:0 0 5px}
h2{font-size:17px;margin:0 0 8px}
h3{font-size:14px;margin:16px 0 8px;color:var(--ink-soft)}
.muted{color:var(--muted);font-size:13.5px;line-height:1.55}
.tiny{font-size:12px}
.eyebrow{text-transform:uppercase;letter-spacing:.1em;color:var(--brand);font-weight:800;font-size:11.5px;margin:0 0 4px;display:flex;align-items:center;gap:7px}
.eyebrow::before{content:'';width:7px;height:7px;border-radius:50%;background:var(--brand3);box-shadow:0 0 0 3px rgba(245,166,35,.14);flex:0 0 auto}
code{white-space:pre-wrap;word-break:break-word}
::selection{background:rgba(38,148,210,.22)}
*:focus-visible{outline:2px solid var(--brand2);outline-offset:2px;border-radius:6px}

/* ===== Login screen ===== */
.login-screen{height:100vh;height:100dvh;overflow-y:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;background:radial-gradient(circle at 82% 18%,rgba(45,158,211,.34),transparent 35%),linear-gradient(145deg,#081a33 0%,#0c2e53 60%,#075d87 100%);padding:max(20px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left))}
.login-card{flex:0 0 auto;position:relative;overflow:hidden;width:min(450px,100%);background:rgba(255,255,255,.98);border:1px solid rgba(255,255,255,.55);border-radius:28px;box-shadow:var(--shadow-lg);padding:40px 36px 36px;animation:workspaceRiseIn .35s ease;margin:auto 0}
.login-card::before{content:'';position:absolute;inset:0 0 auto;height:5px;background:linear-gradient(90deg,var(--brand2) 0 72%,var(--brand3) 72%)}
@keyframes workspaceRiseIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
@keyframes hrmRiseIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
.login-tabs{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin:16px 0 4px;background:var(--bg);padding:4px;border-radius:14px}
.tab-btn{background:transparent;color:var(--muted);border:0;box-shadow:none;font-weight:700}
.tab-btn.active{background:var(--card);color:var(--brand);box-shadow:var(--shadow-sm)}
.tab-btn:hover:not(.active){filter:none;background:rgba(255,255,255,.6)}
.link-btn{background:none;border:0;box-shadow:none;color:var(--brand);padding:4px 3px;font-weight:650;text-decoration:underline;width:auto}
.link-btn:hover{filter:none;box-shadow:none;background:none;text-decoration:none}
.auth-focus-panel{animation:hrmFadeIn .18s ease}
.auth-focus-panel h2{font-size:22px;margin-bottom:6px}
.auth-focus-panel>.back-link{margin-bottom:22px}
.company-logo{display:block;width:116px;height:auto;object-fit:contain;flex:0 0 auto}
.login-company-logo{width:150px;margin-bottom:24px}
/* Shown while the initial /api/me session check is in flight, so a page load
   or refresh never flashes the login screen for an already-authenticated
   user (or the dashboard before redirecting to the requested page) -- just a
   brief, neutral branded moment instead of the wrong screen appearing first. */
.auth-splash{position:fixed;inset:0;z-index:3000;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle at 82% 18%,rgba(45,158,211,.34),transparent 35%),linear-gradient(145deg,#081a33 0%,#0c2e53 60%,#075d87 100%)}
.auth-splash img{width:120px;opacity:0;animation:authSplashFade 400ms 150ms ease-out forwards}
@keyframes authSplashFade{to{opacity:1}}
@media (prefers-reduced-motion: reduce){ .auth-splash img{animation:none;opacity:1} }

/* The login card's white background and the splash's dark gradient backdrop are
   both fixed by design in either theme (see rules above) -- they were never meant
   to flip with the light/dark toggle. But dark mode's token values and a handful
   of hardcoded dark-mode overrides still cascade into them by default, which
   lands light-mode ink text on the light card as near-invisible, or dark literal
   backgrounds inside it. Pin the whole auth screen back to its light values,
   regardless of the user's chosen theme -- the theme choice itself still persists
   correctly for the app once they're logged in.
   Selector specificity is matched to each dark-mode rule being countered (see
   comments) so this wins on theme regardless of source order elsewhere in the file. */
.login-screen{
  --bg:#f3f7fa;--card:#ffffff;--ink:#0b1f3a;--ink-soft:#2b405b;--muted:#62758a;
  --line:#dbe5ec;--line-soft:#eaf0f4;--brand:#0c2545;--brand2:#2d9ed3;--brand3:#f5a623;--brand-soft:#eaf7fc;--bad:#dc2626;
  --shadow-sm:0 1px 2px rgba(20,31,50,.04);--shadow-md:0 10px 28px rgba(12,37,69,.08);--shadow-lg:0 28px 70px rgba(5,24,48,.18);
}
/* Redefining the custom properties above only reaches descendants that
   reference var(--ink) themselves (inputs, .eyebrow, .muted). h1/h2/etc set
   no color of their own, so without this they keep inheriting body's
   already-computed dark-mode color instead of picking up the override --
   setting color here explicitly is what makes it cascade to them too. */
.login-screen{color:var(--ink)}
/* Counters :root[data-theme="dark"] input,select,textarea (0,2,1) */
:root .login-screen input,:root .login-screen select,:root .login-screen textarea{background:#fff;color:var(--ink);border-color:var(--line)}
/* Counters :root[data-theme="dark"] input:disabled,select:disabled,textarea:disabled (0,3,1) */
:root .login-screen input:disabled,:root .login-screen select:disabled,:root .login-screen textarea:disabled{background:#f3f4f6;color:var(--muted)}
/* Counters :root[data-theme="dark"] button.ghost,.button.ghost (0,3,1) */
:root .login-screen button.ghost,:root .login-screen .button.ghost{background:#fff;color:var(--brand);border-color:#d3ddf5}
/* Counters :root[data-theme="dark"] .msg.err / .err (0,4,0 / 0,3,0) */
:root .login-screen .msg.err{color:var(--bad)}
:root .login-screen .err{color:var(--bad)}
/* Counters :root[data-theme="dark"] .strength-meter (0,3,0) */
:root .login-screen .strength-meter{background:#e5e7eb}
/* Counters :root[data-theme="dark"] .recovery-login (0,3,0) */
:root .login-screen .recovery-login{background:#f8fafc}

@media (prefers-reduced-motion: no-preference) { html{scroll-behavior:smooth} }

/* ===== App shell / layout ===== */
.app-shell{height:100vh;height:100dvh;min-height:0;display:grid;grid-template-columns:232px minmax(0,1fr);overflow:hidden}
.app-shell.has-jump-rail{grid-template-columns:232px 184px minmax(0,1fr)}
.mobile-topbar{display:none}

/* "On this page" shortcuts, sitting in their own column between the sidebar
   and the content -- not a row above the content -- so it stays visible the
   whole time without competing with the page's own header for space. */
.page-jump-rail{
  height:100vh;height:100dvh;min-height:0;overflow-y:auto;
  border-right:1px solid var(--line);padding:20px 14px;display:flex;flex-direction:column;gap:8px;
  background:var(--bg);
}
.page-jump-rail.hidden{display:none}
.page-jump-rail-label{font-size:11px;letter-spacing:.04em;text-transform:uppercase;font-weight:800;color:var(--muted);padding:0 2px}
.page-jump-rail nav{display:flex;flex-direction:column;gap:3px}
.page-jump-rail nav a{
  font-size:13px;font-weight:650;color:var(--ink-soft);text-decoration:none;
  padding:8px 10px;border-radius:10px;border:1px solid transparent;
}
.page-jump-rail nav a:hover{background:var(--brand-soft);color:var(--brand);border-color:var(--line)}

.sidebar{
  height:100vh;height:100dvh;min-height:0;overflow:hidden;
  background:linear-gradient(180deg,#fff 0%,#f9fcfd 100%);color:var(--ink);
  border-right:1px solid var(--line);padding:20px 14px;display:flex;flex-direction:column;
}
.brand-box{display:flex;align-items:center;gap:11px;padding:7px 6px 18px;border-bottom:1px solid var(--line-soft);flex:0 0 auto}
.brand-box small{display:block;color:var(--muted);margin-top:1px;font-size:11.5px}
.logo-mark{width:36px;height:36px;border-radius:11px;background:linear-gradient(135deg,var(--brand2),#8fd3f4);display:grid;place-items:center;font-weight:900;color:#fff;font-size:13px;flex:0 0 auto}
.login-logo-mark{width:52px;height:52px;border-radius:15px;font-size:18px;margin-bottom:14px;box-shadow:var(--shadow-md)}

.side-nav{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;margin-top:16px;padding-right:4px;scrollbar-width:thin;scrollbar-color:#cbd5e1 transparent}
.side-nav::-webkit-scrollbar{width:7px}
.side-nav::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:99px}
.nav-group{margin-bottom:18px}
.nav-group-label{display:block;font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.09em;color:#8a94a6;padding:0 10px 6px}
.nav-group .nav-btn+.nav-btn{margin-top:3px}

.nav-btn{
  position:relative;width:100%;display:flex;align-items:center;justify-content:flex-start;
  background:transparent;color:var(--ink-soft);border:1px solid transparent;text-decoration:none;
  min-height:44px;padding:10px 12px;border-radius:13px;font-weight:680;font-size:13px;line-height:1.3;text-align:left;gap:10px;
}
.nav-btn:hover{background:#edf7fb;color:var(--brand)}
.nav-btn.active{background:linear-gradient(90deg,#e7f6fc,#f3faff);color:var(--brand);border-color:#cbeaf6}
.nav-btn.active::before{content:'';position:absolute;left:-14px;top:7px;bottom:7px;width:3px;border-radius:99px;background:var(--brand2)}
.module-link{text-decoration:none}

.side-footer{flex:0 0 auto;margin-top:12px;padding-top:12px;border-top:1px solid var(--line-soft);display:flex;flex-direction:column;gap:8px}
#clockInOutBox .actions{margin-top:14px}
.side-user{font-size:12.5px;color:var(--muted);margin-bottom:10px;line-height:1.5}
.sidebar-overlay{display:none}

.workspace{height:100vh;height:100dvh;min-height:0;overflow-y:auto;overflow-x:hidden;padding:30px clamp(20px,3vw,48px) max(48px,env(safe-area-inset-bottom));background:radial-gradient(circle at 100% 0,rgba(45,158,211,.07),transparent 30%),var(--bg)}
.topbar,.notice,.page{width:min(100%,var(--content-max));margin-left:auto;margin-right:auto}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:20px;flex-wrap:wrap}
.top-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.top-actions>select{min-width:220px}

.notice{background:#fffbeb;border:1px solid #f5df9a;color:#754b0b;border-radius:12px;padding:10px 14px;margin-bottom:20px;font-size:13px;line-height:1.5;overflow-wrap:anywhere;box-sizing:border-box}
.notice-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0}
.notice-summary span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.notice-summary small{color:#98691d;margin-left:8px;font-size:12px}
.notice .link-btn{flex-shrink:0;color:#7a4a06;font-weight:700}
.notice-details{margin-top:8px;padding-top:8px;border-top:1px solid #fbe3a1;display:grid;gap:6px;opacity:1;transition:opacity 160ms ease-out;overflow-wrap:anywhere;min-width:0}
.notice-details.hidden{display:none}
.plain-list{list-style:none;margin:4px 0 0;padding:0;display:grid;gap:4px}
.approvals-legend{display:grid;gap:6px;margin:4px 0 0;padding:0;min-width:0}
.approvals-legend>div{display:grid;grid-template-columns:150px 1fr;gap:8px;align-items:baseline;min-width:0}
.approvals-legend dt{font-weight:700;margin:0;overflow-wrap:anywhere}
.approvals-legend dd{margin:0;color:#754b0b;overflow-wrap:anywhere;min-width:0}
/* Compact notices (leave breakdown, RTS/My Referrals notices) live in narrower
   cards than the full-width dashboard notices, so truncate-to-ellipsis on the
   summary line is too easily wrong for their container width -- wrap instead. */
.notice.compact .notice-summary{flex-wrap:wrap}
.notice.compact .notice-summary span{white-space:normal;overflow:visible;text-overflow:clip}
.notice.compact .approvals-legend>div{grid-template-columns:1fr}
@media (max-width:640px){
  .approvals-legend>div{grid-template-columns:1fr}
}
@media (max-width:640px){
  .notice-summary{flex-direction:column;align-items:flex-start;gap:4px}
  .notice-summary span{white-space:normal}
}

/* ===== Pages & cards ===== */
.page{display:none}
.active-page{display:block;animation:hrmFadeIn .18s ease}
@keyframes hrmFadeIn{from{opacity:0}to{opacity:1}}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 4px 18px rgba(12,37,69,.045);padding:var(--space-5);margin-bottom:var(--space-4);transition:border-color .2s ease,box-shadow .2s ease}
.card:hover{border-color:#cbdce7;box-shadow:0 8px 24px rgba(12,37,69,.065)}
.narrow-card{max-width:760px}
.hero-card{background:linear-gradient(160deg,#ffffff 0%,#f3f9ff 100%);border-color:#e0ecfb}
.hero-col-stack{min-width:0}
.card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px}
.card-head h2{margin-bottom:2px}
.card-head .muted{margin:3px 0 0}
.wrap{flex-wrap:wrap}

.hub-page,.focused-content{width:min(100%,780px);margin-left:auto;margin-right:auto}
.hub-card{background:var(--card);border:1px solid var(--line);border-radius:26px;box-shadow:0 12px 36px rgba(12,37,69,.065);overflow:hidden}
.setting-row{
  width:100%;min-height:88px;padding:19px 22px;border:0;border-bottom:1px solid var(--line-soft);border-radius:0;
  background:#fff;color:var(--ink);box-shadow:none;display:flex;align-items:center;justify-content:flex-start;gap:16px;text-align:left;text-decoration:none;
}
.setting-row:last-child{border-bottom:0}
.setting-row:hover{background:linear-gradient(90deg,#f3fbfe,#fff);filter:none;transform:none;box-shadow:none}
.setting-row>span:first-of-type{display:grid;gap:5px;flex:1}
.setting-row strong{font-size:15px}
.setting-row small{font-size:13px;line-height:1.45;color:var(--muted);font-weight:500}
.setting-row>span:last-child{font-size:28px;line-height:1;color:#8ba0b3;font-weight:400}
.dept-tag-row{display:flex;flex-wrap:wrap;gap:5px;margin-top:2px}
.dept-tag-row:empty{display:none}
.badge.dept-tag{background:transparent;border:1px solid var(--line);color:var(--muted);font-weight:700;font-size:10px;padding:2px 8px}
.ui-icon{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
.access-matrix-table th.matrix-group-header{text-align:center;font-size:10.5px;color:var(--muted);background:var(--brand-soft);border-bottom:2px solid var(--brand2)}
.access-matrix-table th.matrix-group-header+th.matrix-group-header{border-left:1px solid var(--line)}
.access-matrix-table th[data-icon]{white-space:nowrap}
.access-matrix-table th[data-icon] .ui-icon{width:14px;height:14px;margin-right:5px;vertical-align:-2px}
.setting-row>.ui-icon{width:42px;height:42px;padding:10px;border-radius:14px;color:var(--brand2);background:#e9f7fc;stroke-width:1.7}
.directory-intro{display:flex;align-items:center;gap:13px}.directory-intro h2,.directory-intro p{margin:0}.icon-disc{width:42px;height:42px;border-radius:14px;background:#e9f7fc;color:var(--brand2);display:grid;place-items:center}
.back-link{background:transparent;color:var(--brand);box-shadow:none;padding:6px 3px;margin:0 0 14px;border:0;font-weight:700;text-decoration:none;display:inline-block}
.back-link:hover{background:transparent;box-shadow:none;filter:none;text-decoration:underline}

.grid{display:grid;gap:var(--space-4)}
.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid.four{grid-template-columns:minmax(0,1.2fr) minmax(0,1.1fr) minmax(0,1.4fr) minmax(0,1.8fr)}
.grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.compact{gap:12px}
.module-page .kpi-row{margin-bottom:18px}
.balance-source-note{grid-column:1/-1;padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:var(--brand-soft);color:var(--muted);font-size:.9rem}
.utility-input{min-height:180px}
.utility-output{min-height:160px;max-height:320px;overflow:auto;background:#f8fafc;border:1px solid var(--line);border-radius:var(--radius-sm);padding:12px;white-space:pre-wrap}

/* ===== Forms ===== */
label{display:block;font-weight:700;font-size:12px;margin:14px 0 6px;color:var(--ink-soft)}
.sort-inline{display:flex;align-items:center;gap:8px;margin:0 0 12px;font-weight:600}
.sort-inline select{margin:0;width:auto}
input,select,textarea{
  width:100%;min-height:42px;border:1px solid #d7dce6;border-radius:var(--radius-sm);padding:10px 12px;
  font:inherit;background:#fff;color:var(--ink);
}
input::placeholder,textarea::placeholder{color:#9aa4b7}
textarea{min-height:80px;resize:vertical}
input:focus,select:focus,textarea:focus{border-color:var(--brand2);box-shadow:0 0 0 3px rgba(45,158,211,.14);outline:none}
input:disabled,select:disabled,textarea:disabled{background:#f3f4f7;color:var(--muted)}

button,.button{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;border:0;
  background:linear-gradient(135deg,#168fc8,var(--brand2));color:#fff;
  min-height:40px;padding:9px 15px;border-radius:var(--radius-sm);font-weight:700;font-size:13px;
  text-decoration:none;cursor:pointer;transition:filter .15s ease,box-shadow .15s ease,transform .05s ease;
}
button:hover:not(:disabled),.button:hover{filter:brightness(1.05);box-shadow:0 7px 20px rgba(45,158,211,.25)}
button:active:not(:disabled),.button:active{transform:translateY(1px)}
button:disabled{opacity:.55;cursor:not-allowed;filter:none;box-shadow:none}
button.ghost,.button.ghost{background:#fff;color:var(--brand);border:1px solid #d3ddf5}
button.ghost:hover,.button.ghost:hover{background:var(--brand-soft)}
button.danger,.button.danger{background:#fff;color:var(--bad);border:1px solid #fbcaca}
button.danger:hover,.button.danger:hover{background:#fff5f5}
.full{width:100%}
.toolbar,.actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
/* .actions.wrap is the closing button row of a card/form section, always
   directly after a field/paragraph with no bottom margin of its own to
   bridge the gap -- give it breathing room by default instead of the
   per-container margin-top overrides (#clockInOutBox, .approveBox) this
   codebase kept re-adding one page at a time. */
.actions.wrap{margin-top:14px}
/* A bare submit <button> as a direct child of a <form> (not wrapped in
   .actions/.toolbar) is the same "closing button row with no breathing
   room" case as .actions.wrap above -- e.g. "Submit Application" on
   /leave-and-mc/ and a dozen other forms across the app (Apply to Selected
   Days, Submit MC Claim, Create User, Save Profile, Save Rules, etc.) all
   sat flush against whatever field preceded them. One rule instead of
   wrapping each individually, and it can't affect a button already inside
   .actions/.toolbar since those aren't direct <form> children. */
form > button{margin-top:14px}

.msg{min-height:20px;font-size:13.5px;font-weight:600;margin-top:8px}
.msg.ok{color:var(--ok)}
.msg.err{color:var(--bad)}
/* Standalone .err (error text outside a .msg container -- table/panel load
   failures) had no rule at all and silently rendered in the default ink
   color instead of being flagged as an error. */
.err{color:var(--bad);font-weight:600}
.demo-note{background:var(--brand-soft);border:1px solid #cfe0fb;border-radius:12px;padding:10px 12px;margin:14px 0;color:#1e3a6e;font-size:13px}
.strength-meter{height:5px;border-radius:99px;background:#e5e7eb;margin:6px 0;overflow:hidden}
.strength-meter::after{content:'';display:block;height:100%;width:var(--pct,0%);background:var(--col,#dc2626);transition:width .2s,background .2s}
.turnstile-slot{min-height:68px;margin:12px 0;display:flex;justify-content:center;align-items:center}
.turnstile-slot:empty::before{content:'Security check loading…';font-size:12px;color:var(--muted)}

.backfill-panel{border-top:1px dashed var(--line);margin-top:16px;padding-top:16px}

/* ===== Stats / KPIs / snapshots ===== */
.balance{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin:16px 0}
.stat,.kpi{border:1px solid var(--line);background:#fafbfc;border-radius:12px;padding:15px;text-decoration:none;display:block;color:inherit}
.stat span,.kpi span{display:block;color:var(--muted);font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.05em}
.stat strong,.kpi strong{display:block;font-size:22px;margin:4px 0 2px;color:var(--ink)}
.stat small,.kpi small{display:block;color:var(--muted);font-size:11px;margin-top:2px}
.kpi-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin:0 0 18px}
.kpi.clickable{cursor:pointer;transition:transform 120ms var(--ease-out),border-color 120ms ease}
.kpi.clickable:hover{border-color:var(--brand2)}
.kpi.clickable:active{transform:scale(0.97)}
.profile-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px}
.profile-grid .stat{background:#fafbfe}

.snapshot-list{display:grid;gap:8px}
.snapshot-item{padding:11px 13px;border:1px solid var(--line);border-radius:13px;background:#fafbfe;font-size:13.5px}

/* ===== Calendar ===== */
.legend{display:flex;gap:11px;flex-wrap:wrap;margin:8px 0 16px;color:var(--ink-soft);font-size:12.5px}
.legend span{display:inline-flex;align-items:center}
.dot{display:inline-block;width:10px;height:10px;border-radius:99px;margin-right:6px;flex:0 0 auto;background:var(--gray)}
.dot.clock{background:var(--ok)}
.dot.annual_leave{background:var(--blue)}
.dot.mc{background:var(--bad)}
.dot.wfh{background:var(--purple)}
.dot.emergency_leave{background:var(--orange)}
.dot.compassionate_leave{background:var(--pink)}
.dot.replacement_leave_credit{background:var(--indigo)}
.dot.replacement_leave_use{background:var(--cyan)}
.dot.maternity_paternity_leave{background:var(--lime)}
.dot.pending{background:var(--warn)}
.dot.rejected{background:var(--gray)}
.dot.absent{background:var(--brown)}
.dot.backfill{background:var(--teal)}
.dot.holiday{background:var(--fuchsia)}
.dot.claim{background:var(--rose)}
.dot.selected{background:#111827}

.calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border:1px solid var(--line);border-radius:16px;overflow:hidden}
.cal-head{background:#f8fafc;border-bottom:1px solid var(--line);padding:9px;font-weight:800;font-size:12.5px;color:#5b6b84;text-align:center}
.cal-day{min-height:104px;border-right:1px solid var(--line-soft);border-bottom:1px solid var(--line-soft);background:#fff;padding:8px;cursor:default;transition:background .12s ease}
.cal-day:hover{background:#fbfcff}
.cal-day:nth-child(7n){border-right:0}
.cal-day.other{background:#fafbfd}
.cal-day.weekend{background:#eef1f7}
.cal-day.holiday{background:#fdf2fb}
.cal-day.selected{outline:3px solid #111827;outline-offset:-3px;background:#f3f4f6}
.cal-day.today{box-shadow:inset 0 0 0 2px var(--brand2)}
.cal-day.today .day-no{color:var(--brand2);font-weight:700}
.month-nav{display:flex;align-items:center;gap:6px}
.month-nav-btn{padding:6px 12px;font-size:16px;line-height:1;font-weight:700}
.day-detail-item{margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid var(--line-soft)}
.day-detail-item:last-child{border-bottom:0;margin-bottom:0;padding-bottom:0}
.day-no{font-weight:800;margin-bottom:6px;font-size:13px;color:var(--ink-soft)}
.events{display:grid;gap:3px}
.pill{display:inline-block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-radius:99px;padding:3px 7px;font-size:10.5px;font-weight:700;color:#fff;background:var(--gray)}
.pill.clock{background:var(--ok)}
.pill.annual_leave{background:var(--blue)}
.pill.mc{background:var(--bad)}
.pill.wfh{background:var(--purple)}
.pill.emergency_leave{background:var(--orange)}
.pill.compassionate_leave{background:var(--pink)}
.pill.replacement_leave_credit{background:var(--indigo)}
.pill.replacement_leave_use{background:var(--cyan)}
.pill.maternity_paternity_leave{background:var(--lime)}
.pill.pending{background:var(--warn);color:#3a2705}
.pill.rejected{background:var(--gray)}
.pill.absent{background:var(--brown)}
.pill.backfill{background:var(--teal)}
.pill.holiday{background:var(--fuchsia)}
.pill.claim{background:var(--rose)}

/* ===== Lists / badges ===== */
.appItem{border:1px solid var(--line);border-radius:12px;padding:14px 15px;margin-bottom:10px;background:#fff;font-size:13px}
.appItem.unread{border-left:4px solid var(--brand2);background:var(--brand-soft)}
.appItem.read{opacity:.78}
.badge{display:inline-block;border-radius:99px;background:var(--brand-soft);color:var(--brand);font-size:11.5px;padding:3px 9px;font-weight:800}
.badge.pending{background:#fef3c7;color:#92400e}
.badge.demo-badge{background:var(--purple);color:#fff}
tr.row-demo td,.appItem.row-demo{background:linear-gradient(90deg,rgba(124,58,237,.06),transparent)}
.badge.danger-soft{background:#fee2e2;color:#991b1b}
.badge.priority-high{background:#fee2e2;color:#991b1b}
.badge.priority-medium{background:#fef3c7;color:#92400e}
.badge.priority-low{background:#e5e7eb;color:#4b5563}
.global-loading-bar{position:fixed;top:0;left:0;height:3px;width:100%;z-index:2000;background:transparent;overflow:hidden}
.global-loading-bar.hidden{display:none}
.global-loading-bar::before{content:'';position:absolute;top:0;left:-40%;height:100%;width:40%;background:linear-gradient(90deg,transparent,var(--brand2),transparent);animation:global-loading-sweep 1.1s ease-in-out infinite}
@keyframes global-loading-sweep{0%{left:-40%}100%{left:100%}}
.status-dot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:4px;vertical-align:middle}
.status-dot.status-good{background:#0ca30c}
.status-dot.status-warning{background:#fab219}
.status-dot.status-critical{background:#d03b3b}
.status-dot.status-pending{background:#9aa5b1}
.accountability-row{display:grid;grid-template-columns:minmax(0,220px) 1fr auto;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}
.accountability-row:last-child{border-bottom:none}
.accountability-track{background:#eef0f3;border-radius:99px;height:10px;overflow:hidden}
.accountability-fill{height:100%;border-radius:99px;transition:width 200ms var(--ease-out)}
.accountability-fill.status-good{background:#0ca30c}
.accountability-fill.status-warning{background:#fab219}
.accountability-fill.status-critical{background:#d03b3b}
.accountability-fill.status-pending{background:#9aa5b1}
tr.row-flagged{background:rgba(208,59,59,0.08)}
:root[data-theme="dark"] tr.row-flagged{background:rgba(208,59,59,0.18)}
.ceo-rts-snippet{display:block;width:100%;background:none;border:0;padding:4px;margin:0;text-align:left;cursor:pointer;box-shadow:none;text-decoration:none;color:inherit}
.ceo-rts-snippet:hover .kpi{border-color:var(--brand2)}
.kpi-row.compact{grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:8px;margin:0}
.kpi.tiny-kpi{padding:10px 12px}
.kpi.tiny-kpi span{font-size:11.5px}
.kpi.tiny-kpi strong{font-size:16px}
/* Needs Your Attention: reserve a fixed-height label zone (enough for 2 lines)
   so the priority badge and the count land at the same row across every tile,
   regardless of how long each tile's label text happens to be. */
.attn-tile{display:flex;flex-direction:column;gap:6px}
.attn-tile .attn-label{display:block;min-height:2.6em;line-height:1.3;color:var(--muted);font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.05em}
.attn-tile .attn-priority{align-self:flex-start}
.attn-tile .attn-count{display:block;font-size:22px;margin:0;color:var(--ink)}
.week-chart{display:flex;align-items:flex-end;gap:10px;height:76px;padding:6px 2px 0;border-bottom:1px solid var(--line);margin-bottom:14px}
.week-bar-col{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;gap:6px}
.week-bar{width:100%;max-width:26px;min-height:4px;border-radius:5px 5px 0 0;background:var(--brand2);opacity:.5}
.week-bar-today{opacity:1;box-shadow:0 0 0 2px var(--brand3) inset}
.week-bar-col small{color:var(--ink-soft);font-size:11px;font-weight:700}
.dept-chips{display:flex;flex-wrap:wrap;gap:10px}
.dept-chip{display:inline-flex;align-items:center;gap:8px;background:var(--brand-soft);color:var(--brand);border-radius:99px;padding:8px 14px;font-weight:700;font-size:13.5px}
.dept-chip small{background:var(--card);color:var(--ink-soft);border-radius:99px;padding:2px 8px;font-size:11px;font-weight:800}
/* Generic progressive-disclosure section: content starts collapsed behind a
   summary row, so a page's secondary/advanced tools don't read as "that's
   everything" right above the fold. Works standalone (nested inside an
   existing card's padding) or as its own card (.disclosure.card). */
details.disclosure>summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0}
details.disclosure>summary::-webkit-details-marker{display:none}
details.disclosure>summary::after{content:'▾';color:var(--muted);font-size:13px;transition:transform 160ms var(--ease-out);flex-shrink:0}
details.disclosure[open]>summary::after{transform:rotate(180deg)}
details.disclosure>summary h2{margin:0}
details.disclosure>summary:hover{color:var(--brand)}
details.disclosure.card{padding:0;overflow:hidden}
details.disclosure.card>summary{padding:var(--space-5)}
details.disclosure.card>summary:hover{background:var(--brand-soft);color:inherit}
details.disclosure.card>.disclosure-body{padding:0 var(--space-5) var(--space-5)}
/* The topbar used to have two separate .top-actions siblings fighting over
   the parent's justify-content:space-between, which left them floating
   mid-row instead of anchored to the right edge. .topbar-right groups them
   into one flex item so the space-between only ever has two participants:
   the title block, and this whole right-hand cluster.
   On pages with a staff selector (e.g. Calendar), that selector stacks as
   its own row above the icons + month-nav row -- rather than competing with
   them for space in a single row -- both rows staying right-aligned. On
   pages without a staff selector (e.g. Payroll) the select is hidden and
   this collapses to the single icons + month-nav row. */
.topbar-right{display:flex;flex-direction:column;align-items:flex-end;gap:8px}
.topbar-actions-row{display:flex;align-items:center;justify-content:flex-end;gap:14px;flex-wrap:wrap}
.staff-select-row{align-self:flex-end;min-width:200px}
/* Locked to a fixed square regardless of any ancestor's flex-stretch
   behavior (align-items:stretch/width:100% on a .top-actions ancestor at
   narrow widths) -- an icon-only button must never grow to fill available
   width or height the way a form control legitimately does. */
.tray-btn{position:relative;width:40px;height:40px;padding:0;flex:0 0 auto;align-self:center;display:inline-flex;align-items:center;justify-content:center}
.tray-dot{position:absolute;top:6px;right:6px;width:9px;height:9px;border-radius:50%;background:var(--brand3,#f5a623);box-shadow:0 0 0 2px var(--card);animation:trayDotBlink 1.4s ease-in-out infinite}
@keyframes trayDotBlink{0%,100%{opacity:1}50%{opacity:.25}}
@media (prefers-reduced-motion: reduce){ .tray-dot{animation:none} }
.tray-wrap{position:relative;flex:0 0 auto;align-self:center}
.tray-panel{position:absolute;top:calc(100% + 8px);right:0;width:min(360px,90vw);background:var(--card);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow-lg);padding:18px 20px;z-index:200;color:var(--ink-soft);font-size:13px;line-height:1.55}
.tray-panel h3{margin:0 0 10px;font-size:14px;color:var(--ink)}
.tray-panel p{margin:0 0 10px}
.tray-panel p:last-child{margin-bottom:0}
th[data-sort]{cursor:pointer;user-select:none;white-space:nowrap}
th[data-sort]:hover{color:var(--brand)}
th[data-sort]::after{content:'⇅';opacity:.35;margin-left:4px;font-size:10px}
th[data-sort].sort-asc::after{content:'↑';opacity:1}
th[data-sort].sort-desc::after{content:'↓';opacity:1}
input[type="search"]{margin-bottom:12px}

/* ===== Outstanding Report Generator (scoped: presentation-style slides rendered
   at a fixed 1024x768 for consistent PDF export via html2canvas) ===== */
.outrep{overflow-x:auto;display:flex;flex-direction:column;align-items:center;gap:24px;padding:20px 4px;background:#e9edf0;border-radius:14px}
.outrep .slide{width:1024px;min-width:1024px;height:768px;background:#fff;position:relative;overflow:hidden;box-shadow:0 10px 28px rgba(0,0,0,.18);color:#111;font-family:Arial,Helvetica,sans-serif;flex-shrink:0}
.outrep .cover,.outrep .thanks{background:linear-gradient(#ffffff82,#ffffff82),linear-gradient(135deg,#102532,#1c4a63)}
.outrep .logo{position:absolute;top:44px;left:44px;display:flex;align-items:center;gap:12px;font-size:30px;color:#2c9fe0;font-weight:800}
.outrep .logo span{width:48px;height:48px;border-radius:50%;background:linear-gradient(90deg,#6cc5e8 0 50%,#ffb22d 50%)}
.outrep .coverBand{position:absolute;left:0;bottom:110px;width:640px;height:180px;background:rgba(16,37,50,.92);border-top:7px solid #bbd5e1;color:#fff;padding:38px 46px}
.outrep .coverBand h1{margin:0 0 16px;font-size:42px;color:#ffb22d}
.outrep .coverBand p{font-size:24px;margin:0;color:#ffb22d;font-weight:900}
.outrep .thanks .coverBand h1{color:#fff;font-size:58px}
.outrep .sideBg{position:absolute;left:0;top:0;width:200px;height:768px;background:linear-gradient(135deg,#0e2330,#1c4a63)}
.outrep .ribbon{position:absolute;left:36px;top:60px;background:#29475a;color:#fff;font-weight:900;font-size:22px;padding:14px 40px;clip-path:polygon(0 0,100% 0,90% 100%,10% 100%)}
.outrep .rep-title{position:absolute;left:270px;top:60px;right:60px;text-align:center}
.outrep .rep-title h2{font-size:44px;margin:0 0 14px}
.outrep .rep-title p{font-weight:900;margin:0}
.outrep .outrep-kpis{position:absolute;left:48px;right:60px;top:185px;display:grid;grid-template-columns:1fr 1fr;gap:40px 100px}
.outrep .outrep-kpi h3,.outrep .exp h3{font-size:19px;text-transform:uppercase;letter-spacing:2px;margin:0 0 16px}
.outrep .outrep-kpi strong{display:block;font-size:40px}
.outrep .outrep-kpi p{font-size:19px;font-weight:800;margin:14px 0}
.outrep .chartSlide{padding:32px 28px}
.outrep .chartSlide h2,.outrep .tableSlide h2,.outrep .appendix h2{font-family:Georgia,serif;text-align:center;color:#29475a;font-size:38px;margin:0 0 24px}
.outrep .chartPair{display:grid;grid-template-columns:1fr 1fr;gap:22px}
.outrep .chartBox{height:400px;background:#3c3c3c;padding:12px 8px 6px;position:relative;display:flex;flex-direction:column;border-radius:6px}
.outrep .chartBox h3{color:#fff;font-size:26px;line-height:1;margin:0 8px 2px 0;align-self:flex-end}
.outrep .chartBox canvas{width:100%!important;flex:1;min-height:0!important}
.outrep .single .chartBox{width:680px;height:460px;margin:0 auto}
.outrep .emptyNote{display:flex;height:360px;align-items:center;justify-content:center;font-size:26px;font-weight:900;color:#5a6a72}
.outrep .exposureGrid{position:absolute;left:48px;right:48px;top:170px;display:grid;grid-template-columns:1fr 1fr;gap:32px 84px}
.outrep .exp h3{font-size:17px;line-height:1.15;margin:0 0 12px}
.outrep .exp strong{font-size:27px;line-height:1.1;display:block;text-transform:uppercase}
.outrep .exp p{font-size:30px;font-weight:900;margin:14px 0 0;line-height:1.1}
.outrep .exposure .rep-title{top:48px}
.outrep .exposure .rep-title h2{font-size:44px;margin-bottom:12px}
.outrep .appendix{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:14px}
.outrep .appendix h2{font-size:48px}
.outrep .appendix p{font-size:26px;font-weight:800;margin:0}
.outrep .tableSlide{padding:36px 24px}
.outrep .tableSlide h2{font-size:28px;margin-bottom:4px}
.outrep .tableSlide>p{text-align:center;font-size:18px;font-weight:900;margin:0 0 14px}
.outrep .tableWrap{width:100%;overflow:hidden}
.outrep .exposureTable{width:100%;border-collapse:collapse;table-layout:fixed;font-size:9px}
.outrep .exposureTable th,.outrep .exposureTable td{border:1px solid #d4dce2;padding:5px 3px;text-align:center;vertical-align:middle;overflow-wrap:anywhere}
.outrep .exposureTable th{background:#eaf0f4;font-weight:900}
.outrep .exposureTable td:first-child,.outrep .exposureTable th:first-child{width:80px;font-weight:900;background:#f8fafb}
.outrep .exposureTable td:last-child,.outrep .exposureTable th:last-child{width:82px;font-weight:900;background:#f8fafb}
.outrep .source{position:absolute;bottom:20px;left:24px;font-size:11px;color:#5a6a72}
:root[data-theme="dark"] .outrep{background:#0f1522}
@media (max-width:640px){
  .accountability-row{grid-template-columns:1fr;text-align:left}
}
.approveBox{margin-top:10px;padding-top:10px;border-top:1px dashed var(--line)}
.approveBox .actions{margin-top:14px}
.approvals-progress{font-size:12.5px;color:var(--ink-soft);margin:6px 0;padding:6px 10px;background:#f8fafc;border:1px solid var(--line);border-radius:10px}

/* ===== Tables ===== */
.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:12px}
table{width:100%;border-collapse:collapse;background:#fff;min-width:920px}
.access-matrix-table{min-width:700px}
.access-matrix-table th:not(:first-child),.access-matrix-table td:not(:first-child){text-align:center}
input[type="checkbox"]{width:15px;height:15px;vertical-align:middle;accent-color:var(--brand2)}
.access-matrix-table input[type="checkbox"]{margin:0}
.mt-button{margin-top:16px}
.section-gap{margin-top:24px}
.pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;color:var(--muted);font-size:12.5px}
.pagination-actions{display:flex;align-items:center;gap:10px}
.pagination-jump{width:auto;min-height:auto;padding:6px 10px;font-size:12.5px}
.pagination button{padding:7px 11px}
th,td{padding:12px 14px;border-bottom:1px solid var(--line-soft);text-align:left;font-size:12.5px;vertical-align:top}
/* A number inside a table cell that jumps to the page explaining it, for that
   row's person -- kept understated (looks like normal data, not a button) so
   a whole numbers-heavy table doesn't turn into a wall of buttons. */
.cell-link{background:none;border:0;padding:0;margin:0;color:inherit;font:inherit;cursor:pointer;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:2px}
.cell-link:hover{color:var(--brand);text-decoration-style:solid}
th{background:#f8f9fb;color:#59677d;font-size:10.5px;text-transform:uppercase;letter-spacing:.055em;position:sticky;top:0}
tbody tr:nth-child(even) td{background:#fbfcfe}
tbody tr:hover td{background:#eef4ff}
.distance-good{color:var(--ok);font-weight:800}
.distance-warn{color:#b45309;font-weight:800}
.distance-bad{color:var(--bad);font-weight:800}

/* ===== Account security ===== */
.recovery-login{margin:14px 0;border:1px solid var(--line);border-radius:12px;padding:12px;background:#f8fafc}
.recovery-login summary{cursor:pointer;font-weight:750;color:var(--brand);margin-bottom:8px}
.security-card{grid-column:1/-1}
.security-form{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:12px;align-items:end;margin:16px 0}
.security-form label{margin:0}
.security-list{display:grid;gap:10px;margin-top:14px}
.security-item{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:#f8fafc}
.security-item small{display:block;color:var(--muted);margin-top:4px}
.recovery-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px}
.recovery-codes-panel{margin-top:14px;padding:16px;border:1px solid #f0b429;border-radius:12px;background:#fffbeb}
.recovery-codes-panel pre{columns:2;white-space:pre-wrap;font:700 14px/1.8 ui-monospace,SFMono-Regular,Consolas,monospace;color:#172033}
.notice.compact{padding:10px 12px;margin:12px 0;font-size:12.5px}

/* ===== Toast ===== */
#toast{position:fixed;bottom:20px;right:20px;max-width:340px;background:#111827;color:#fff;padding:12px 16px;border-radius:12px;box-shadow:var(--shadow-lg);font-size:13.5px;font-weight:650;z-index:999;opacity:0;transform:translateY(8px);pointer-events:none;transition:opacity .2s,transform .2s}
#toast.show{opacity:1;transform:translateY(0)}
#toast.err{background:var(--bad)}
#toast.ok{background:var(--ok)}

/* ===== Responsive ===== */
@media(max-width:980px){
  body{overflow:auto}
  body.menu-open{overflow:hidden}
  .mobile-topbar{
    display:flex;align-items:center;justify-content:space-between;gap:12px;
    background:#fff;color:var(--ink);border-bottom:1px solid var(--line);padding:calc(12px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 12px max(16px,env(safe-area-inset-left));position:sticky;top:0;z-index:40;
  }
  .mobile-topbar .brand-box{padding:0;border:0}
  .mobile-topbar .actions{gap:8px}
  .hamburger-btn{display:flex;flex-direction:column;gap:4px;justify-content:center;align-items:center;background:#f4f6fa;border:1px solid var(--line);width:40px;height:38px;border-radius:10px;padding:0}
  .hamburger-btn .bar{display:block;width:18px;height:2px;border-radius:2px;background:var(--ink)}
  .icon-btn{display:flex;justify-content:center;align-items:center;width:40px;height:38px;border-radius:10px;padding:0;background:#f4f6fa;border:1px solid var(--line);color:var(--ink)}
  .icon-btn:hover{background:#e9eef6}
  .app-shell{height:auto;min-height:100vh;min-height:100dvh;grid-template-columns:minmax(0,1fr);overflow:visible}
  .app-shell.has-jump-rail{grid-template-columns:minmax(0,1fr)}
  /* No room for a 3rd column on mobile -- the sidebar itself already becomes
     an overlay drawer here, so the jump rail steps aside entirely rather than
     fighting it for space. The content is still reachable by scrolling. */
  .page-jump-rail{display:none}
  .sidebar{
    position:fixed;top:0;left:0;bottom:0;width:270px;max-width:82vw;height:100dvh;padding-top:max(18px,env(safe-area-inset-top));padding-bottom:max(18px,env(safe-area-inset-bottom));z-index:60;
    transform:translateX(-104%);transition:transform 260ms var(--ease-drawer);box-shadow:var(--shadow-lg);
  }
  .sidebar.open{transform:translateX(0)}
  .sidebar .brand-box{display:none}
  .sidebar-overlay{
    display:block;position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:50;
    opacity:0;pointer-events:none;transition:opacity 220ms ease;
  }
  .sidebar-overlay.show{opacity:1;pointer-events:auto}
  .workspace{height:auto;overflow:visible;padding:20px max(16px,env(safe-area-inset-right)) max(36px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));min-width:0}
  .topbar,.grid.two,.grid.three,.grid.four{grid-template-columns:minmax(0,1fr);display:grid}
  .balance,.kpi-row{grid-template-columns:minmax(0,1fr)}
  .calendar{font-size:12px}
  .cal-day{min-height:88px}
  h1{font-size:23px}
}
@media(max-width:640px){
  .top-actions{flex-direction:column;align-items:stretch;width:100%}
  /* The icon-only bell/info-tray pair should never stretch to full width like
     the form-control top-actions groups (month picker, staff select) do --
     they stay compact and right-aligned, same idea as the mobile topbar's own
     icon row. */
  #persistentTopActions{flex-direction:row;align-items:center;width:auto;justify-content:flex-end;align-self:flex-end}
  .topbar-right{width:100%;align-items:stretch}
  .topbar-actions-row{width:100%}
  .staff-select-row{width:100%;min-width:0}
  .cal-head{padding:6px 2px;font-size:10.5px}
  .cal-day{min-height:70px;padding:5px 4px}
  .day-no{font-size:11px;margin-bottom:3px}
  .pill{font-size:9px;padding:2px 4px}
  .card{padding:15px}
  .setting-row{min-height:74px;padding:15px 16px}
  .notice-summary small{display:none}
  .login-card{padding:24px}
  .pagination{align-items:stretch;flex-direction:column}
  .pagination-actions{justify-content:space-between}
  .security-form{grid-template-columns:minmax(0,1fr)}
  .security-item,.recovery-actions{align-items:stretch;flex-direction:column}
  .recovery-codes-panel pre{columns:1}
}
@media(min-width:981px) and (max-width:1280px){
  .app-shell{grid-template-columns:224px minmax(0,1fr)}
  .grid.four,.grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}
  .top-actions{min-width:250px}
}
@media(min-width:981px) and (max-height:820px){
  .sidebar{padding:14px 12px}
  .nav-btn{padding:7px 10px;font-size:12.5px}
  .workspace{padding:16px 18px 26px}
  .card{padding:16px;margin-bottom:14px}
}
