/* Sign-offs: phone first. Oxford navy and stone, as the other house apps and the approval emails.
   Status dots are monday's own label colours, so an item reads the way it does on the board. */
:root {
  --navy: #0e223b; --ink: #0e223b; --soft: #4a5a6c; --paper: #ffffff; --stone: #ebe6df; --stone-2: #f6f3ef;
  --rule: #d9d2c8; --accent: #2b5b9a; --bad: #b3261e; --good: #087a4b;
  --s-done: #00c875; --s-stuck: #df2f4a; --s-hosa: #5559df; --s-review: #579bfc; --s-resubmit: #ff6d3b;
  --s-declined: #bb3354; --s-grey: #9aa3ad;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--stone-2); color: var(--ink); font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
.wrap { max-width: 42rem; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.25; margin: 0; text-wrap: balance; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1.02rem; }
p { margin: 0; }
a { color: var(--accent); }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.bar { background: var(--navy); color: #fff; padding-top: env(safe-area-inset-top, 0px); }
.bar-in { max-width: 42rem; margin: 0 auto; display: flex; align-items: center; gap: 12px; min-height: 52px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.who { margin-left: auto; font-size: .85rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.signout { background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 8px; padding: 4px 10px; font-size: .85rem; }

main { padding-block: 16px 120px; display: grid; gap: 14px; }
.loading { color: var(--soft); padding: 40px 0; text-align: center; }
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; padding: 14px; display: grid; gap: 8px; min-width: 0; }
.muted { color: var(--soft); }
.small { font-size: .88rem; }
.error { background: #fdecea; color: var(--bad); border: 1px solid #f3c2bd; border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; }
.okbox { background: #e8f5ee; color: var(--good); border: 1px solid #b9e0ca; border-radius: 12px; padding: 12px 14px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--stone); border-radius: 12px; padding: 4px; gap: 4px; }
.tabs button { border: 0; border-radius: 9px; min-height: 44px; background: transparent; color: var(--ink); font-weight: 600; }
.tabs button[aria-selected="true"] { background: var(--paper); box-shadow: 0 1px 2px rgba(14,34,59,.15); }

.row { display: grid; gap: 4px; text-decoration: none; color: inherit; }
.row:hover h2 { text-decoration: underline; }
.kind { font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 700; color: var(--soft); }
.empty { text-align: center; padding: 28px 12px; }

.st { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; }
.st::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--s-grey)); flex: none; }
.st[data-s="Done"] { --c: var(--s-done); } .st[data-s="Stuck"] { --c: var(--s-stuck); }
.st[data-s="Head of Sales Approved"] { --c: var(--s-hosa); } .st[data-s="Head of Sales Review"] { --c: var(--s-review); }
.st[data-s="Resubmission Required"] { --c: var(--s-resubmit); } .st[data-s="Declined"] { --c: var(--s-declined); }
.st[data-s="Approved"] { --c: var(--s-done); } .st[data-s="Awaiting Approval"] { --c: var(--s-review); }

.head { display: grid; gap: 4px; }
.back { justify-self: start; background: none; border: 0; color: var(--accent); padding: 4px 0; font-weight: 600; }
.notes { background: var(--stone-2); border-radius: 10px; padding: 10px 12px; }
.label { font-size: .75rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 700; color: var(--soft); }

.item { gap: 10px; }
.item .note { color: var(--soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.files { display: flex; flex-wrap: wrap; gap: 8px; }
.filebtn { border: 1px solid var(--rule); background: var(--stone-2); color: var(--accent); border-radius: 8px; padding: 8px 12px; min-height: 40px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg button { min-height: 48px; border-radius: 10px; border: 1px solid var(--rule); background: var(--stone); color: var(--ink); font-weight: 600; padding: 0 4px; }
.seg button[aria-checked="true"][data-d="approve"] { background: var(--good); border-color: var(--good); color: #fff; }
.seg button[aria-checked="true"][data-d="resubmit"] { background: #8a5a00; border-color: #8a5a00; color: #fff; }
.seg button[aria-checked="true"][data-d="decline"] { background: var(--bad); border-color: var(--bad); color: #fff; }
textarea { width: 100%; font: inherit; font-size: 16px; border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; min-height: 76px; resize: vertical; background: #fff; color: var(--ink); }
.field { display: grid; gap: 6px; }

.figures { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.figures td { padding: 6px 0; border-bottom: 1px solid var(--rule); }
.figures td:last-child { text-align: right; }
.figures tr.strong td { font-weight: 700; }
.lines { margin: 0; padding-left: 18px; }

.dock { position: fixed; left: 0; right: 0; bottom: 0; background: var(--paper); border-top: 1px solid var(--rule);
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.dock-in { max-width: 42rem; margin: 0 auto; display: grid; gap: 8px; }
.primary { min-height: 52px; border: 0; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 700; font-size: 1.02rem; width: 100%; }
.primary:disabled { background: #9aa6b4; }
.secondary { min-height: 48px; border: 1px solid var(--rule); border-radius: 12px; background: var(--stone); color: var(--ink); font-weight: 600; width: 100%; }

.sheet-bg { position: fixed; inset: 0; background: rgba(14,34,59,.45); display: grid; align-items: end; z-index: 20; }
.sheet { background: var(--paper); border-radius: 18px 18px 0 0; padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 12px; max-width: 42rem; width: 100%; margin: 0 auto; }
.sheet ul { margin: 0; padding-left: 18px; }
.foot { color: var(--soft); font-size: .75rem; padding-bottom: 24px; text-align: center; }
@media (prefers-reduced-motion: no-preference) { .sheet { animation: up .18s ease-out; } @keyframes up { from { transform: translateY(24px); } } }
