/* WorkPass shared UI — tokens, light/dark, components. No external fonts or CDNs (CSP: self only). */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f0f2f5; --text: #1b1f24; --muted: #5d6673; --border: #d9dee5;
  --primary: #1f4e79; --primary-ink: #ffffff; --primary-soft: #e3edf7; --accent: #2e75b6;
  --ok: #1e6b35; --ok-soft: #e1f3e6; --warn: #7a4a00; --warn-soft: #fdf0d8; --bad: #9b1c1c; --bad-soft: #fbe3e3; --info-soft: #e3edf7;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --font: system-ui, -apple-system, "Segoe UI", "Noto Sans", "Noto Sans Devanagari", "FreeSans", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216; --surface: #171b21; --surface-2: #1e232b; --text: #e7eaee; --muted: #9aa4b1; --border: #2c333d;
    --primary: #5b9bd5; --primary-ink: #0b1a29; --primary-soft: #1a2c3f; --accent: #7fb3e6;
    --ok: #6fcf8a; --ok-soft: #12301c; --warn: #f2c26b; --warn-soft: #362707; --bad: #f08a8a; --bad-soft: #3a1414; --info-soft: #1a2c3f;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1 { font-size: 1.45rem; margin: 0 0 4px; } h2 { font-size: 1.1rem; margin: 0 0 12px; } h3 { font-size: 1rem; margin: 0 0 8px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .mono { font-family: ui-monospace, Consolas, monospace; font-size: .85em; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .grow { flex: 1; } .stack > * + * { margin-top: 12px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.tile { display: block; text-decoration: none; color: inherit; } .tile .v { font-size: 1.9rem; font-weight: 700; } .tile:hover { border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 8px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); } .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); } .btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.big { min-height: 52px; font-size: 1.05rem; width: 100%; } .btn.link { border: 0; background: none; color: var(--accent); padding: 4px; min-height: 0; }
label.f { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
input, select, textarea { width: 100%; min-height: 42px; padding: 8px 10px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; }
input[type=checkbox], input[type=radio] { width: 20px; min-height: 20px; height: 20px; margin: 0; accent-color: var(--primary); }
.field { margin-bottom: 14px; } .field .err { color: var(--bad); font-size: .85rem; margin-top: 3px; } .hint { color: var(--muted); font-size: .85rem; margin-top: 3px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; background: var(--surface); }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.warn { background: var(--warn-soft); color: var(--warn); } .chip.bad { background: var(--bad-soft); color: var(--bad); } .chip.info { background: var(--info-soft); color: var(--primary); }
.banner { padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--info-soft); margin-bottom: 14px; }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); } .banner.bad { background: var(--bad-soft); } .banner.ok { background: var(--ok-soft); }
table.t { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.t th, table.t td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: .92rem; }
table.t th { background: var(--surface-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; height: 16px; margin: 8px 0; }
@keyframes sk { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
dialog { border: 1px solid var(--border); border-radius: 12px; padding: 0; background: var(--surface); color: var(--text); width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10, 14, 20, .5); } dialog .dh { padding: 16px 18px; border-bottom: 1px solid var(--border); font-weight: 700; } dialog .db { padding: 18px; max-height: 70vh; overflow: auto; } dialog .df { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); }
#toast .t { padding: 12px 14px; border-radius: 8px; background: var(--text); color: var(--bg); box-shadow: var(--shadow); font-weight: 500; }
#toast .t.bad { background: var(--bad); color: #fff; }
/* desktop shell (company + admin) */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
/* The menu stays in place while the page scrolls; a long menu scrolls on its own. */
.side { background: #1c2430; color: #cfd6df; padding: 16px 10px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #3a4757 transparent; }
.side .brand { font-weight: 800; color: #fff; font-size: 1.15rem; padding: 4px 10px 14px; } .side a { color: #cfd6df; text-decoration: none; padding: 8px 10px; border-radius: 6px; }
.side a.active, .side a:hover { background: #2a3646; color: #fff; } .side .foot { margin-top: auto; font-size: .8rem; padding: 10px; color: #9aa6b4; }
.side select { background: #2a3646; color: #fff; border-color: #3a4757; min-height: 34px; margin-top: 6px; }
main.page { padding: 24px 28px 60px; max-width: 1100px; width: 100%; }
.head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; } .side { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 8px; gap: 4px; height: auto; z-index: 5; } .side .brand, .side .foot { display: none; }
  .side a { white-space: nowrap; } main.page { padding: 16px; }
}
/* centred auth / mobile pages */
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; } .narrow { width: min(420px, 100%); }
.otp { letter-spacing: .4em; font-size: 1.5rem; text-align: center; font-variant-numeric: tabular-nums; }
/* shift calendar (C23) */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-day { padding: 10px; min-height: 140px; } .cal-day h3 { font-size: .9rem; } .cal-day h3.today { color: var(--accent); }
.cal-shift { display: block; text-decoration: none; color: inherit; border: 1px solid var(--border); border-left: 4px solid var(--ok); border-radius: 6px; padding: 6px 8px; margin-top: 6px; background: var(--surface-2); }
.cal-shift.cancelled { border-left-color: var(--bad); opacity: .7; } .cal-shift.filled { border-left-color: var(--accent); } .cal-shift:hover { border-color: var(--accent); }
@media (max-width: 900px) { .cal { grid-template-columns: 1fr; } .cal-day { min-height: 0; } }
/* worker app: job cards and bottom tab bar */
.jobcard { display: block; text-decoration: none; color: inherit; } .jobcard:hover { border-color: var(--accent); }
.jobcard .pay { font-size: 1.15rem; font-weight: 700; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; background: var(--surface); border-top: 1px solid var(--border); z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; max-width: 120px; min-width: 0; text-align: center; padding: 8px 2px 10px; color: var(--muted); text-decoration: none; font-size: .74rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabbar a .ic { display: block; font-size: 1.3rem; line-height: 1.4; } .tabbar a.active { color: var(--primary); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; } .chips .btn { min-height: 36px; padding: 6px 12px; white-space: nowrap; }
.timeline { list-style: none; padding: 0; margin: 0; } .timeline li { border-left: 3px solid var(--border); padding: 0 0 12px 12px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--primary); }
a.banner { display: block; text-decoration: none; color: inherit; } a.banner:hover { border-color: var(--accent); }
