/* ScanLo HR. Base layer + shared pieces, ported 1:1 from .design/project/*.dc.html.
   No Pico. Colours are variables named after the mockup hex they replace; body.dark
   redefines them following .design/project/dark.css.

   CLASS NAMES FOR PAGE TEMPLATES
   Layout
     body_class block: "page-soft" for #F2F5F0 pages (Home, Inbox); default page is white.
     .container            page width 1280, padding 28/24/48 (set in base.html)
     {% block band %}      full-width slot under the top bar (profile band)
     .page-head > h1 + .btn   title row (h1 30px) with action on the right; .count = grey count after h1
     .profile-layout > .info-side + .profile-main    profile pages under the band
     .with-sidebar > .sidebar + content              settings/reports side menu (stacks < 900px)
     .home-layout > aside.home-side + .home-main     Main.dc.html two columns
     .cols-2 / .cols-3     responsive grids (1 column on phones)
   Pieces
     .card                 white rounded box, 12px radius, soft shadow, 24px padding
     .card-flush           same, no padding (for headed cards); .card-head = charcoal header strip
     .section-head > h2 + .last-change    22px heading with bottom rule; "Last changed by ..." line
     .last-change          grey 14px line ("Last changed by X, date · <a>Change history</a>")
     .info-side .info-group .info-key .muted .wrap-any    left info sidebar (Personal.dc.html)
     .balances > .balance (> .balance-label .balance-value .balance-unit .balance-note)
                           time-off balance cards (Main.dc.html); .balance-value.is-muted grey
     .stat-cards > .stat-card (.stat-label .stat-value)    small number cards
     .chip + .chip-pending|approved|rejected|denied|sick|holiday|info|active|inactive|...
     .status-pending|approved|denied   coloured status text (Profile.dc.html list lines)
     .holiday              hatched background (holiday cells / rows)
     .tip                  hover help "i" (use partials/_tip.html or _field.html)
     .avatar-sm (36px) .avatar-md (48px) .avatar-lg (60px) initials circles; add .av-purple|.av-red|.av-lime
     .pill-box             bordered rounded box (Upcoming holidays)
     .table-wrap           horizontal scroll wrapper for wide tables; table.stack = stacked rows on phones
                           (needs data-label="Column" on each td)
     .modal-backdrop > .modal (h2, p, .modal-actions)   dialog; <dialog> gets the same box
   Buttons:  button / .btn = primary lime; .btn-secondary (also button.secondary/.outline);
             .btn-outline (green outline, Main "My Timesheet"); .btn-danger; .btn-white (on charcoal);
             .btn-lg (52px, Clock In); .btn-icon (square 48/52px icon button)
   Forms:    label (column, 14px #3C464A) > input; .form-grid (3 cols, .span-2); fieldset > legend;
             .form-actions (top rule, buttons); input[readonly] grey; .field-error; .hint
*/

:root {
  --c-FFFFFF: #FFFFFF;  /* cards, page */
  --c-F2F5F0: #F2F5F0;  /* soft page, readonly input, info sidebar */
  --c-ECEFE8: #ECEFE8;  /* table head */
  --c-F8FAF6: #F8FAF6;
  --c-E3EDD3: #E3EDD3;  /* lime tint (tip, approved chip) */
  --c-D5E6BB: #D5E6BB;  /* avatar lime tint */
  --c-FFF1D6: #FFF1D6;  /* amber tint */
  --c-FBEAE5: #FBEAE5;  /* red tint */
  --c-E8EEF9: #E8EEF9;  /* blue tint */
  --c-E3E0F3: #E3E0F3;  /* purple tint */
  --c-F6E0DA: #F6E0DA;
  --c-1F2528: #1F2528;  /* charcoal (bars, band) */
  --t-1F2528: #1F2528;  /* main text */
  --t-3C464A: #3C464A;  /* labels, th */
  --t-566065: #566065;  /* muted */
  --t-6B7679: #6B7679;
  --t-4A7C14: #4A7C14;  /* green text, links */
  --t-5E9A1C: #5E9A1C;  /* lime ink */
  --t-8A5A10: #8A5A10;  /* amber text */
  --t-6B4A12: #6B4A12;
  --t-8A2B17: #8A2B17;  /* red text */
  --t-7A2F1E: #7A2F1E;
  --t-3D2F7A: #3D2F7A;  /* purple text */
  --t-23427A: #23427A;  /* blue text */
  --t-C2410C: #C2410C;  /* orange warning */
  --b-DDE3D6: #DDE3D6;  /* rules */
  --b-E5EADF: #E5EADF;  /* row borders */
  --b-E9EDE3: #E9EDE3;
  --b-C5CEBC: #C5CEBC;  /* input borders */
  --link: #4A7C14; --link-hover: #3A6410;
  --lime: #86C232; --ink-on-lime: #14191B;
  --danger: #B42318;
  --hatch-a: #ECEFE8; --hatch-b: #E1E5DA;
  --shadow-card: 0 1px 2px rgba(20,40,30,0.08);
  --font: Barlow, system-ui, sans-serif;
  --font-display: 'Barlow Condensed', Impact, sans-serif;
}
body.dark {
  --c-FFFFFF: #283034; --c-F2F5F0: #2D363A; --c-ECEFE8: #2D363A; --c-F8FAF6: #262E32;
  --c-E3EDD3: #34402A; --c-D5E6BB: #41532F; --c-FFF1D6: #3A3320; --c-FBEAE5: #3A2622;
  --c-E8EEF9: #25304A; --c-E3E0F3: #2E2842; --c-F6E0DA: #3A2622; --c-1F2528: #14191B;
  --t-1F2528: #F2F5F0; --t-3C464A: #D0D8D2; --t-566065: #A9B3AE; --t-6B7679: #8C9792;
  --t-4A7C14: #A4D65E; --t-5E9A1C: #86C232; --t-8A5A10: #E3B25A; --t-6B4A12: #E3C27A;
  --t-8A2B17: #F0A898; --t-7A2F1E: #F0A898; --t-3D2F7A: #B9A8F0; --t-23427A: #9DB6F0; --t-C2410C: #F0A070;
  --b-DDE3D6: #3A4448; --b-E5EADF: #3A4448; --b-E9EDE3: #3A4448; --b-C5CEBC: #3A4448;
  --link: #A4D65E; --link-hover: #C2E58F;
  --hatch-a: #2D363A; --hatch-b: #364044;
  color-scheme: dark;
}

/* ---------------------------------------------------------------- reset + base */
*, *::before, *::after { box-sizing: border-box; }
/* html and body always fill the window with the page colour (no strip of another colour under short pages). */
html { -webkit-text-size-adjust: 100%; min-height: 100%; background: #FFFFFF; }
html:has(body.page-soft) { background: #F2F5F0; }
html:has(body.dark) { background: #283034; }
html:has(body.dark.page-soft) { background: #2D363A; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; font-family: var(--font); font-size: 16px; line-height: 1.35; color: var(--t-1F2528); background: var(--c-FFFFFF); overflow-x: hidden; }
body.page-soft { background: var(--c-F2F5F0); }
html:has(body.page-login), body.page-login { background: #1F2528; }
html:has(body.dark.page-login), body.dark.page-login { background: #14191B; }
body.page-login .container { max-width: none; padding: 0; }
button, input, select, textarea, optgroup, a, nav, label { font-family: var(--font); }
img, svg { max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { font-family: var(--font-display); font-style: italic; font-weight: 800; margin: 0 0 12px; line-height: 1.15; color: var(--t-1F2528); }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 12px; padding-left: 22px; }
:where(a) { color: var(--link); }
:where(a):hover { color: var(--link-hover); }
small { font-size: 14px; }
hr { border: 0; border-top: 1px solid var(--b-DDE3D6); margin: 16px 0; }
dl { margin: 0 0 12px; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
dt { color: var(--t-3C464A); font-size: 14px; }
dd { margin: 0; }
code { font-size: 14px; }
.muted { color: var(--t-566065); }
.wrap-any { overflow-wrap: anywhere; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { max-width: 1280px; margin: 0 auto; padding: 28px 24px 48px; }
body:has(.profile-band) .container { padding-top: 0; }
main { min-width: 0; }
.msg { background: var(--c-E3EDD3); color: var(--t-4A7C14); border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-weight: 600; }
.msg.error, .msg.warning { background: var(--c-FBEAE5); color: var(--t-8A2B17); }

/* ---------------------------------------------------------------- buttons */
button, .btn, [role="button"], input[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer;
  background: var(--lime); color: var(--ink-on-lime); border: 0; border-radius: 6px;
  padding: 12px 20px; min-height: 44px; margin: 0;
}
button:hover, .btn:hover, [role="button"]:hover { background: #7AB22C; color: var(--ink-on-lime); }
button:focus-visible, .btn:focus-visible, a:focus-visible, [role="button"]:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
button:disabled { opacity: .55; cursor: not-allowed; }
.btn-secondary, button.secondary, button.outline, .btn.secondary, a.secondary[role="button"] {
  background: var(--c-FFFFFF); color: var(--t-1F2528); border: 1px solid var(--b-C5CEBC); font-weight: 400;
}
.btn-secondary:hover, button.secondary:hover, button.outline:hover { background: var(--c-F2F5F0); color: var(--t-1F2528); }
.btn-outline { background: var(--c-FFFFFF); color: var(--link); border: 1px solid var(--t-5E9A1C); border-radius: 8px; padding: 10px 14px; font-weight: 600; }
.btn-outline:hover { background: var(--c-E3EDD3); color: var(--link); }
.btn-danger { background: var(--danger); color: #FFFFFF; }
.btn-danger:hover { background: #95190F; color: #FFFFFF; }
.btn-white { background: var(--c-FFFFFF); color: var(--t-1F2528); padding: 10px 14px; font-weight: 600; min-height: 0; }
.btn-white:hover { background: var(--c-F2F5F0); color: var(--t-1F2528); }
.btn-lg { min-height: 52px; border-radius: 8px; font-size: 18px; }
.btn-icon { width: 52px; min-height: 52px; padding: 0; border-radius: 8px; background: var(--c-FFFFFF); border: 1px solid var(--t-5E9A1C); color: var(--t-5E9A1C); }
.btn-icon.is-grey { width: 48px; min-height: 48px; border-color: var(--b-C5CEBC); color: var(--t-566065); }
.btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--link); font-weight: 400; text-decoration: underline; }
.btn-link:hover { background: none; color: var(--link-hover); }

/* ---------------------------------------------------------------- forms */
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--t-3C464A); min-width: 0; }
label > span:first-child { display: inline-flex; align-items: center; flex-wrap: wrap; }
input, select, textarea {
  font: inherit; color: var(--t-1F2528); background: var(--c-FFFFFF);
  padding: 10px; border: 1px solid var(--b-C5CEBC); border-radius: 6px; width: 100%; max-width: 100%; min-width: 0;
}
input[type="checkbox"], input[type="radio"] { width: auto; padding: 0; accent-color: var(--t-5E9A1C); }
label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) { flex-direction: row; align-items: center; gap: 8px; }
input[readonly], input:disabled, select:disabled, textarea[readonly] { border-color: var(--b-DDE3D6); background: var(--c-F2F5F0); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--lime); outline-offset: -1px; border-color: var(--t-5E9A1C); }
textarea { min-height: 88px; resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0 0 28px; min-width: 0; }
legend { font-weight: 700; font-size: 17px; margin-bottom: 12px; padding: 0; display: flex; align-items: center; gap: 8px; color: var(--t-1F2528); }
form > label, fieldset > label { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-grid > label { margin: 0; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--b-DDE3D6); padding-top: 16px; margin-top: 8px; }
.field { margin-bottom: 16px; }
.field-label { display: inline-flex; align-items: center; flex-wrap: wrap; }
.field-error { color: var(--t-C2410C); display: block; font-size: 14px; }
.hint, .field + small { color: var(--t-566065); font-size: 14px; display: block; margin: -10px 0 16px; }
.errorlist { color: var(--t-C2410C); list-style: none; padding: 0; margin: 0 0 12px; font-size: 14px; }

/* ---------------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 12px; text-align: left; font-size: 13px; font-weight: 700; color: var(--t-3C464A); background: var(--c-ECEFE8); }
td { padding: 12px; border-bottom: 1px solid var(--b-E5EADF); text-align: left; }
th > button.sort { background: none; border: 0; padding: 0; min-height: 0; font: inherit; font-weight: 700; color: inherit; width: 100%; justify-content: flex-start; }
th a { color: inherit; text-decoration: none; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- top bar (Nav.dc.html) */
.topbar { font-family: var(--font); color: #F2F5F0; background: var(--c-1F2528); border-bottom: 3px solid var(--lime); }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 20px; min-height: 61px; }
.topbar-logo { display: flex; align-items: center; gap: 10px; color: #F2F5F0; text-decoration: none; font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 24px; line-height: 1; white-space: nowrap; flex: none; }
.topbar-logo img { display: block; height: 24px; width: auto; }
.topbar-logo span { color: var(--lime); }
.topbar-logo:hover { color: #F2F5F0; }
.topbar-nav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1 1 auto; min-width: 0; }
.topbar-nav a { color: #D5DDD0; text-decoration: none; padding: 10px 12px; font-weight: 500; border-radius: 6px; white-space: nowrap; }
.topbar-nav a:hover { color: #FFFFFF; }
.topbar-nav a.on { color: var(--ink-on-lime); background: var(--lime); font-weight: 700; }
.topbar-search { margin: 0; }
.topbar-search label { flex-direction: row; align-items: center; gap: 8px; border: 1px solid #4A565A; border-radius: 20px; padding: 0 12px; height: 38px; color: #C5CEBC; font-size: 16px; }
.topbar-search label:focus-within, .menu-search label:focus-within { outline: 2px solid var(--lime); outline-offset: 2px; border-color: var(--lime); }
.topbar-search input { border: 0; background: transparent; color: #F2F5F0; font: inherit; width: 120px; padding: 0; outline: none; }
.topbar-search input::placeholder { color: #A9B3AE; }
.topbar-tools { display: flex; align-items: center; gap: 20px; }
.topbar-tools form { margin: 0; display: flex; }
.topbar .icon-btn { position: relative; width: 40px; height: 40px; min-height: 0; display: flex; align-items: center; justify-content: center; color: #C5CEBC; background: none; border: 0; padding: 0; border-radius: 6px; }
.topbar .icon-btn:hover { color: #FFFFFF; background: none; }
.topbar .badge { position: absolute; top: 2px; right: 0; background: #C2410C; color: #FFFFFF; border-radius: 9px; font-size: 11px; font-weight: 700; padding: 1px 5px; line-height: 1.2; }
.topbar .avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 2px solid var(--lime); background: var(--lime); color: var(--ink-on-lime); font-weight: 700; display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 14px; }
.topbar .logout { width: 32px; }
/* Phone menu: JS-only (html.js). Without JS the nav strip stays and the button and panel never show. */
.topbar-menu-btn, .topbar-menu { display: none; }
.topbar-menu-btn { width: 44px; min-height: 44px; height: 44px; padding: 0; color: #F2F5F0; background: none; border: 1px solid #4A565A; border-radius: 6px; }
.topbar-menu-btn:hover { background: #2D363A; color: #FFFFFF; }
.topbar-menu[hidden] { display: none !important; }
.topbar-menu nav { display: flex; flex-direction: column; }
.topbar-menu a { display: flex; align-items: center; min-height: 44px; padding: 10px 12px; color: #D5DDD0; text-decoration: none; font-weight: 500; border-radius: 6px; }
.topbar-menu a:hover { color: #FFFFFF; background: #2D363A; }
.topbar-menu a.on { color: var(--ink-on-lime); background: var(--lime); font-weight: 700; }
.menu-search { margin: 8px 0 12px; }
.menu-search label { display: block; margin: 0; }
.menu-search input { width: 100%; min-height: 44px; border: 1px solid #4A565A; border-radius: 22px; background: #14191B; color: #F2F5F0; font: inherit; padding: 0 16px; outline: none; }
.menu-search input::placeholder { color: #A9B3AE; }

/* ---------------------------------------------------------------- profile band (ProfileHead.dc.html) */
.profile-band { font-family: var(--font); background: var(--c-1F2528); }
.profile-band-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; }
.band-avatar-wrap { width: 200px; display: flex; justify-content: center; position: relative; z-index: 1; }
.band-avatar { width: 164px; height: 164px; border-radius: 50%; background: var(--c-D5E6BB); color: var(--t-1F2528); font-size: 52px; font-family: var(--font); font-weight: 700; letter-spacing: 0.02em; display: flex; align-items: center; justify-content: center; border: 5px solid #FFFFFF; margin: 20px 0 -48px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.band-main { flex: 1 1 500px; min-width: 0; }
.band-title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 28px; }
.band-title h1 { color: #FFFFFF; font-size: 30px; margin: 0; flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
.band-sub { color: #C5CEBC; font-size: 15px; flex: 1 1 auto; }
.band-title .chip { flex: none; }
.band-title h1 small { font-size: 18px; color: #C5CEBC; }
.band-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 18px; }
.band-tabs a { color: #FFFFFF; text-decoration: none; padding: 12px 16px; font-weight: 600; white-space: nowrap; }
.band-tabs a:hover { color: var(--lime); }
.band-tabs a.on { color: var(--t-1F2528); background: var(--c-FFFFFF); font-weight: 700; border-radius: 6px 6px 0 0; }

/* ---------------------------------------------------------------- page layouts */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-head h1 { margin: 0; flex: 1 1 auto; }
.count, h1 .count { font-family: var(--font); font-style: normal; font-size: 16px; font-weight: 500; color: var(--t-566065); }
.profile-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.profile-main { flex: 999 1 560px; min-width: 0; padding-top: 24px; }
.with-sidebar { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.with-sidebar > * { min-width: 0; }
.sidebar { background: var(--c-FFFFFF); border: 1px solid var(--b-DDE3D6); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.sidebar a { display: block; padding: 10px 12px; border-radius: 6px; text-decoration: none; color: var(--t-1F2528); font-weight: 500; }
.sidebar a:hover { background: var(--c-F2F5F0); color: var(--t-1F2528); }
.sidebar a.on { background: var(--lime); color: var(--ink-on-lime); font-weight: 700; }
.home-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.home-side { flex: 1 1 300px; max-width: 340px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.home-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; align-items: start; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; align-items: end; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--c-FFFFFF); border-radius: 12px; box-shadow: var(--shadow-card); padding: 24px; margin-bottom: 16px; min-width: 0; }
body:not(.page-soft) .card { border: 1px solid var(--b-DDE3D6); }
.card > h2:first-child, .card > h3:first-child { font-size: 18px; margin: 0 0 12px; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { background: var(--c-1F2528); color: #FFFFFF; padding: 16px 20px; display: flex; align-items: center; gap: 14px; }
.card-head a { color: #FFFFFF; font-weight: 700; font-size: 19px; text-decoration: none; }
.card-head .sub { color: #D5DDD0; font-size: 14px; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding: 14px 20px 20px; border-top: 1px solid var(--b-E9EDE3); }
.pill-box { border: 1px solid var(--b-DDE3D6); border-radius: 10px; padding: 12px 16px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 12px; }
.sub-head { color: var(--t-566065); font-size: 14px; font-weight: 600; margin: 12px 0 8px; }

/* ---------------------------------------------------------------- info sidebar (Personal.dc.html aside) */
.info-side { flex: 1 1 200px; max-width: 200px; background: var(--c-F2F5F0); padding: 64px 16px 24px; display: flex; flex-direction: column; gap: 20px; font-size: 14px; align-self: stretch; min-width: 0; }
.info-group { display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
.info-group + .info-group { border-top: 1px solid var(--b-DDE3D6); padding-top: 16px; }
.info-key { color: var(--t-4A7C14); font-weight: 700; }

/* ---------------------------------------------------------------- section heading + last changed */
.section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border-bottom: 1px solid var(--b-DDE3D6); padding-bottom: 12px; margin-bottom: 28px; }
.section-head h2 { margin: 0; font-size: 22px; flex: 1 1 auto; }
.last-change { color: var(--t-566065); font-size: 14px; margin: 0; }
.last-change small { font-size: inherit; }

/* ---------------------------------------------------------------- balances + stat cards (Main.dc.html) */
.balances { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.balance { padding: 20px; text-align: center; }
.balance + .balance { border-left: 1px solid var(--b-E5EADF); }
.balance-label { font-weight: 600; }
.balance-value { font-size: 34px; font-family: var(--font-display); font-weight: 700; color: var(--t-5E9A1C); margin-top: 4px; line-height: 1.1; }
.balance-value.is-muted { color: var(--t-566065); }
.balance-unit { color: var(--t-4A7C14); font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.balance-unit.is-muted { color: var(--t-566065); }
.balance-note { color: var(--t-566065); font-size: 13px; margin-top: 4px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: var(--c-FFFFFF); border: 1px solid var(--b-E5EADF); border-radius: 10px; padding: 16px; text-align: center; }
.stat-card .stat-label { font-weight: 600; font-size: 14px; }
.stat-card .stat-value { font-family: var(--font-display); font-weight: 700; font-size: 34px; color: var(--t-5E9A1C); line-height: 1.1; margin-top: 4px; }
.stat-card small { color: var(--t-566065); font-size: 13px; }
.mini-stat .k { color: var(--t-566065); font-size: 13px; }
.mini-stat .v { font-weight: 700; color: var(--t-4A7C14); }

/* ---------------------------------------------------------------- avatars */
.avatar-sm, .avatar-md, .avatar-lg { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; background: var(--c-D5E6BB); color: var(--t-1F2528); }
.avatar-sm { width: 36px; height: 36px; font-size: 14px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 60px; height: 60px; font-size: 22px; border: 3px solid #FFFFFF; }
.av-purple { background: var(--c-E3E0F3); color: var(--t-3D2F7A); }
.av-red { background: var(--c-F6E0DA); color: var(--t-7A2F1E); }
.av-lime { background: var(--c-D5E6BB); color: var(--t-1F2528); }

/* ---------------------------------------------------------------- status chips + status text */
.chip { display: inline-block; border-radius: 10px; padding: 2px 8px; font-size: 12px; font-weight: 700; line-height: 1.35; white-space: nowrap; background: var(--c-E8EEF9); color: var(--t-23427A); }
.chip-pending, .chip-wait, .chip-submitted, .chip-cancel_requested, .chip-out { background: var(--c-FFF1D6); color: var(--t-6B4A12); }
.chip-approved, .chip-ok, .chip-active { background: var(--c-E3EDD3); color: var(--t-4A7C14); }
.chip-rejected, .chip-denied, .chip-bad, .chip-sent_back, .chip-inactive, .chip-cancelled { background: var(--c-FBEAE5); color: var(--t-8A2B17); }
.chip-sick, .chip-off { background: var(--c-E3E0F3); color: var(--t-3D2F7A); }
.chip-info, .chip-draft, .chip-open { background: var(--c-E8EEF9); color: var(--t-23427A); }
.chip-holiday { color: var(--t-566065); border: 1px solid var(--b-C5CEBC); background: repeating-linear-gradient(135deg, var(--hatch-a), var(--hatch-a) 8px, var(--hatch-b) 8px, var(--hatch-b) 16px); }
.status-pending { color: var(--t-8A5A10); }
.status-approved { color: var(--t-4A7C14); }
.status-denied, .status-rejected { color: var(--t-8A2B17); }
.holiday, .cell-holiday { background: repeating-linear-gradient(135deg, var(--hatch-a), var(--hatch-a) 8px, var(--hatch-b) 8px, var(--hatch-b) 16px); color: var(--t-566065); }

/* ---------------------------------------------------------------- hover help (.tip, from the mockups) */
.tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--c-E3EDD3); color: #1F2528; font-size: 11px; font-weight: 700; cursor: help; margin-left: 6px; font-style: normal; flex: none; }
.tip:hover::after, .tip:focus::after { content: attr(data-tip); position: absolute; left: 0; bottom: calc(100% + 8px); width: min(260px, 70vw); background: #1F2528; color: #FFFFFF; padding: 8px 10px; border-radius: 6px; font-size: 13px; font-weight: 400; line-height: 1.4; z-index: 20; white-space: normal; text-align: left; }
.tip:focus { outline: 2px solid var(--lime); outline-offset: 2px; }
body.dark .tip { background: #34402A; color: #A4D65E; }
body.dark .tip:hover::after, body.dark .tip:focus::after { background: #14191B; color: #F2F5F0; }

/* ---------------------------------------------------------------- dialogs (People.dc.html) */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,32,26,0.55); display: flex; align-items: flex-start; justify-content: center; padding: 160px 16px; z-index: 50; overflow-y: auto; }
.modal, dialog { background: var(--c-FFFFFF); color: var(--t-1F2528); border: 0; border-radius: 12px; width: 100%; max-width: 460px; padding: 24px; box-shadow: 0 20px 48px rgba(0,0,0,0.25); height: fit-content; }
.modal h2, dialog h2 { font-family: var(--font); font-style: normal; font-weight: 700; margin: 0 0 8px; font-size: 20px; }
.modal p, dialog p { margin: 0 0 20px; color: var(--t-3C464A); }
.modal-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
dialog::backdrop { background: rgba(20,32,26,0.55); }
dialog[open]:not(.inline) { position: fixed; inset: 0; margin: 160px auto auto; z-index: 50; max-width: min(460px, calc(100vw - 32px)); }

/* ---------------------------------------------------------------- details / summary (legacy pages) */
details > summary { cursor: pointer; }
details > summary[role="button"] { list-style: none; display: inline-flex; }
details > summary[role="button"]::-webkit-details-marker { display: none; }
details[open] > summary[role="button"] { margin-bottom: 16px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .topbar-search { display: none; }
  html.js .topbar-nav { display: none; }
  html.js .topbar-menu-btn { display: inline-flex; }
  html.js .topbar-menu:not([hidden]) { display: block; order: 4; flex: 1 1 100%; padding: 4px 0 8px; }
}
@media (max-width: 1000px) {
  .band-avatar-wrap { width: auto; }
  .band-avatar { width: 112px; height: 112px; font-size: 40px; border-width: 4px; margin: 20px 0 0; }
  .band-main { flex-basis: 100%; }
  .band-title { padding-top: 0; }
}
@media (max-width: 640px) {
  .profile-band-inner { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 14px; align-items: center; }
  .band-main { display: contents; }
  .band-avatar-wrap { margin-top: 0; }
  .band-avatar { width: 72px; height: 72px; font-size: 28px; border-width: 3px; margin: 14px 0; }
  .band-title { grid-column: 2; }
  .band-tabs { grid-column: 1 / -1; margin-top: 4px; }
}
@media (max-width: 900px) {
  .with-sidebar { grid-template-columns: minmax(0, 1fr); }
  .sidebar { flex-direction: row; overflow-x: auto; }
  .sidebar a { white-space: nowrap; }
  .info-side { max-width: none; flex-basis: 100%; padding: 16px; flex-direction: row; flex-wrap: wrap; gap: 16px 24px; }
  .info-group + .info-group { border-top: 0; padding-top: 0; border-left: 1px solid var(--b-DDE3D6); padding-left: 24px; }
  .profile-main { padding-top: 8px; }
  .home-side { max-width: none; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Safety net: any table not already wrapped scrolls inside itself. */
  main table:not(.stack) { display: block; overflow-x: auto; max-width: 100%; }
  .table-wrap table:not(.stack) { display: table; }
  .band-avatar-wrap { width: auto; }
  .band-avatar { width: 112px; height: 112px; font-size: 40px; border-width: 4px; margin: 20px 0 0; }
  .band-main { flex-basis: 100%; }
  .band-title { padding-top: 0; }
  .band-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
}
@media (max-width: 760px) {
  .topbar-inner { gap: 4px 12px; padding: 8px 16px 0; }
  .topbar-logo { flex: 1 1 auto; font-size: 19px; gap: 6px; }
  .topbar-logo img { height: 18px; }
  .topbar-tools { gap: 2px; }
  .topbar .icon-btn { width: 36px; }
  .topbar .avatar { width: 34px; height: 34px; margin: 0 2px; }
  .topbar-nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 4px 16px 8px; }
  .topbar-nav::-webkit-scrollbar, .band-tabs::-webkit-scrollbar { display: none; }
  .container { padding: 20px 16px 40px; }
  .profile-band-inner { padding: 0 16px; gap: 12px 16px; align-items: flex-start; }
  .band-avatar { width: 72px; height: 72px; font-size: 28px; border-width: 3px; margin: 16px 0 0; }
  .band-main { flex: 1 1 0; }
  .band-title { padding-top: 16px; }
  .band-title h1 { font-size: 24px; flex-basis: 100%; }
  .band-tabs { margin: 12px -16px 0 -104px; padding-left: 16px; }
  .band-tabs a { padding: 10px 12px; }
  h1 { font-size: 26px; }
}
@media (max-width: 600px) {
  .form-grid, .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .card { padding: 16px; }
  .card-flush { padding: 0; }
  .info-group + .info-group { border-left: 0; padding-left: 0; }
  .modal-backdrop { padding: 64px 16px; }
  dialog[open]:not(.inline) { margin-top: 64px; }
  dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  dd { margin-bottom: 8px; }
  /* Stacked rows: <table class="stack"> with data-label on each td. */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border-bottom: 1px solid var(--b-E5EADF); padding: 8px 0; }
  table.stack td { border: 0; padding: 4px 0; display: flex; gap: 12px; }
  table.stack td[data-label]::before { content: attr(data-label); flex: 0 0 40%; color: var(--t-566065); font-size: 13px; font-weight: 700; }
}
