/* Acorvia — app styles, from the brand board (v2).

   Acorn, growth, prosperity. Forest green is the brand and does the work that
   matters: primary buttons, the screen you are on, money that arrived. Midnight
   is the ink and the dark ground. The page sits on warm white, not plain white.

   Sky, gold and coral are status colours only — in progress, pending, alert.
   They report what happened; they are never decoration, and none of them is a
   second brand colour.

   Contrast note: growth green, sky, gold and coral are all under 3:1 on white,
   so none of them is ever text on a light ground. Each has a darker partner
   (--growth-ink, --sky-ink, --gold-ink, --coral-ink) for exactly that job. */

/* Inter, self-hosted — no font is fetched from anyone else's server, so
   nothing about who is using Acorvia leaves the box. One variable file per
   subset covers every weight. */
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* The board's palette, by its own names */
  --forest: #176B4D;       /* the brand — primary buttons, active states, money in */
  --growth: #36A96B;       /* rising numbers, chart line, accents */
  --spring: #9AD56A;       /* light accents, motif, reversed mark */
  --midnight: #17324D;     /* the ink, and the dark ground */
  --gold: #E2A63B;         /* pending */
  --sky: #4B9BC8;          /* in progress, paid */
  --coral: #E26D5A;        /* alert */
  --ground: #F7F9F5;       /* warm white — the page */
  --slate: #4D5D63;        /* secondary copy */

  /* Working shades of the above */
  --forest-800: #114F39;   /* hover on a forest fill */
  --forest-100: #E8F5EE;   /* forest tint */
  --midnight-2: #24466A;   /* one step up, for depth on a dark ground */
  --growth-ink: #167A47;   /* growth green, dark enough to be text */
  --sky-ink: #2E6B8F;
  --gold-ink: #8A6115;
  --coral-ink: #A83B28;
  --sky-100: #E7F1F8;
  --gold-100: #FCF2E0;
  --coral-100: #FCEBE8;

  --ink: #17324D;
  --ink-soft: #4D5D63;
  --line: #E4E8E2;
  --neutral: #9AA5A0;
  --white: #ffffff;
  --danger: #A83B28;
  --danger-bg: #FCEBE8;
  --ok: #176B4D;
  --ok-bg: #E8F5EE;
  --warn: #8A6115;
  --warn-bg: #FCF2E0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(23,50,77,.06), 0 4px 14px rgba(23,50,77,.06);
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--ground);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--forest); }
h1, h2, h3 { color: var(--ink); margin: 0; font-weight: 700; letter-spacing: -.011em;
  line-height: 1.2; }

/* A dropdown that searches: the list floats under its input, options are
   plain buttons, and anything beyond the first handful says to keep typing. */
.combo-panel { position: absolute; left: 0; right: 0; top: 100%; z-index: 60; margin-top: 4px;
  background: #fff; border: 1px solid var(--forest); border-radius: 8px; box-shadow: var(--shadow);
  max-height: 320px; overflow-y: auto; padding: 4px; }
/* The open list carries the same green edge as the box it belongs to, so it
   reads as one control and not as loose text on the page. (Tester, 11/2026.) */
.combo-opt { display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 8px 10px; border-radius: 6px; font-size: 13.5px; font-family: var(--font);
  color: var(--ink); cursor: pointer; }
.combo-opt:hover { background: var(--ground); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: var(--midnight); }
.login-card { background: var(--white); border-radius: 14px; box-shadow: var(--shadow);
  width: 100%; max-width: 380px; padding: 32px; }
.login-logo { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 22px; }
.login-logo img { height: 40px; width: auto; }
.login-sub { text-align: center; color: var(--ink-soft); margin: -12px 0 22px; font-size: 13px; }

/* ---------- App shell ---------- */
/* The menu and the page scroll independently: the shell is locked to the
   window height and each column gets its own scrollbar. */
.app { display: grid; grid-template-columns: 232px 1fr; height: 100vh; overflow: hidden; }
/* The ☰ button in the title bar folds the menu away. On a desktop the page
   simply takes the whole width; on a phone (below) the menu instead opens as
   a drawer over the page, and starts closed. */
.app.nav-collapsed { grid-template-columns: 1fr; }
.app.nav-collapsed .sidebar, .app.nav-collapsed #nav-scrim { display: none; }
#nav-scrim { display: none; }
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: min(272px, 84vw); z-index: 120;
    box-shadow: 0 12px 40px rgba(11, 27, 42, .45); }
  #nav-scrim { display: block; position: fixed; inset: 0; z-index: 110; background: rgba(11, 27, 42, .45); }
  /* Search results float from the drawer, so they must sit above it. */
  #global-search-results { z-index: 130; max-width: 92vw; }
}
.sidebar { background: var(--midnight); color: #C7D0D9; display: flex; flex-direction: column; overflow-y: auto; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
/* The logo is a wordmark, so it is sized by height and left to find its
   own width. Forcing a square would squash it. */
.sb-brand img { height: 32px; width: auto; }
.sb-brand #report-bug { margin-left: auto; }
/* Universal search: one box in the rail, results as a light card floating over
   the page. */
.sb-search { position: relative; padding: 10px 14px 2px; }
.sb-search input { width: 100%; background: var(--midnight-2); border: 1px solid rgba(247,249,245,.14); border-radius: 8px;
  color: var(--ground); padding: 8px 12px; font-size: 13px; }
.sb-search input::placeholder { color: #8FA0B0; }
.sb-search input:focus { outline: none; border-color: var(--spring); }
/* Fixed, not absolute: the sidebar scrolls (overflow clips), so the results
   float over the page instead of being cut off at the rail's edge. */
#global-search-results { position: fixed; left: 14px; top: 112px; width: 520px; max-width: 60vw; z-index: 90;
  background: #fff; border-radius: 7px; box-shadow: var(--shadow); border: 1px solid var(--line);
  max-height: 60vh; overflow-y: auto; padding: 4px; }
.gs-hit { display: block; padding: 8px 10px; border-radius: 7px; text-decoration: none; color: var(--ink); font-size: 13.5px; }
.gs-hit:hover { background: var(--ground); }
/* The kind sits on the left; the name and its status line stack beside it, never under it. */
.gs-hit { display: flex; align-items: flex-start; gap: 8px; }
.gs-name { display: flex; flex-direction: column; min-width: 0; }
.gs-sub { font-size: 11.5px; color: var(--ink-soft); }
.gs-kind { display: inline-block; min-width: 118px; color: var(--ink-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.gs-none { padding: 10px; color: var(--ink-soft); font-size: 13px; }

.sb-nav { padding: 6px 10px; flex: 1; overflow-y: auto; }
/* The menu's scroll bar: thin and dark, so the whole menu reads as one dark
   panel — no light track or arrow buttons beside it (Windows draws those by
   default). (Bug #86, 11/2026.) */
.sidebar, .sb-nav { scrollbar-width: thin; scrollbar-color: rgba(199, 208, 217, .28) transparent; }
.sidebar::-webkit-scrollbar, .sb-nav::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track, .sb-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb, .sb-nav::-webkit-scrollbar-thumb { background: rgba(199, 208, 217, .28); border-radius: 3px; }
.sidebar::-webkit-scrollbar-thumb:hover, .sb-nav::-webkit-scrollbar-thumb:hover { background: rgba(199, 208, 217, .45); }
.sidebar::-webkit-scrollbar-button, .sb-nav::-webkit-scrollbar-button { display: none; height: 0; }
.sb-group { color: #8FA0B0; font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em;
  margin: 16px 10px 6px; }
.sb-link { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px;
  color: #C7D0D9; text-decoration: none; cursor: pointer; font-size: 13.5px; margin-bottom: 1px; }
.sb-link:hover { background: rgba(247,249,245,.08); color: #fff; }
/* The screen you are on: a forest fill, with a spring-green edge — the one
   place the lightest green earns its keep, against the midnight rail. */
.sb-link.active { background: var(--forest); color: #fff; font-weight: 600;
  box-shadow: inset 3px 0 0 var(--spring); }
.sb-link .ic { width: 16px; text-align: center; opacity: .9; }
/* A subheading inside a section — click the row to show the pages under it. */
.sb-sub { width: 100%; background: none; border: 0; font-family: inherit; text-align: left; }
.sb-subitems .sb-link { padding-left: 30px; }
/* Count of work waiting on a screen. A forest pill on the midnight rail — and
   inverted on the active row, where the row itself is already forest. */
.sb-badge { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px;
  background: var(--forest); color: #fff; font-size: 11px; font-weight: 700;
  line-height: 1.6; text-align: center; }
.sb-link.active .sb-badge { background: var(--midnight); color: #fff; }
.sb-foot { border-top: 1px solid rgba(247,249,245,.14); padding: 10px 12px; font-size: 12px; color: #A5B2C0; }
/* The user chip: initials in a tinted circle, the name, a chevron that flips
   when the row folds open to show Sign out. */
.sb-me { width: 100%; display: flex; align-items: center; gap: 10px; padding: 4px; min-width: 0;
  background: none; border: 0; border-radius: 8px; font: inherit; color: #fff; cursor: pointer; text-align: left; }
.sb-me:hover { background: rgba(247,249,245,.06); }
.sb-avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none;
  border-radius: 50%; background: var(--forest-100); color: var(--forest); font-weight: 700; font-size: 13px; }
.sb-me .who { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sb-me-chev { flex: none; color: #9fb0d0; transition: transform .15s; }
.sb-me.open .sb-me-chev { transform: rotate(180deg); }
.sb-me-items { padding: 8px 4px 2px; }
/* Sign out on the midnight rail: pale text and a faint border, and a hover
   that stays on the rail instead of the page's light button hover. */
.sb-foot .btn.ghost { color: #C7D0D9; border-color: rgba(247,249,245,.14); }
.sb-foot .btn.ghost:hover { background: rgba(247,249,245,.1); color: #fff; border-color: rgba(247,249,245,.3); }

.main { display: flex; flex-direction: column; min-width: 0; overflow-y: auto; }
/* Everything above the list — the demo banner, the title bar, the tab strip and
   the table's column headings — stays put while the rows scroll under it. Each
   one pins directly below the one above, and the heights are measured on the
   page rather than written in here, so a banner that wraps or a tab strip
   carrying buttons never leaves a gap or hides a row. */
.demo-ribbon { background: var(--forest); color: #fff; font-size: 13.5px; padding: 8px 26px;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 6; }
.demo-ribbon a { color: #fff; font-weight: 600; margin-left: auto; white-space: nowrap; }
.topbar { background: var(--white); border-bottom: 1px solid var(--line); padding: 14px 26px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: var(--ribbon-h, 0px); z-index: 5; }
.topbar h1 { font-size: 20px; }
.tb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tb-left h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#nav-toggle { flex: none; width: 34px; height: 34px; padding: 0; line-height: 1; font-size: 17px;
  background: var(--white); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
#nav-toggle:hover { background: var(--ground); }
.topbar .crumb { color: var(--ink-soft); font-size: 13px; }
.tb-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
/* The guided tour: a play button beside each sidebar heading, one in the
   title bar, the ring on the page being shown, and the caption over the page. */
.sb-group { display: flex; align-items: center; gap: 8px; }
.sb-group[hidden] { display: none; }
.tour-btn { flex: none; width: 18px; height: 18px; padding: 0 0 0 1px; border-radius: 50%; cursor: pointer;
  display: inline-grid; place-items: center; background: transparent; color: var(--spring);
  border: 1px solid rgba(154,213,106,.55); }
.tour-btn:hover, .tour-btn:focus-visible { background: var(--spring); color: var(--midnight); }
.tour-btn[hidden], .tour-top[hidden] { display: none; }
.tour-top { flex: none; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--forest); background: var(--white);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; }
.tour-top:hover, .tour-top:focus-visible { background: var(--ground); }
body.touring .content { padding-bottom: 190px; }
/* Messages and the new-version nudge sit above the caption, not on its buttons. */
body.touring #toast-host { bottom: 200px; }
body.touring .build-nudge { bottom: 200px !important; }
.tour-video-bg { z-index: 92; }
.tour-video { width: 100%; max-width: 1000px; background: #fff; border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.tour-video-h, .tour-video-f { display: flex; align-items: center; gap: 12px; padding: 10px 14px; font-size: 14px; }
.tour-video-h b { flex: 1; min-width: 0; }
.tour-video-f .muted { flex: 1; min-width: 0; font-size: 12.5px; }
.tour-video video { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - 170px); background: #0B1B2A; }
@media (max-width: 720px) { .tour-video-f .muted { display: none; } .tour-video-f { justify-content: flex-end; } }
.sb-link.tour-here { box-shadow: 0 0 0 2px var(--spring); }
.tour-panel { position: fixed; bottom: 18px; z-index: 70; box-sizing: border-box; max-width: 900px;
  background: var(--midnight); color: #fff; border-radius: 12px; padding: 14px 18px 12px;
  box-shadow: 0 10px 34px rgba(11,27,42,.35); }
.tour-meta { display: flex; align-items: center; gap: 10px; font-size: 13.5px; min-width: 0; }
.tour-meta b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tour-tag { flex: none; background: var(--spring); color: var(--midnight); font-weight: 700; font-size: 11px;
  letter-spacing: .09em; text-transform: uppercase; border-radius: 5px; padding: 2px 8px; }
.tour-count { flex: none; color: #C7D0D9; font-size: 12.5px; }
.tour-x { flex: none; background: transparent; color: #fff; border: 0; font-size: 20px; line-height: 1;
  cursor: pointer; padding: 0 2px; border-radius: 6px; }
.tour-x:hover, .tour-x:focus-visible { background: rgba(255,255,255,.14); }
.tour-text { margin: 8px 0 10px; font-size: 16px; line-height: 1.45; }
.tour-nav { display: flex; align-items: center; gap: 8px; }
.tour-hint { flex: 1; min-width: 0; color: #8FA0B0; font-size: 12.5px; }
.tour-panel .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.tour-panel .btn.ghost:disabled { opacity: .4; cursor: default; }
@media (max-width: 720px) { .tour-top span, .tour-hint { display: none; } .tour-top { padding: 6px 8px; }
  .tour-nav { justify-content: flex-end; } .tour-text { font-size: 15px; } }
.content { padding: 24px 26px 60px; max-width: 1180px; width: 100%; }
.content.wide { max-width: none; }

/* ---------- Cards / tables ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 20px; }
.card-h { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex;
  align-items: center; justify-content: space-between; gap: 12px; }
.card-h h2 { font-size: 15.5px; }
.card-b { padding: 18px; }
.card-b.flush { padding: 0; }
/* A card table that scrolls under its own header: the card's title and
   explanation hold still, only the rows move, and the column headers ride
   sticky inside the scroll area. */
/* The dashboard's widget grid: four columns, each widget spanning 1–4 of
   them. On narrow windows everything stacks full-width regardless. */
.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; align-items: start; }
.dash-w { min-width: 0; }
.dash-w .card { margin-bottom: 0; }
.dash-wc { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
@media (max-width: 1100px) { .dash-w { grid-column: span 12 !important; } }

.scroll-table { max-height: 62vh; overflow: auto; }
/* Inside its own scroll area the header pins at the area's TOP — the global
   thead rule's page offsets (top bar, tab strip) don't apply here, they'd
   float the header into the middle of the table. The :has() variant outranks
   the tabbed-page rule below. */
.scroll-table thead th,
.content:has(.tabs) .scroll-table thead th { position: sticky; top: 0; background: var(--white); z-index: 1; box-shadow: 0 1px 0 var(--line); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th[aria-sort="ascending"]::after { content: " \2191"; }
th[aria-sort="descending"]::after { content: " \2193"; }
/* Every column heading sorts its list, so every one of them looks clickable and
   carries a sort marker: a faint up-and-down arrow to say "you can sort by me",
   which turns into a solid arrow showing which way the list is sorted. */
table:not(.no-sort) > thead th:not(.no-sort):not(:empty) { cursor: pointer; user-select: none; }
table:not(.no-sort) > thead th:not(.no-sort):not(:empty):hover { color: var(--midnight); }
table:not(.no-sort) > thead th:not(.no-sort):not(:empty)::after {
  content: "\00a0\2195"; opacity: .4; font-size: 11px; }
table:not(.no-sort) > thead th:not(.no-sort):not(:empty):hover::after { opacity: .8; }
table:not(.no-sort) > thead th:not(.no-sort):not(:empty)[aria-sort="ascending"]::after {
  content: "\00a0\2191"; opacity: 1; }
table:not(.no-sort) > thead th:not(.no-sort):not(:empty)[aria-sort="descending"]::after {
  content: "\00a0\2193"; opacity: 1; }
th { text-align: left; color: var(--ink-soft); font-weight: 600; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--line); }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
td.cell-sel { background: var(--forest-100) !important; box-shadow: inset 0 0 0 1px var(--growth); }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--ground); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.money { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--forest); }
.money.neg { color: var(--danger); }
.muted { color: var(--ink-soft); }
/* Section header in the Roles & Permissions grid (People, Sales, …): a forest
   band so the sections stand apart from the rows under them. */
.perm-group { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--forest-800); background: var(--forest-100); border-left: 3px solid var(--forest);
  padding: 7px 10px; margin-bottom: 6px; border-radius: 0 6px 6px 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--forest);
  background: var(--forest); color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 13.5px;
  font-weight: 600; cursor: pointer; font-family: var(--font); text-decoration: none; line-height: 1; }
.btn:hover { background: var(--forest-800); border-color: var(--forest-800); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
/* The board has two buttons: a forest fill and a white one with a hairline.
   This keeps working for markup that already asks for an accent button. */
.btn.accent { background: var(--forest); border-color: var(--forest); color: #fff; }
.btn.accent:hover { background: var(--forest-800); border-color: var(--forest-800); }
.btn.ghost { background: transparent; color: var(--midnight); border-color: var(--line); }
.btn.ghost:hover { background: var(--ground); }
.btn.danger { background: transparent; color: var(--danger); border-color: #EBC3BB; }
.btn.danger:hover { background: var(--danger-bg); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
/* The report form's file box — the Tickets screen's drop zone (Kirk, 11/2026). */
.tk-drop { border: 2px dashed #b9c4bf; border-radius: 8px; padding: 10px; font-size: 12.5px; color: var(--ink-soft); text-align: center; }
.tk-drop.over { border-color: #1d5c3f; background: #eef6ee; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
/* Every select wears the house style — native OS chrome never shows. The
   chevron is drawn, so it matches in every browser. */
/* A box is a box wherever it sits: inputs outside a .field (table cells,
   toolbars) dress the same as everything else. :where keeps this at zero
   specificity so any deliberate styling still wins. */
input:where(:not([type=checkbox]):not([type=radio]):not([type=file])) {
  font: inherit; font-size: 13.5px; color: var(--ink); background: var(--white);
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
}
select { appearance: none; -webkit-appearance: none; font: inherit; font-size: 13.5px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 30px 7px 10px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235D5D60' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center; }
select:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(23,107,77,.18); }
/* A multi-pick list box: no chevron (nothing drops down), rows breathe. */
select[multiple] { background-image: none; padding-right: 10px; }
select[multiple] option { padding: 6px 8px; }

.field input, .field select, .field textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 13.5px; font-family: var(--font); color: var(--ink); background: #fff; }
/* The shared .field background above painted over the base chevron — put it
   back, so a dropdown never dresses as a plain text box. */
.field select { padding-right: 30px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235D5D60' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center; }
/* A text box that opens a list (the sponsor picker) wears the selects' own
   drawn chevron, so it reads as a dropdown everywhere selects do. */
.field input.combo-input { padding-right: 30px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235D5D60' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--forest);
  box-shadow: 0 0 0 3px var(--forest-100); }
.field textarea { min-height: 90px; resize: vertical; font-family: ui-monospace, monospace; font-size: 12.5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.card-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; margin-bottom: 20px; }
.card-pair .card { margin-bottom: 0; }
@media (max-width: 900px) { .card-pair { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }

/* ---------- Badges / pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.neutral { background: var(--forest-100); color: var(--forest); }
.badge.accent { background: var(--forest-100); color: var(--forest); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px;
  position: sticky; top: calc(var(--ribbon-h, 0px) + var(--topbar-h, 52px));
  background: var(--ground); z-index: 3; }

/* A tab strip at the very top of a screen is part of the frozen top, so the
   breathing room around it has to be frozen with it. The gap above it (the
   page's own top margin) and the gap below it (down to the first card) live
   inside the strip as padding rather than outside it as margins — otherwise
   those two bands of empty space are the first thing to scroll away, and the
   whole top of the screen jumps upward by their height before it settles.
   With them inside, the strip starts life exactly where it pins and never
   moves at all. The line under the tabs is drawn where the margin used to
   start, so the strip still looks the way it did. */
.content:has(> .tabs:first-child) { padding-top: 0; }
.content > .tabs:first-child {
  --tabs-gap: 18px;
  padding-top: 24px;
  padding-bottom: var(--tabs-gap);
  margin-bottom: 0;
  border-bottom: 0;
}
.content > .tabs:first-child::after {
  content: ''; position: absolute; left: 0; right: 0;
  bottom: calc(var(--tabs-gap) - 1px); height: 1px; background: var(--line);
}
.tab { padding: 9px 15px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  border-bottom: 2px solid transparent; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--midnight); border-bottom-color: var(--growth); }
/* How much a tab is holding, said quietly beside its name. */
/* A count on a tab: a small forest-green circle with white digits. */
.tab-n:not(:empty) { display: inline-flex; align-items: center; justify-content: center;
  margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--forest); color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
  vertical-align: 1px; }

/* ---------- Stat tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tile { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); }
.tile .k { color: var(--ink-soft); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.tile .v { font-size: 26px; font-weight: 700; color: var(--midnight); margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile .v.accent-bar { border-left: 3px solid var(--forest); padding-left: 10px; }

/* ---------- Misc ---------- */
.row-actions { display: flex; gap: 8px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input[type=search] { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; min-width: 240px; font-size: 13.5px; }
.spacer { flex: 1; }
.empty { text-align: center; color: var(--ink-soft); padding: 44px 20px; }
.empty .big { font-size: 15px; color: var(--ink); font-weight: 600; margin-bottom: 4px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--ink-soft); font-weight: 600; }
.kv dd { margin: 0; }
/* A wide details list runs two label/value pairs per row; back to one on
   narrow screens. */
.kv.two-col { grid-template-columns: 150px 1fr 150px 1fr; column-gap: 28px; }
@media (max-width: 1000px) { .kv.two-col { grid-template-columns: 150px 1fr; } }
/* Document editor: a contenteditable page with a small formatting toolbar.
   Used for agreement bodies — office-authored, sanitized server-side. */
.doc-toolbar { display: flex; gap: 4px; margin-bottom: 6px; }
.doc-toolbar button { border: 1px solid var(--line); background: #fff; border-radius: 8px;
  min-width: 30px; height: 28px; cursor: pointer; font-size: 13px; color: var(--ink); }
.doc-toolbar button:hover { background: var(--ground); }
.doc-editor { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; min-height: 180px;
  max-height: 320px; overflow-y: auto; font-size: 14px; line-height: 1.55; background: #fff; }
.doc-editor:focus { outline: none; border-color: var(--forest); }
.doc-editor:empty::before { content: attr(data-placeholder); color: var(--neutral); }
.doc-editor h1, .doc-editor h2, .doc-editor h3 { margin: 10px 0 4px; }
.doc-editor p, .doc-editor div { margin: 6px 0; }

/* Tree disclosure: a bare caret, no button chrome — it rotates open like a
   Finder triangle. The hit area stays generous even though the glyph is small. */
.tree-toggle { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 6px;
  border: none; background: none; cursor: pointer; color: var(--ink-soft); font-size: 15px; line-height: 1;
  border-radius: 8px; transition: transform .15s ease, color .1s; vertical-align: middle; }
.tree-toggle:hover { color: var(--ink); background: var(--tint, var(--ground)); }
.tree-toggle.open { transform: rotate(90deg); }

/* Wizard trail: steps run across the top, the body below changes per step.
   Growth green is 3:1 on a light ground, so the current step is ink with a
   green underline rather than green lettering. */
.stepbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -4px 0 18px; font-size: 13px; }
.step { color: var(--ink-soft); }
.step.done { color: var(--ok); }
.step.active { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--growth); padding-bottom: 3px; }
.step-sep { color: var(--neutral); }
.gate-warn { background: var(--warn-bg); border: 1px solid #ecdcae; border-radius: 8px; padding: 10px 14px; color: var(--warn); font-size: 13px; margin-bottom: 14px; }
.gate-ok { background: var(--ok-bg); border: 1px solid #c5e4d2; border-radius: 8px; padding: 10px 14px; color: var(--ok); font-size: 13px; margin-bottom: 14px; }

/* Toast */
#toast-host { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast { background: var(--midnight); color: #fff; padding: 11px 16px; border-radius: 7px; box-shadow: var(--shadow);
  font-size: 13.5px; max-width: 340px; animation: slidein .18s ease; }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } }

/* Modal */
#modal-host:empty { display: none; }
/* A question raised over a form that is already open sits on its own layer, so
   the form stays where it is with everything typed into it. */
#modal-host-2:empty { display: none; }
#modal-host-2 .modal-bg { z-index: 95; background: rgba(23,50,77,.25); }
.modal-bg { position: fixed; inset: 0; background: rgba(23,50,77,.45); display: grid; place-items: center; z-index: 90; padding: 20px; }
.modal { background: #fff; border-radius: 10px; box-shadow: var(--shadow); width: 100%; max-width: 460px;
  max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal > form { display: flex; flex-direction: column; min-height: 0; }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 650; font-size: 15px; flex-shrink: 0; }
.modal-b { padding: 20px; overflow-y: auto; }
.modal-f { flex-shrink: 0; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* ------------------------------------------------------------ pack station
   A bench screen: the count reads across the room, a refused scan is red
   before it is words, and the box being filled sits on the right. */
.pack-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
  flex-wrap: wrap; margin-bottom: 16px; }
.pack-count { text-align: right; }
.pack-count .n { font-size: 44px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
  color: var(--midnight); }
.pack-count .n span { font-size: 24px; color: var(--ink-soft); font-weight: 600; }
.pack-count .k { font-size: 13px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .1em;
  margin-top: 4px; }
.pack-count.done .n { color: var(--ok); }
.pack-grid { display: grid; grid-template-columns: 1fr 420px; gap: 18px; align-items: start; }
.pack-grid > * { min-width: 0; }
.pack tr.line-done td { opacity: .5; }
.pack .ok-tick { color: var(--ok); font-weight: 700; }
.pack .gone { font-size: 13px; padding: 5px 0; border-top: 1px solid var(--line); }
.pack .gone:first-of-type { border-top: 0; }
/* The scan box is the biggest input on the screen for a reason. */
.pack #scan { font-size: 20px; padding: 12px 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.say { min-height: 44px; border-radius: 8px; padding: 11px 14px; font-size: 15px; font-weight: 600;
  margin: 0 0 12px; display: flex; align-items: center; }
.say:empty { background: transparent; padding: 0; min-height: 8px; }
.say.good { background: var(--ok-bg); color: var(--ok); }
.say.bad { background: var(--danger-bg); color: var(--danger); }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
/* display:grid would otherwise beat the hidden attribute. */
.row3[hidden] { display: none; }
/* A button's inline-flex would otherwise beat the hidden attribute — a
   hidden button must be gone, not just marked. */
.btn[hidden] { display: none !important; }
.countrow { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.inbox { margin: 12px 0; max-height: 240px; overflow-y: auto; }
.initem { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.initem .mono { color: var(--ink-soft); }
.rates { margin: 4px 0 14px; }
.rate { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 7px;
  padding: 11px 13px; margin-bottom: 8px; cursor: pointer; font-size: 14px; }
.rate.on { border-color: var(--growth); background: var(--forest-100); }
.rate input { width: auto; margin: 0; }
.rate .t { flex: 1; }
.rate .p { font-weight: 700; font-variant-numeric: tabular-nums; }
.rate .tag { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.note-muted, .note-bad { font-size: 13px; padding: 9px 12px; border-radius: 8px; margin-bottom: 12px; }
.note-muted { background: var(--ground); color: var(--ink-soft); }
.note-bad { background: var(--danger-bg); color: var(--danger); }
@media (max-width: 1100px) { .pack-grid { grid-template-columns: 1fr; } }

/* --------------------------------------------------------- agreement notice
   Not a modal you can click away from: agreeing is the only way past it, and
   the words are the thing on the screen. */
.agr-back { position: fixed; inset: 0; z-index: 200; background: rgba(23,50,77,.55);
  display: grid; place-items: center; padding: 24px; }
.agr-card { background: var(--white); border-radius: 7px; box-shadow: var(--shadow);
  width: min(720px, 100%); max-height: 86vh; display: flex; flex-direction: column; }
.agr-head { padding: 20px 24px 12px; border-bottom: 1px solid var(--line); }
.agr-head h2 { margin: 0 0 2px; font-size: 19px; }
.agr-changed { background: var(--forest-100); padding: 11px 24px; font-size: 13.5px; color: var(--forest); }
.agr-body { padding: 20px 24px; overflow-y: auto; font-size: 14.5px; line-height: 1.6; flex: 1; }
.agr-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex;
  align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Typed signatures write in a signing hand, everywhere one is typed.
   The face is bundled (Great Vibes, SIL Open Font License) so every
   device draws the very same script. */
@font-face {
  font-family: 'Signature';
  src: url('/fonts/signature.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
input[name="signature"] {
  font-family: 'Signature', 'Snell Roundhand', 'Segoe Script', cursive;
  font-size: 24px;
  color: #1a1a59;
}

/* Pay Bills amount boxes: an input only when the row is ticked — until then
   the amount reads as quiet text, not a dead grey control. */
.pay-amt {
  width: 110px;
  padding: 7px 10px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13.5px;
}
.pay-amt:disabled {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.pay-amt::-webkit-outer-spin-button, .pay-amt::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pay-amt { -moz-appearance: textfield; appearance: textfield; }

/* Table headers stay put while the rows scroll beneath them — pinned just
   under the top bar, opaque so rows vanish underneath. */
thead th {
  position: sticky;
  top: calc(var(--ribbon-h, 0px) + var(--topbar-h, 52px));
  background: var(--white);
  z-index: 2;
  box-shadow: 0 1px 0 var(--line);
}
/* Inside a popup the scroll area starts at the popup's own top, not 52px
   down — pinning there would hide the first rows behind the header. */
.modal-b thead th { top: 0; }


/* On a page with a tab strip, table headers pin just under the tabs. */
.content:has(.tabs) thead th {
  top: calc(var(--ribbon-h, 0px) + var(--topbar-h, 52px) + var(--tabs-h, 38px));
}


/* Keyboard focus on a clickable row reads like hover does for the mouse. */
tr.clickable:focus { outline: 2px solid var(--growth); outline-offset: -2px; }

/* Anyone who asked their computer for less motion gets less motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* Keyboard focus is always visible — buttons, links and tab pills alike. */
button:focus-visible, a:focus-visible, .tab:focus-visible, [role=button]:focus-visible {
  outline: 2px solid var(--forest); outline-offset: 2px; border-radius: 4px;
}


/* Number boxes lose their spinner arrows — typing is the way. */
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* Drag-to-reorder rows (custom fields): a grip, a lifted look while dragging,
   and a line where the row will land. */
.drag-row { cursor: grab; }
.drag-row.dragging { opacity: .45; }
.drag-row.drop-above { box-shadow: inset 0 2px 0 var(--forest); }
.drag-row.drop-below { box-shadow: inset 0 -2px 0 var(--forest); }
.drag-grip { display: inline-block; color: var(--ink-soft); margin-right: 8px; letter-spacing: -2px; user-select: none; vertical-align: middle; }

/* A small "i" beside a field label: the how-to shows on hover, focus or tap,
   so the box itself stays empty. */
.label-row { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.label-row label { margin-bottom: 0; }
.info-i { position: relative; width: 16px; height: 16px; padding: 0; border-radius: 50%; border: 1px solid var(--ink-soft); background: transparent; color: var(--ink-soft); font: italic 700 11px/14px Georgia, serif; cursor: help; }
.info-i:hover, .info-i:focus { border-color: var(--forest); color: var(--forest); outline: none; }
.info-i::after { content: attr(data-tip); display: none; position: absolute; left: -6px; top: 22px; z-index: 30; width: 230px; padding: 8px 10px; border-radius: 6px; background: var(--ink, #1f2a26); color: #fff; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 12.5px; line-height: 1.4; font-weight: 400; font-style: normal; text-align: left; white-space: normal; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.info-i:hover::after, .info-i:focus::after { display: block; }
