/* Attendance and Leave
   One family (Atkinson Hyperlegible Next, built for legibility) with its mono
   cut kept for the big clock. Cool paper, slate ink, emerald for "on the
   clock", indigo for leave. The day strip is the one bold element. */

@font-face { font-family: 'Atkinson Next'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/atkinson-hyperlegible-next-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Atkinson Next'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/atkinson-hyperlegible-next-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Atkinson Next'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/atkinson-hyperlegible-next-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Atkinson Next'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/atkinson-hyperlegible-next-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Atkinson Next'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/atkinson-hyperlegible-next-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Atkinson Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/atkinson-hyperlegible-mono-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Atkinson Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/atkinson-hyperlegible-mono-latin-700-normal.woff2) format('woff2'); }

:root {
  --paper: #F3F5F4;
  --rail: #E7ECEA;
  --surface: #FFFFFF;
  --ink: #17262B;
  --ink-2: #2C3E44;
  --muted: #5B6B70;
  --line: #D9E0DE;
  --line-strong: #B4C1BE;
  --emerald: #0E7C66;
  --emerald-2: #0A6352;
  --emerald-tint: #E1F2EC;
  --indigo: #3C4FB0;
  --indigo-tint: #ECEFFB;
  --amber: #9A4A06;
  --amber-line: #C77712;
  --amber-tint: #FCEFDF;
  --red: #B42318;
  --red-tint: #FDECEA;
  --info: #2B5F75;
  --info-tint: #E3EFF3;
  --neutral-tint: #E9EEEC;
  --sans: 'Atkinson Next', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Arabic', 'Geeza Pro', Tahoma, sans-serif;
  --mono: 'Atkinson Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --r-sm: 8px; --r: 10px; --r-lg: 14px; --r-xl: 20px;
  --focus: 0 0 0 3px rgba(14, 124, 102, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.5 var(--sans); color: var(--ink); background: var(--paper); }
img, svg { display: block; }
a { color: var(--emerald-2); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--emerald); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 .75em; }
code { font-family: var(--mono); font-size: .9em; background: var(--neutral-tint); padding: 1px 5px; border-radius: 5px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg use { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.nowrap { white-space: nowrap; }
.text-warn { color: var(--amber); font-weight: 700; }
.text-bad { color: var(--red); font-weight: 700; }
.lede { font-size: 17px; color: var(--muted); max-width: 70ch; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r); }
.skip:focus { top: 8px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }

/* ------------------------------------------------------------------ Shell */
.rail { display: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 12px 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .brand { flex: 1; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand-mark { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: #fff; }
.brand-mark svg { width: 20px; height: 20px; }
.brand-mark-lg { width: 52px; height: 52px; border-radius: 15px; }
.brand-mark-lg svg { width: 30px; height: 30px; }
.brand-org { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-app { font-size: 13px; color: var(--muted); }
.topbar-bell { position: relative; display: grid; place-items: center; width: 40px; height: 40px; color: var(--ink); border-radius: var(--r); }
.topbar-bell svg { width: 22px; height: 22px; }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--amber-line); color: #fff; font-size: 12px; font-weight: 700; }
.topbar-bell .count { position: absolute; top: 2px; right: 0; }
.account { position: relative; }
.account summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; border-radius: var(--r); padding: 4px; }
.account summary::-webkit-details-marker { display: none; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--emerald-tint); color: var(--emerald-2); font-weight: 700; }
.account-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 8px 24px rgba(23, 38, 43, .12); display: grid; gap: 8px; }
.account-menu a, .account-menu .linklike { font-weight: 500; }
.main { padding: 16px 16px 104px; max-width: 1240px; }
.tabbar { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 10px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 700; }
.tabbar svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--emerald-2); }
.tabbar a[aria-current="page"] svg use { stroke-width: 2.2; }
.signed-out .main { max-width: none; padding: 0; }

@media (min-width: 1024px) {
  .signed-in { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
  .topbar, .tabbar { display: none; }
  .rail { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 20px 14px; background: var(--rail); border-right: 1px solid var(--line); }
  .rail .brand { padding: 4px 8px 22px; }
  .rail-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .rail-nav a, .rail-note { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); color: var(--ink-2); text-decoration: none; font-weight: 500; }
  .rail-nav svg, .rail-note svg { width: 22px; height: 22px; color: var(--muted); }
  .rail-nav a:hover, .rail-note:hover { background: rgba(255, 255, 255, .6); color: var(--ink); }
  .rail-nav a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: inset 3px 0 0 var(--emerald); }
  .rail-nav a[aria-current="page"] svg { color: var(--emerald); }
  .rail-foot { margin-top: auto; display: grid; gap: 6px; }
  .rail-note .count { margin-left: auto; }
  .rail .account summary { padding: 8px; }
  .rail .account summary:hover { background: rgba(255, 255, 255, .6); }
  .account-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rail .account-menu { right: auto; left: 0; top: auto; bottom: calc(100% + 6px); }
  .main { padding: 28px 40px 64px; width: 100%; }
  h1 { font-size: 30px; }
}

/* --------------------------------------------------------------- Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid var(--ink); border-radius: var(--r); background: var(--ink); color: #fff; font: 700 15px/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .15s, transform .08s; }
.btn svg { width: 18px; height: 18px; }
.btn:hover { background: var(--ink-2); color: #fff; }
.btn:active { transform: scale(.98); }
.btn-quiet { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-quiet:hover { background: var(--neutral-tint); color: var(--ink); }
.btn-go { background: var(--emerald); border-color: var(--emerald); }
.btn-go:hover { background: var(--emerald-2); }
.btn-danger { color: var(--red); border-color: #E7B4AE; }
.btn-danger:hover { background: var(--red-tint); color: var(--red); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; }
.btn-block { width: 100%; }
.btn.is-disabled { opacity: .35; pointer-events: none; }
.btnrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--emerald-2); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; text-align: left; }
.linklike:hover { color: var(--ink); }

.field { margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { display: block; margin-bottom: 6px; font-weight: 700; font-size: 15px; padding: 0; }
.optional { font-weight: 400; color: var(--muted); font-size: 14px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink); font: 400 16px/1.4 var(--sans); }
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--emerald); box-shadow: var(--focus); }
input[type=file] { font: inherit; max-width: 100%; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--emerald); flex: none; }
.input-short { max-width: 160px; }
.input-tiny { max-width: 96px; }
.hint { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.row { display: grid; gap: 0 16px; }
@media (min-width: 640px) { .row { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }
.checkline { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; font-weight: 400; cursor: pointer; }
.field > .checkline { display: flex; margin-bottom: 0; font-size: 16px; font-weight: 400; }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; }
.checkgrid-tall { max-height: 360px; overflow-y: auto; padding: 4px 12px; border: 1px solid var(--line); border-radius: var(--r); }
.checkgrid-head { grid-column: 1 / -1; margin: 10px 0 0; font-weight: 700; color: var(--muted); font-size: 14px; display: flex; gap: 12px; align-items: baseline; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; }
.segmented span { display: block; text-align: center; padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--r); font-weight: 700; cursor: pointer; }
.segmented input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.segmented input:focus-visible + span { box-shadow: var(--focus); }
.form .btn[type=submit] { margin-top: 4px; }
.form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 12px; }
.form-row .field { margin-bottom: 12px; }
.form-row .btn { margin-bottom: 12px; }
.field-grow { flex: 1 1 240px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form input, .inline-form select { width: auto; min-height: 36px; }
.inline-upload { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }

.error-box { margin: 0 0 18px; padding: 12px 16px; border-left: 4px solid var(--red); background: var(--red-tint); border-radius: 0 var(--r) var(--r) 0; }
.error-title { font-weight: 700; color: var(--red); margin-bottom: 4px; }
.error-box ul { margin: 0; padding-left: 20px; }
.flashes { display: grid; gap: 8px; margin-bottom: 18px; }
.flash { margin: 0; padding: 12px 16px; border-radius: 0 var(--r) var(--r) 0; border-left: 4px solid; font-weight: 500; }
.flash-good { background: var(--emerald-tint); border-color: var(--emerald); }
.flash-bad { background: var(--red-tint); border-color: var(--red); }
.flash-warn { background: var(--amber-tint); border-color: var(--amber-line); }
.note-warn { padding: 10px 14px; border-radius: var(--r); background: var(--amber-tint); color: #5C2E04; }

.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.chip-good { background: var(--emerald-tint); color: var(--emerald-2); }
.chip-warn { background: var(--amber-tint); color: var(--amber); }
.chip-bad { background: var(--red-tint); color: var(--red); }
.chip-leave { background: var(--indigo-tint); color: var(--indigo); }
.chip-info { background: var(--info-tint); color: var(--info); }
.chip-neutral { background: var(--neutral-tint); color: var(--muted); }

/* ------------------------------------------------------------------ Blocks */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; margin-bottom: 16px; }
.panel > :last-child { margin-bottom: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.panel-head h2 { margin: 0; }
.panel-link { display: block; text-decoration: none; color: inherit; }
.panel-link:hover { border-color: var(--line-strong); color: inherit; }
.attention { border-left: 4px solid var(--amber-line); }
.attention h2 { margin-bottom: 2px; }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; margin-bottom: 18px; }
.pagehead h1 { margin-bottom: 4px; }
.pagehead .lede { margin-bottom: 0; }
.pagehead-tight { align-items: center; margin: 20px 0 8px; }
.pagehead-tight h2 { margin: 0; }
.h-sub { font-weight: 500; color: var(--muted); font-size: .75em; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; color: var(--muted); text-decoration: none; font-weight: 500; }
.back svg { width: 18px; height: 18px; }
.back:hover { color: var(--ink); }
.section { margin-top: 28px; }
.section-sub { margin-top: 20px; }
.narrow { max-width: 640px; }
.narrow-wide { max-width: 860px; }
.detail-grid { display: grid; gap: 0 20px; align-items: start; }
@media (min-width: 960px) { .detail-grid { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); } }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cards > .panel { margin: 0; }

.subnav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: -4px 0 20px; }
.subnav > a, .subnav summary { flex: none; padding: 8px 14px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; cursor: pointer; }
.subnav > a:hover, .subnav summary:hover { background: var(--neutral-tint); color: var(--ink); }
.subnav > a[aria-current="page"], .subnav summary[data-current] { background: var(--ink); color: #fff; font-weight: 700; }
.subnav-more { position: relative; flex: none; }
.subnav-more summary { list-style: none; }
.subnav-more summary::-webkit-details-marker { display: none; }
.subnav-more summary::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.subnav-menu { position: absolute; z-index: 25; top: calc(100% + 6px); left: 0; min-width: 210px; padding: 8px; display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 8px 24px rgba(23, 38, 43, .12); }
.subnav-menu a { padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; }
.subnav-menu a:hover, .subnav-menu a[aria-current="page"] { background: var(--neutral-tint); font-weight: 700; }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 12px; margin: 0 0 16px; }
.field-inline { margin-bottom: 10px; min-width: 150px; }
.field-inline > label { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.filters .btn { margin-bottom: 10px; }
.periodnav, .yearnav { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.periodnav-label { font-size: 18px; font-weight: 700; min-width: 9ch; text-align: center; }

.tally { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.tally > div { padding: 8px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-width: 104px; }
.tally dt { font-size: 13px; color: var(--muted); }
.tally dd { margin: 0; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tally .tally-warn { border-color: #EBC79B; background: var(--amber-tint); }
.tally .tally-warn dd { color: var(--amber); }
.tally .tally-bad { border-color: #EFB8B2; background: var(--red-tint); }
.tally .tally-bad dd { color: var(--red); }
.tally .tally-good dd { color: var(--emerald-2); }

.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 16px; }
.table th, .table td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table thead th { font-size: 13px; font-weight: 700; color: var(--muted); background: #F8FAF9; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody tr:hover { background: #FAFCFB; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.tnum { white-space: nowrap; }
.table-dense th, .table-dense td { padding: 7px 10px; font-size: 14px; }
.table-form td, .table-form th { vertical-align: middle; }
.table-form input[type=time] { min-width: 110px; }
.cell-sub { display: block; font-size: 13px; color: var(--muted); }
.is-voided td { color: var(--muted); }
.is-voided td:first-child, .is-voided td:nth-child(2) { text-decoration: line-through; }
.is-muted { opacity: .62; }
.audit-details { font-family: var(--mono); font-size: 12px; word-break: break-word; max-width: 520px; }
.rowmenu summary { cursor: pointer; color: var(--red); font-size: 14px; }
.rowmenu form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rowmenu input { min-height: 36px !important; }
@media (max-width: 760px) {
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  .table td { white-space: normal; min-width: 90px; }
}

.list { list-style: none; margin: 0 0 12px; padding: 0; }
.list li a { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.list li a:hover span:first-child { text-decoration: underline; }
.list li:last-child a { border-bottom: 0; }
.list li a > span:first-child { flex: 1 1 160px; font-weight: 500; }
.list-rows li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-rows li:last-child { border-bottom: 0; }
.list-rows li.is-unread { box-shadow: inset 3px 0 0 var(--amber-line); padding-left: 12px; }
.list-rows li > :first-child { flex: 1 1 220px; }
.files { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.files li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.files svg { width: 20px; height: 20px; color: var(--muted); }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 20px; margin: 0 0 12px; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 500; }
.facts-row { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin-top: 16px; }

.empty { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 36px 20px; color: var(--ink); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.empty p { max-width: 46ch; color: var(--muted); margin: 0; }
.empty .btn { margin-top: 10px; }
.empty-icon { width: 36px; height: 36px; color: var(--muted); margin-bottom: 6px; }
.empty-small { padding: 18px; grid-auto-flow: column; justify-content: start; align-items: center; gap: 10px; text-align: left; }
.empty-small .empty-icon { width: 22px; height: 22px; margin: 0; color: var(--emerald); }
.empty-page { margin: 60px auto; max-width: 560px; }
.empty-inline { color: var(--muted); padding: 12px 0; }

.attention-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 6px; }
.attention-list li a { display: block; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--emerald); border-radius: 0 var(--r) var(--r) 0; color: var(--ink); text-decoration: none; }
.attention-list li.is-warn a { border-left-color: var(--amber-line); }
.attention-list li a:hover { border-color: var(--line-strong); }

.sample { font-family: var(--mono); font-size: 13px; line-height: 1.5; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; overflow-x: auto; }
.howto { padding-left: 22px; }
.howto li { margin-bottom: 8px; }

/* ---------------------------------------------------------------- Sign in */
.signin { min-height: 100vh; display: grid; place-content: center; gap: 22px; padding: 32px 16px; grid-template-columns: minmax(0, 420px); }
.signin-brand { display: grid; justify-items: start; gap: 2px; }
.signin-brand .brand-mark { margin-bottom: 10px; }
.signin-org { margin: 0; font-size: 22px; font-weight: 700; }
.signin-app { margin: 0; color: var(--muted); }
.signin-form { padding: 24px; }
.signin-form h1 { font-size: 24px; margin-bottom: 16px; }

/* ------------------------------------------------------------------ Today */
.today { display: grid; gap: 0 24px; }
@media (min-width: 1024px) { .today { grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); } .today-head { grid-column: 1 / -1; } }
.today-head { margin-bottom: 14px; }
.today-date { margin: 0 0 2px; color: var(--muted); font-weight: 500; }
.clockcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 20px; margin-bottom: 16px; }
@media (min-width: 640px) { .clockcard { padding: 28px; } }
.clockcard-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.shiftline { margin: 0; font-weight: 700; font-size: 17px; }
.bigclock { margin: 14px 0 18px; font: 700 clamp(60px, 17vw, 96px)/1 var(--mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.clockform { margin: 0; }
.clockbtn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 76px; border: 0; border-radius: 18px; color: #fff; font: 700 23px/1 var(--sans); cursor: pointer; transition: background-color .15s, transform .08s; }
.clockbtn svg { width: 28px; height: 28px; }
.clockbtn svg use { stroke-width: 2; }
.clockbtn-in { background: var(--emerald); }
.clockbtn-in:hover { background: var(--emerald-2); }
.clockbtn-out { background: var(--ink); }
.clockbtn-out:hover { background: var(--ink-2); }
.clockbtn:active { transform: scale(.985); }
.clockbtn[disabled] { opacity: .7; cursor: progress; }
.clock-status { margin: 12px 0 0; font-size: 15px; color: var(--muted); min-height: 1.5em; }
.clock-status.is-error { color: var(--red); font-weight: 700; }
.clock-status.is-ok { color: var(--emerald-2); font-weight: 700; }
.clock-terminal { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--neutral-tint); }
.clock-terminal svg { flex: none; width: 28px; height: 28px; color: var(--emerald); }
.punchlist { list-style: none; margin: 4px 0 0; padding: 0; }
.punchlist li { display: flex; align-items: baseline; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.punch-dir { width: 34px; font-weight: 700; font-size: 14px; }
.punch-in { color: var(--emerald-2); }
.punch-out { color: var(--ink); }
.balance { margin-bottom: 8px; }
.balance-num { margin: 0; font-size: 46px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--indigo); }
.balance-label { margin: 2px 0 6px; font-weight: 700; }

/* The day strip */
.strip { margin: 26px 0 8px; user-select: none; }
.strip-track { position: relative; height: 64px; }
.strip-track::before { content: ''; position: absolute; left: 0; right: 0; top: 42px; height: 2px; background: var(--line); border-radius: 2px; }
.strip-shift { position: absolute; top: 34px; height: 18px; border-radius: 9px; background: var(--emerald-tint); box-shadow: inset 0 0 0 1.5px var(--emerald); }
.strip-now { position: absolute; top: 22px; bottom: 0; width: 0; border-left: 2px dotted var(--amber-line); }
.strip-tick { position: absolute; top: 24px; width: 3px; height: 36px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); }
.strip-tick.strip-in { background: var(--emerald); }
.strip-tick span { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font: 700 13px/1 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.strip-tick.strip-in span { color: var(--emerald-2); }
.strip-scale { position: relative; height: 18px; margin-top: 4px; }
.strip-scale span { position: absolute; transform: translateX(-50%); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.strip-scale span:first-child { transform: none; }
.strip-scale span:last-child { transform: translateX(-100%); }
.strip-tick.is-new { animation: tick-drop .5s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes tick-drop { from { transform: translateY(-18px); opacity: 0; } to { transform: none; opacity: 1; } }

/* --------------------------------------------------------------- Day list */
.days { list-style: none; margin: 0 0 20px; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.dayrow { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "date status" "times times" "shift act"; gap: 2px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.dayrow:last-child { border-bottom: 0; }
.dayrow-off { background: #FAFBFB; }
.dayrow-off .dayrow-wd { color: var(--muted); }
.dayrow-date { grid-area: date; font-weight: 700; }
.dayrow-shift { grid-area: shift; font-size: 14px; font-variant-numeric: tabular-nums; }
.dayrow-times { grid-area: times; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 15px; }
.dayrow-status { grid-area: status; justify-self: end; }
.dayrow-act { grid-area: act; justify-self: end; }
@media (min-width: 760px) {
  .dayrow { grid-template-columns: 120px 110px minmax(0, 1fr) auto 70px; grid-template-areas: "date shift times status act"; padding: 10px 16px; }
  .dayrow-status { justify-self: start; }
}

/* ---------------------------------------------------------------- Leave */
.balgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 8px; }
.balgrid > .panel { margin: 0; }
.bal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.bal-head h3 { margin: 0 0 8px; }
.bal-num { margin: 0 0 8px; color: var(--muted); }
.bal-num span { font-size: 30px; font-weight: 700; color: var(--indigo); margin-right: 4px; font-variant-numeric: tabular-nums; }
.bal-detail { display: grid; gap: 4px; margin: 0 0 8px; font-size: 14px; }
.bal-detail > div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dotted var(--line); padding-bottom: 3px; }
.bal-detail dt { color: var(--muted); }
.bal-detail dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.bal-note summary { cursor: pointer; color: var(--emerald-2); font-size: 14px; }
.bal-note p { font-size: 14px; color: var(--ink-2); margin: 6px 0 0; }
.leave-check { min-height: 1.5em; font-weight: 500; }
.leave-check.is-error { color: var(--red); }
.leave-check.is-ok { color: var(--indigo); }

.steps { list-style: none; margin: 0; padding: 0; }
.step { position: relative; display: flex; gap: 14px; padding: 0 0 16px; }
.step:not(:last-child)::before { content: ''; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.step > div { display: grid; gap: 2px; }
.step-dot { flex: none; width: 16px; height: 16px; margin-top: 3px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); }
.step-done .step-dot { background: var(--emerald); border-color: var(--emerald); }
.step-now .step-dot { border-color: var(--amber-line); box-shadow: 0 0 0 4px var(--amber-tint); }
.step-bad .step-dot { background: var(--red); border-color: var(--red); }
.step-skip { opacity: .7; }
.decide { border-top: 4px solid var(--ink); }
.checkline + .field { margin-top: 10px; }
.approve-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.approve-main { flex: 1 1 300px; }
.approve-main p { margin: 0 0 3px; }
.approve-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 0 1 440px; }
.approve-actions input { flex: 1 1 180px; min-height: 36px; }

/* -------------------------------------------------------------- HR setup */
.schedule-card .panel-head h2 a { color: var(--ink); text-decoration: none; }
.week { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.week li { padding: 8px 4px; border-radius: var(--r-sm); background: var(--emerald-tint); text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; display: grid; gap: 2px; }
.week li.is-off { background: var(--neutral-tint); color: var(--muted); }
.week-day { font-weight: 700; font-size: 13px; }
.codecard { text-align: left; }
.setupcode { margin: 12px 0; padding: 18px; border-radius: var(--r-lg); background: var(--paper); font: 700 clamp(30px, 8vw, 44px)/1 var(--mono); letter-spacing: .08em; text-align: center; user-select: all; }
.setupcode-long { font-size: 16px; letter-spacing: 0; word-break: break-all; text-align: left; }
.pager { display: flex; align-items: center; gap: 12px; margin: 8px 0 20px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .rail, .topbar, .tabbar, .subnav, .filters, .btn, form { display: none !important; }
  body { background: #fff; display: block; }
  .main { padding: 0; }
}

/* --- Added: approvals, overtime, payroll, reports ------------------------------ */
.note-good { padding: 10px 14px; border-radius: var(--r); background: var(--emerald-tint); color: #0B4A3D; }
.clock-break { width: 100%; margin-top: 10px; justify-content: center; }
.board-fresh { margin: -8px 0 10px; }
.preset { margin-bottom: 18px; }
.preset h2 { margin-top: 0; }
td.actions { white-space: nowrap; }
td.actions form { display: inline-block; margin-right: 12px; }
.disclose { margin-top: 10px; }
.disclose > summary { cursor: pointer; color: var(--emerald-2); font-weight: 500; }
.disclose[open] > summary { margin-bottom: 10px; }
.table-compact th, .table-compact td { padding: 7px 10px; }
.table tr.is-current td { background: #F8FCFA; }
.table-pay td.num, .table-pay th.num { white-space: nowrap; }
.attention-list li:not(:has(> a)) { padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--emerald); border-radius: 0 var(--r) var(--r) 0; }
.attention-list li.is-warn:not(:has(> a)) { border-left-color: var(--amber-line); }
.approve-ot { flex-basis: 520px; }
.ot-fields { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; width: 100%; }
.ot-field { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.approve-actions .ot-field input { flex: 0 0 72px; }
.week-cycle { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.tabs { display: flex; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--emerald); }

/* Charts: one hue per chart (emerald), hairline grid, 2px line, 8px markers. */
.chart-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 14px; margin-bottom: 14px; }
.chart-card { margin: 0; }
.chart-card figcaption h2 { margin: 0 0 2px; font-size: 17px; }
.chart-card figcaption p { margin: 0 0 8px; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-bars { max-width: 720px; }
@media (max-width: 560px) { .chart-grid-2 { grid-template-columns: 1fr; } }
.chart-grid { stroke: #E4E9E7; stroke-width: 1; }
.chart-base { stroke: var(--line-strong); stroke-width: 1; }
.chart-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-label { fill: var(--ink-2); font-size: 13px; }
.chart-value { fill: var(--ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-stroke { fill: none; stroke: var(--emerald); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: var(--emerald); fill-opacity: .1; stroke: none; }
.chart-dot { fill: var(--emerald); stroke: var(--surface); stroke-width: 2; }
.chart-hit { fill: transparent; }
.chart-pt:hover .chart-dot { r: 6; }
.chart-bar { fill: var(--emerald); }
.chart-pt:hover .chart-bar { fill: var(--emerald-2); }
@media (forced-colors: active) { .chart-stroke, .chart-bar, .chart-dot { stroke: CanvasText; fill: CanvasText; } .chart-stroke { fill: none; } }
.approve-actions .checkline input[type="checkbox"] { flex: none; min-height: 0; width: 18px; height: 18px; margin: 0; }
.approve-actions .checkline { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; }
.detail-grid > * { min-width: 0; }
.table-scroll > .table { min-width: 100%; }
.periodnav { flex-wrap: wrap; row-gap: 8px; }
.table-pay td:first-child { min-width: 160px; }
.table-pay td:last-child { min-width: 150px; }
.table-pay th, .table-pay td { padding-left: 10px; padding-right: 10px; }
.main { min-width: 0; }
.table-pay thead th { white-space: normal; vertical-align: bottom; }
.table-pay td.num .cell-sub { white-space: normal; }
.table-pay td.num { white-space: nowrap; }

/* Site map (site form): pin and drawn boundary. Leaflet's own styles load on that page only. */
.sitemap { height: 380px; margin: 10px 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; z-index: 0; font: 13px/1.4 var(--sans); }
@media (max-width: 640px) { .sitemap { height: 320px; } }
.sitemap.is-drawing.leaflet-grab, .sitemap.is-drawing .leaflet-interactive { cursor: crosshair; }
.sitemap:focus-visible { outline: none; box-shadow: var(--focus); }
.map-corner { background: #fff; border: 3px solid var(--emerald); border-radius: 50%; box-sizing: border-box; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.map-corner:focus-visible { outline: none; box-shadow: var(--focus); }
.sitemap-tools { margin-bottom: 4px; }
.maptoggle { display: inline-flex; }
.maptoggle .btn { border-radius: 0; }
.maptoggle .btn:first-child { border-radius: var(--r) 0 0 var(--r); }
.maptoggle .btn:last-child { border-radius: 0 var(--r) var(--r) 0; margin-left: -1px; }
.maptoggle .btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.sitemap-tools .btn:disabled { opacity: .45; cursor: default; }
.sitemap-status { min-height: 1.4em; margin: 4px 0 8px; }
.manual-position { margin-top: 8px; }
.manual-position > summary { cursor: pointer; font-weight: 700; color: var(--ink-2); padding: 6px 0; }
.manual-position[open] > summary { margin-bottom: 6px; }
