/* Hospital HR — base styles. No external fonts or CDNs (works offline, strict CSP). */
:root {
  --bg: #f4f6f8; --surface: #ffffff; --surface-2: #f8fafb; --line: #e2e7ec; --line-strong: #cfd7df;
  --ink: #17212b; --ink-2: #4a5866; --ink-3: #7a8794;
  --brand: #0f6e66; --brand-ink: #ffffff; --brand-soft: #e3f2f0;
  --good: #1f7a3d; --good-soft: #e5f4ea; --warn: #9a5b00; --warn-soft: #fdf1dc;
  --bad: #b42318; --bad-soft: #fdecea; --info: #1d5fa8; --info-soft: #e7f0fb;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --font: "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1418; --surface: #171e24; --surface-2: #1c242b; --line: #26313a; --line-strong: #34414c;
    --ink: #e6ebef; --ink-2: #b3bec8; --ink-3: #8794a0;
    --brand: #3fb3a6; --brand-ink: #06221f; --brand-soft: #123330;
    --good: #5cc983; --good-soft: #163222; --warn: #f0b456; --warn-soft: #34270f;
    --bad: #f27b70; --bad-soft: #3a1714; --info: #79aef0; --info-soft: #152739;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.35rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
h3 { font-size: .95rem; margin: 0 0 .5rem; color: var(--ink-2); }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.mono, .ltr { direction: ltr; unicode-bidi: isolate; }
[dir=rtl] dd.ltr, [dir=rtl] td.ltr { text-align: right; }
.mono { font-family: Consolas, "Courier New", monospace; }

/* Layout */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-inline-end: 1px solid var(--line); padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; padding: .25rem .5rem 1rem; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; }
.nav-group { margin: .75rem 0; }
.nav-title { font-size: .75rem; color: var(--ink-3); padding: 0 .5rem; margin-bottom: .25rem; }
.nav a { display: block; padding: .45rem .6rem; border-radius: 8px; color: var(--ink-2); }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.main { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .who { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.content { padding: 1.5rem; max-width: 1280px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.btn.menu-toggle { display: none; }

/* Cards & grid */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 1rem 1.1rem; }
.stat .num { font-size: 1.7rem; font-weight: 700; }
.stat .lbl { color: var(--ink-3); font-size: .85rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .6rem .7rem; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
th { font-size: .8rem; color: var(--ink-3); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
tr:hover td { background: var(--surface-2); }
.inactive td { color: var(--ink-3); }

/* Forms */
form.inline { display: inline; }
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; }
.field label { font-weight: 600; font-size: .88rem; }
.field .hint { font-size: .8rem; color: var(--ink-3); }
.req::after { content: " *"; color: var(--bad); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=time], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
textarea { min-height: 80px; }
.check { display: flex; align-items: center; gap: .45rem; margin: .25rem 0; font-weight: 400; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .15rem 1rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-bottom: 1rem; }
.filters .field { margin: 0; min-width: 160px; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.err { color: var(--bad); font-size: .82rem; }
.is-invalid { border-color: var(--bad) !important; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .5rem .95rem; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.06); background: var(--brand); }
.btn-danger { color: var(--bad); border-color: var(--bad); }
.btn-sm { padding: .3rem .6rem; font-size: .85rem; }
.btn-link { background: none; border: 0; color: var(--brand); padding: 0; cursor: pointer; font: inherit; }

/* Badges & alerts */
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.muted { opacity: .8; }
.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid transparent; }
.alert-ok { background: var(--good-soft); color: var(--good); }
.alert-bad { background: var(--bad-soft); color: var(--bad); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert ul { margin: .25rem 0 0; padding-inline-start: 1.2rem; }

/* Definition list */
.dl { display: grid; grid-template-columns: 160px 1fr; gap: .45rem 1rem; margin: 0; }
.dl dt { color: var(--ink-3); font-size: .88rem; }
.dl dd { margin: 0; }

/* Auth pages */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 420px; }
.code-box { font-family: Consolas, monospace; font-size: 1.15rem; letter-spacing: .08em; background: var(--surface-2); border: 1px dashed var(--line-strong); padding: .75rem; border-radius: 8px; text-align: center; direction: ltr; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem; direction: ltr; font-family: Consolas, monospace; }

/* Pagination */
.pager { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: 1rem; align-items: center; }
.pager a, .pager span { padding: .3rem .65rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: .88rem; }
.pager .current { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.pager .disabled { color: var(--ink-3); }

.bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); }
details summary { cursor: pointer; color: var(--brand); }
.diff { font-size: .8rem; margin: 0; padding-inline-start: 1rem; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 260px; z-index: 20; transform: translateX(100%); transition: transform .2s; }
  [dir=ltr] .side { transform: translateX(-100%); }
  body.menu-open .side { transform: none; }
  .btn.menu-toggle { display: inline-flex; }
  .topbar .today { display: none; }
  .table-wrap td { white-space: nowrap; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .content { padding: 1rem; }
  .dl { grid-template-columns: 1fr; }
}
@media print { .side, .topbar, .no-print { display: none !important; } .shell { display: block; } }

/* Bar widths in 5% steps (no inline styles under CSP) */
.bar > i.w-0 { width: 0%; }
.bar > i.w-5 { width: 5%; }
.bar > i.w-10 { width: 10%; }
.bar > i.w-15 { width: 15%; }
.bar > i.w-20 { width: 20%; }
.bar > i.w-25 { width: 25%; }
.bar > i.w-30 { width: 30%; }
.bar > i.w-35 { width: 35%; }
.bar > i.w-40 { width: 40%; }
.bar > i.w-45 { width: 45%; }
.bar > i.w-50 { width: 50%; }
.bar > i.w-55 { width: 55%; }
.bar > i.w-60 { width: 60%; }
.bar > i.w-65 { width: 65%; }
.bar > i.w-70 { width: 70%; }
.bar > i.w-75 { width: 75%; }
.bar > i.w-80 { width: 80%; }
.bar > i.w-85 { width: 85%; }
.bar > i.w-90 { width: 90%; }
.bar > i.w-95 { width: 95%; }
.bar > i.w-100 { width: 100%; }
.w-bar { width: 45%; }

/* MFA QR: always on white so phones can scan it in dark mode too */
.qr-box { display: flex; justify-content: center; margin: .75rem 0; }
.qr-box img { background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--line); }
.upload-box { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.upload-box summary { font-weight: 600; margin-bottom: .5rem; }
.page-head h2 { margin: 0; }

/* ---- Mobile attendance (PWA) ---- */
.m-body { background: var(--bg); }
.m-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.m-top .brand { padding: 0; }
.m-links { display: flex; gap: .9rem; font-size: .9rem; }
.m-main { max-width: 560px; margin: 0 auto; padding: 1rem; }
.m-name { font-size: 1.2rem; font-weight: 700; }
.m-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 1rem 0; }
.m-btn { padding: 1.1rem .5rem; font-size: 1.1rem; border-radius: 12px; }
.m-btn:disabled { opacity: .55; cursor: wait; }
.m-status { min-height: 1.6rem; font-weight: 600; padding: .4rem 0; }
.m-status.m-good { color: var(--good); }
.m-status.m-warn { color: var(--warn); }
.m-status.m-bad { color: var(--bad); }
.m-site, .m-event { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.m-site:last-child, .m-event:last-child { border-bottom: 0; }

/* ---- Admin: assignments & attendance ---- */
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a { padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: .9rem; }
.tabs a.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.pick-list { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .75rem; background: var(--surface-2); }
.pick-list .check[hidden] { display: none; }
.checks-inline { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.check-row td:first-child { width: 2.5rem; }
.result-pass { color: var(--good); font-weight: 600; }
.result-fail { color: var(--bad); font-weight: 600; }
.result-warn { color: var(--warn); font-weight: 600; }
.result-skip { color: var(--ink-3); }

/* Phase 4 */
.mt { margin-top: 1rem; }
.bal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.bal { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; background: var(--surface); }
.bal b { font-size: 1.5rem; display: block; }
.num-pos { color: var(--good, #15803d); }
.num-neg { color: var(--bad, #b91c1c); }

/* Phase 5: payroll */
.steps { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; padding: 0; list-style: none; counter-reset: st; }
.steps li { counter-increment: st; color: var(--ink-3); }
.steps li::before { content: counter(st); display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 1px solid var(--line); margin-inline-end: .35rem; font-size: .8rem; }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--good-soft); border-color: var(--good); color: var(--good); content: "✓"; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; }
.inline-form { display: flex; gap: .4rem; align-items: center; }
.inline-form input[type=text] { min-width: 180px; }
.kpis b { font-size: 1.3rem; display: block; }
.payslip-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.payslip table { width: 100%; }
.payslip tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
.payslip .net { font-size: 1.2rem; margin: 1rem 0; }
@media print {
  .m-top, .flash, .no-print { display: none !important; }
  .payslip { border: 0; box-shadow: none; }
  body { background: #fff; }
}

/* Phase 6: reports & insurance */
tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
ul.links { margin: 0; padding-inline-start: 1.1rem; line-height: 2; }
.print-only { display: none; }
.work-list { display: grid; gap: .35rem; }
.work-list a { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem .5rem; border-radius: 8px; background: var(--surface-2, transparent); }
.work-list a b { min-width: 2rem; text-align: center; }
@media print {
  .print-only { display: block; }
  .report table { font-size: 11px; }
  .report th, .report td { padding: 3px 5px; }
}
.report td, .report th { white-space: nowrap; }

/* Phase 9: notifications */
.strong { font-weight: 700; }
.notif-link { position: relative; }
.notif-link.active { font-weight: 700; }
.notif-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { border-bottom: 1px solid var(--line); }
.notif-list li:last-child { border-bottom: 0; }
.notif-list li > a { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .7rem .25rem; color: inherit; text-decoration: none; }
.notif-list li > a:hover { background: var(--surface-2); }
.notif-list li.unread .notif-text { font-weight: 700; }
.notif-list li.unread > a { border-inline-start: 3px solid var(--info); padding-inline-start: .6rem; }
.notif-list li.read .notif-text { color: var(--ink-2); }
.notif-list li.muted { padding: .7rem .25rem; }
@media (max-width: 640px) { .notif-list li > a { flex-direction: column; gap: .2rem; } }
/* six links on a narrow phone: wrap instead of running off the screen */
.m-links { flex-wrap: wrap; justify-content: flex-end; row-gap: .35rem; column-gap: .8rem; }

/* Phase 9: printed / PDF tables must not be clipped by the scroll wrapper */
@media print {
  .table-wrap { overflow: visible !important; }
  .report td, .report th, .table-wrap td { white-space: normal; }
  .report td.ltr, .table-wrap td.ltr, .table-wrap .ltr { white-space: nowrap; }
  .card { box-shadow: none; }
  table { page-break-inside: auto; }
  tr { page-break-inside: avoid; }
  thead { display: table-header-group; }
}

/* ===== UI update (17 Oct): grouped menu, simpler dashboard, people list ===== */
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav .nav-home { display: flex; align-items: center; gap: .55rem; font-weight: 600; margin-bottom: .35rem; }
.nav details.nav-group { margin: .1rem 0; }
.nav details.nav-group > summary { list-style: none; display: flex; align-items: center; gap: .55rem; padding: .5rem .6rem; border-radius: 8px; color: var(--ink); font-weight: 600; cursor: pointer; user-select: none; }
.nav details.nav-group > summary::-webkit-details-marker { display: none; }
.nav details.nav-group > summary::after { content: "‹"; margin-inline-start: auto; color: var(--ink-3); transition: transform .15s; }
[dir=ltr] .nav details.nav-group > summary::after { content: "›"; }
.nav details.nav-group[open] > summary::after { transform: rotate(-90deg); }
.nav details.nav-group > summary:hover { background: var(--surface-2); }
.nav details.nav-group[data-has-active] > summary { color: var(--brand); }
.nav .nav-items { padding-inline-start: 1.6rem; margin: .1rem 0 .4rem; border-inline-start: 1px solid var(--line); margin-inline-start: .95rem; }
.nav .nav-items a { padding: .35rem .6rem; font-size: .92rem; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-grid; place-items: center; font-weight: 700; flex: none; font-size: .9rem; }
.who-name, .notif-link { display: inline-flex; align-items: center; gap: .4rem; color: var(--ink-2); }
.menu-backdrop { display: none; }

/* dashboard */
.dash-head h1 { font-size: 1.45rem; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi { display: flex; flex-direction: column; gap: .1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); color: var(--ink); border-top: 3px solid var(--line-strong); }
a.kpi:hover { text-decoration: none; border-color: var(--brand); }
.kpi.good { border-top-color: var(--good); } .kpi.bad { border-top-color: var(--bad); } .kpi.warn { border-top-color: var(--warn); }
.kpi-num { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.kpi.bad .kpi-num { color: var(--bad); } .kpi.warn .kpi-num { color: var(--warn); }
.kpi-lbl { font-weight: 600; color: var(--ink-2); }
.kpi-sub { font-size: .8rem; color: var(--ink-3); }
.quick { display: flex; flex-wrap: wrap; gap: .5rem; }
.quick .btn { flex: 1 1 140px; }
.empty-ok { color: var(--good); font-weight: 600; margin: .5rem 0; }
details.fold > summary { list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary b::before { content: "+ "; color: var(--brand); }
details.fold[open] > summary b::before { content: "− "; }

/* people list */
.count-pill { display: inline-block; font-size: .85rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 .6rem; vertical-align: middle; color: var(--ink-2); }
.chips a b { font-weight: 700; margin-inline-start: .25rem; opacity: .85; }
.search-card { padding: .85rem 1rem; }
.search-row { display: flex; gap: .5rem; }
.search-row input[type=search] { flex: 1; font-size: 1rem; padding: .65rem .8rem; }
.search-card .adv { margin-top: .5rem; }
.search-card .adv .filters { margin: .6rem 0 0; }
table.people td { vertical-align: middle; }
.person { display: flex; align-items: center; gap: .65rem; color: var(--ink); }
.person:hover { text-decoration: none; }
.person:hover b { color: var(--brand); }
.sub { display: block; font-size: .8rem; color: var(--ink-3); }
.row-go a { font-size: .85rem; white-space: nowrap; }
td.empty { text-align: center; color: var(--ink-3); padding: 2rem; }
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12); min-width: 150px; z-index: 10; padding: .3rem; }
.menu-list a { display: block; padding: .45rem .7rem; border-radius: 6px; color: var(--ink); }
.menu-list a:hover { background: var(--surface-2); text-decoration: none; }

@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .kpi { padding: .75rem .85rem; }
  .kpi-num { font-size: 1.5rem; }
  .hide-sm { display: none !important; }
  .topbar { padding: .6rem .9rem; }
  .topbar .who { gap: .5rem; flex-wrap: nowrap; }
  body.menu-open .menu-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 15; }
  /* people list becomes cards */
  table.people thead { display: none; }
  table.people tr { display: grid; grid-template-columns: 1fr auto; gap: .2rem .6rem; padding: .7rem .2rem; border-bottom: 1px solid var(--line); }
  table.people td { border: 0; padding: 0; white-space: normal !important; }
  table.people td:nth-child(2) { grid-column: 1; font-size: .85rem; padding-inline-start: 2.6rem; }
  table.people td:nth-child(4) { grid-row: 1; grid-column: 2; align-self: start; }
  table.people td.row-go { display: none; }
  .search-row { flex-wrap: wrap; }
}

/* geofence form */
.geo-steps { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: .75rem; }
.geo-step { border: 1px solid var(--line); border-radius: 8px; padding: .75rem .9rem; background: var(--surface-2); }
.geo-step p { margin: .25rem 0 .5rem; }
.geo-result { background: var(--good-soft); color: var(--good); border-radius: 8px; padding: .55rem .8rem; margin-bottom: .8rem; font-weight: 600; }
.radius-pick { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .4rem; }
.radius-input { max-width: 160px; }
@media (max-width: 900px) { .geo-steps { grid-template-columns: 1fr; } }
.kv td:first-child { color: var(--ink-3); } .kv td { padding: .35rem .5rem; }

/* review 17 Oct: organization chart */
.org-tree{display:grid;gap:14px;margin-bottom:16px}
.org-branch{padding:0;overflow:hidden}
.org-branch>.org-node{background:var(--brand-soft,#e7f3f1);padding:14px 16px;border-bottom:1px solid var(--line,#e5e7eb)}
.org-node{display:flex;justify-content:space-between;align-items:center;gap:12px}
.org-actions{display:flex;gap:8px;align-items:center;flex-shrink:0}
.org-children{list-style:none;margin:0;padding:8px 16px 12px;position:relative}
.org-children>li{position:relative;padding:10px 12px;margin-inline-start:18px;border-bottom:1px dashed var(--line,#e5e7eb)}
.org-children>li:last-child{border-bottom:0}
.org-children>li::before{content:"";position:absolute;inset-inline-start:-14px;top:0;bottom:50%;border-inline-start:2px solid var(--line,#d1d5db);border-bottom:2px solid var(--line,#d1d5db);width:10px}
.org-node.inactive,.org-branch.inactive{opacity:.6}
.org-node.warn-row{background:rgba(245,158,11,.12)}
a.count-pill{text-decoration:none}

/* review 17 Oct: employee app (bottom tabs, hero card, big action button) */
.m-app { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
.m-top-actions { display: flex; gap: .6rem; align-items: center; }
.m-icon { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--ink, inherit); }
.m-icon svg, .m-tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.m-dot { position: absolute; top: 2px; inset-inline-end: 0; background: var(--bad); color: #fff; font-size: .65rem; border-radius: 10px; padding: 0 5px; line-height: 1.4; }
.m-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; }
.m-tabs { position: fixed; bottom: 0; inset-inline: 0; z-index: 10; display: flex; justify-content: space-around; background: var(--surface); border-top: 1px solid var(--line); padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); }
.m-tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; color: var(--ink-3); padding: .25rem 0; border-radius: 10px; }
.m-tabs a.active { color: var(--brand); font-weight: 700; }
.m-tabs a.active svg { stroke-width: 2.3; }
.m-hero { background: linear-gradient(135deg, var(--brand), #13897f); color: #fff; border-radius: 18px; padding: 1.1rem 1.1rem 1rem; margin-bottom: 1rem; box-shadow: 0 8px 24px rgba(15,110,102,.25); }
.m-hero-top { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; }
.m-hello { font-size: 1.25rem; font-weight: 800; }
.m-sub, .m-date { font-size: .82rem; opacity: .85; }
.m-clock { text-align: end; }
.m-time { font-size: 1.9rem; font-weight: 800; line-height: 1; letter-spacing: .5px; }
.m-state { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.m-pill { background: rgba(255,255,255,.16); border-radius: 999px; padding: .25rem .7rem; font-size: .8rem; }
.m-pill.good { background: rgba(110,231,183,.25); }
.m-pill.warn { background: rgba(252,211,77,.28); }
.m-pill.bad { background: rgba(248,113,113,.32); }
.m-action { text-align: center; padding-top: 1.4rem; }
.m-round { width: 172px; height: 172px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-ink); font-size: 1.15rem; font-weight: 800; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; box-shadow: 0 0 0 10px var(--brand-soft), 0 10px 28px rgba(15,110,102,.35); cursor: pointer; transition: transform .12s; }
.m-round:active { transform: scale(.96); }
.m-round.out { background: #b45309; box-shadow: 0 0 0 10px rgba(180,83,9,.14), 0 10px 28px rgba(180,83,9,.3); }
.m-round:disabled { opacity: .6; cursor: wait; }
.m-round-ico { font-size: 2rem; line-height: 1; }
.m-alt { margin-top: 1.1rem; }
.m-action .m-status { margin-top: .6rem; }
.m-note { margin-top: .4rem; text-align: start; }
.m-note input { margin-top: .4rem; width: 100%; }
.m-privacy { margin-top: .8rem; }
.m-month { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-bottom: 1rem; color: inherit; }
.m-month > div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .65rem .3rem; text-align: center; }
.m-month b { display: block; font-size: 1.35rem; }
.m-month span { font-size: .72rem; color: var(--ink-3); }
.m-month .warn b { color: var(--warn); }
.m-month .bad b { color: var(--bad); }
.m-quick { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: 1rem; }
.m-quick a { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .85rem .75rem; display: flex; align-items: center; gap: .6rem; color: inherit; font-weight: 600; }
.m-quick a span { font-size: 1.35rem; }
@media print { .m-tabs { display: none !important; } }
.m-alt { display: block; margin: 1.1rem auto 0; }
.m-pill .ltr, .m-sub .ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* review 17 Oct: management indicators */
.chart-card h2 { margin-bottom: .25rem; }
svg.chart { width: 100%; height: auto; display: block; margin: .5rem 0; direction: ltr; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart .axis { fill: var(--ink-3); font-size: 11px; }
svg.chart .line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.chart .dot { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
svg.chart .hit { fill: transparent; }
svg.chart .pt:hover .dot { r: 6; }
.hbar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: .6rem; padding: .35rem 0; }
.hbar-name { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track.bar { height: 12px; }
.hbar-track.bar > i { border-radius: 0 4px 4px 0; }
[dir="rtl"] .hbar-track.bar > i { border-radius: 4px 0 0 4px; margin-inline-start: 0; }
.hbar-val { font-size: .85rem; font-variant-numeric: tabular-nums; color: var(--ink-2); }
[data-accuracy].bad { color: var(--bad); font-weight: 600; }

/* review 18 Oct: setup checklist */
.setup-score { min-width: 180px; text-align: center; }
.setup-list { list-style: none; margin: 0; padding: 0; }
.setup-item { display: flex; gap: .75rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.setup-item:last-child { border-bottom: 0; }
.setup-body { flex: 1; }
.setup-dot { width: 1.8rem; height: 1.8rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.setup-item.ok .setup-dot { background: var(--good-soft); color: var(--good); }
.setup-item.warn .setup-dot { background: var(--warn-soft); color: var(--warn); }
.setup-item.fail .setup-dot { background: var(--bad-soft); color: var(--bad); }
