:root {
  --ink: #1F2B33; --ink-2: #4A5961; --ink-3: #7C8990;
  --paper: #F4F6F5; --surface: #FFFFFF; --line: #DCE2E4; --line-2: #EBEFF0;
  --tag: #F0B429; --oxide: #A63D24; --spinifex: #3F7A4F; --river: #2F5F8A;
  --teal: #1F6F78; --amber: #B7791F; --rust: #C0622F; --dusk: #6A4C86;
  --ok-bg: #EEF5EF; --warn-bg: #FFF6E0; --block-bg: #FBEDE9;
  --r-s: 6px; --r-m: 10px;
  --sans: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
  --cond: "Barlow Condensed", "Barlow", "Arial Narrow", sans-serif;
  --focus: 0 0 0 3px rgba(240,180,41,.55);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 400 16px/1.5 var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-s); }
a { color: var(--river); }

/* shell */
.shell { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #DCE4E8; display: flex; flex-direction: column; padding: 22px 14px 18px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand { padding: 0 10px 20px; }
.brand .logo { display: flex; align-items: center; gap: 10px; }
.brand b { display: block; font: 700 23px/1 var(--cond); color: #fff; letter-spacing: .01em; }
.brand span { display: block; font-size: 13.5px; color: #9FB0B8; margin-top: 6px; }
.phase-chip { display: inline-block; margin-top: 10px; font: 600 12.5px/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--ink); background: var(--tag); padding: 5px 8px; border-radius: 4px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .group { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #7F929B; padding: 16px 12px 6px; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: var(--r-s); color: #C4D0D5; text-decoration: none; font-weight: 500; font-size: 15.5px; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a[aria-current="page"] { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--tag); }
.nav .count { font-size: 13px; background: var(--tag); color: var(--ink); border-radius: 20px; padding: 0 8px; font-weight: 700; min-width: 22px; text-align: center; }
.side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 14px; }
.side-foot .who { color: #fff; font-weight: 600; }
.side-foot .role { color: #9FB0B8; font-size: 13.5px; }
.side-foot button { background: none; border: 0; color: #9FB0B8; padding: 0; margin-top: 8px; text-decoration: underline; font-size: 13.5px; }
.state-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: #C4D0D5; margin-bottom: 12px; }
.state-pill i { width: 9px; height: 9px; border-radius: 50%; background: #6FBF7F; }
.page { padding: 32px 40px 70px; max-width: 1180px; width: 100%; }
.page.wide { max-width: none; }

/* type */
h1 { font: 600 38px/1.05 var(--cond); margin: 0; }
h2 { font: 600 24px/1.2 var(--cond); margin: 0; }
h3 { font-size: 17px; font-weight: 600; margin: 0; }
.lede { font-size: 19px; line-height: 1.45; margin: 10px 0 4px; max-width: 68ch; }
.meta { color: var(--ink-3); font-size: 14.5px; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.head { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding-bottom: 18px; border-bottom: 2px solid var(--ink); margin-bottom: 22px; flex-wrap: wrap; }
.head .day { font: 600 16px/1 var(--cond); color: var(--ink-2); margin-bottom: 8px; letter-spacing: .02em; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 0 12px; flex-wrap: wrap; }

/* figures / tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px 18px; text-decoration: none; color: inherit; display: block; position: relative; }
.tile:hover { border-color: #B9C4C9; }
.tile b { display: block; font: 600 38px/1 var(--cond); }
.tile span { display: block; color: var(--ink-2); font-size: 14.5px; margin-top: 6px; }
.tile em { font-style: normal; display: block; font-size: 13.5px; color: var(--ink-3); margin-top: 4px; }
.tile.hot { border-color: var(--tag); box-shadow: inset 4px 0 0 var(--tag); }
.tile.money b { font-size: 30px; }

/* buttons */
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-s); padding: 8px 14px; font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.btn:hover { border-color: #AEB9BE; }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.go { background: var(--spinifex); color: #fff; border-color: var(--spinifex); }
.btn.go:hover { background: #356A43; }
.btn.warn { color: var(--oxide); }
.btn.big { padding: 12px 18px; font-size: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.link { border: 0; background: none; padding: 0; color: var(--river); text-decoration: underline; font-weight: 500; }

/* cards for approvals */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 18px 20px; margin-bottom: 12px; }
.card.done { background: #FAFBFA; }
.card .top { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.card .title { font-weight: 600; font-size: 18px; line-height: 1.3; }
.card .sub { color: var(--ink-2); font-size: 15px; margin-top: 2px; }
.card .amt { font: 600 28px/1 var(--cond); text-align: right; white-space: nowrap; }
.card .amt small { display: block; font: 400 13px/1.4 var(--sans); color: var(--ink-3); margin-top: 4px; }
.card .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.card .prepared { font-size: 14.5px; color: var(--ink-2); margin-top: 10px; padding-left: 12px; border-left: 3px solid var(--line); }
.card .prepared b { color: var(--ink); font-weight: 600; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chk { font-size: 13.5px; border-radius: 20px; padding: 3px 10px 3px 8px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; }
.chk::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chk.ok { background: var(--ok-bg); color: var(--spinifex); }
.chk.warn { background: var(--warn-bg); color: var(--amber); border-color: #F1DDAA; }
.chk.block { background: var(--block-bg); color: var(--oxide); border-color: #EFC9BF; font-weight: 600; }
.flagline { margin-top: 10px; font-size: 14.5px; border-radius: var(--r-s); padding: 8px 12px; }
.flagline.warn { background: var(--warn-bg); color: #7A5310; }
.flagline.block { background: var(--block-bg); color: var(--oxide); }
.result { margin-top: 12px; font-size: 14.5px; background: var(--ok-bg); color: #2C5A39; padding: 8px 12px; border-radius: var(--r-s); }
.result.held { background: #F1F3F4; color: var(--ink-2); }
.pill { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pill.ap { background: #E6EEF6; color: var(--river); }
.pill.ar { background: #E9F3F3; color: var(--teal); }
.pill.cn { background: #F1ECF6; color: var(--dusk); }
.pill.gold { background: #FFF1C7; color: #6E4E00; }
.pill.green { background: var(--ok-bg); color: var(--spinifex); }
.pill.red { background: var(--block-bg); color: var(--oxide); }
.bulkbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--ok-bg); border: 1px solid #CFE2D3; border-radius: var(--r-m); padding: 12px 16px; margin: 0 0 16px; flex-wrap: wrap; }

/* tabs */
.tabs { display: flex; gap: 6px; margin: 4px 0 18px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line); background: var(--surface); border-radius: 30px; padding: 6px 14px; font-weight: 500; font-size: 15px; color: var(--ink-2); display: inline-flex; gap: 8px; align-items: center; }
.tab b { font-weight: 700; color: var(--ink); }
.tab[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab[aria-pressed="true"] b { color: var(--tag); }

/* tables */
.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-2); background: #F8FAF9; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr.click { cursor: pointer; } tr.click:hover td { background: #FAFBFA; }
tr.fresh td { background: #FFF9E6; }
.rag { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.rag.green { background: #6FBF7F; } .rag.amber { background: #E0A630; } .rag.red { background: #D0573A; } .rag.none { background: #CBD3D6; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters select, .filters input { border: 1px solid var(--line); border-radius: var(--r-s); padding: 7px 10px; background: var(--surface); font-size: 15px; }
.num { text-align: right; white-space: nowrap; }

/* schedule */
.sched { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: auto; }
.sgrid { display: grid; grid-template-columns: 190px repeat(6, minmax(130px, 1fr)); min-width: 980px; }
.sgrid .h { background: #F8FAF9; border-bottom: 1px solid var(--line); padding: 10px 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.sgrid .h.today { color: var(--ink); box-shadow: inset 0 -3px 0 var(--tag); }
.sgrid .res { padding: 10px; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); font-size: 14px; }
.sgrid .res b { display: block; font-size: 15px; }
.sgrid .cell { border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); padding: 6px; min-height: 64px; position: relative; }
.sgrid .cell.today { background: #FFFCF2; }
.jobblk { display: block; width: 100%; text-align: left; border: 0; border-radius: 6px; padding: 6px 8px; font-size: 13px; line-height: 1.3; background: #E6EEF6; color: #1C3E5C; border-left: 4px solid var(--river); margin-bottom: 4px; }
.jobblk b { display: block; font-size: 13.5px; }
.jobblk.Complete { background: #EEF1F2; color: var(--ink-2); border-left-color: #A9B5BA; }
.jobblk.Draft { background: #FFF4D6; color: #5E4300; border-left-color: var(--tag); border-style: dashed; border-width: 1px 1px 1px 4px; border-color: #E9C766; border-left-color: var(--tag); }
.jobblk.long { background: #EDF4EE; color: #2C5A39; border-left-color: var(--spinifex); }
.jobblk.ip { background: #E9F3F3; color: #164E54; border-left-color: var(--teal); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-2); margin: 10px 0 0; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(20,28,33,.35); opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 20; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--surface); box-shadow: none; visibility: hidden; transform: translateX(100%); transition: transform .18s ease, visibility .18s; z-index: 21; display: flex; flex-direction: column; }
.drawer.on { transform: none; visibility: visible; box-shadow: -8px 0 30px rgba(0,0,0,.12); }
.drawer .dh { padding: 20px 24px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.drawer .db { padding: 18px 24px 30px; overflow: auto; flex: 1; }
.drawer .df { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; background: #FAFBFA; }
.x { border: 0; background: none; font-size: 26px; line-height: 1; color: var(--ink-3); }
dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; margin: 0 0 16px; font-size: 15px; }
dl.kv dt { color: var(--ink-3); } dl.kv dd { margin: 0; }
.checklist { list-style: none; padding: 0; margin: 6px 0 16px; }
.checklist li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 15px; }
.checklist li .dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 4px; }
.checklist li.ok .dot { background: #6FBF7F; } .checklist li.warn .dot { background: #E0A630; } .checklist li.block .dot { background: #D0573A; }
.checklist li span { color: var(--ink-2); font-size: 14px; display: block; }
.doc { border: 1px solid var(--line); border-radius: var(--r-s); padding: 16px; font-size: 14.5px; background: #FDFDFC; margin: 8px 0 16px; }
.doc .dhd { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line-2); padding-bottom: 8px; margin-bottom: 8px; }
.doc table { font-size: 14px; } .doc td, .doc th { padding: 5px 6px; background: none; }
.doc .tot td { font-weight: 700; border-top: 1px solid var(--line); }
.email { white-space: pre-wrap; font-size: 14.5px; background: #FDFDFC; border: 1px solid var(--line); border-radius: var(--r-s); padding: 14px; margin: 8px 0 16px; }
textarea, .field input, .field select { width: 100%; border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 12px; background: var(--surface); font-size: 16px; }
textarea { min-height: 70px; }

/* mobile form */
.phone-wrap { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 36px; align-items: start; }
.phone { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px 20px; box-shadow: 0 8px 30px rgba(31,43,51,.08); }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 5px; }
.field .hint { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg button { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-s); padding: 10px 6px; font-weight: 600; font-size: 14.5px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.howto { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 18px 20px; }
.howto ol { margin: 8px 0 0; padding-left: 20px; } .howto li { margin-bottom: 6px; }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login .left { background: var(--ink); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login .left h1 { font-size: 46px; margin: 18px 0 14px; max-width: 16ch; }
.login .left p { color: #C4D0D5; font-size: 18px; max-width: 46ch; }
.login .right { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login .box { width: 100%; max-width: 470px; }
.ms { width: 100%; justify-content: center; padding: 12px; font-size: 16px; margin: 16px 0 6px; }
.who-list { display: grid; gap: 8px; margin-top: 10px; }
.who-btn { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-m); padding: 11px 14px; }
.who-btn:hover { border-color: #AEB9BE; }
.who-btn b { display: block; } .who-btn span { font-size: 13.5px; color: var(--ink-2); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13.5px; margin: 18px 0 4px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 30px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-m); font-size: 15px; max-width: min(640px, 92vw); opacity: 0; transition: all .2s; z-index: 40; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.empty { text-align: center; padding: 50px 20px; color: var(--ink-2); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-m); }
.twocol { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.list .row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line-2); font-size: 15px; }
.list .row:last-child { border-bottom: 0; }
.list .row .meta { font-size: 13.5px; }
.matrix td, .matrix th { font-size: 14.5px; }
.note { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; }

/* phone / narrow */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; height: auto; z-index: 10; padding: 10px 12px; flex-direction: row; align-items: center; gap: 10px; overflow-x: auto; }
  .brand { padding: 0 6px 0 0; flex: none; }
  .brand span, .phase-chip, .side-foot .role, .state-pill, .nav .group { display: none; }
  .brand b { font-size: 19px; }
  .nav { flex-direction: row; gap: 2px; flex: none; }
  .nav a { padding: 7px 10px; font-size: 14.5px; white-space: nowrap; }
  .side-foot { margin: 0; padding: 0 0 0 6px; border: 0; flex: none; display: flex; gap: 8px; align-items: center; }
  .side-foot button { margin: 0; }
  .page { padding: 20px 16px 60px; }
  h1 { font-size: 30px; }
  .twocol, .phone-wrap { grid-template-columns: 1fr; }
  .phone { border-radius: var(--r-m); box-shadow: none; }
  .login { grid-template-columns: 1fr; }
  .login .left { padding: 28px 22px; } .login .left h1 { font-size: 32px; }
  .login .right { padding: 22px 16px; }
  .card .top { flex-direction: column; gap: 8px; } .card .amt { text-align: left; }
  dl.kv { grid-template-columns: 110px 1fr; }
  .hide-sm { display: none; }
}
.brand span.phase-chip { display: inline-block; color: var(--ink); font-size: 12px; margin-top: 12px; }
.page { min-width: 0; }
.list .row { align-items: center; }
@media (max-width: 860px) { .head > .meta, .head > div[style] { text-align: left !important; } .doc { overflow-x: auto; } .bulkbar .btn { width: 100%; justify-content: center; } }
