/* Second Avenue Team — employee app
   Street-sign system: sign green plates with a white inset rule,
   concrete grey ground, curb yellow for breaks, signal red for stop. */

:root {
  --sign: #0E5A3A;
  --sign-deep: #0A4029;
  --sign-wash: #E3EFE8;
  --sign-text: #0E5A3A;
  --plate-text: #FFFFFF;
  --ground: #E8EBE9;
  --surface: #F8F9F8;
  --ink: #16201B;
  --muted: #56625C;
  --line: #CDD5D1;
  --curb: #F2C230;
  --curb-ink: #3A2E00;
  --curb-wash: #FBF0C9;
  --signal: #C3362B;
  --signal-wash: #F8E1DE;
  --focus: #1F6FEB;
  --radius: 14px;
  --font: 'Overpass', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sign: #12704A; --sign-deep: #0B4A31; --sign-wash: #16291F; --sign-text: #7BD7A6;
    --ground: #101513; --surface: #18201C; --ink: #E9EFEC; --muted: #9AA8A1; --line: #2B3631;
    --curb-wash: #2E2810; --curb-ink: #2E2400; --signal: #E0574B; --signal-wash: #34191A; --focus: #6EA8FE;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sign: #12704A; --sign-deep: #0B4A31; --sign-wash: #16291F; --sign-text: #7BD7A6;
  --ground: #101513; --surface: #18201C; --ink: #E9EFEC; --muted: #9AA8A1; --line: #2B3631;
  --curb-wash: #2E2810; --curb-ink: #2E2400; --signal: #E0574B; --signal-wash: #34191A; --focus: #6EA8FE;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 96px);
}
body.no-tabs #app { padding-bottom: calc(env(safe-area-inset-bottom) + 32px); }

/* ── Sign plate (the one bold element) ───────────────────── */
.plate {
  background: var(--sign);
  color: var(--plate-text);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 4px var(--sign), inset 0 0 0 6px rgba(255,255,255,.92);
  padding: 22px 22px 20px;
  position: relative;
}
.plate.on-break { background: var(--curb); color: var(--curb-ink); box-shadow: inset 0 0 0 4px var(--curb), inset 0 0 0 6px rgba(58,46,0,.85); }
.plate.warn { background: var(--signal); box-shadow: inset 0 0 0 4px var(--signal), inset 0 0 0 6px rgba(255,255,255,.92); }
.plate .street { font-weight: 800; font-size: 34px; line-height: 1.05; letter-spacing: -.01em; margin: 0; }
.plate .suffix { font-weight: 700; font-size: 15px; opacity: .9; margin-top: 6px; }
.plate .clock { font-weight: 800; font-size: 54px; line-height: 1; letter-spacing: -.02em; margin: 14px 0 4px; font-variant-numeric: tabular-nums; }
.plate .corner {
  position: absolute; top: 14px; right: 16px;
  font-size: 13px; font-weight: 700; padding: 2px 9px; border-radius: 6px;
  border: 1.5px solid currentColor; opacity: .9;
}

.mini-plate {
  display: inline-flex; white-space: nowrap; flex: none; align-items: baseline; gap: 6px;
  background: var(--sign); color: #fff; border-radius: 8px;
  box-shadow: inset 0 0 0 2px var(--sign), inset 0 0 0 3.5px rgba(255,255,255,.9);
  padding: 6px 12px 4px; font-weight: 800; font-size: 17px; letter-spacing: -.01em;
}
.mini-plate small { font-weight: 700; font-size: 11px; opacity: .85; }

/* ── Layout bits ─────────────────────────────────────────── */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.hello h1 { font-size: 24px; font-weight: 800; margin: 0; line-height: 1.15; }
.hello p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.title-chip { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--sign-text); background: var(--sign-wash); padding: 3px 10px 2px; border-radius: 999px; }

h2.section { font-size: 15px; font-weight: 800; margin: 28px 0 10px; color: var(--ink); display: flex; justify-content: space-between; align-items: baseline; }
h2.section span { font-weight: 600; color: var(--muted); font-size: 14px; }
.page-title { font-size: 28px; font-weight: 800; margin: 4px 0 16px; letter-spacing: -.01em; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 10px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .label { font-weight: 700; }
.row .sub { color: var(--muted); font-size: 14px; }
.row .right { text-align: right; font-weight: 700; }
a.row:active, button.row:active { background: var(--sign-wash); }
button.row { width: 100%; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; cursor: pointer; }
button.row:first-child { border-top: 0; }
.chev::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); display: inline-block; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stats > div { background: var(--surface); padding: 12px 12px 10px; }
.stats b { display: block; white-space: nowrap; font-size: clamp(17px, 5.4vw, 22px); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stats span { color: var(--muted); font-size: 13px; }

.note { font-size: 14px; color: var(--muted); margin: 10px 2px 0; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 28px 16px; }

.banner { border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-size: 15px; display: flex; gap: 10px; align-items: flex-start; }
.banner.warn { background: var(--signal-wash); color: var(--ink); border-left: 5px solid var(--signal); }
.banner.info { background: var(--curb-wash); border-left: 5px solid var(--curb); }
.banner.news { background: var(--sign-wash); border-left: 5px solid var(--sign); width: 100%; text-align: left; border-top: 0; border-right: 0; border-bottom: 0; cursor: pointer; }
.banner b { display: block; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 18px 10px; border-radius: 12px; border: 0;
  font-weight: 800; font-size: 17px; cursor: pointer; text-decoration: none;
  background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line);
  touch-action: manipulation;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn[aria-busy="true"] { opacity: .7; }
.btn.block { width: 100%; }
.btn.big { min-height: 66px; font-size: 21px; border-radius: var(--radius); }
.btn.go { background: var(--sign); color: #fff; box-shadow: none; }
.btn.stop { background: var(--signal); color: #fff; box-shadow: none; }
.btn.pause { background: var(--curb); color: var(--curb-ink); box-shadow: none; }
.btn.ghost { background: transparent; box-shadow: none; color: var(--sign-text); padding-inline: 8px; }
.btn.small { min-height: 38px; font-size: 15px; padding: 8px 12px 6px; }
.actions { display: grid; gap: 10px; margin-top: 14px; }
.actions.two { grid-template-columns: 1fr 1fr; }

/* ── Forms ───────────────────────────────────────────────── */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.field > span em { font-style: normal; font-weight: 500; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface); font-size: 17px;
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--sign); outline: none; box-shadow: 0 0 0 3px var(--sign-wash); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
fieldset { border: 0; padding: 0; margin: 22px 0 6px; }
legend { font-weight: 800; font-size: 15px; margin-bottom: 10px; padding: 0; }
.form-error { color: var(--signal); font-weight: 700; font-size: 15px; min-height: 1.2em; margin: 4px 0 8px; }

.seg { display: flex; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg label { flex: 1; text-align: center; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 9px 6px 7px; border-radius: 9px; font-weight: 700; font-size: 15px; cursor: pointer; }
.seg input:checked + span { background: var(--sign); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--focus); }

/* ── Tasks ───────────────────────────────────────────────── */
.task { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 12px; }
.task + .task { margin-top: 10px; }
.task.done { opacity: .62; }
.task-head { display: flex; gap: 12px; align-items: flex-start; }
.check { width: 30px; height: 30px; flex: none; border-radius: 9px; border: 2px solid var(--sign); background: transparent; cursor: pointer; display: grid; place-items: center; margin-top: 1px; }
.check[aria-pressed="true"] { background: var(--sign); }
.check[aria-pressed="true"]::after { content: ''; width: 11px; height: 6px; border-left: 3px solid #fff; border-bottom: 3px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.task-title { font-weight: 800; font-size: 17px; line-height: 1.25; }
.task.done .task-title { text-decoration: line-through; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 14px; color: var(--muted); margin-top: 3px; }
.task-meta .late { color: var(--signal); font-weight: 700; }
.task-details { font-size: 15px; margin: 6px 0 0; white-space: pre-wrap; }
.quota { margin-top: 12px; }
.bar { height: 10px; background: var(--ground); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: var(--sign); border-radius: 99px; transition: width .25s ease; }
.quota-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.quota-row b { color: var(--sign-text); font-size: 18px; font-variant-numeric: tabular-nums; }
.stepper { display: flex; gap: 6px; }
.stepper button { width: 46px; height: 42px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); font-size: 22px; font-weight: 800; cursor: pointer; }

/* ── Status chips ────────────────────────────────────────── */
.chip { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 9px 1px; border-radius: 999px; background: var(--ground); color: var(--muted); }
.chip.pending { background: var(--curb-wash); color: var(--ink); }
.chip.approved { background: var(--sign-wash); color: var(--sign); }
.chip.denied { background: var(--signal-wash); color: var(--signal); }

/* ── Role card ───────────────────────────────────────────── */
.role-card { border-left: 5px solid var(--sign); }
.role-title { font-weight: 800; font-size: 17px; }
.role-desc { margin: 6px 0 0; font-size: 15px; white-space: pre-wrap; color: var(--ink); }
.role-desc.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Week navigator ──────────────────────────────────────── */
.weeknav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.weeknav b { font-size: 17px; }
.weeknav button { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-size: 20px; font-weight: 800; }

.day { display: grid; grid-template-columns: 58px 1fr; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); align-items: center; }
.day:first-child { border-top: 0; }
.day .dnum { text-align: center; line-height: 1.05; }
.day .dnum small { display: block; font-size: 13px; color: var(--muted); font-weight: 700; }
.day .dnum b { font-size: 24px; font-weight: 800; }
.day.today .dnum b { color: var(--sign-text); }
.day .shift { font-weight: 800; }
.day .off { color: var(--muted); }

/* ── PIN pad ─────────────────────────────────────────────── */
.pin-screen { min-height: calc(100dvh - 60px); display: flex; flex-direction: column; justify-content: center; text-align: center; }
.pin-screen h1 { font-size: 26px; font-weight: 800; margin: 22px 0 4px; }
.pin-dots { display: flex; gap: 18px; justify-content: center; margin: 26px 0 10px; }
.pin-dots i { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--sign); }
.pin-dots i.on { background: var(--sign); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
.pin-msg { min-height: 1.4em; font-weight: 700; color: var(--signal); }
.pad { display: grid; grid-template-columns: repeat(3, 82px); gap: 14px 22px; justify-content: center; margin-top: 18px; }
.pad button { width: 82px; height: 82px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 32px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.pad button:active { background: var(--sign-wash); }
.pad button:disabled { opacity: .35; }
.pad .del { background: transparent; box-shadow: none; font-size: 16px; font-weight: 800; color: var(--muted); }

.pin-reveal { display: flex; gap: 10px; justify-content: center; margin: 22px 0; }
.pin-reveal span { width: 64px; height: 84px; display: grid; place-items: center; font-size: 46px; font-weight: 800; border-radius: 12px; background: var(--sign); color: #fff; box-shadow: inset 0 0 0 3px var(--sign), inset 0 0 0 5px rgba(255,255,255,.9); }

.code-box { font-size: 32px; font-weight: 800; letter-spacing: .12em; text-align: center; padding: 14px; border: 2px dashed var(--sign); border-radius: 12px; background: var(--surface); font-variant-numeric: tabular-nums; }
.steps { padding-left: 22px; margin: 10px 0; }
.steps li { margin-bottom: 8px; }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px 4px calc(env(safe-area-inset-bottom) + 6px);
}
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 700; padding: 6px 0 2px; border-radius: 10px; position: relative; }
.tabs a svg { width: 26px; height: 26px; }
.tabs a[aria-current="page"] { color: var(--sign-text); }
.tabs .dot { position: absolute; top: 4px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--signal); color: #fff; font-size: 11px; display: grid; place-items: center; }

/* ── Sheet (bottom drawer) ───────────────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(10,20,15,.45); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; border-radius: 20px 20px 0 0; padding: 22px 18px calc(env(safe-area-inset-bottom) + 20px); max-height: 92dvh; overflow: auto; animation: rise .22s ease-out; }
.sheet h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 86px); transform: translate(-50%, 20px); background: var(--ink); color: var(--ground); padding: 12px 18px 10px; border-radius: 12px; font-weight: 700; font-size: 15px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--signal); color: #fff; }

.spinner { width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--sign); border-radius: 50%; animation: spin .8s linear infinite; margin: 30vh auto 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.welcome { padding-top: 8vh; }
.welcome h1 { font-size: 32px; font-weight: 800; line-height: 1.1; margin: 22px 0 8px; letter-spacing: -.01em; }
.welcome p { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
