/* =========================================================
   Mafaz Attendance — design system
   Brand: #0153FF (Mafaz blue) · #070E2A (Mafaz navy)
   ========================================================= */
:root {
  --brand: #0153FF; --brand-600: #0042D9; --brand-700: #0034AD; --brand-400: #3D7BFF;
  --brand-50: #EEF3FF; --brand-100: #DCE7FF; --brand-glow: rgba(1, 83, 255, .28);
  --navy: #070E2A; --navy-2: #121B3E;
  --bg: #F4F6FB; --surface: #FFFFFF; --surface-2: #F7F9FD; --ink: #070E2A; --ink-2: #2A3350;
  --muted: #6A7390; --line: #E6EAF3; --line-2: #EEF1F7;
  --ok: #12A16B; --ok-bg: #E3F6EE; --warn: #C27803; --warn-bg: #FFF4DC; --bad: #E5484D; --bad-bg: #FDECEC;
  --info-bg: #EEF3FF; --violet: #7A4EE0; --violet-bg: #F0EAFE; --orange: #E8590C; --orange-bg: #FFEDE2;
  --off-bg: #EFF1F6;
  --r-xl: 26px; --r-lg: 20px; --r-md: 14px; --r-sm: 10px;
  --shadow-1: 0 1px 2px rgba(7, 14, 42, .04), 0 2px 8px rgba(7, 14, 42, .04);
  --shadow-2: 0 2px 4px rgba(7, 14, 42, .04), 0 12px 32px rgba(7, 14, 42, .08);
  --shadow-brand: 0 18px 40px -12px rgba(1, 83, 255, .55);
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: 72px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #060B22; --surface: #0E1534; --surface-2: #131B3F; --ink: #EEF2FF; --ink-2: #C9D2EE;
  --muted: #8E98BC; --line: #1E2850; --line-2: #18214A;
  --brand-50: #0F1E54; --brand-100: #15297A; --info-bg: #0F1E54;
  --ok-bg: #0C2E26; --warn-bg: #33270A; --bad-bg: #3A1418; --violet-bg: #231A47; --orange-bg: #3A1D0C; --off-bg: #161E42;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 12px 32px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  font-family: 'Readex Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink); background: var(--bg); min-height: 100dvh; font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::selection { background: var(--brand-100); }

/* ------------------------------ shell ------------------------------ */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; padding: calc(10px + var(--safe-t)) 18px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.brandmark { height: 30px; width: auto; display: block; color: var(--ink); }
.brandmark .wm { fill: currentColor; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-1); border: 1px solid var(--line-2);
  transition: transform .15s var(--ease), background .2s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 20px; height: 20px; }
.avatar-btn { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-700)); color: #fff; font-weight: 600; font-size: 14px; display: grid; place-items: center; box-shadow: 0 6px 16px -6px var(--brand-glow); }

main.view { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 6px 16px calc(var(--nav-h) + 28px + var(--safe-b)); }

/* bottom nav */
.nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40; padding: 8px 10px calc(8px + var(--safe-b));
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.8) blur(20px);
  -webkit-backdrop-filter: saturate(1.8) blur(20px); border-top: 1px solid var(--line);
}
.nav-logo { display: none; }
.nav-in { position: relative; display: flex; max-width: 620px; margin: 0 auto; }
.nav button {
  position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 2px; color: var(--muted); font-size: 11px; font-weight: 500; transition: color .25s;
}
.nav button svg { width: 23px; height: 23px; transition: transform .35s var(--spring); }
.nav button.on { color: var(--brand); }
.nav button.on svg { transform: translateY(-1px) scale(1.06); }
.nav-ind {
  position: absolute; top: 2px; height: calc(100% - 4px); border-radius: 16px; background: var(--brand-50);
  transition: left .45s var(--spring), width .45s var(--spring);
}
@media (min-width: 980px) {
  .app { padding-inline-start: 248px; }
  .nav { inset-inline-start: 0; inset-inline-end: auto; top: 0; bottom: 0; width: 248px; padding: calc(84px + var(--safe-t)) 14px 20px; border-top: 0; border-inline-end: 1px solid var(--line); }
  .nav-in { flex-direction: column; gap: 4px; max-width: none; }
  .nav button { flex-direction: row; gap: 12px; padding: 12px 16px; font-size: 14.5px; justify-content: flex-start; border-radius: 14px; }
  .nav button.on { background: var(--brand-50); }
  .nav-ind { display: none; }
  .topbar { padding-inline: 28px; }
  .topbar .logo-slot { visibility: hidden; }
  .nav-logo { display: block !important; position: absolute; top: calc(24px + var(--safe-t)); inset-inline-start: 26px; }
  .nav-logo .brandmark { height: 34px; }
  main.view { padding: 10px 28px 40px; }
}

/* ------------------------------ type ------------------------------ */
.h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.h2 { font-size: 19px; font-weight: 650; letter-spacing: -.005em; }
.h3 { font-size: 15.5px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }

/* ------------------------------ surfaces ------------------------------ */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-1); border: 1px solid var(--line-2); }
.card + .card, .stack > * + * { margin-top: 14px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 980px) { .cols-desk { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; align-items: start; } .cols-desk > * + * { margin-top: 0; } }

/* ------------------------------ controls ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 14px;
  font-weight: 600; font-size: 15px; background: var(--brand); color: #fff; box-shadow: 0 8px 20px -10px var(--brand-glow);
  transition: transform .15s var(--ease), background .2s, opacity .2s, box-shadow .2s; white-space: nowrap;
}
.btn:hover { background: var(--brand-600); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn.block { width: 100%; padding: 15px; font-size: 16px; }
.btn.soft { background: var(--brand-50); color: var(--brand); box-shadow: none; }
.btn.ghost { background: var(--surface-2); color: var(--ink-2); box-shadow: none; border: 1px solid var(--line); }
.btn.danger { background: var(--bad-bg); color: var(--bad); box-shadow: none; }
.btn.dark { background: var(--navy); color: #fff; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 11px; }
.btn.sm svg { width: 16px; height: 16px; }

.field { display: block; margin-top: 14px; }
.field > span.row { display: flex; }
.field > span { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; padding: 13px 14px; border-radius: 13px; border: 1.5px solid var(--line); background: var(--surface-2);
  font-size: 16px; transition: border-color .2s, box-shadow .2s, background .2s; appearance: none;
}
textarea.input { resize: vertical; min-height: 76px; }
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236A7390' stroke-width='2'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; padding-inline-end: 36px; }
[dir="ltr"] select.input { background-position: right 12px center; }
.input:focus { outline: none; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px var(--brand-50); }
.input.code { text-align: center; letter-spacing: .3em; font-size: 20px; font-weight: 600; }
.seg { display: flex; padding: 4px; border-radius: 14px; background: var(--off-bg); gap: 4px; position: relative; }
.seg button { flex: 1; padding: 9px 10px; border-radius: 11px; font-size: 13.5px; font-weight: 500; color: var(--muted); transition: background .25s, color .25s, box-shadow .25s; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .25s; }
.switch i::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform .3s var(--spring); }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(20px); }
[dir="rtl"] .switch input:checked + i::after { transform: translateX(-20px); }
.range { width: 100%; accent-color: var(--brand); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.c-ok { background: var(--ok-bg); color: var(--ok); } .c-late { background: var(--warn-bg); color: var(--warn); }
.c-absent { background: var(--bad-bg); color: var(--bad); } .c-pending { background: var(--info-bg); color: var(--brand); }
.c-off, .c-upcoming, .c-before, .c-manual { background: var(--off-bg); color: var(--muted); }
.c-extra { background: var(--violet-bg); color: var(--violet); } .c-missing { background: var(--violet-bg); color: var(--violet); }
.c-early { background: var(--orange-bg); color: var(--orange); } .c-ot { background: var(--ok-bg); color: var(--ok); }
.c-admin { background: var(--navy); color: #fff; } :root[data-theme="dark"] .c-admin { background: var(--brand); }
.c-supervisor { background: var(--brand-50); color: var(--brand); } .c-employee { background: var(--off-bg); color: var(--muted); }
.shift-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); }
.shift-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

/* ------------------------------ KPIs ------------------------------ */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border-radius: 18px; padding: 14px; border: 1px solid var(--line-2); box-shadow: var(--shadow-1); text-align: start; transition: transform .2s var(--ease), border-color .2s; position: relative; overflow: hidden; }
button.kpi:active { transform: scale(.97); }
.kpi.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.kpi b { display: block; font-size: 26px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi i { position: absolute; inset-inline-end: 12px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--kc, var(--brand)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--kc, var(--brand)) 18%, transparent); }
.k-ok { --kc: var(--ok); } .k-ok b { color: var(--ok); }
.k-bad { --kc: var(--bad); } .k-bad b { color: var(--bad); }
.k-warn { --kc: var(--warn); } .k-warn b { color: var(--warn); }
.k-violet { --kc: var(--violet); } .k-violet b { color: var(--violet); }
.k-brand b { color: var(--brand); }

/* ------------------------------ lists ------------------------------ */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line-2); text-align: start; width: 100%; }
.item:last-child { border-bottom: 0; }
button.item { transition: background .2s; border-radius: 12px; padding-inline: 8px; margin-inline: -8px; width: calc(100% + 16px); }
button.item:hover { background: var(--surface-2); }
.item .t { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { font-size: 12.5px; color: var(--muted); }
.times { font-variant-numeric: tabular-nums; font-size: 13.5px; text-align: end; white-space: nowrap; color: var(--ink-2); line-height: 1.6; }
.ava { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-weight: 600; font-size: 14px; flex-shrink: 0; color: var(--brand); background: var(--brand-50); position: relative; }
.ava::after { content: ""; position: absolute; inset-inline-end: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--surface); background: var(--sc, transparent); }
.ava.s-ok { --sc: var(--ok); } .ava.s-late { --sc: var(--warn); } .ava.s-absent { --sc: var(--bad); } .ava.s-extra { --sc: var(--violet); } .ava.s-in { --sc: var(--ok); }
.empty { text-align: center; padding: 36px 12px; color: var(--muted); }
.empty svg { width: 54px; height: 54px; color: var(--line); margin-bottom: 8px; }
.group-h { display: flex; align-items: center; gap: 8px; margin: 18px 0 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.group-h:first-child { margin-top: 0; }
.daybadge { width: 46px; height: 50px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; line-height: 1.1; }
.daybadge b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.daybadge span { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.daybadge.today { background: var(--brand); border-color: var(--brand); color: #fff; } .daybadge.today span { color: rgba(255,255,255,.8); }

/* ------------------------------ home ------------------------------ */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 2px 16px; }
.hello .h1 span { color: var(--brand); }
.clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-2); padding: 7px 12px; border-radius: 12px; box-shadow: var(--shadow-1); white-space: nowrap; }
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 22px 20px 24px; color: #fff;
  background: radial-gradient(120% 90% at 85% 0%, #2F74FF 0%, transparent 55%), linear-gradient(160deg, #0153FF 0%, #0034AD 58%, #071A5E 100%);
  box-shadow: var(--shadow-brand);
}
.hero.out { background: radial-gradient(120% 90% at 85% 0%, #24306A 0%, transparent 55%), linear-gradient(160deg, #121B3E 0%, #070E2A 70%); box-shadow: 0 18px 40px -16px rgba(7, 14, 42, .7); }
.hero.done { background: radial-gradient(120% 90% at 85% 0%, #22C38A 0%, transparent 55%), linear-gradient(160deg, #0FA36B 0%, #087A50 100%); box-shadow: 0 18px 40px -16px rgba(18, 161, 107, .55); }
.hero.muted { background: linear-gradient(160deg, #3A4466, #1C2446); box-shadow: 0 14px 30px -16px rgba(7, 14, 42, .5); }
.hero .pattern { position: absolute; inset: 0; opacity: .12; pointer-events: none; background-image: radial-gradient(circle at 1px 1px, #fff 1px, transparent 0); background-size: 18px 18px; mask-image: radial-gradient(80% 80% at 80% 10%, #000, transparent); }
.hero-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hero .shift-chip { background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(6px); }
.hero .shift-chip .dot { background: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 70%, transparent); }
.hero .meta { font-size: 13px; opacity: .85; }

/* reticle — signature element (from the logo's crosshair) */
.reticle-wrap { position: relative; display: grid; place-items: center; margin: 22px auto 14px; width: 232px; height: 232px; }
.reticle { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.reticle .ring { fill: none; stroke: rgba(255,255,255,.28); stroke-width: 1.5; }
.reticle .ring2 { fill: none; stroke: rgba(255,255,255,.16); stroke-width: 1; stroke-dasharray: 2 6; transform-origin: 50% 50%; animation: spin 40s linear infinite; }
.reticle .arc { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 90 600; transform-origin: 50% 50%; opacity: 0; }
.reticle .tick { stroke: rgba(255,255,255,.7); stroke-width: 2.5; stroke-linecap: round; }
.reticle .dotc { fill: #fff; }
.punch {
  position: relative; width: 168px; height: 168px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: #fff; color: var(--brand); font-weight: 700; font-size: 18px; text-align: center; line-height: 1.25;
  box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .45), inset 0 -6px 14px rgba(1, 83, 255, .08);
  transition: transform .25s var(--spring), box-shadow .3s;
}
.punch svg.ic { width: 40px; height: 40px; }
.punch small { font-size: 12px; font-weight: 500; color: var(--muted); }
.punch:active { transform: scale(.94); }
.hero.out .punch { color: var(--navy); }
.hero.done .punch { color: var(--ok); }
.hero.muted .punch { color: var(--muted); }
.punch::before { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); animation: breathe 2.8s var(--ease) infinite; }
.hero.done .punch::before, .hero.muted .punch::before { animation: none; opacity: .4; }
.reticle-wrap.scanning .arc { opacity: 1; animation: spin 1.1s linear infinite; }
.reticle-wrap.scanning .ring2 { animation-duration: 6s; }
.reticle-wrap.scanning .punch { transform: scale(.96); }
.reticle-wrap.locked .tick { stroke: #fff; }
.reticle-wrap.success .punch { animation: pop .6s var(--spring); }
.reticle-wrap.error .punch { animation: shake .45s; }
.burst { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; }
.burst.go { animation: burst .9s var(--ease) forwards; border: 3px solid #fff; }
.check-draw path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .1s var(--ease) forwards; }

.geo-pill { position: relative; margin: 0 auto; display: flex; width: fit-content; max-width: 100%; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: rgba(255,255,255,.14); backdrop-filter: blur(8px); font-size: 13px; font-weight: 500; }
.geo-pill .led { width: 9px; height: 9px; border-radius: 50%; background: #FFD25A; box-shadow: 0 0 0 0 rgba(255, 210, 90, .7); animation: led 1.6s infinite; }
.geo-pill.in .led { background: #3BF0A5; box-shadow: 0 0 0 0 rgba(59, 240, 165, .7); }
.geo-pill.out .led { background: #FF7A7E; animation: none; }
.geo-pill.weak .led { background: #FFD25A; }

.timeline { position: relative; margin-top: 18px; }
.tl-bar { position: relative; height: 8px; border-radius: 99px; background: rgba(255,255,255,.18); overflow: visible; }
.tl-fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 99px; background: linear-gradient(90deg, rgba(255,255,255,.65), #fff); width: 0; transition: width 1s var(--ease); }
[dir="rtl"] .tl-fill { background: linear-gradient(270deg, rgba(255,255,255,.65), #fff); }
.tl-now { position: absolute; top: 50%; width: 14px; height: 14px; margin-inline-start: -7px; border-radius: 50%; background: #fff; transform: translateY(-50%); box-shadow: 0 0 0 4px rgba(255,255,255,.25); }
.tl-labels { display: flex; justify-content: space-between; font-size: 12px; opacity: .85; margin-top: 8px; font-variant-numeric: tabular-nums; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; padding: 12px; box-shadow: var(--shadow-1); }
.tile span { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.tile b { display: block; font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; }
.next { display: flex; align-items: center; gap: 12px; }
.next .ic { width: 42px; height: 42px; border-radius: 14px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.next .ic svg { width: 22px; height: 22px; }

/* ------------------------------ board / date strip ------------------------------ */
.strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; scroll-snap-type: x mandatory; }
.strip::-webkit-scrollbar { display: none; }
.strip button { scroll-snap-align: center; flex-shrink: 0; width: 54px; padding: 8px 0; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); display: flex; flex-direction: column; align-items: center; gap: 1px; transition: background .2s, color .2s, transform .2s; }
.strip button span { font-size: 11px; color: var(--muted); }
.strip button b { font-size: 17px; font-variant-numeric: tabular-nums; }
.strip button.on { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 10px 22px -12px var(--brand-glow); }
.strip button.on span { color: rgba(255,255,255,.8); }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ok); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: led 1.6s infinite; box-shadow: 0 0 0 0 rgba(18,161,107,.6); }

/* ------------------------------ roster grid ------------------------------ */
.roster-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; scrollbar-width: thin; }
.roster { border-collapse: separate; border-spacing: 0; min-width: 640px; width: 100%; }
.roster td, .roster th { padding: 3px; }
.roster th { font-size: 12px; font-weight: 600; color: var(--muted); padding: 2px 0 4px; text-align: center; }
.roster th b { display: block; font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.roster th.today b { color: var(--brand); }
.roster td.name { position: sticky; inset-inline-start: 0; z-index: 2; background: var(--surface); min-width: 112px; max-width: 140px; padding-inline-end: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell { width: 100%; min-width: 72px; height: 48px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; line-height: 1.2; position: relative;
  background: color-mix(in srgb, var(--c, #8E98BC) 13%, var(--surface)); color: var(--c, var(--muted)); border: 1.5px solid transparent; transition: transform .2s var(--spring), border-color .2s, box-shadow .2s; }
.cell small { font-size: 10.5px; font-weight: 500; opacity: .85; font-variant-numeric: tabular-nums; }
.cell.off { background: repeating-linear-gradient(135deg, var(--off-bg), var(--off-bg) 6px, var(--surface-2) 6px, var(--surface-2) 12px); color: var(--muted); }
.cell.ovr::after { content: ""; position: absolute; top: 5px; inset-inline-end: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.cell.sel { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); transform: scale(.95); }
.cell:active { transform: scale(.93); }
.actionbar { position: fixed; inset-inline: 12px; bottom: calc(var(--nav-h) + 16px + var(--safe-b)); z-index: 45; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 18px; background: var(--navy); color: #fff; box-shadow: 0 18px 40px -10px rgba(7,14,42,.6); max-width: 640px; margin: 0 auto; animation: rise .35s var(--spring); }
@media (min-width: 980px) { .actionbar { inset-inline-start: 272px; bottom: 24px; } }

/* shifts */
.shift-card { display: flex; gap: 14px; align-items: center; }
.shift-card .sw { width: 6px; align-self: stretch; border-radius: 99px; background: var(--c); }
.day24 { direction: ltr; position: relative; height: 10px; border-radius: 99px; background: var(--off-bg); margin-top: 8px; overflow: hidden; }
.day24 i { position: absolute; top: 0; bottom: 0; background: var(--c); border-radius: 99px; }
.day24-scale { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; direction: ltr; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches label { position: relative; }
.swatches input { position: absolute; opacity: 0; }
.swatches i { display: block; width: 34px; height: 34px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 3px var(--surface); border: 2px solid transparent; transition: transform .2s var(--spring), border-color .2s; }
.swatches input:checked + i { border-color: var(--c); transform: scale(1.1); }
.week7 { display: grid; gap: 8px; }
.week7 .wd { display: grid; grid-template-columns: 80px 1fr; align-items: center; gap: 10px; }

/* map */
.map { height: 320px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--off-bg); z-index: 0; }
.leaflet-container { font-family: inherit; }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 11px 8px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.tbl th:first-child { border-start-start-radius: 10px; border-end-start-radius: 10px; }
.tbl th:last-child { border-start-end-radius: 10px; border-end-end-radius: 10px; }
.tbl td:first-child, .tbl th:first-child { text-align: start; }
.bar-mini { height: 6px; border-radius: 99px; background: var(--off-bg); overflow: hidden; min-width: 60px; }
.bar-mini i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }

/* ------------------------------ sheet / toast ------------------------------ */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(5, 10, 30, .45); backdrop-filter: blur(2px); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; background: var(--surface); border-radius: 26px 26px 0 0; padding: 10px 20px calc(22px + var(--safe-b)); box-shadow: 0 -10px 40px rgba(0,0,0,.18); animation: up .38s var(--spring); overscroll-behavior: contain; }
.sheet .grab { width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: 2px auto 14px; }
.sheet .acts { display: flex; gap: 10px; margin-top: 20px; }
.sheet .acts .btn { flex: 1; }
.scrim.closing { animation: fade .2s reverse forwards; }
.scrim.closing .sheet { animation: down .22s var(--ease) forwards; }
@media (min-width: 720px) { .scrim { align-items: center; } .sheet { border-radius: 26px; } .scrim.closing .sheet { animation: fade .2s reverse forwards; } }
.toast-host { position: fixed; z-index: 100; inset-inline: 0; top: calc(12px + var(--safe-t)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: min(92vw, 460px); padding: 12px 16px; border-radius: 16px; background: var(--navy); color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 16px 40px -12px rgba(7,14,42,.5); animation: drop .45s var(--spring); }
:root[data-theme="dark"] .toast { background: #fff; color: var(--navy); }
.toast svg { width: 20px; height: 20px; flex-shrink: 0; }
.toast.ok svg { color: #3BF0A5; } .toast.err svg { color: #FF7A7E; }
.toast.out { animation: fade .25s reverse forwards; }
.msg { margin-top: 14px; padding: 12px 14px; border-radius: 14px; font-size: 14px; font-weight: 500; line-height: 1.6; }
.msg.err { background: var(--bad-bg); color: var(--bad); } .msg.ok { background: var(--ok-bg); color: var(--ok); } .msg.info { background: var(--info-bg); color: var(--brand); }

/* login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 18px calc(24px + var(--safe-b)); position: relative; overflow: hidden; }
.login::before { content: ""; position: absolute; width: 760px; height: 760px; border-radius: 50%; top: -420px; inset-inline-end: -260px; background: radial-gradient(circle, rgba(1,83,255,.16), transparent 62%); }
.login::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; bottom: -300px; inset-inline-start: -200px; background: radial-gradient(circle, rgba(1,83,255,.10), transparent 62%); }
.login-card { position: relative; z-index: 1; width: 100%; max-width: 410px; }
.login .brandmark { height: 46px; margin: 0 auto 26px; }
.login .float-mark { position: absolute; width: 520px; opacity: .045; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; color: var(--brand); animation: spin 120s linear infinite; }
.lang-toggle { position: absolute; top: calc(16px + var(--safe-t)); inset-inline-end: 16px; z-index: 2; }

/* skeleton */
.skel { border-radius: 14px; background: linear-gradient(90deg, var(--off-bg) 0%, var(--surface-2) 50%, var(--off-bg) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }

/* motion */
.rise { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes down { to { transform: translateY(100%); } }
@keyframes drop { from { opacity: 0; transform: translateY(-16px) scale(.96); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .5; } 50% { transform: scale(1.06); opacity: .15; } }
@keyframes pop { 0% { transform: scale(.9); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes burst { from { transform: scale(.8); opacity: .9; } to { transform: scale(1.7); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes led { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes shimmer { to { background-position: -200% 0; } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; animation-timing-function: var(--ease); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- v3: requests, leave, notifications ---------- */
:root { --leave: #0CA5B0; --leave-bg: #E0F6F7; }
:root[data-theme="dark"] { --leave-bg: #0B2E33; }
.c-leave { background: var(--leave-bg); color: var(--leave); }
.c-perm { background: var(--info-bg); color: var(--brand); }
.k-leave { --kc: var(--leave); } .k-leave b { color: var(--leave); }
.ava.s-leave { --sc: var(--leave); }
.rs-pending { background: var(--warn-bg); color: var(--warn); } .rs-approved { background: var(--ok-bg); color: var(--ok); }
.rs-rejected { background: var(--bad-bg); color: var(--bad); } .rs-cancelled { background: var(--off-bg); color: var(--muted); }
.chip.linkish { background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.nav-in button { position: relative; }
.nbadge { position: absolute; top: 4px; inset-inline-end: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff;
  font: 700 11px/18px var(--font, inherit); font-style: normal; text-align: center; box-shadow: 0 0 0 2px var(--surface); animation: pop .4s var(--ease); }
.nbadge.in-seg { position: static; display: inline-block; margin-inline-start: 6px; box-shadow: none; vertical-align: 1px; }
.nbadge.hidden { display: none; }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
.req-ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--rc-bg); color: var(--rc); }
.req-ic svg { width: 20px; height: 20px; }
.k-leave.req-ic, .req-tag.k-leave { --rc: var(--leave); --rc-bg: var(--leave-bg); }
.k-permission { --rc: var(--brand); --rc-bg: var(--info-bg); } .k-correction { --rc: var(--violet); --rc-bg: var(--violet-bg); }
.req-tag { display: inline-flex; align-items: center; gap: 5px; color: var(--rc); font-weight: 600; }
.req-tag svg { width: 14px; height: 14px; }
.item.req { align-items: flex-start; }
.item .s.q { font-style: italic; }
.req-acts { display: flex; gap: 8px; margin-top: 10px; }
.btn.ok-btn { background: var(--ok); }
.btn.ok-btn svg, .btn svg { width: 16px; height: 16px; }
.bal { background: linear-gradient(135deg, var(--leave-bg), var(--surface) 70%); }
.bal-n { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.bal-n b { font-size: 38px; font-weight: 700; color: var(--leave); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bal-n span { color: var(--muted); font-size: 13px; }
.ring-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--leave); box-shadow: 0 0 0 6px color-mix(in srgb, var(--leave) 14%, transparent); }
.ring-ic svg { width: 24px; height: 24px; }
.bal-bar { display: flex; height: 8px; border-radius: 99px; background: var(--off-bg); overflow: hidden; margin: 14px 0 8px; }
.bal-bar i { display: block; height: 100%; background: var(--leave); transition: width .8s var(--ease); }
.bal-bar i.p { background: repeating-linear-gradient(45deg, var(--warn) 0 4px, color-mix(in srgb, var(--warn) 50%, transparent) 4px 8px); }
.notif-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--off-bg); }
.notif-row .ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--brand); flex: none; }
.notif-row .ic svg { width: 18px; height: 18px; }
.notif-card .next .ic svg { animation: ring 2.4s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes ring { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 80% { transform: rotate(-12deg); } 85% { transform: rotate(8deg); } 90% { transform: rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .notif-card .next .ic svg, .nbadge { animation: none; } }

.grid2 > .field, .grid2 .input { min-width: 0; }
.input[type=date], .input[type=time] { width: 100%; min-width: 0; }
