/* ================================================================
   HRM Pane by Profitiq: ledger design system.
   Light paper surfaces, hairline rules, uppercase micro-labels and
   monospaced figures. Public Sans for text, IBM Plex Mono for numbers,
   Montserrat for the Profitiq wordmark, Newsreader on the sign-in art.
   Tokens first, then shell, then components. Class names are shared with
   every Blade view, so rename nothing here without grepping the views.
   ================================================================ */

:root {
  --bg: #f1f1ee;
  --surface: #ffffff;
  --surface-2: #f8f8f6;
  --surface-hover: #f3f3ef;
  --border: #dcdcd6;
  --border-soft: #e9e9e4;
  --border-strong: #c8c8c1;
  --text: #111111;
  --text-2: #4a4a45;
  --text-3: #7a7a73;
  /* Black ink, yellow highlight, white paper. Links use a deep amber so they stay readable on white. */
  --primary: #111111;
  --primary-hover: #000000;
  --primary-2: #8f6500;
  --primary-soft: #fff4cc;
  --primary-ink: #ffffff;
  --yellow: #ffc800;
  --yellow-ink: #111111;
  --accent: #8f6500;
  --accent-soft: #fff4cc;
  --gold: #ffc800;
  --nav-label: #7a7a73;
  --good: #1a6b3c;
  --good-soft: #e2f2e8;
  --warn: #8a5a00;
  --warn-soft: #fff1cc;
  --bad: #a32020;
  --bad-soft: #fbe6e6;
  --info: #1d4ed8;
  --info-soft: #e6ecfd;
  --c-present: #1a1a1a;
  --c-late: #ffc800;
  --c-wfh: #9a9a93;
  --c-leave: #3fa7b5;
  --c-absent: #c0392b;
  --chart-1: #1a1a1a;
  --chart-2: #ffc800;
  --chart-3: #9a9a93;
  --shadow-sm: 0 1px 1px rgba(0, 0, 0, .04);
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 8px 24px -18px rgba(0, 0, 0, .35);
  --shadow-lg: 0 16px 36px -14px rgba(0, 0, 0, .3);
  --radius: 8px;
  --radius-sm: 6px;
  --font: "Public Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --brand-font: "Montserrat", "Public Sans", sans-serif;
  --font-display: var(--font);
  --sidebar: 248px;
  --sidebar-collapsed: 64px;
  --top: 54px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a; --surface: #141414; --surface-2: #191919; --surface-hover: #1f1f1f;
    --border: #2b2b2b; --border-soft: #222222; --border-strong: #3a3a3a;
    --text: #f3f3ef; --text-2: #b3b3ac; --text-3: #85857e; --nav-label: #85857e;
    --primary: #ffc800; --primary-hover: #ffd633; --primary-2: #ffc800; --primary-soft: #2a2206; --primary-ink: #111111;
    --accent: #ffc800; --accent-soft: #2a2206; --yellow: #ffc800; --yellow-ink: #111111;
    --good: #5fc98a; --good-soft: #12291d; --warn: #ffcf4d; --warn-soft: #2b2310; --bad: #f28b8b; --bad-soft: #2d1618; --info: #8fb3ff; --info-soft: #151f33;
    --c-present: #f3f3ef; --c-late: #ffc800; --c-wfh: #8a8a84; --chart-1: #f3f3ef; --chart-2: #ffc800; --chart-3: #8a8a84;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 30px -20px rgba(0, 0, 0, .9); --shadow-lg: 0 16px 40px -12px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0a; --surface: #141414; --surface-2: #191919; --surface-hover: #1f1f1f;
  --border: #2b2b2b; --border-soft: #222222; --border-strong: #3a3a3a;
  --text: #f3f3ef; --text-2: #b3b3ac; --text-3: #85857e; --nav-label: #85857e;
  --primary: #ffc800; --primary-hover: #ffd633; --primary-2: #ffc800; --primary-soft: #2a2206; --primary-ink: #111111;
  --accent: #ffc800; --accent-soft: #2a2206; --yellow: #ffc800; --yellow-ink: #111111;
  --good: #5fc98a; --good-soft: #12291d; --warn: #ffcf4d; --warn-soft: #2b2310; --bad: #f28b8b; --bad-soft: #2d1618; --info: #8fb3ff; --info-soft: #151f33;
  --c-present: #f3f3ef; --c-late: #ffc800; --c-wfh: #8a8a84; --chart-1: #f3f3ef; --chart-2: #ffc800; --chart-3: #8a8a84;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 30px -20px rgba(0, 0, 0, .9); --shadow-lg: 0 16px 40px -12px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 13.5px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary-2); text-decoration: none; }
a:hover { color: var(--primary); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { letter-spacing: -.025em; }
p { margin: 0 0 8px; }
:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--primary-soft); color: var(--text); }
.icon { flex: none; }
.muted { color: var(--text-3); }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.mono { letter-spacing: .02em; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { display: block; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); font-weight: 650; margin-bottom: 3px; }

/* ---------------- shell ---------------- */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.app.collapsed { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr); }

/* Sidebar in black: light text, yellow marks the current page. */
.sidebar {
  --side-bg: #161616; --side-bg-2: #0a0a0a; --side-text: rgba(255, 255, 255, .78); --side-strong: #ffffff; --side-muted: #9a9a92;
  --side-line: rgba(255, 255, 255, .08); --side-field: rgba(255, 255, 255, .06); --side-hover: rgba(255, 255, 255, .06); --side-active: rgba(255, 200, 0, .14); --side-mark: #ffc800;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; z-index: 40; color: var(--side-text);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 34px),
    radial-gradient(260px 200px at 0 100%, rgba(255, 200, 0, .12), transparent 70%),
    linear-gradient(180deg, var(--side-bg), var(--side-bg-2));
}
:root[data-theme="dark"] .sidebar { --side-bg: #111111; --side-bg-2: #050505; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sidebar { --side-bg: #111111; --side-bg-2: #050505; } }
.brand { display: flex; align-items: center; gap: 10px; height: var(--top); padding: 0 16px; border-bottom: 1px solid var(--side-line); color: var(--side-strong); flex: none; }
.brand:hover { text-decoration: none; color: var(--side-strong); }
.brand-mark { width: 22px; height: 30px; display: grid; place-items: center; flex: none; }
.brand-mark img { width: 100%; height: 100%; display: block; }
.brand-name { font-family: var(--brand-font); font-weight: 700; font-size: 14.5px; line-height: 1.05; letter-spacing: .14em; color: var(--side-strong); white-space: nowrap; }
.brand-name small { display: block; margin-top: 3px; font-family: var(--font); font-size: 9.5px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--side-mark); }

.ctx { padding: 10px 12px; display: grid; gap: 6px; border-bottom: 1px solid var(--side-line); }
.sidebar .ctx select { width: 100%; height: 30px; background-color: var(--side-field); color: var(--side-strong); border: 1px solid var(--side-line); border-radius: var(--radius-sm); padding: 0 26px 0 9px; font: inherit; font-size: 12.5px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23bdbdb5' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.sidebar .ctx select option { color: #111111; background: #fff; }
.ctx .fixed { font-size: 12px; padding: 6px 9px; border-radius: var(--radius-sm); background: var(--side-field); border: 1px solid var(--side-line); color: var(--side-text); }

.nav-find { position: relative; padding: 10px 12px 6px; }
.nav-find input { width: 100%; height: 30px; padding: 0 44px 0 28px; border-radius: var(--radius-sm); border: 1px solid var(--side-line); background: var(--side-field); color: var(--side-strong); font: inherit; font-size: 12.5px; }
.nav-find input::placeholder { color: var(--side-muted); }
.nav-find input:focus { outline: none; border-color: rgba(255, 200, 0, .55); background: rgba(255, 255, 255, .09); }
.nav-find .icon { position: absolute; left: 21px; top: 18px; width: 14px; height: 14px; color: var(--side-muted); pointer-events: none; }
.nav-find kbd { position: absolute; right: 19px; top: 16px; font: 9.5px var(--mono); color: var(--side-muted); border: 1px solid var(--side-line); border-radius: 3px; padding: 1px 4px; background: transparent; }

.nav { flex: 1; overflow-y: auto; padding: 0 0 12px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .14) transparent; }
/* Sections fold so a long menu stays short; the one holding the current page is open. */
.nav-section { padding: 2px 0; }
.nav-section + .nav-section { border-top: 1px solid var(--side-line); }
.nav-label { display: flex; align-items: center; gap: 6px; padding: 8px 16px 5px; font-size: 9.5px; font-weight: 650; letter-spacing: .13em; text-transform: uppercase; color: var(--side-muted); white-space: nowrap; cursor: pointer; list-style: none; user-select: none; }
.nav-label::-webkit-details-marker { display: none; }
.nav-label::after { content: ""; margin-left: auto; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.nav-section[open] > .nav-label::after { transform: rotate(45deg); }
.nav-label:hover { color: var(--side-strong); }
.nav-label .count { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0; color: var(--side-muted); }
.nav-section[open] > .nav-label .count { display: none; }
.nav-items { padding-bottom: 4px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 5px 16px 5px 14px; border-left: 2px solid transparent; color: var(--side-text); font-size: 12.8px; white-space: nowrap; }
.nav-item .icon { width: 16px; height: 16px; opacity: .7; }
a.nav-item:hover { background: var(--side-hover); color: var(--side-strong); text-decoration: none; }
.nav-item.active { background: linear-gradient(90deg, var(--side-active), rgba(255, 200, 0, .02)); color: var(--side-strong); border-left-color: var(--side-mark); font-weight: 600; }
.nav-item.active .icon { opacity: 1; color: var(--side-mark); }
.nav-item.soon { opacity: .5; cursor: default; }
.nav-item .tag { margin-left: auto; font: normal 9.5px var(--mono); padding: 0 4px; border-radius: 3px; background: rgba(255, 200, 0, .16); color: var(--side-mark); }
.nav-none { padding: 10px 16px; font-size: 12px; color: var(--side-muted); }
.nav.filtering .nav-label { display: none; }
.side-foot { border-top: 1px solid var(--side-line); padding: 8px 12px; }
.collapse-btn { width: 100%; justify-content: flex-start; }
.sidebar .btn.on-dark { background: var(--side-field); border-color: var(--side-line); color: var(--side-text); }
.sidebar .btn.on-dark:hover { background: rgba(255, 255, 255, .1); color: var(--side-strong); }
.collapsed .brand-name, .collapsed .nav-label, .collapsed .nav-item span, .collapsed .nav-item .tag, .collapsed .ctx, .collapsed .nav-find { display: none; }
.collapsed .nav-item, .collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
.collapsed .collapse-btn .icon { transform: rotate(180deg); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 20px; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); }
.crumb { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.crumb b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.search { width: 290px; max-width: 34vw; position: relative; }
.search input { width: 100%; height: 32px; padding: 0 30px 0 30px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 12.5px; }
.search input:focus { outline: none; border-color: var(--primary-2); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-soft); }
.search .icon { position: absolute; left: 9px; top: 9px; width: 14px; height: 14px; color: var(--text-3); }
.search kbd { position: absolute; right: 8px; top: 8px; font: 9.5px var(--mono); color: var(--text-3); border: 1px solid var(--border); border-radius: 3px; padding: 1px 4px; background: var(--surface); }
.period { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font-family: var(--mono); font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.period b { color: var(--text); font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.topbar > .crumb { margin-right: auto; }
.icon-btn { position: relative; width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); cursor: pointer; }
.icon-btn .icon { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.dot-count { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font: 600 9.5px/17px var(--mono); text-align: center; border: 2px solid var(--surface); box-sizing: content-box; }
.who { display: flex; align-items: center; gap: 8px; padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--border); cursor: pointer; list-style: none; }
.who::-webkit-details-marker { display: none; }
.who .nm { line-height: 1.15; }
.who .nm b { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); }
.who .nm span { font-size: 10.5px; color: var(--text-3); }
.who .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-size: 11px; }
.avatar { width: 32px; height: 32px; border-radius: var(--radius-sm); display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--primary); background: var(--primary-soft); flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 10.5px; }
.mobile-only { display: none; }

.content { padding: 18px 22px 44px; max-width: 1640px; width: 100%; }

/* ---------------- menus (details/summary, no JS needed) ---------------- */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 5px; z-index: 50; }
.menu-panel.wide { min-width: 340px; }
.menu-head { padding: 7px 9px; font-size: 9.5px; color: var(--text-3); font-weight: 650; text-transform: uppercase; letter-spacing: .13em; }
.menu-item { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 5px; color: var(--text); font-size: 12.5px; width: 100%; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.menu-item .icon { width: 15px; height: 15px; color: var(--text-3); }
.menu-item:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.menu-sep { height: 1px; background: var(--border-soft); margin: 5px 0; }
.menu-empty { padding: 14px 9px; color: var(--text-3); font-size: 12.5px; }

/* ---------------- page head ---------------- */
.page-head, .welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1, .welcome h1 { font-size: 21px; line-height: 1.2; }
.page-head p, .welcome p { margin: 3px 0 0; color: var(--text-2); font-size: 12.5px; max-width: 80ch; }
.crumbs { display: flex; gap: 5px; align-items: center; margin-bottom: 3px; font-size: 10px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--primary-2); text-decoration: none; }
.crumbs .icon { width: 10px; height: 10px; }
.toolbar { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip { display: inline-flex; gap: 5px; align-items: center; height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: 5px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.chip .icon { width: 13px; height: 13px; color: var(--text-3); }
.filters { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg a { padding: 0 10px; height: 28px; line-height: 28px; font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.seg a:hover { background: var(--surface-hover); text-decoration: none; }
.seg a + a { border-left: 1px solid var(--border-soft); }
.seg a.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* ---------------- buttons ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn .icon { width: 15px; height: 15px; }
.btn:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--primary-ink); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-hover); }
.btn.sm { height: 27px; padding: 0 9px; font-size: 11.5px; }
.btn.sm .icon { width: 13px; height: 13px; }
.btn.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 30%, var(--border)); }
.btn.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, var(--border)); }
.btn.on-dark { background: transparent; color: var(--text-2); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------------- forms ---------------- */
.field { display: grid; gap: 5px; align-content: start; min-width: 0; }
.field label { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); font-weight: 650; }
.field .hint, .field small.muted { font-size: 11.5px; color: var(--text-3); }
.field .err { font-size: 11.5px; color: var(--bad); }
.input, select.input, textarea.input { width: 100%; min-height: 34px; padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
textarea.input { resize: vertical; }
.input:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px var(--primary-soft); }
.input:hover:not(:focus) { border-color: var(--border-strong); }
.input.is-invalid { border-color: var(--bad); }
select.input, .ctx select { appearance: none; -webkit-appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2377857b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; cursor: pointer; }
.input.sm { min-height: 28px; padding: 4px 8px; font-size: 12px; width: auto; }
select.input.sm { padding-right: 24px; background-position: right 7px center; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 14px; }
.form-section { padding: 16px 18px; border-top: 1px solid var(--border-soft); }
.form-section:first-child { border-top: 0; }
.form-section h3 { font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--text-3); font-weight: 650; padding-bottom: 6px; margin-bottom: 12px; border-bottom: 1px solid var(--border-soft); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 11px 18px; border-top: 1px solid var(--border-soft); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 7px 16px; }
.check { display: flex; gap: 7px; align-items: flex-start; font-size: 12.5px; color: var(--text-2); }
.check input { margin-top: 2px; accent-color: var(--primary-2); }

/* ---------------- cards / grids ---------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--border-soft); }
.card-head h2 { font-size: 13.5px; font-weight: 650; display: flex; gap: 8px; align-items: center; }
.card-head h2 .icon { color: var(--text); width: 15px; height: 15px; }
.card-head .sub { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); font-weight: 400; letter-spacing: .02em; }
.card-body { padding: 14px; }
.card-foot { padding: 9px 14px; border-top: 1px solid var(--border-soft); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }

.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-fit { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: center; }
.span-2 { grid-column: span 2; }
.stack { display: grid; gap: 14px; align-content: start; }
.mt { margin-top: 14px; }

/* ---------------- KPI strip: one ruled panel, figures in mono ---------------- */
.g-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border-soft); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.g-kpi > .kpi { border: 0; border-radius: 0; box-shadow: none; }
.kpi { display: flex; flex-direction: column; gap: 3px; padding: 11px 14px 12px; color: var(--text); position: relative; }
a.kpi:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: transparent; }
a.kpi:hover::before { background: var(--yellow); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); font-weight: 650; }
.kpi-icon { color: var(--text-3); display: grid; }
.kpi-icon .icon { width: 14px; height: 14px; }
.kpi-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.kpi-value { font-family: var(--mono); font-size: 21px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; margin-top: 2px; }
.kpi-meta { font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.trend { display: inline-flex; align-items: center; gap: 2px; font-family: var(--mono); font-weight: 600; font-size: 11px; }
.trend .icon { width: 11px; height: 11px; }
.trend.up { color: var(--good); }
.trend.down { color: var(--bad); }
.trend.flat { color: var(--text-3); }
.spark { display: block; overflow: visible; width: 76px; height: 24px; }
.spark-line { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-area { fill: var(--yellow); opacity: .22; }

/* ---------------- charts ---------------- */
.donut-wrap { display: grid; grid-template-columns: 136px 1fr; gap: 18px; align-items: center; }
.donut { width: 136px; height: 136px; transform: rotate(-90deg); }
.donut text { transform: rotate(90deg); transform-origin: 70px 70px; }
.donut-track { fill: none; stroke: var(--surface-hover); stroke-width: 12; }
.donut-seg { fill: none; stroke-width: 12; }
.donut-value { font-family: var(--mono); font-size: 19px; font-weight: 600; fill: var(--text); }
.donut-label { font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase; fill: var(--text-3); }
.legend { display: grid; gap: 6px; }
.legend-row { display: grid; grid-template-columns: 9px 1fr auto auto; gap: 9px; align-items: center; font-size: 12.5px; }
.legend-row span:not(.pct) { white-space: nowrap; }
.legend-row i { width: 9px; height: 9px; border-radius: 2px; }
.legend-row b { font-family: var(--mono); font-weight: 600; }
.legend-row .pct { color: var(--text-3); min-width: 44px; text-align: right; font-family: var(--mono); font-size: 11.5px; }
.chart-line { width: 100%; height: auto; display: block; }
.chart-line .grid { stroke: var(--border-soft); stroke-dasharray: 2 3; }
.chart-line .axis { font-size: 9.5px; fill: var(--text-3); }
.chart-line .line { fill: none; stroke: var(--chart-1); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-line .dot { fill: var(--surface); stroke: var(--chart-1); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.alt .chart-line .line { stroke: var(--chart-2); }
.alt .chart-line .dot { stroke: var(--chart-2); }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 150px) 1fr 52px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-row .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.bar-track { height: 6px; border-radius: 3px; background: var(--surface-hover); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; background: var(--yellow); }
.bar-row .val { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12px; }
.stacked { display: flex; height: 8px; border-radius: 3px; overflow: hidden; background: var(--surface-hover); gap: 2px; }
.stacked span { display: block; height: 100%; }
.funnel { display: grid; gap: 6px; }
.funnel-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; font-size: 12.5px; }
.funnel-bar { height: 24px; border-radius: 4px; background: var(--yellow); color: var(--yellow-ink); display: flex; align-items: center; padding: 0 8px; font: 600 11.5px var(--mono); min-width: 34px; margin: 0 auto 0 0; }
.funnel-row .name { color: var(--text-2); }
.empty-inline { color: var(--text-3); font-size: 12.5px; margin: 6px 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 14px; background: var(--surface-2); overflow-x: auto; }
.card-head + .tabs { margin-top: 0; }
.tab { padding: 9px 11px; font-size: 12px; font-weight: 550; color: var(--text-2); border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; background: none; font-family: inherit; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--yellow); font-weight: 650; }
[role="tabpanel"][hidden] { display: none; }

/* ---------------- ledger tables ---------------- */
.table-wrap { overflow-x: auto; max-width: 100%; }
.card-head + .table-wrap { margin-top: 0 !important; }
table.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th { text-align: left; font-weight: 650; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); padding: 8px 12px; background: var(--surface-hover); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 8px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .r { text-align: right; }
.table td.num { white-space: nowrap; font-size: 12px; color: var(--text-2); }
.table td.r .toolbar { flex-wrap: nowrap; justify-content: flex-end; }
.person { display: flex; align-items: center; gap: 9px; min-width: 170px; }
.person b { font-weight: 600; display: block; color: var(--text); }
.person small { color: var(--text-3); font-size: 11px; }
.person a { color: inherit; }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 4px; font-size: 11px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; background: var(--surface-hover); color: var(--text-2); border: 1px solid var(--border-soft); }
.pill.present, .pill.active, .pill.approved, .pill.good { color: var(--good); background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 22%, transparent); }
.pill.late, .pill.half_day, .pill.pending, .pill.probation, .pill.notice, .pill.warn { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.pill.wfh { color: var(--info); background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.pill.leave { color: #1f7f8c; background: color-mix(in srgb, var(--c-leave) 13%, var(--surface)); border-color: color-mix(in srgb, var(--c-leave) 30%, transparent); }
.pill.absent, .pill.rejected, .pill.exited, .pill.bad { color: var(--bad); background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 22%, transparent); }
.pill.cancelled, .pill.off { color: var(--text-3); }

.empty { text-align: center; padding: 32px 20px; color: var(--text-3); font-size: 12.5px; }
.empty .icon { color: var(--text-3); margin-bottom: 6px; }
.empty b { display: block; color: var(--text); font-weight: 600; font-size: 13px; margin-bottom: 2px; }

/* ---------------- lists ---------------- */
.list { display: grid; }
.list-row { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.card-body.list { padding-top: 4px; padding-bottom: 4px; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row small { color: var(--text-3); font-size: 11.5px; }
.ev-date { width: 40px; text-align: center; flex: none; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); padding: 3px 0; line-height: 1.1; }
.ev-date b { font-family: var(--mono); font-size: 14px; }
.ev-date small { font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.ev-ico { width: 28px; height: 28px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-2); flex: none; }
.ev-ico.birthday { background: var(--accent-soft); color: var(--accent); }
.ev-ico.holiday { background: var(--info-soft); color: var(--info); }
.ev-ico.contract, .ev-ico.probation { background: var(--bad-soft); color: var(--bad); }

/* ---------------- insights ---------------- */
.insights { border-top: 2px solid var(--gold); }
.ai-badge { width: 24px; height: 24px; border-radius: 5px; display: grid; place-items: center; color: #fff; background: var(--primary); }
.ai-badge .icon { width: 14px !important; height: 14px !important; color: #fff !important; }
.insight { display: flex; gap: 9px; padding: 8px 0; font-size: 12.5px; color: var(--text); border-bottom: 1px solid var(--border-soft); }
.insight:last-child { border-bottom: 0; }
.insight i { width: 6px; height: 6px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--text); }
.insight.good i { background: var(--good); }
.insight.warn i { background: var(--yellow); box-shadow: 0 0 0 1px var(--yellow-ink); }

/* ---------------- quick actions ---------------- */
.qa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.qa { display: flex; flex-direction: column; gap: 8px; padding: 11px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 12.5px; cursor: pointer; font-family: inherit; text-align: left; transition: border-color .12s, background .12s; }
.qa:hover { border-color: var(--yellow); background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.qa .icon { color: var(--text); width: 16px; height: 16px; }

/* ---------------- my day ---------------- */
.myday { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 13px 16px; }
.myday .clock { font-family: var(--mono); font-size: 21px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.myday .grow { flex: 1; min-width: 200px; }
.balances { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.balance { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.balance > small:first-child { display: block; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); font-weight: 650; }
.balance b { font-family: var(--mono); font-size: 19px; font-weight: 600; display: block; margin: 2px 0; }
.balance b small { font-family: var(--font); font-size: 11px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.balance small { color: var(--text-3); font-size: 11px; }

/* ---------------- detail ---------------- */
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 18px; margin: 0; }
.dl dt { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); font-weight: 650; margin-bottom: 2px; }
.dl dd { margin: 0; font-weight: 550; font-size: 13px; }
.profile-head { display: flex; gap: 14px; align-items: center; padding: 16px; }
.profile-head .avatar { width: 52px; height: 52px; font-size: 17px; border-radius: var(--radius); }
.timeline { display: grid; }
.tl-row { display: grid; grid-template-columns: 14px 1fr; gap: 9px; padding: 7px 0; font-size: 12.5px; }
.tl-row::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary-2); margin-top: 5px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border); }
.tl-row small { color: var(--text-3); display: block; font-family: var(--mono); font-size: 10.5px; }

/* ---------------- notes / flash ---------------- */
.flash { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 12.5px; color: var(--text); border: 1px solid var(--border); border-left-width: 3px; background: var(--surface-2); }
.flash .icon { width: 15px; height: 15px; }
.flash.ok { background: var(--good-soft); border-left-color: var(--good); }
.flash.ok .icon { color: var(--good); }
.flash.error { background: var(--bad-soft); border-left-color: var(--bad); }
.flash.error .icon { color: var(--bad); }
.flash.warn { background: var(--warn-soft); border-left-color: var(--warn); }
.flash.warn .icon { color: var(--warn); }
.flash .btn { margin-left: auto; }

/* ---------------- pagination ---------------- */
.pager { display: flex; gap: 4px; align-items: center; }
.pager a, .pager span { min-width: 28px; height: 28px; padding: 0 7px; border-radius: 5px; display: grid; place-items: center; font: 12px var(--mono); border: 1px solid var(--border); color: var(--text-2); background: var(--surface); }
.pager a:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; }
.pager .on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.pager .off { opacity: .4; }

/* ---------------- sign-in ---------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--surface); }
.auth-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 44px 46px; color: #fff;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 34px), repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 34px), linear-gradient(160deg, #1c1c1c, #070707 70%); }
.auth-art h2 { font-family: var(--serif); font-size: 38px; font-weight: 500; line-height: 1.12; letter-spacing: -.02em; max-width: 520px; }
.auth-art h2 em { font-style: italic; color: #ffc800; }
.auth-art p { color: rgba(255, 255, 255, .78); font-size: 13.5px; max-width: 46ch; margin-top: 12px; }
.auth-art > small { font-family: var(--mono); font-size: 11px; color: rgba(255, 255, 255, .6) !important; }
.auth-form { display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 360px; }
.auth-card h1 { font-size: 22px; }
.auth-wrap { width: 100%; max-width: 440px; }
.auth-wrap .auth-card { margin: 0 auto; }
.brand-lockup { display: grid; justify-items: start; gap: 16px; }
.brand-lockup img { width: 52px; height: auto; }
.brand-lockup .wordmark { font-family: var(--brand-font); font-weight: 700; font-size: 26px; letter-spacing: .16em; line-height: 1; }
.brand-lockup .legal { font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255, 255, 255, .7); margin-top: 7px; }
.gold-rule { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 340px; }
.gold-rule::before, .gold-rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #ffc800); }
.gold-rule::after { background: linear-gradient(90deg, #ffc800, transparent); }
.gold-rule i { width: 6px; height: 6px; border-radius: 50%; background: #ffc800; }
.tagline { font-size: 13.5px; color: rgba(255, 255, 255, .88); }
.auth-mobile-brand { display: none; align-items: center; justify-content: center; gap: 10px; margin-bottom: 26px; }
.auth-mobile-brand img { height: 34px; }
.auth-mobile-brand b { font-family: var(--brand-font); font-weight: 700; letter-spacing: .14em; font-size: 17px; color: var(--text); }

/* ---------------- SaaS admin bits ---------------- */
.codes { display: grid; grid-template-columns: repeat(2, max-content); gap: 6px 24px; font: 600 14px/1.6 var(--mono); padding: 12px 16px; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.qr { width: 180px; height: 180px; padding: 10px; background: #fff; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.qr svg { width: 100%; height: 100%; display: block; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.plan { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: grid; gap: 5px; align-content: start; cursor: pointer; background: var(--surface); }
.plan:has(input:checked) { border-color: var(--primary-2); box-shadow: 0 0 0 3px var(--primary-soft); }
.plan .price { font-family: var(--mono); font-size: 20px; font-weight: 600; }
.plan ul { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--text-2); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; border: 1px solid var(--border); }
.inline-form { display: inline; }
.locked { max-width: 520px; margin: 10vh auto; padding: 0 16px; }
.invoice { max-width: 860px; margin: 0 auto; background: var(--surface); }
.invoice table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.invoice th, .invoice td { border: 1px solid var(--border-strong); padding: 6px 8px; text-align: left; vertical-align: top; }
.invoice th { background: var(--surface-hover); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; }
.invoice td.num, .invoice th.num { text-align: right; }

/* ---------------- time ---------------- */
.table.roster td.cell, .table.roster th.num { text-align: center; padding-left: 5px; padding-right: 5px; }
.table.roster th.today { color: var(--primary-2); }
.rcell { display: inline-block; min-width: 44px; padding: 2px 5px; border-radius: 4px; font: 600 11px var(--mono); color: #fff; background: var(--c, var(--primary-2)); }
.rcell.std { background: transparent; color: var(--text-3); font-weight: 400; }
.rcell.off { background: var(--surface-hover); color: var(--text-3); }
.rcell.leave { background: color-mix(in srgb, var(--c-leave) 16%, transparent); color: #1f7f8c; }
.branch-rule { padding-bottom: 14px; border-bottom: 1px solid var(--border-soft); }
.branch-rule:last-of-type { border-bottom: 0; padding-bottom: 0; }
body.kiosk { background: var(--bg); min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 16px; }
body.kiosk main { display: grid; gap: 12px; justify-items: center; }
body.kiosk h1 { font-size: 28px; margin: 8px 0 0; }
.kiosk-qr { width: min(70vw, 420px); aspect-ratio: 1; background: #fff; padding: 18px; border-radius: 12px; box-shadow: var(--shadow-lg); }
.kiosk-qr img { width: 100%; height: 100%; display: block; }
.kiosk-clock { font-family: var(--mono); font-size: 32px; font-weight: 600; }

/* ---------------- responsive ---------------- */
@media (max-width: 1280px) {
  .g-main { grid-template-columns: minmax(0, 1fr); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) { .g-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); } .period { display: none; } }
@media (max-width: 900px) {
  .app, .app.collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(var(--sidebar), 86vw); transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(8, 12, 10, .45); z-index: 35; }
  .collapsed .brand-name, .collapsed .nav-label, .collapsed .nav-item span, .collapsed .nav-item .tag, .collapsed .ctx, .collapsed .nav-find { display: revert; }
  .mobile-only { display: grid; }
  .desktop-only, .search kbd, .who .nm { display: none; }
  .search { width: auto; flex: 1; max-width: none; }
  .crumb { display: none; }
  .top-actions { margin-left: auto; }
  .topbar { padding: 0 12px; }
  .content { padding: 14px 12px 36px; }
  .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-mobile-brand { display: flex; }
}
@media (max-width: 560px) {
  .kpi { padding: 10px 12px; }
  .kpi-value { font-size: 18px; }
  .kpi .spark { display: none; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .legend { width: 100%; }
  .menu-panel.wide { min-width: 0; width: calc(100vw - 24px); right: -60px; }
  .welcome h1, .page-head h1 { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------------- print ---------------- */
@media print {
  .sidebar, .topbar, .toolbar, .filters, .no-print, .flash { display: none !important; }
  .app { display: block; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #bbb; break-inside: avoid; }
}

/* Calendar: month grid with event chips, agenda beside it. Each kind sets --k. */
.k-holiday { --k: var(--yellow); } .k-leave { --k: var(--c-leave); } .k-interview { --k: var(--info); } .k-task { --k: var(--bad); } .k-review { --k: var(--text); } .k-off { --k: var(--border-strong); }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.cal { overflow: hidden; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 11px 14px; border-bottom: 1px solid var(--border-soft); font-size: 12px; color: var(--text-2); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cal-legend i { width: 9px; height: 9px; border-radius: 2px; background: var(--k); }
.cal-legend b { font: 600 11.5px var(--mono); color: var(--text); }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head span { padding: 8px 9px; font-size: 9.5px; font-weight: 650; letter-spacing: .13em; text-transform: uppercase; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-grid { gap: 1px; background: var(--border-soft); }
.cal-day { background: var(--surface); min-height: 112px; padding: 6px 6px 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day.off { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface) 6px 12px); }
.cal-day.hol { background: color-mix(in srgb, var(--yellow) 9%, var(--surface)); }
.cal-day.out { background: var(--surface-2); }
.cal-day.out .cal-n { color: var(--text-3); opacity: .55; }
.cal-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.cal-top small { font-size: 9px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); padding-right: 3px; }
.cal-n { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 12px; font: 600 12px var(--mono); color: var(--text); }
a.cal-n:hover { background: var(--surface-hover); text-decoration: none; }
.cal-day.today .cal-n { background: var(--yellow); color: var(--yellow-ink); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--yellow); }
.cal-evs { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-ev { display: block; font-size: 11px; line-height: 1.35; padding: 2px 6px; border-radius: 3px; border-left: 3px solid var(--k); background: color-mix(in srgb, var(--k) 13%, var(--surface)); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.cal-ev:hover { text-decoration: none; color: var(--text); background: color-mix(in srgb, var(--k) 24%, var(--surface)); }
.cal-ev.wrap { white-space: normal; font-size: 12px; padding: 4px 8px; }
.cal-more { font-size: 10.5px; color: var(--text-3); padding-left: 6px; }
.agenda { position: sticky; top: calc(var(--top) + 12px); max-height: calc(100vh - var(--top) - 24px); overflow-y: auto; }
.agenda-day { display: grid; grid-template-columns: 46px 1fr; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border-soft); scroll-margin-top: 50px; }
.agenda-day:last-child { border-bottom: 0; }
.agenda-day:target { background: var(--primary-soft); }
.agenda-date { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.agenda-date b { font: 600 18px/1 var(--mono); }
.agenda-date > span:not(.pill) { font-size: 9.5px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
@media (max-width: 1100px) {
  .cal-layout { grid-template-columns: 1fr; }
  .agenda { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .cal-head span { padding: 6px 2px; text-align: center; letter-spacing: .04em; }
  .cal-day { min-height: 54px; padding: 4px 2px; align-items: center; }
  .cal-top small, .cal-more { display: none; }
  .cal-evs { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 2px; }
  .cal-evs .cal-ev { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 50%; font-size: 0; background: var(--k); }
}

/* Attendance day register. */
.att-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.att-nav form { display: contents; }
.att-summary { display: grid; grid-template-columns: 260px minmax(0, 1fr); margin-bottom: 16px; overflow: hidden; }
.att-rate { padding: 14px 16px; border-right: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 6px; }
.att-rate > b { font: 600 28px/1 var(--mono); }
.att-rate > b small { font-size: 14px; color: var(--text-3); margin-left: 4px; }
.att-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-hover); }
.att-bar i { display: block; height: 100%; }
.att-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border-soft); }
.att-tab { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 10px 14px; background: var(--surface); color: var(--text-2); border-left: 3px solid transparent; min-width: 0; }
.att-tab span { font-size: 9.5px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-tab b { font: 600 20px/1 var(--mono); color: var(--text); }
a.att-tab:hover { background: var(--surface-hover); text-decoration: none; color: var(--text); }
.att-tab.on { background: var(--primary-soft); border-left-color: var(--yellow); color: var(--text); }
.st-present { --k: var(--c-present); } .st-late, .st-half_day { --k: var(--c-late); } .st-wfh { --k: var(--c-wfh); } .st-leave { --k: var(--c-leave); } .st-absent { --k: var(--c-absent); } .st-off { --k: var(--border-strong); }
.att-tab[class*="st-"]:not(.st-all) span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: var(--k); margin-right: 6px; vertical-align: 0; }
.week-dots { display: flex; gap: 3px; }
.week-dots i { width: 10px; height: 10px; border-radius: 2px; background: var(--k); }
.week-dots i.none { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
@media (max-width: 900px) {
  .att-summary { grid-template-columns: 1fr; }
  .att-rate { border-right: 0; border-bottom: 1px solid var(--border-soft); }
  .att-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Install card under the sign-up form. */
.install-card { display: flex; align-items: center; gap: 12px; max-width: 440px; margin: 18px auto 0; padding: 12px 14px; border: 1px solid var(--border); border-left: 3px solid var(--yellow); border-radius: var(--radius); background: var(--surface); }
.install-card[hidden] { display: none; }
.install-card img { flex: none; border-radius: 9px; }
.install-card .grow { flex: 1; min-width: 0; }
.install-card b { display: block; font-size: 13.5px; }
.install-card small { display: block; color: var(--text-3); font-size: 12px; line-height: 1.4; margin-top: 2px; }

/* Demo logins under the sign-in form (public demo mode only). */
.demo-logins { max-width: 360px; margin: 22px auto 0; border: 1px solid var(--border); border-top: 3px solid var(--yellow); border-radius: var(--radius); background: var(--surface); padding: 12px 14px; }
.demo-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.demo-head h2 { font-size: 13.5px; }
.demo-head span { font-size: 12px; color: var(--text-2); }
.demo-head code { font: 600 12px var(--mono); background: var(--primary-soft); color: var(--text); padding: 1px 6px; border-radius: 4px; user-select: all; }
.demo-logins ul { list-style: none; margin: 0 0 8px; padding: 0; max-height: 260px; overflow-y: auto; }
.demo-logins li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border-soft); }
.demo-logins li b { display: block; font-size: 12.5px; }
.demo-logins li small { display: block; font: 11px var(--mono); color: var(--text-3); }
.demo-logins > small { display: block; font-size: 11px; line-height: 1.4; }
