/* ATAD Documents -- base shared with the Staff Portal and Vendor Portal; document screens at the end. */
: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; }

/* ================================================================ vendor portal */
.muted { color: var(--muted); font-size: 14px; line-height: 20px; }
.strong { font-weight: 700; }
.bad-t { color: var(--bad); font-size: 13px; font-weight: 600; }
textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--field);
  border-radius: 12px; padding: 12px 14px; font-size: 16px; resize: vertical; width: 100%; }
textarea:focus { outline: none; border-color: var(--navy-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy-ink) 22%, transparent); }

/* nav under the top bar: tabs on a desk, a scrolling strip on a phone */
.navbar { background: var(--bg); border-bottom: 1px solid var(--line); }
.navbar-in { max-width: 1120px; margin: 0 auto; padding: 0 12px; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; white-space: nowrap;
  text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 3px solid transparent; }
.nav-a svg { width: 18px; height: 18px; }
.nav-a.on { color: var(--navy-ink); border-bottom-color: var(--navy-ink); }
.nav-a:focus-visible { outline: 3px solid var(--navy-ink); outline-offset: -3px; border-radius: 6px; }
.wrap { padding-top: 12px; }
.page-head .hello { font-size: 14px; color: var(--muted); font-weight: 500; }

.cards3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-bottom: 18px; }
@media (min-width: 820px) { .cards3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { background: var(--surface); border-radius: 18px; padding: 18px 20px; display: flex; flex-direction: column;
  gap: 6px; box-shadow: var(--shadow); }
.card .k, .invite .k { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.card b { font-size: 17px; }
.card.soon { background: var(--soft-gold); box-shadow: none; border: 1.5px dashed var(--gold); }
.card.soon .k { color: var(--soft-gold-ink); }
.card .more { font-weight: 700; font-size: 14px; text-decoration: none; margin-top: 2px; }

.panel { background: var(--surface); border-radius: 18px; padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.panel h2 { margin: 0 0 12px; font-size: 18px; font-weight: 800; }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; flex: 1; }
.panel.list { padding: 6px 0; }

/* tables that become cards on a phone */
.tbl { display: flex; flex-direction: column; }
.tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 4px;
  border-bottom: 1px solid var(--line-soft); font-size: 14px; align-items: center; }
.tr:last-child { border-bottom: 0; }
.tr.th { display: none; }
.tr .num { text-align: right; font-variant-numeric: tabular-nums; }
@media (min-width: 760px) {
  .tr { grid-template-columns: 1.2fr 1fr 1.4fr 1fr 130px; }
  .tr.th { display: grid; background: var(--raised); border-radius: 10px; font-size: 12px; font-weight: 700;
    letter-spacing: .06em; color: var(--muted); text-transform: uppercase; border: 0; padding: 10px 8px; }
  .tr > span { padding: 0 4px; }
}
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pill.blue { background: color-mix(in srgb, var(--navy-ink) 14%, transparent); color: var(--navy-ink); }
.pill.grey { background: var(--raised); color: var(--muted); }

.chips { gap: 8px; }
.chip-b { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 0 14px; min-height: 40px;
  font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink); }
.chip-b.on { border-color: var(--navy-ink); background: color-mix(in srgb, var(--navy-ink) 12%, transparent); color: var(--navy-ink); }
.chip-b:focus-visible { outline: 3px solid var(--navy-ink); outline-offset: 2px; }

.row-link { display: flex; align-items: center; gap: 12px; padding: 14px 20px; min-height: 64px; text-decoration: none;
  color: var(--ink); border-bottom: 1px solid var(--line-soft); }
.row-link:last-child { border-bottom: 0; }
.row-link:hover { background: color-mix(in srgb, var(--navy-ink) 5%, transparent); }
.row-link:focus-visible { outline: 3px solid var(--navy-ink); outline-offset: -3px; }
.rl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rl-main b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-main small { font-size: 12px; color: var(--muted); }
.row-link svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.row-link .s { font-size: 13px; font-weight: 600; white-space: nowrap; }

.two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 18px; }
@media (min-width: 900px) { .two { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .span2 { grid-column: span 2; } }
.form-grid h2 { margin: 0; }
.field.ro .ro-v { min-height: 52px; display: flex; align-items: center; padding: 0 14px; border-radius: 12px;
  background: var(--raised); font-size: 16px; font-weight: 600; }
.field input:disabled { background: var(--raised); }

.people-l { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.pl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.pl-row .s { font-size: 13px; font-weight: 600; }
.pl-act { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.invite { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 14px; background: var(--raised); }
.invite .field input { background: var(--surface); }

.banner { border-radius: 14px; padding: 14px 16px; font-size: 14px; font-weight: 600; margin-bottom: 16px; line-height: 20px; }
.banner.ok { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ok); }
.banner.bad { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); color: var(--bad); }
.kv { display: flex; flex-direction: column; }
.kv-r { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.kv-r:last-child { border-bottom: 0; }
.kv-r span { color: var(--muted); }
.kv-r b { text-align: right; }

.help { display: flex; flex-direction: column; gap: 4px; }
.help-row { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.help-row:last-child { border-bottom: 0; }
.help-row svg { width: 22px; height: 22px; color: var(--navy-ink); flex-shrink: 0; margin-top: 2px; }
.help-row div { display: flex; flex-direction: column; gap: 4px; font-size: 15px; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.msg { margin: 0; white-space: pre-wrap; font-family: inherit; font-size: 13px; line-height: 19px; color: var(--muted);
  background: var(--raised); border-radius: 12px; padding: 12px 14px; max-height: 180px; overflow: auto; }
.sheet-foot { flex-wrap: wrap; }

/* ================================================================ documents */
:root { --teal: #1F6F78; --info-bg: color-mix(in srgb, var(--navy-ink) 9%, var(--surface)); }
.btn.danger { background: var(--bad); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.danger { color: #2A0B08; } }
.danger-t { color: var(--bad) !important; }
.btn svg { width: 17px; height: 17px; }
.btn.small svg { width: 15px; height: 15px; }
.sub-h { font-size: 15px; font-weight: 800; margin: 22px 4px 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.banner.warn { background: color-mix(in srgb, var(--warn) 13%, var(--surface)); color: var(--warn-ink); }
.banner.info { background: var(--info-bg); color: var(--ink); font-weight: 500; }
.banner { margin-bottom: 0; }
.stack > .banner, .u-right .banner { margin: 0; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; display: inline-block; vertical-align: -3px; }

/* status colours: one set, used by pills, dots and card edges */
.st-valid    { --st: var(--ok); }
.st-expiring { --st: var(--warn); }
.st-expired  { --st: var(--bad); }
.st-missing, .st-nodate { --st: var(--faint); }
.pill[class*="st-"] { background: color-mix(in srgb, var(--st) 15%, transparent); color: var(--st); }
.pill.st-expiring { color: var(--warn-ink); }
.pill.st-missing, .pill.st-nodate { color: var(--muted); background: var(--raised); }

/* people list */
.chip-b .cnt { font-weight: 800; }
.chip-t { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted);
  min-height: 40px; padding: 0 6px; cursor: pointer; }
.chip-t input { width: 18px; height: 18px; accent-color: var(--navy); margin: 0; }
.person-row { flex-wrap: wrap; }
.person-row .rl-main { flex: 1 1 220px; }
.person-row.leaver { opacity: .65; }
.dots { display: flex; flex-wrap: wrap; gap: 6px; }
.dot-l { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  background: color-mix(in srgb, var(--st) 14%, transparent); color: var(--st); }
.dot-l.st-expiring { color: var(--warn-ink); }
.dot-l.st-missing, .dot-l.st-nodate { background: transparent; color: var(--muted); border: 1px dashed var(--field); padding: 2px 8px; }
@media (max-width: 640px) { .person-row .dots { order: 3; flex-basis: 100%; } }

/* document cards */
.doc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 720px) { .doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .doc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.doc-card { background: var(--surface); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px; border-top: 4px solid var(--st, var(--line)); min-width: 0; }
.doc-card.missing { background: transparent; box-shadow: none; border: 1.5px dashed var(--field); }
.dc-head { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.dc-head b { font-size: 16px; line-height: 21px; }
.dc-body { display: flex; flex-direction: column; gap: 2px; }
.dc-kv { display: flex; justify-content: space-between; gap: 14px; font-size: 14px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.dc-kv span { color: var(--muted); } .dc-kv b { text-align: right; overflow-wrap: anywhere; font-weight: 700; }
.dc-note { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.dc-renew { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--warn-ink); display: flex; gap: 6px; align-items: flex-start; }
.dc-renew svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.dc-by { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.dc-act { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-more { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.dc-old { display: flex; flex-direction: column; gap: 4px; }
.dc-old .k { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.old-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.panel.list .old-row { padding: 12px 20px; }
.old-row:last-child { border-bottom: 0; }

/* upload / review: the document on the left, the form on the right */
.sheet.wide .sheet-panel { max-width: 1080px; }
@media (min-width: 640px) { .sheet.wide .sheet-panel { height: 92vh; } }
.u-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 900px) { .u-wrap { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
  .u-left { position: sticky; top: 0; } }
.u-preview { background: var(--raised); border-radius: 14px; min-height: 220px; display: flex; flex-direction: column; gap: 8px;
  padding: 8px; overflow: hidden; }
.u-preview img { max-width: 100%; max-height: 70vh; object-fit: contain; margin: 0 auto; border-radius: 8px; }
.u-preview iframe { width: 100%; height: 70vh; border: 0; border-radius: 8px; background: #fff; }
.u-preview .empty { margin: auto; }
.slots { display: flex; flex-direction: column; gap: 8px; }
.slot-wrap { position: relative; }
/* The input stays rendered (1px) and the label opens it: several phone browsers
   refuse to open a picker for a display:none input. */
.file-in { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; left: 0; top: 0; }
.slot { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; border-radius: 14px;
  border: 1.5px dashed var(--field); cursor: pointer; }
.slot svg { width: 22px; height: 22px; color: var(--navy-ink); flex-shrink: 0; }
.slot-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.slot-state { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot.done { border-style: solid; border-color: var(--ok); }
.slot.done .slot-state { color: var(--ok); font-weight: 600; }
.slot.busy { opacity: .7; }
.file-in:focus-visible + .slot { outline: 3px solid var(--navy-ink); outline-offset: 2px; }
.banner.ai { display: flex; flex-direction: column; gap: 4px; background: var(--info-bg); color: var(--ink); font-weight: 500; }
.banner.ai b { color: var(--navy-ink); }
.banner.ai.conf-low b, .banner.ai.conf-medium b { color: var(--warn-ink); }
.ai-note { font-style: italic; } .ai-extra { font-size: 13px; color: var(--muted); }
.field input.ai-filled { border-color: var(--navy-ink); background: color-mix(in srgb, var(--navy-ink) 8%, var(--surface)); }
.u-right .form-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 520px) { .u-right .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field select { appearance: auto; }

/* viewer */
.viewer { position: fixed; inset: 0; z-index: 55; display: flex; align-items: center; justify-content: center; }
.viewer-backdrop { position: absolute; inset: 0; background: rgba(10,12,30,.72); }
.viewer-panel { position: relative; background: var(--surface); width: min(1100px, 100%); height: min(94vh, 100%);
  border-radius: 18px; display: flex; flex-direction: column; overflow: hidden; }
@media (max-width: 640px) { .viewer-panel { border-radius: 0; height: 100%; } }
.viewer-panel .sheet-head h2 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.viewer-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 0 16px 12px; }
.v-tabs { display: flex; gap: 8px; }
.v-stage { flex: 1; min-height: 0; background: var(--raised); border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: auto; }
.v-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.v-stage iframe { width: 100%; height: 100%; border: 0; background: #fff; }

/* settings + activity */
.ty-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 12px 20px;
  border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.ty-row:last-child { border-bottom: 0; }
.ty-row .input { height: 42px; max-width: 120px; font-size: 15px; }
.ty-row.th { display: none; }
@media (min-width: 760px) {
  .ty-row { grid-template-columns: 1.6fr .7fr 1fr .5fr 90px; }
  .ty-row.th { display: grid; background: var(--raised); font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
}
.tog input { width: 20px; height: 20px; accent-color: var(--navy); }
.log-row { display: flex; gap: 14px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); }
.log-row:last-child { border-bottom: 0; }
.log-at { font-size: 13px; color: var(--muted); width: 110px; flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* ================================================================ gate pass */
.steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 16px; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 6px; }
.steps li b { width: 24px; height: 24px; border-radius: 12px; display: grid; place-items: center; background: var(--raised); font-size: 12px; }
.steps li.on { color: var(--navy-ink); border-color: var(--navy-ink); }
.steps li.on b { background: var(--navy); color: #fff; }
.steps li.done b { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.row-end { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.banner.last { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.match-list, .check-list { display: flex; flex-direction: column; }
.match-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px 12px; align-items: center; padding: 12px 0;
  border-bottom: 1px solid var(--line-soft); }
.match-row .m-line { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.match-row .m-line small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.match-row .m-pick { grid-column: 1 / 2; }
.match-row .m-pick select { height: 44px; font-size: 14px; }
.match-row .m-st { grid-column: 1 / 2; font-size: 13px; font-weight: 700; }
.match-row .icon-btn { grid-row: 1; grid-column: 2; }
.match-row.bad { box-shadow: inset 3px 0 0 var(--bad); padding-left: 12px; }
.match-row.warn { box-shadow: inset 3px 0 0 var(--warn); padding-left: 12px; }
@media (min-width: 900px) {
  .match-row { grid-template-columns: 1fr 1.6fr 150px 44px; }
  .match-row .m-pick, .match-row .m-st { grid-column: auto; }
  .match-row .icon-btn { grid-row: auto; grid-column: auto; }
}
.s.bad-t { color: var(--bad); }
.check-row { padding: 12px 0; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 8px; }
.check-row .c-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.check-row .c-head .rl-main { flex: 1 1 220px; }
.check-row .c-probs { margin: 0; padding-left: 20px; font-size: 14px; color: var(--bad); }
.check-row .c-probs .k-short { color: var(--warn-ink); }
.check-row.bad { box-shadow: inset 3px 0 0 var(--bad); padding-left: 12px; }
.check-row .input { height: 44px; font-size: 14px; }

.pass-pages { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 900px) { .pass-pages { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .pass-pages { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pass-page { background: #fff; color: #111; border-radius: 6px; box-shadow: 0 2px 14px rgba(0,0,0,.18); aspect-ratio: 210 / 297;
  padding: 4.7%; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.pp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; border-bottom: 1px dashed #ccd; padding-bottom: 6px; }
.pp-head small { color: #666; }
.pp-grid { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 10px; align-items: start; }
.pp-slot { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pp-slot img { width: 100%; height: auto; border: 1px solid #eee; }
.pp-slot.empty { min-height: 90px; justify-content: center; align-items: center; border: 1.5px dashed #d33; border-radius: 6px; padding: 8px; text-align: center; }
.pp-slot.empty .muted { color: #a22; font-size: 12px; }
.pp-cap { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: #666; }
.pp-cap .btn.ghost { height: 28px; font-size: 12px; padding: 0 8px; color: #2E3192; }
.dl-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.email-box { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line-soft); padding-top: 16px; }
.email-box h3 { margin: 0; font-size: 16px; }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { flex: 1; height: 44px; font-size: 14px; }
.email-box .field .btn { align-self: flex-start; }

.crop-stage { position: relative; overflow: hidden; background: var(--raised); border-radius: 12px; padding: 8px; touch-action: none; cursor: crosshair;
  user-select: none; display: flex; justify-content: center; }
.crop-stage img { max-width: 100%; max-height: 64vh; display: block; pointer-events: none; }
.crop-rect { position: absolute; border: 2px solid #E53935; background: rgba(229,57,53,.08); box-shadow: 0 0 0 9999px rgba(0,0,0,.25); pointer-events: none; }

/* ================================================================ import folder */
.imp-pick { margin-top: 14px; }
.imp-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.imp-prog { height: 10px; border-radius: 999px; background: var(--raised); overflow: hidden; margin-bottom: 8px; }
.imp-prog span { display: block; height: 100%; background: var(--navy-ink); transition: width .3s; }
#impProgress { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
#impProgress .btn { align-self: flex-start; }
.imp-groups { display: flex; flex-direction: column; }
.imp-group { padding: 12px 0; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.imp-group:last-child { border-bottom: 0; }
.imp-group.bad { box-shadow: inset 3px 0 0 var(--bad); padding-left: 12px; }
.imp-group.warn { box-shadow: inset 3px 0 0 var(--warn); padding-left: 12px; }
.imp-group.off .m-line b { color: var(--muted); }
.imp-g-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 12px; align-items: center; }
.imp-g-head .m-line { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.imp-g-head .m-line small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.imp-g-head .m-line b { overflow-wrap: anywhere; }
.imp-g-head select { height: 44px; font-size: 14px; }
.imp-g-head .m-st { font-size: 13px; font-weight: 700; }
@media (min-width: 900px) { .imp-g-head { grid-template-columns: 1fr 1.6fr 190px auto; } }
.imp-files { display: flex; flex-direction: column; gap: 2px; }
.imp-file { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; min-height: 36px; padding: 2px 0; cursor: pointer; }
.imp-file input { width: 18px; height: 18px; margin: 0; accent-color: var(--navy); flex-shrink: 0; }
.imp-file.off .imp-fname { color: var(--muted); }
.imp-fname { overflow-wrap: anywhere; min-width: 0; flex: 1 1 160px; }
.imp-reason { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--raised); color: var(--muted); white-space: nowrap; }
.imp-state { font-size: 12px; font-weight: 700; }
.imp-person .panel-head h2 { font-size: 17px; overflow-wrap: anywhere; }
.imp-item { border-top: 1px solid var(--line-soft); padding: 14px 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.imp-item.flagged { box-shadow: inset 3px 0 0 var(--warn); padding-left: 12px; }
.imp-item.clear { box-shadow: inset 3px 0 0 var(--ok); padding-left: 12px; }
.imp-item.done { opacity: .75; }
.imp-i-head { display: flex; align-items: center; gap: 10px; }
.imp-i-head .rl-main b { white-space: normal; overflow-wrap: anywhere; }
.imp-form { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .imp-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .imp-form { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.imp-form .field input, .imp-form .field select { height: 44px; font-size: 15px; }
.imp-form .field input.ai-filled { border-color: var(--navy-ink); background: color-mix(in srgb, var(--navy-ink) 8%, var(--surface)); }
.imp-ai { margin: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.imp-flags { margin: 0; padding-left: 20px; font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.imp-flags:empty { display: none; }
.imp-flags .k-flag { color: var(--warn-ink); font-weight: 600; }
.imp-flags .k-block { color: var(--bad); font-weight: 600; }
.imp-flags .k-info { color: var(--muted); }
#revWaiting, #revTyping { margin-bottom: 12px; }
