/* ATAD Staff -- the landing page every staff login arrives at. */
:root {
  --navy: #2E3192; --navy-ink: #2E3192; --navy-press: #23267A;
  --gold: #BD9A2C; --cyan: #54C5D0;
  --bg: #F4F5FA; --surface: #FFFFFF; --raised: #EEF2F8;
  --ink: #16183A; --muted: #5A5E7A; --faint: #9A9DB5;
  --line: #E3E5EF; --line-soft: #ECEEF5; --field: #CDD0E3;
  --bad: #B3261E; --warn: #C26A00; --warn-ink: #8A4B00; --ok: #1E6B3A;
  --soft-gold: #FBF7EC; --soft-gold-ink: #6B5518;
  --hero-ink: #DADCF7;
  --shadow: 0 2px 10px rgba(22,24,58,.06);
  --radius: 20px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --navy: #3A3DA8; --navy-ink: #9094F2; --navy-press: #2E3192;
    --bg: #0F1424; --surface: #19203A; --raised: #2B3855;
    --ink: #EEF0FA; --muted: #A9AECB; --faint: #6F7596;
    --line: #2A3252; --line-soft: #232A47; --field: #3A4366;
    --bad: #FF8A80; --warn: #FFB25C; --warn-ink: #FFC98F; --ok: #7BD89A;
    --soft-gold: #2A2412; --soft-gold-ink: #E6CC7A;
    --hero-ink: #C9CBF2;
    --shadow: 0 2px 12px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body { min-height: 100vh; min-height: 100dvh; }
a { color: var(--navy-ink); }
button, input, select { font: inherit; color: inherit; }
img { display: block; }
.light-only { display: block; } .dark-only { display: none; }
@media (prefers-color-scheme: dark) { .light-only { display: none; } .dark-only { display: block; } }

/* ---------------------------------------------------------------- splash */
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 50; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line);
  border-top-color: var(--navy-ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- layout */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px calc(32px + env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.topbar-in { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
.topbar .mark { width: 34px; height: 34px; }
.brand { font-weight: 800; font-size: 17px; letter-spacing: .04em; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { font-weight: 500; letter-spacing: 0; color: var(--muted); font-size: 14px; margin-left: 6px; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.icon-btn svg { width: 20px; height: 20px; }
.back { border: 0; background: transparent; }
.who { display: none; font-size: 14px; font-weight: 600; color: var(--muted); }
@media (min-width: 760px) { .who { display: block; } }

/* ---------------------------------------------------------------- sign in */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.auth-hero { background: #2E3192; padding: calc(56px + env(safe-area-inset-top)) 24px 56px;
  border-radius: 0 0 28px 28px; color: #fff; }
.auth-hero-in { max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.auth-logo { background: #fff; border-radius: 16px; padding: 12px 14px; align-self: flex-start; }
.auth-logo img { height: 34px; width: auto; }
.auth h1 { margin: 0; font-size: 30px; line-height: 36px; font-weight: 800; }
.auth-hero p { margin: 0; color: #DADCF7; font-size: 15px; line-height: 22px; }
.auth-card { width: calc(100% - 32px); max-width: 440px; margin: -28px auto 0; background: var(--surface);
  border-radius: var(--radius); padding: 24px 20px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 8px 28px rgba(22,24,58,.10); }
.auth-foot { width: calc(100% - 32px); max-width: 440px; margin: 20px auto 40px; }
.first-time { padding: 16px 18px; border-radius: 16px; border: 1.5px dashed var(--gold);
  background: var(--soft-gold); display: flex; flex-direction: column; gap: 4px; }
.first-time span { font-size: 13px; font-weight: 600; color: var(--soft-gold-ink); }
.first-time button { all: unset; cursor: pointer; font-size: 15px; font-weight: 700; color: var(--navy-ink); padding: 4px 0; }
.first-time button:focus-visible { outline: 2px solid var(--navy-ink); outline-offset: 2px; border-radius: 4px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: 14px; font-weight: 600; }
.field input, .field select, input.input, select.input {
  height: 52px; border: 1.5px solid var(--field); border-radius: 12px; padding: 0 14px;
  font-size: 16px; background: var(--surface); color: var(--ink); width: 100%; min-width: 0; }
.field input:focus, .field select:focus, .input:focus { outline: none; border-color: var(--navy-ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy-ink) 22%, transparent); }
.hint { font-size: 13px; color: var(--muted); line-height: 19px; margin: 0; }

.btn { height: 52px; border-radius: 14px; border: 0; padding: 0 18px; font-weight: 700; font-size: 16px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:active { background: var(--navy-press); }
.btn.ghost { background: transparent; color: var(--navy-ink); height: 44px; }
.btn.line { background: var(--surface); color: var(--ink); border: 1px solid var(--field); }
.btn.small { height: 40px; font-size: 14px; border-radius: 10px; padding: 0 14px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, .icon-btn:focus-visible, .tile:focus-visible, .need:focus-visible {
  outline: 3px solid var(--navy-ink); outline-offset: 2px; }

/* ---------------------------------------------------------------- home */
.greet { padding: 12px 4px 20px; display: flex; flex-direction: column; gap: 4px; }
.greet .hello { font-size: 14px; color: var(--muted); font-weight: 500; }
.greet h1 { margin: 0; font-size: 28px; line-height: 34px; font-weight: 800; }
.greet .sub { font-size: 13px; color: var(--muted); }
.section-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted);
  margin: 4px 4px 10px; text-transform: uppercase; }
.home { display: grid; gap: 20px; }
@media (min-width: 900px) { .home { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }

.needs { display: flex; flex-direction: column; gap: 10px; }
.need { text-decoration: none; color: var(--ink); background: var(--surface); border-radius: 14px;
  padding: 14px; display: flex; align-items: center; gap: 12px; min-height: 64px; box-shadow: var(--shadow); }
.need .dot { width: 10px; height: 10px; border-radius: 5px; flex-shrink: 0; }
.need .txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.need b { font-size: 15px; }
.need small { font-size: 12px; color: var(--muted); }
.need svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.all-clear { background: var(--surface); border-radius: 14px; padding: 16px; font-size: 14px; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile { position: relative; text-decoration: none; color: var(--ink); background: var(--surface);
  border-radius: var(--radius); padding: 18px 16px; min-height: 176px; display: flex; flex-direction: column;
  gap: 12px; box-shadow: var(--shadow); border: 0; text-align: left; cursor: pointer; }
.tile .ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; }
.tile .ico svg { width: 26px; height: 26px; color: #fff; }
.tile .name { font-size: 18px; font-weight: 700; }
.tile .blurb { font-size: 13px; color: var(--muted); line-height: 18px; }
.tile .status { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: auto; }
.tile .status.hot { color: var(--bad); }
.tile .badge { position: absolute; top: 14px; right: 14px; background: var(--bad); color: #fff;
  font-size: 12px; font-weight: 700; border-radius: 12px; padding: 3px 9px; }
@media (prefers-color-scheme: dark) { .tile .badge { color: #2A0B08; } }
.tile.soon { background: transparent; border: 1.5px dashed var(--field); box-shadow: none; cursor: default; color: var(--muted); }
.tile.soon .ico { background: var(--raised) !important; }
.tile.soon .ico svg { color: var(--muted); }

.side { display: flex; flex-direction: column; gap: 16px; }
.admin-card { text-decoration: none; background: #2E3192; color: #fff; border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.admin-card b { font-size: 17px; } .admin-card span { font-size: 14px; color: #DADCF7; line-height: 20px; }
.admin-card em { font-style: normal; font-weight: 700; font-size: 14px; margin-top: 4px; color: #fff; }
.tip { background: var(--surface); border-radius: 16px; padding: 14px 16px; display: flex; gap: 12px;
  align-items: center; font-size: 13px; color: var(--muted); line-height: 18px; }
.tip svg { width: 22px; height: 22px; color: var(--navy-ink); flex-shrink: 0; }

/* The one-app screen: a labourer lands straight on his payslips. */
.pay-hero { background: #2E3192; color: #fff; border-radius: 22px; padding: 22px 20px; display: flex;
  flex-direction: column; gap: 16px; }
.pay-hero .k { font-size: 13px; font-weight: 700; letter-spacing: .08em; color: #DADCF7; }
.pay-hero .v { font-size: 28px; font-weight: 800; }
.pay-hero .btn { background: #fff; color: #2E3192; }
.notice { background: var(--surface); border-radius: 16px; padding: 16px; font-size: 14px; color: var(--muted); line-height: 20px; }

/* ---------------------------------------------------------------- access */
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 8px 4px 16px; }
.page-head .t { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 800; }
.page-head p { margin: 0; font-size: 14px; color: var(--muted); line-height: 20px; }
.page-head .input { height: 44px; font-size: 15px; flex: 1 1 220px; max-width: 320px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; font-size: 13px; }
.chip b { font-weight: 700; }

.people { background: var(--surface); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.p-row { display: grid; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); align-items: center;
  grid-template-columns: minmax(0, 1fr); }
.p-row:last-child { border-bottom: 0; }
.p-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.p-name b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-name small { font-size: 12px; color: var(--muted); }
.p-group select { height: 40px; border-radius: 10px; border: 1.5px solid var(--field); background: var(--surface);
  padding: 0 10px; font-size: 14px; font-weight: 600; width: 100%; }
.p-apps { display: flex; flex-wrap: wrap; gap: 6px; }
.p-app { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); cursor: pointer; user-select: none; min-height: 36px; }
.p-app input { width: 18px; height: 18px; margin: 0; accent-color: var(--navy); }
.p-app.on { border-color: var(--navy-ink); background: color-mix(in srgb, var(--navy-ink) 10%, transparent); font-weight: 600; }
.p-app.locked { opacity: .7; cursor: default; }
.p-state { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.p-state .s { font-size: 13px; font-weight: 600; }
.s.ok { color: var(--ok); } .s.warn { color: var(--warn-ink); } .s.none { color: var(--muted); font-weight: 500; }
.p-head { display: none; }
@media (min-width: 980px) {
  .p-row { grid-template-columns: 1.6fr 1fr 2.6fr 1.3fr; gap: 16px; padding: 14px 22px; }
  .p-head { display: grid; background: var(--raised); font-size: 12px; font-weight: 700; letter-spacing: .06em;
    color: var(--muted); text-transform: uppercase; }
  .p-state { justify-content: flex-start; }
}
.empty { padding: 28px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------- sheet */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10,12,30,.5); }
.sheet-panel { position: relative; background: var(--surface); width: 100%; max-width: 520px; max-height: 92vh;
  border-radius: 22px 22px 0 0; display: flex; flex-direction: column; }
@media (min-width: 640px) { .sheet { align-items: center; } .sheet-panel { border-radius: 22px; } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 8px 20px; }
.sheet-head h2 { margin: 0; font-size: 19px; flex: 1; }
.sheet-body { overflow: auto; padding: 8px 20px 16px; display: flex; flex-direction: column; gap: 16px; }
.sheet-foot { padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-soft);
  display: flex; gap: 10px; }
.sheet-foot .btn { flex: 1; }

.picker { position: relative; }
.pick-list { background: var(--raised); border-radius: 12px; margin-top: 6px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.pick-list button { all: unset; box-sizing: border-box; width: 100%; padding: 12px 14px; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--line); }
.pick-list button:last-child { border-bottom: 0; }
.pick-list button:focus-visible, .pick-list button:hover { background: color-mix(in srgb, var(--navy-ink) 12%, transparent); }
.pick-list small { font-size: 12px; color: var(--muted); }
.picked { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--raised); }
.picked div { flex: 1; min-width: 0; display: flex; flex-direction: column; } .picked small { color: var(--muted); font-size: 12px; }

.code-box { font-size: 30px; font-weight: 800; letter-spacing: 3px; text-align: center; padding: 18px;
  border-radius: 14px; background: var(--raised); color: var(--ink); user-select: all; }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: #16183A; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; max-width: 480px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); pointer-events: auto; }
.toast.bad { background: #8C1D18; } .toast.ok { background: #1E5B34; }
