.staff-attendance-bar {
  --attendance-ink:var(--native-ink,var(--ink,#243c36));
  --attendance-accent:var(--native-accent,#176b52);
  display:flex;align-items:center;gap:18px;min-height:44px;flex:0 0 auto;
  padding:4px 16px;border-bottom:1px solid var(--line,#e0e8e3);
  background:var(--theme-panel,var(--surface,#f5f8f6));color:var(--attendance-ink);font-size:12px;
}
.staff-attendance-state{display:flex;align-items:center;gap:7px;white-space:nowrap;font-weight:650}
.staff-attendance-state i{height:7px;width:7px;border-radius:50%;background:var(--attendance-accent)}
.staff-attendance-bar>button{margin-inline-start:auto;min-height:36px;padding:6px 12px;border-radius:9px;border:1px solid var(--line,#dbe6df);background:transparent;font-size:12px;white-space:nowrap}
.staff-attendance-bar>button:hover:not(:disabled){background:var(--accent-soft,#e8f2ed)}
.staff-attendance-gate {
  --attendance-ink:var(--native-ink,var(--ink,#243c36));
  --attendance-accent:var(--native-accent,#176b52);
  width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;
  margin:auto;padding:28px;border:1px solid var(--line,#dbe6df);border-radius:24px;
  background:var(--surface,#fff);color:var(--attendance-ink);box-shadow:0 24px 90px #0a201833;
  text-align:center;overscroll-behavior:contain;
}
.staff-attendance-gate::backdrop{background:rgb(9 25 22 / .66);backdrop-filter:blur(3px)}
.staff-attendance-brand{display:flex;justify-content:center;align-items:center;gap:9px;font-size:11px;font-weight:750;letter-spacing:2px;direction:ltr;color:var(--attendance-accent)}
.staff-attendance-brand img{width:27px;height:27px;object-fit:contain}
.staff-attendance-emblem{display:grid;place-items:center;width:64px;height:64px;margin:24px auto 18px;border:1px solid color-mix(in srgb,var(--attendance-accent) 20%,transparent);border-radius:20px;background:color-mix(in srgb,var(--attendance-accent) 8%,transparent);color:var(--attendance-accent);font-size:38px;line-height:1}
.staff-attendance-gate h2{margin:0 0 10px;font-size:23px;line-height:1.5;font-weight:700}
.staff-attendance-gate p{font-size:13px;line-height:1.9;color:var(--muted,#64796f)}
.staff-attendance-gate .staff-attendance-greeting{margin:0 0 8px;font-size:18px;line-height:1.65;font-weight:650;color:var(--attendance-accent);overflow-wrap:anywhere}
.staff-attendance-gate .staff-attendance-feedback{margin:14px 0 0;padding:10px;border-radius:10px;background:#ad425010;color:var(--native-danger,#a8444d);font-size:12px;overflow-wrap:anywhere}
.staff-attendance-gate :is(.staff-attendance-confirm,.staff-attendance-retry){width:100%;min-height:48px;padding:11px 18px;margin-top:22px;border:1px solid var(--attendance-accent);border-radius:12px;background:var(--attendance-accent);color:#fff;font-weight:650;font-size:14px}
.staff-attendance-logout{min-height:44px;margin-top:10px;padding:10px 20px;color:var(--muted,#64796f);font-size:12px}
.staff-attendance-gate button:focus-visible,.staff-attendance-bar button:focus-visible{outline:3px solid var(--attendance-accent);outline-offset:3px}
html[data-theme="dark"] .staff-attendance-gate{background:#12262d;border-color:#2c454b;color:#edf5f1;--attendance-ink:#edf5f1;--attendance-accent:#7bd7b8}
html[data-theme="dark"] .staff-attendance-gate p{color:#a6bcb4}
html[data-theme="dark"] .staff-attendance-gate .staff-attendance-greeting{color:var(--attendance-accent)}
html[data-theme="dark"] .staff-attendance-gate :is(.staff-attendance-confirm,.staff-attendance-retry){color:#112c23}
@media(max-width:620px){.staff-attendance-bar{gap:8px;padding:4px 10px;font-size:11px}.staff-attendance-bar>button{min-height:44px;padding:7px 9px;font-size:11px}.staff-attendance-gate{padding:22px}.staff-attendance-gate h2{font-size:21px}}
/* Desktop-only feature: native and mobile clients neither gate nor keep shifts alive. */
html.native-android :is(.staff-attendance-bar,.staff-attendance-gate){display:none!important}
.staff-attendance-idle-clock{display:grid;gap:7px;margin:20px 0 4px;padding:18px 12px;border:1px solid #d2a04055;border-radius:15px;background:#d2a0400c}
.staff-attendance-idle-clock[hidden]{display:none}
.staff-attendance-idle-clock>span{font-size:12px;color:var(--muted,#64796f)}
.staff-attendance-idle-clock>strong{font-size:38px;line-height:1.25;letter-spacing:2px;font-variant-numeric:tabular-nums;color:var(--attendance-ink);font-weight:700}
.staff-attendance-idle-clock>small{font-size:11px;color:var(--muted,#64796f)}
.staff-attendance-gate[data-phase="away"] .staff-attendance-emblem{color:#b78118;background:#d2a04012;border-color:#d2a04055}
html[data-theme="dark"] .staff-attendance-gate[data-phase="away"] .staff-attendance-emblem{color:#f4bd52}
html[data-theme="dark"] .staff-attendance-idle-clock :is(span,small){color:#a6bcb4}

/* Personal statistics stay scoped to their dialog in both app themes. */
#staff-attendance-self-dialog{--sas-bg:#0c151e;--sas-panel:#121e28;--sas-line:#293945;--sas-ink:#edf3f7;--sas-muted:#9daeba;--sas-mint:#39d5a1;width:min(1050px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 36px);margin:auto;padding:0;border:1px solid var(--sas-line);border-radius:18px;background:var(--sas-bg);color:var(--sas-ink);box-shadow:0 24px 100px #0007;overflow:auto;font-size:13px;overscroll-behavior:contain;color-scheme:dark}
#staff-attendance-self-dialog::backdrop{background:#050d16b8;backdrop-filter:blur(4px)}
#staff-attendance-self-dialog [hidden]{display:none!important}
#staff-attendance-self-dialog :is(h2,h3,p){margin:0;color:inherit}
#staff-attendance-self-dialog svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
#staff-attendance-self-dialog button{font:inherit;min-height:34px;border:1px solid var(--sas-line);border-radius:7px;background:#15222c;color:var(--sas-ink);padding:6px 12px;cursor:pointer;box-shadow:none}
#staff-attendance-self-dialog button:disabled{opacity:.45;cursor:default}
#staff-attendance-self-dialog button:hover:not(:disabled){border-color:#497164;background:#1a302f}
#staff-attendance-self-dialog :is(button,input,summary):focus-visible{outline:2px solid var(--sas-mint);outline-offset:3px}
#staff-attendance-self-dialog .sas-header{position:sticky;top:0;z-index:2;display:flex;align-items:center;gap:20px;padding:20px 24px;background:var(--sas-bg);border-bottom:1px solid var(--sas-line)}
#staff-attendance-self-dialog .sas-header>div:first-child{flex:1}
#staff-attendance-self-dialog .sas-header small{color:var(--sas-mint);font-size:10px;letter-spacing:.2px}
#staff-attendance-self-dialog h2{font-size:24px;line-height:1.55;font-weight:750}
#staff-attendance-self-dialog .sas-header p{margin-top:3px;font-size:13px;color:var(--sas-muted)}
#staff-attendance-self-dialog [data-sas-close]{width:36px;height:36px;min-height:36px;padding:0;flex:none;font-size:23px;line-height:1;background:transparent}
#staff-attendance-self-dialog .sas-status{display:inline-flex;align-items:center;gap:7px;border:1px solid #75899b55;border-radius:999px;padding:5px 10px;font-size:11px;color:#b9c7d2;white-space:nowrap;background:#778b9d0c}
#staff-attendance-self-dialog .sas-status i{width:7px;height:7px;border-radius:50%;background:currentColor}
#staff-attendance-self-dialog .sas-state-active{color:#4ce0af;border-color:#39d5a155;background:#39d5a10d}
#staff-attendance-self-dialog .sas-state-away{color:#f4bd52;border-color:#f4bd5255;background:#f4bd520c}
#staff-attendance-self-dialog .sas-body{padding:20px 24px 24px}
#staff-attendance-self-dialog .sas-toolbar{display:flex;align-items:center;gap:10px;padding:8px;background:var(--sas-panel);border:1px solid var(--sas-line);border-radius:10px}
#staff-attendance-self-dialog .sas-presets{display:flex;gap:0;flex:none}
#staff-attendance-self-dialog .sas-presets button{border-radius:0;min-width:73px;padding-inline:10px;background:#111c25}
#staff-attendance-self-dialog .sas-presets button:first-child{border-radius:0 6px 6px 0}
#staff-attendance-self-dialog .sas-presets button:last-child{border-radius:6px 0 0 6px}
#staff-attendance-self-dialog .sas-presets button+button{margin-inline-start:-1px}
#staff-attendance-self-dialog .sas-presets button[aria-pressed="true"]{color:var(--sas-mint);background:#39d5a114;border-color:#39d5a177;position:relative}
#staff-attendance-self-dialog .sas-filters{display:flex;align-items:center;gap:8px;flex:1;margin:0;min-width:0}
#staff-attendance-self-dialog .sas-filters label{position:relative;display:block;flex:1;min-width:0;margin:0}
#staff-attendance-self-dialog .sas-filters label>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#staff-attendance-self-dialog .sas-filters input{width:100%;min-width:0;min-height:34px;max-height:34px;padding:5px 10px;border:1px solid var(--sas-line);border-radius:6px;background:#0e1922;color:var(--sas-ink);font:inherit;direction:ltr;box-shadow:none;color-scheme:dark}
#staff-attendance-self-dialog [data-sas-report]{background:var(--sas-mint);border-color:var(--sas-mint);color:#073f2d;min-width:76px;font-weight:750}
#staff-attendance-self-dialog .sas-range{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:9px 2px 16px;color:var(--sas-muted);font-size:11px}
#staff-attendance-self-dialog [data-sas-range]{font-variant-numeric:tabular-nums}
#staff-attendance-self-dialog [data-sas-custom]{padding:3px 0;min-height:26px;background:none;border:0;color:var(--sas-muted);font-size:11px}
#staff-attendance-self-dialog [data-sas-message]{padding:11px 12px;margin-bottom:12px;border-radius:8px;background:#ef586414;color:#ff9aa2;line-height:1.7}
#staff-attendance-self-dialog .sas-summary{display:flex;flex-wrap:wrap;gap:12px 22px;margin-bottom:12px;color:var(--sas-muted);font-size:11px}
#staff-attendance-self-dialog .sas-summary b{color:#d9e6ed;margin-inline-start:5px;font-variant-numeric:tabular-nums}
#staff-attendance-self-dialog :is(.sas-metrics,.sas-performance){display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
#staff-attendance-self-dialog .sas-performance{grid-template-columns:repeat(3,minmax(0,1fr));margin-top:12px}
#staff-attendance-self-dialog .sas-metric{--sas-tone:var(--sas-mint);position:relative;min-width:0;padding:16px;border:1px solid var(--sas-line);border-top:3px solid var(--sas-tone);border-radius:9px;background:var(--sas-panel)}
#staff-attendance-self-dialog .sas-metric.sas-amber{--sas-tone:#f4bd52}
#staff-attendance-self-dialog .sas-metric.sas-red{--sas-tone:#ef6670}
#staff-attendance-self-dialog .sas-metric.sas-blue{--sas-tone:#78aef4}
#staff-attendance-self-dialog .sas-metric>div{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#cbd7e0;font-size:12px}
#staff-attendance-self-dialog .sas-metric svg{color:var(--sas-tone)}
#staff-attendance-self-dialog .sas-metric>strong{display:block;margin:9px 0 5px;font-size:27px;font-weight:750;line-height:1.25;font-variant-numeric:tabular-nums;direction:ltr;text-align:right;unicode-bidi:isolate;color:var(--sas-ink)}
#staff-attendance-self-dialog .sas-metric>small{display:block;color:var(--sas-muted);font-size:10px;line-height:1.6}
#staff-attendance-self-dialog .sas-note{margin:12px 2px 18px;font-size:11px;line-height:1.8;color:var(--sas-muted)}
#staff-attendance-self-dialog .sas-history{overflow:hidden;border:1px solid var(--sas-line);border-radius:10px;background:var(--sas-panel)}
#staff-attendance-self-dialog .sas-history>header{display:flex;justify-content:space-between;align-items:center;padding:15px 17px;border-bottom:1px solid var(--sas-line)}
#staff-attendance-self-dialog h3{font-size:16px;font-weight:700}
#staff-attendance-self-dialog .sas-history>header>span{padding:4px 9px;border-radius:999px;background:#22333f;color:#bdccd7;font-size:10px}
#staff-attendance-self-dialog .sas-table-scroll{overflow:auto}
#staff-attendance-self-dialog table{width:100%;min-width:620px;border:0;border-collapse:collapse;background:var(--sas-panel);color:var(--sas-ink);font-size:12px}
#staff-attendance-self-dialog :is(th,td){border:0;border-bottom:1px solid #293945aa;padding:12px 15px;text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums;background:transparent;color:var(--sas-ink);position:static}
#staff-attendance-self-dialog thead th{background:#14212b;color:var(--sas-muted);font-size:11px;font-weight:500}
#staff-attendance-self-dialog tbody th{font-weight:600}
#staff-attendance-self-dialog tbody tr:nth-child(even){background:#10202a}
#staff-attendance-self-dialog .sas-work{color:var(--sas-mint);font-weight:650}
#staff-attendance-self-dialog .sas-history>footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;color:var(--sas-muted);font-size:11px}
#staff-attendance-self-dialog .sas-history>footer button{font-size:11px;min-height:30px}
#staff-attendance-self-dialog .sas-daily{margin-top:14px;border:1px solid var(--sas-line);border-radius:9px;background:var(--sas-panel);overflow:hidden}
#staff-attendance-self-dialog .sas-daily summary{padding:13px 16px;cursor:pointer;font-size:12px;color:#d1dfe7}
#staff-attendance-self-dialog .sas-empty{text-align:center;padding:30px 16px;color:var(--sas-muted);line-height:1.8}
@media(max-width:780px){#staff-attendance-self-dialog .sas-toolbar{flex-wrap:wrap}#staff-attendance-self-dialog .sas-presets{flex:1}#staff-attendance-self-dialog .sas-presets button{flex:1}#staff-attendance-self-dialog .sas-filters{order:2;flex-basis:100%}#staff-attendance-self-dialog .sas-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}#staff-attendance-self-dialog .sas-performance{grid-template-columns:1fr}#staff-attendance-self-dialog .sas-performance .sas-metric{display:grid;grid-template-columns:1fr auto;gap:0 12px}#staff-attendance-self-dialog .sas-performance .sas-metric>strong{grid-column:2;grid-row:1 / 3;align-self:center;margin:0;font-size:24px}#staff-attendance-self-dialog .sas-performance .sas-metric>small{grid-column:1}}
@media(max-width:480px){#staff-attendance-self-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);border-radius:13px}#staff-attendance-self-dialog .sas-header{padding:15px;gap:10px}#staff-attendance-self-dialog .sas-body{padding:14px}#staff-attendance-self-dialog h2{font-size:21px}#staff-attendance-self-dialog .sas-status{padding:4px 7px;font-size:10px}#staff-attendance-self-dialog .sas-metric{padding:13px}#staff-attendance-self-dialog .sas-metric>strong{font-size:26px}#staff-attendance-self-dialog .sas-summary{gap:7px 15px;font-size:10px}#staff-attendance-self-dialog .sas-metric>div{font-size:11px}#staff-attendance-self-dialog .sas-metric svg{width:16px;height:16px}}
