
/* Layout: navy cover band, then deck-style square cards. Colour carries meaning: navy = Finance's turn, amber = needs rework, pink = overdue, grey = quiet. */
:root {
  --bg: #FFFFFF; --card: #F4F5F8; --surface: #FFFFFF; --field: #FFFFFF; --surface-2: #EDEFF4;
  --ink: #101532; --ink-2: #3A4067; --ink-3: #6E7180;
  --line: #DFE2EA; --line-2: #C7CAD9;
  --brand: #101532; --navy: #101532; --amber: #F5A623; --amber-ink: #3A2E00; --pink: #FBEAE7; --pink-ink: #8A1F14;
  --accent: #FF6634; --accent-ink: #101532; --accent-text: #C4400F;
  --info: #3A4067; --good: #196B24; --warn: #C4400F; --bad: #B3261E; --review: #8A5A00; --muted: #6E7180;
  --font-display: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SF Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0E24; --card: #151A3D; --surface: #151A3D; --field: #0E1230; --surface-2: #1A2048; --ink: #F4F5F8; --ink-2: #C7CAD9; --ink-3: #9CA0B5;
    --line: #272D5C; --line-2: #3A4067; --navy: #262D63; --pink: #3A1F2B; --pink-ink: #FFB3AB;
    --accent: #FF7A4D; --accent-text: #FF8E69; --info: #AEB6EE; --good: #5CC68C; --warn: #FF8E69; --bad: #F2807A; --review: #F5A623; --muted: #9CA0B5;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B0E24; --card: #151A3D; --surface: #151A3D; --field: #0E1230; --surface-2: #1A2048; --ink: #F4F5F8; --ink-2: #C7CAD9; --ink-3: #9CA0B5;
  --line: #272D5C; --line-2: #3A4067; --navy: #262D63; --pink: #3A1F2B; --pink-ink: #FFB3AB;
  --accent: #FF7A4D; --accent-text: #FF8E69; --info: #AEB6EE; --good: #5CC68C; --warn: #FF8E69; --bad: #F2807A; --review: #F5A623; --muted: #9CA0B5;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; font-weight: 400; line-height: 1.5; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 0 24px; min-height: 100vh; }
#app { display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; }
main.wrap { min-width: 0; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; letter-spacing: -0.015em; font-weight: 500; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 400; }
.eyebrow.o { color: var(--accent-text); }

/* header */
.band { background: var(--brand); color: #F4F5F8; margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); margin-right: calc(-1 * max(16px, env(safe-area-inset-right, 0px))); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); margin-bottom: 32px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding: 18px 0; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand img { width: 34px; height: 34px; flex: none; }
.brand-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.band .eyebrow { color: #9CA0B5; }
.brand h1 { font-size: 22px; font-weight: 500; color: #fff; }
.brand button.home { background: none; border: 0; padding: 0; text-align: left; color: inherit; }
.who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip { font-size: 12.5px; padding: 4px 11px; border: 1px solid rgba(255,255,255,.22); border-radius: 2px; background: rgba(255,255,255,.06); color: #C7CAD9; white-space: nowrap; }
.chip b { color: #fff; font-weight: 600; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 2px; border: 1px solid var(--line-2); background: var(--field); font-weight: 500; font-size: 14px; text-decoration: none; color: var(--ink); line-height: 1.2; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.danger { color: var(--bad); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.on-dark { background: transparent; border-color: rgba(255,255,255,.4); color: #fff; }
.btn.on-dark:hover { border-color: #fff; }
.link { background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* labels */
.pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; padding: 4px 9px; border-radius: 2px; white-space: nowrap; background: color-mix(in srgb, var(--c) 13%, var(--card)); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 30%, var(--card)); }
.pill::before { content: ""; width: 6px; height: 6px; background: var(--c); }
.t-muted { --c: var(--muted); } .t-info { --c: var(--info); } .t-bad { --c: var(--bad); } .t-warn { --c: var(--warn); } .t-good { --c: var(--good); } .t-review { --c: var(--review); }

/* page title */
.page-t { display: grid; gap: 6px; margin-bottom: 24px; }
.page-t h2 { font-size: 36px; line-height: 1.1; }

/* timeline: five deck-style cards */
.tl { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.tl li { display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 14px; background: var(--card); min-height: 196px; min-width: 0; font-size: 13.5px; color: var(--ink-3); }
.tl .num { font-size: 34px; font-weight: 400; color: var(--accent-text); line-height: 1; margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.tl li b { color: var(--ink); font-size: 17px; font-weight: 500; line-height: 1.2; }
.tl .wk { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); margin-top: auto; padding-top: 10px; }
.tl li.past .num { color: var(--ink-3); }
.tl li.now { background: var(--navy); color: #C7CAD9; }
.tl li.now b { color: #fff; }
.tl li.now .num, .tl li.now .wk { color: var(--accent); }

/* summary cards */
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 12px; margin-block: 24px; }
.sc { background: var(--card); padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sc .l { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }
.sc .n { font-size: 38px; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.sc.review { background: var(--amber); } .sc.review .l, .sc.review .n { color: var(--amber-ink); }
.sc.bad { background: var(--pink); } .sc.bad .l { color: var(--pink-ink); } .sc.bad .n { color: var(--pink-ink); }
.sc.good { background: var(--navy); } .sc.good .l { color: var(--accent); } .sc.good .n { color: #fff; }

/* panels */
.panel { background: var(--card); border-radius: 2px; }
.panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 20px 4px; }
.panel-h h2 { font-size: 21px; font-weight: 500; }
.panel-b { padding: 14px 20px 20px; }
.queue { list-style: none; margin: 8px 0 0; padding: 0; }
.queue li { border-top: 1px solid var(--line-2); }
.queue button { display: flex; width: 100%; gap: 12px; align-items: center; justify-content: space-between; text-align: left; padding: 12px 20px; background: none; border: 0; flex-wrap: wrap; }
.queue button:hover { background: var(--surface-2); }
.queue .q-main { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-width: 0; }
.queue .q-when { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }

/* tiles */
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 36px 0 14px; flex-wrap: wrap; }
.sec-h h2 { font-size: 24px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tile { --t-bg: var(--navy); --t-ink: #fff; --t-ink-2: #9CA0B5; --t-label: var(--accent); --t-bar: var(--accent); --t-off: #3A4067;
  display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 16px; min-height: 196px; background: var(--t-bg); color: var(--t-ink); border: 0; border-radius: 2px; min-width: 0; }
.tile:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.tile.v-not_issued { --t-label: #9CA0B5; --t-bar: #9CA0B5; }
.tile.v-issued { --t-label: #AEB6EE; --t-bar: #AEB6EE; }
.tile.v-submitted { --t-label: var(--accent); --t-bar: var(--accent); }
.tile.v-returned { --t-label: #F5A623; --t-bar: #F5A623; }
.tile.v-overdue { --t-label: #FF8E85; --t-bar: #FF8E85; }
.tile.v-approved { --t-label: #5CC68C; --t-bar: #5CC68C; }
.tile-lab { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--t-label); }
.exec-head { background: var(--navy); color: #fff; padding: 20px 22px; margin-bottom: 22px; border-radius: 2px; display: flex; gap: 18px; align-items: center; }
.exec-head img { width: 52px; height: 52px; flex: none; }
.exec-head .eyebrow { color: var(--accent); }
.exec-head h2 { font-size: 38px; line-height: 1.08; margin: 4px 0 6px; overflow-wrap: anywhere; }
.exec-head .n { color: #C7CAD9; font-size: 15px; }
.exec-head .n b { color: var(--accent); font-weight: 500; }
.exec-head.dept { flex-wrap: wrap; }
.exec-head.dept .grow { flex: 1 1 260px; min-width: 0; }
.exec-head.dept .meta { color: #C7CAD9; margin-top: 4px; }
.exec-head.dept .meta b { color: #fff; }
.exec-head.dept .flag { color: var(--accent); }
.exec-head.dept .hint { color: #9CA0B5; }
.exec-head.dept .pill { margin-left: auto; align-self: flex-start; }
.tile-top { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.tile-top img { width: 34px; height: 34px; flex: none; }
.tile-top > span { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile-top .tile-name { margin-top: 0; }
.tile-name { font-size: 24px; font-weight: 500; line-height: 1.12; overflow-wrap: anywhere; margin-top: 10px; }
.tile-mgr { color: var(--t-ink-2); font-size: 14px; }
.tile-foot { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); flex-wrap: wrap; margin-top: auto; }
.bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin-top: auto; }
.bar i { height: 4px; background: var(--t-off); }
.bar i.on { background: var(--t-bar); }
.flag { font-weight: 500; }
.flag.bad { color: inherit; }

/* callouts */
.banner { padding: 14px 18px; border-radius: 2px; background: var(--pink); color: var(--ink); margin-bottom: 18px; font-size: 14px; }
.banner.warn, .banner.bad { background: var(--pink); }
.banner b { font-weight: 600; }
.notify { background: var(--navy); color: #fff; border-radius: 2px; padding: 16px 20px; margin-bottom: 18px; display: grid; gap: 12px; }
.notify .hint { color: #9CA0B5; }
.notify pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: 12.5px; background: rgba(255,255,255,.07); border-radius: 2px; padding: 10px 12px; user-select: all; color: #fff; }
.notify .btn:not(.primary) { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.notify .link { color: var(--accent); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* department page */
.crumb { margin-bottom: 18px; }
.dept-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 22px; }
.dept-head h2 { font-size: 42px; font-weight: 500; line-height: 1.08; overflow-wrap: anywhere; margin-top: 4px; }
.meta { display: flex; gap: 6px 26px; flex-wrap: wrap; color: var(--ink-3); font-size: 14px; margin-top: 10px; }
.meta b { color: var(--ink); font-weight: 500; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-bottom: 26px; }
.step { position: relative; padding-top: 24px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); min-width: 0; }
.step::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 2px; background: var(--line-2); }
.step::after { content: ""; position: absolute; left: 0; top: 0; width: 16px; height: 16px; background: var(--bg); border: 2px solid var(--line-2); }
.step.done { color: var(--ink); }
.step.done::before { background: var(--c); }
.step.done::after { background: var(--c); border-color: var(--c); }
.step .s-note { display: block; color: var(--ink-3); font-size: 10.5px; text-transform: none; letter-spacing: 0; font-family: var(--font-body); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.stack { display: grid; gap: 12px; min-width: 0; }
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line-2); }
.files li:first-child { border-top: 0; padding-top: 0; }
.f-name { font-weight: 500; overflow-wrap: anywhere; }
.f-sub { color: var(--ink-3); font-size: 12.5px; }
.cur { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 400; color: var(--accent-text); margin-right: 8px; }
textarea, input[type=text], input[type=date] { width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 2px; background: var(--field); }
textarea { min-height: 76px; resize: vertical; }
label.fld { display: grid; gap: 5px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); min-width: 0; }
label.fld input, label.fld textarea { font-family: var(--font-body); font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--ink); }
.hint { color: var(--ink-3); font-size: 13px; margin: 0; }
.empty { color: var(--ink-3); font-size: 14px; margin: 0; }
.thread { display: grid; gap: 10px; margin-bottom: 14px; max-height: 460px; overflow-y: auto; }
.msg { padding: 11px 14px; border-radius: 2px; background: var(--field); max-width: 92%; justify-self: start; }
.msg.fin { justify-self: end; background: var(--navy); color: #fff; }
.msg .by { font-size: 12.5px; color: var(--ink-3); margin-bottom: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.msg .by b { color: var(--ink-2); font-weight: 600; }
.msg.fin .by, .msg.fin .by b { color: #C7CAD9; }
.msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.guide { background: var(--navy); color: #fff; border-radius: 2px; padding: 16px 20px 18px; margin-bottom: 14px; }
.guide-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.guide-h .eyebrow { color: var(--accent); }
.guide-h button { background: none; border: 1px solid rgba(255,255,255,.35); color: #fff; padding: 4px 12px; border-radius: 2px; font-size: 13px; }
.guide-h button:hover { border-color: #fff; }
.guide ol { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.guide li { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: #C7CAD9; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.2); min-width: 0; }
.guide li .num { font-size: 28px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.guide li b { color: #fff; font-weight: 500; font-size: 15.5px; }
.fq { padding: 16px 0; border-top: 1px solid var(--line-2); }
.fq:first-of-type { border-top: 0; padding-top: 2px; }
.fq-h { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.fq-t { margin: 0; font-size: 16px; font-weight: 500; white-space: pre-wrap; overflow-wrap: anywhere; }
.fq-new { border-top: 1px solid var(--line-2); margin-top: 8px; padding-top: 16px; display: grid; gap: 10px; }
.review-box { border-top: 1px solid var(--line-2); margin-top: 16px; padding-top: 16px; display: grid; gap: 10px; }

/* manage */
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 14px; }
th { text-align: left; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); font-weight: 400; padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
td { padding: 6px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
td input { padding: 6px 8px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

.sc.money .n { font-size: 30px; }
.sc .f-sub { color: var(--ink-3); font-size: 12.5px; }
.sc.review .f-sub { color: var(--amber-ink); }
.sum-note { margin: 12px 0 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 600; border-top: 2px solid var(--ink); border-bottom: 0; }
.ex { border-top: 1px solid var(--line-2); padding: 16px 0; }
.chk { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 16px; margin-top: 12px; }
.cb { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.cb input { width: auto; accent-color: var(--accent); }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 48px; padding-top: 14px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; color: var(--ink-3); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 2px; font-size: 14px; max-width: min(520px, calc(100vw - 32px)); z-index: 20; box-shadow: 0 6px 24px rgba(0,0,0,.25); border-left: 3px solid var(--accent); }
.skeleton { height: 150px; background: linear-gradient(90deg, var(--card) 25%, var(--surface-2) 50%, var(--card) 75%); background-size: 200% 100%; animation: sh 1.4s linear infinite; }
@keyframes sh { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
@media (max-width: 900px) { .guide ol { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tl { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tl li { min-height: 150px; } }
@media (max-width: 760px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .guide ol { grid-template-columns: minmax(0, 1fr); }
  .dept-head h2 { font-size: 32px; }
  .page-t h2 { font-size: 28px; }
  .step { font-size: 10px; }
  .tl { grid-template-columns: minmax(0, 1fr); }
}


body { margin: 0; }
.local-banner { background: #fff3d6; color: #3a2e00; padding: 10px max(16px,calc((100vw - 1120px)/2)); display:flex; gap:12px; align-items:center; flex-wrap:wrap; font-size:13px; }
.local-banner label { display:flex; gap:8px; align-items:center; }
.local-banner select { background:white; color:#101532; padding:5px; border:1px solid #b7a77b; }
.auth-card { max-width:520px; margin:12vh auto; padding:32px; background:var(--card); }
.auth-card h1 { font-size:32px; margin-bottom:16px; }
.auth-card p { margin-bottom:24px; }
.sync-status { padding:8px 16px; background:var(--pink); color:var(--pink-ink); text-align:center; }
.skip-link { position:absolute; top:-100px; background:white; padding:12px; z-index:100; }
.skip-link:focus { top:0; }
@media(max-width:600px) { .page-t h2 { font-size:30px; } .exec-head.dept h2 { font-size:30px; } }
