/* CareBOS — app styles, mirroring the Acorvia design language.

   Same bones as Acorvia (dark rail, white cards on a warm ground, Inter,
   tinted status pills), keyed to CareBOS's own brand: navy is the ink and the
   rail and does the primary work; CareBOS green marks the screen you're on,
   money, and "done". Gold, sky and coral are status colours only — pending,
   in-progress, alert — never decoration.

   One committed light theme, like Acorvia: the rail is always dark (it wears
   the dark-background logo), the page is always light. */

/* Inter, self-hosted — no font is fetched from anyone else's server. */
@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 {
  color-scheme: light;
  /* The CareBOS palette in Acorvia's roles. The blue is Acorvia's midnight —
     Kirk prefers it to the old CareBOS navy, and the logo is following. */
  --navy: #17324D;         /* the brand — rail, primary buttons, ink headings */
  --navy-2: #24466A;       /* one step up, for depth on the dark rail */
  --green: #22af2c;        /* the accent — active screen, money in, done (non-text uses) */
  --green-dk: #156e1c;     /* green for TEXT — ≥4.5:1 on white AND on green-100 (WCAG AA) */
  --green-100: #e8f5ec;    /* green tint */
  --gold-ink: #8A6115;     /* pending */
  --gold-100: #FCF2E0;
  --sky-ink: #2E6B8F;      /* in progress */
  --sky-100: #E7F1F8;
  --coral-ink: #A83B28;    /* alert */
  --coral-100: #FCEBE8;

  /* The names the app's markup already speaks */
  --bg: #F7F9F5;           /* warm white — the page */
  --panel: #ffffff;
  --ink: #17324D;
  --muted: #4D5D63;
  --line: #E4E8E2;
  --brand: var(--navy);
  --brand-ink: #ffffff;
  --accent: var(--green);
  --danger: var(--coral-ink);
  --ok: var(--green-dk);
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20,32,58,.06), 0 4px 14px rgba(20,32,58,.06);
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { color: var(--ink); font-weight: 700; letter-spacing: -.011em; line-height: 1.2; }
a { color: var(--navy); }
/* A link that must read as one at a glance — a name the office is meant to
   click to open or fix a record, not just text that happens to be clickable. */
.linklike { color: #1d4ed8; text-decoration: underline; text-underline-offset: 2px; }
.linklike:hover { color: #1e40af; }
button { font: inherit; cursor: pointer; }
input, select, textarea {
  font: inherit; font-size: 13.5px; width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); color: var(--ink);
}
/* Number fields carry no stepper. The arrows are a pixel-hunt at this size,
   and their real cost is the wheel: scrolling the page with the pointer over
   one silently edited the value. See the wheel guard in app.js. */
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Every select wears the house style — native OS chrome never shows. */
select { appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background: var(--panel) 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='%235b6b86' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-100); }
.hidden { display: none !important; }

/* Login — the card floats on the brand's dark ground, like Acorvia. */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--navy); }
.login-card {
  background: var(--panel); padding: 32px; border-radius: 14px; box-shadow: var(--shadow);
  width: 100%; max-width: 380px;
}
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--navy); color: var(--brand-ink); border: 1px solid var(--navy);
  padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px; line-height: 1.45;
  text-decoration: none;
}
.btn:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--bg); }
.btn.danger { background: transparent; color: var(--danger); border-color: #EBC3BB; }
.btn.danger:hover { background: var(--coral-100); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }

/* The self sign-up look (signup.html), for the screens a new agency's admin
   walks through after it: password and agreements, then two-step setup. */
.su-page { min-height: 100vh; background: #f5f8fc; color: #17324D; line-height: 1.55; }
.su-head { background: #fff; border-bottom: 1px solid #e6eaf1; }
.su-head-inner { max-width: 960px; margin: 0 auto; padding: 0 24px; height: 68px; display: flex; align-items: center; }
.su-head-inner img { height: 30px; width: auto; }
.su-wrap { max-width: 860px; margin: 0 auto; padding: 40px 20px 80px; }
.su-page h1 { font-size: 30px; letter-spacing: -.01em; margin: 0 0 6px; color: #17324D; }
.su-lede { color: #5b6b86; margin: 0 0 28px; font-size: 15px; }
.su-panel { background: #fff; border: 1px solid #e6eaf1; border-radius: 16px; padding: 24px; margin-bottom: 18px; }
.su-panel h2 { font-size: 16px; margin: 0 0 14px; }
.su-page .field label { font-size: 13px; color: #17324D; }
.su-page .field input { padding: 11px 13px; border: 1px solid #e6eaf1; border-radius: 10px; font-size: 15px; }
.su-page .field input:focus { outline: 2px solid #22af2c; outline-offset: 0; border-color: #22af2c; }
.su-page .field input:disabled { background: #f5f8fc; color: #5b6b86; }
.su-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.su-btn { display: block; width: 100%; font-weight: 600; border-radius: 10px; padding: 13px 24px; cursor: pointer; border: none; font-size: 15px; background: #22af2c; color: #fff; }
.su-btn:hover { background: #1c9626; }
.su-btn:disabled { opacity: .6; cursor: default; }
.su-steps { display: flex; gap: 8px; margin: 0 0 18px; font-size: 13px; color: #5b6b86; flex-wrap: wrap; }
.su-steps b { color: #1c9626; }
@media (max-width: 560px) { .su-grid { grid-template-columns: 1fr; } }

/* App shell */
/* Menu and page scroll independently: the shell is viewport-height and each
   column manages its own overflow, so a long list never scrolls the menu away
   (and a long menu never scrolls the page). */
.shell { display: grid; grid-template-columns: 228px 1fr; height: 100vh; overflow: hidden; }
/* The rail is the brand's dark ground — light lettering, the active screen in
   CareBOS green. */
.sidebar { background: var(--navy); color: #C7D0D9; padding: 16px 12px; display: flex; flex-direction: column; overflow-y: auto; }
.sidebar .brand { font-weight: 700; font-size: 18px; padding: 6px 10px 16px; color: #fff; }
.brand-logo { width: 148px; max-width: 100%; height: auto; display: block; }
.login-logo { width: 190px; max-width: 72%; height: auto; display: block; margin: 0 auto 10px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sidebar .search { background: var(--navy-2); border: 1px solid rgba(247,249,245,.14); color: #F7F9F5; font-size: 13px; }
.sidebar .search::placeholder { color: #8FA0B0; }
.sidebar .search:focus { border-color: var(--green); box-shadow: none; }
.nav a { display: block; padding: 8px 12px; border-radius: 8px; color: #C7D0D9; text-decoration: none; margin-bottom: 1px; font-size: 13.5px; }
.nav a:hover { background: rgba(247,249,245,.08); color: #fff; }
/* The screen you are on: a green edge on a lifted row — the accent's one job
   on the rail. */
.nav a.active { background: var(--navy-2); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--green); }
.sidebar .spacer { flex: 1; }
.settings-group { border-top: 1px solid rgba(247,249,245,.14); padding-top: 8px; margin-bottom: 8px; }
.nav-toggle { display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: none; padding: 8px 12px; border-radius: 8px; color: #8FA0B0; font: inherit; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; cursor: pointer; }
.nav-toggle:hover { color: #fff; }
.nav-toggle.active { color: #fff; }
.nav.submenu, div.submenu { margin-top: 2px; }
.nav.submenu a, .submenu .submenu-flat a { padding-left: 24px; font-size: 13px; }
/* Second-level menu (Financial → Payroll / Billing & Payments / Vendors & Bills):
   a bold collapsible row, its items indented behind a thin rail. */
.nav-subtoggle { display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: none; padding: 8px 12px 8px 24px; border-radius: 8px; color: #C7D0D9; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; margin-bottom: 1px; }
.nav-subtoggle:hover { background: rgba(247,249,245,.08); color: #fff; }
.nav-subtoggle.active { background: var(--navy-2); color: #fff; box-shadow: inset 3px 0 0 var(--green); }
.nav.subnav { margin: 2px 0 4px 24px; border-left: 1px solid rgba(247,249,245,.18); }
.nav.subnav a { padding-left: 14px; font-size: 13px; }
.userbox { border-top: 1px solid rgba(247,249,245,.14); padding-top: 12px; font-size: 13px; color: #A5B2C0; }
.userbox .who { color: #fff; font-weight: 600; }
.userbox a { color: #A5B2C0; }
/* The bug icon by the logo sits on the dark rail — the page's muted grey
   would vanish there. */
.sidebar .brand button { color: #A5B2C0 !important; }
.userbox .btn.secondary { color: #fff; border-color: rgba(247,249,245,.25); }
.userbox .btn.secondary:hover { background: rgba(247,249,245,.08); }
.main { padding: 24px 28px; overflow-y: auto; overflow-x: auto; }
.screen-tabs { margin: -6px 0 16px; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.topbar h2 { margin: 0; font-size: 20px; flex: 1; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; }
.toolbar .search { flex: 1; max-width: 340px; }

/* Table */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
td { vertical-align: middle; }
th { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
/* Shrink-wrap a column to its content (numbers, dates, badges, actions) so
   sparse tables on wide screens don't smear columns apart — the leftover
   width goes to the unmarked text columns instead. Mark the th AND its tds. */
th.sh, td.sh { width: 1%; white-space: nowrap; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--ink); }
th.sorted { color: var(--ink); }
.sort-ind { margin-left: 5px; font-size: 10px; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--bg); }
.select-all-banner { padding: 9px 14px; background: var(--bg); border-bottom: 1px solid var(--line); font-size: 13px; text-align: center; }
.select-all-banner a { color: var(--navy); font-weight: 600; }
tbody tr:last-child td { border-bottom: none; }

/* Status pills: a tint with its dark-ink partner, so colour is never pale
   text on white. */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.badge.ok, .badge.active, .badge.verified { background: var(--green-100); border-color: transparent; color: var(--ok); }
.badge.inactive, .badge.terminated, .badge.discharged, .badge.rejected { background: var(--coral-100); border-color: transparent; color: var(--danger); }
.badge.voided { color: var(--muted); text-decoration: line-through; }
/* Work-waiting count on a rail menu item: a green pill on the dark ground,
   whatever other badge classes the markup carries. */
.badge.nav-badge { background: var(--green); border-color: transparent; color: #fff; text-decoration: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.grid2 label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.grid2 input, .grid2 select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; color: inherit; background: var(--card, #fff); }
.filters { display: flex; gap: 6px; }
.chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted); font-weight: 600; font-size: 13px; }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.bulkrow { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.bulkrow .spacer { flex: 1; }
.bulkrow .sel-count { color: var(--muted); font-size: 13px; }
.pager { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--muted); }
.pager .spacer { flex: 1; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }

/* Tabs — underline in green, lettering in ink. */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab { background: none; border: none; padding: 9px 15px; color: var(--muted); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--green); }
/* Caregiver portal: the tab bar shares the width out so every tab is always on
   screen; past the point where the words fit, it becomes one menu button. */
.portal-tabs { overflow: hidden; }
.portal-tabs[hidden], .portal-tab-menu[hidden], .portal-tab-menu-list[hidden] { display: none; }
.portal-tabs .tab { flex: 1 1 0; min-width: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; padding: 9px 6px; }
.portal-tabs .tab svg { flex: 0 0 auto; }
.tab-count { background: var(--green); color: #fff; border-radius: 10px; font-size: 11px; line-height: 1; padding: 3px 6px; min-width: 18px; text-align: center; }
.portal-tab-menu { position: relative; max-width: 640px; margin: 0 auto; }
.portal-tab-menu-btn { width: 100%; background: none; border: none; display: flex; align-items: center; gap: 8px; padding: 11px 16px; font: inherit; font-weight: 600; font-size: 14px; color: var(--ink); border-bottom: 2px solid var(--green); }
.portal-tab-menu-btn > span:first-of-type { flex: 1; text-align: left; }
.portal-tab-menu-caret { flex: 0 0 auto; color: var(--muted); }
.portal-tab-menu-list { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-top: none; box-shadow: 0 10px 24px rgba(0,0,0,.12); z-index: 50; }
.portal-tab-menu-item { width: 100%; background: none; border: none; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 13px 16px; font: inherit; font-size: 15px; color: var(--ink); text-align: left; }
.portal-tab-menu-item:first-child { border-top: none; }
.portal-tab-menu-item > span:first-of-type { flex: 1; }
.portal-tab-menu-item.active { color: var(--green); font-weight: 600; }

/* Form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 20px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; padding: 0 20px 20px; align-items: center; }
.form-actions .spacer { flex: 1; }

/* Toast + banner */
.toast { position: fixed; bottom: 84px; right: 20px; background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: 13.5px; max-width: 340px; animation: slidein .18s ease; z-index: 100; }
.toast.err { background: var(--danger); color: #fff; margin: 0; } /* the app shell styles a bare .err as red text — keep the toast readable */
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } }
.banner { background: var(--coral-100); color: var(--danger); border: 1px solid #EBC3BB; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13.5px; }

/* Calendar: a white card, with the grid itself sitting on the page's ground so
   the gaps between day boxes read as gridlines. */
.cal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.cal-grid { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.cal-head {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
}

/* Visit chips: a small name card — avatar initials, who is coming, and the
   day's minutes. Green is the usual caregiver; sky is a one-day cover; coral
   an unexplained gap; gold a moved day; a removed day goes quiet and dashed. */
.cal-chip { display: flex; align-items: center; gap: 7px; background: var(--green-100); border: 1px solid rgba(34,175,44,.28); border-radius: 10px; padding: 5px 7px; min-width: 0; }
.cal-chip .avx { width: 24px; height: 24px; border-radius: 50%; background: #cdead3; color: var(--green-dk); font-weight: 700; font-size: 10.5px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.cal-chip .who { min-width: 0; flex: 1; }
.cal-chip .who .nm { display: block; font-weight: 600; font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip .who .sub { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.cal-chip .dots { color: var(--muted); font-weight: 700; flex: 0 0 auto; padding: 0 2px; line-height: 1; }
.cal-chip.cover { background: var(--sky-100); border-color: rgba(46,107,143,.32); }
.cal-chip.cover .avx { background: #d2e5f1; color: var(--sky-ink); }
/* Rulebook: a day that can't be clocked in right now (somebody is already on
   the clock) stays visible, greyed, with the reason on its second line. */
.cal-chip.dim { background: #f1f2f3; border-color: var(--line); opacity: .7; }
.cal-chip.dim .avx { background: #e2e4e7; color: var(--muted); }
.cal-chip.dim .who .sub { color: var(--coral-ink); }
.cal-chip.alert { background: var(--coral-100); border-color: rgba(168,59,40,.3); }
.cal-chip.alert .avx { background: #f5d8d2; color: var(--coral-ink); }
.cal-chip.moved { background: var(--gold-100); border-color: rgba(138,97,21,.3); }
.cal-chip.moved .avx { background: #f0e2c2; color: var(--gold-ink); }
.cal-chip.removed { background: var(--bg); border: 1px dashed var(--line); opacity: .8; }
.cal-chip.removed .nm { text-decoration: line-through; color: var(--muted); font-weight: 500; }

/* Week-board chips: the same soft cards, tinted by what the day needs —
   green is fine, sky is underway, coral needs someone's attention. */
.bd-chip { display: flex; gap: 7px; align-items: flex-start; border-radius: 10px; padding: 6px 8px; font-size: 12px; line-height: 1.35; margin: 3px 0; border: 1px solid transparent; cursor: pointer; white-space: normal; text-align: left; color: var(--ink); }
.bd-chip .bdot { flex: 0 0 auto; margin-top: 1px; }
.bd-green { background: var(--green-100); border-color: rgba(34,175,44,.28); }
.bd-green .bdot { color: var(--green-dk); }
.bd-sky { background: var(--sky-100); border-color: rgba(46,107,143,.32); }
.bd-sky .bdot { color: var(--sky-ink); }
.bd-red { background: var(--coral-100); border-color: rgba(168,59,40,.3); }
.bd-red .bdot { color: var(--coral-ink); }
.bd-red b { color: var(--coral-ink); }
/* Same colors as the calendar chips (.cal-chip.moved): a day brought from another. */
.bd-gold { background: var(--gold-100); border-color: rgba(138,97,21,.3); }
.bd-gold .bdot { color: var(--gold-ink); }
.bd-empty { border-radius: 10px; background: var(--bg); color: var(--muted); text-align: center; padding: 6px 8px; font-size: 12px; margin: 3px 0; }
.board-cell.bd-today { background: rgba(34,175,44,.05); }

/* Caregiver portal forms (direct deposit, W-4): the app's own card and
   fields, with a grey hint under a field, a heading between sections, and a
   checkbox that reads as a sentence. */
.field-hint { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.form-sec { font-weight: 700; font-size: 14px; color: var(--ink); margin: 18px 0 12px; padding-top: 16px; border-top: 1px solid var(--line); }
label.field-check { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-weight: 400; font-size: 14px; color: var(--ink); cursor: pointer; }
label.field-check input { width: auto; flex: 0 0 auto; margin-top: 2px; }
.field.field-checkrow { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: start; }
.field.field-checkrow > input { width: auto; margin: 2px 0 0; }
.field.field-checkrow > label { grid-column: 2; margin: 0; font-weight: 400; font-size: 14px; color: var(--ink); cursor: pointer; }
.field.field-checkrow > .field-hint { grid-column: 2; }

/* Read-only record view: label and value sit next to each other in narrow
   pairs, two or three across, instead of the wide two-column edit grid where a
   value can end up half a screen from its label. */
.view-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 32px; padding: 8px 20px 16px; }
.view-row { display: flex; gap: 12px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.view-row > .k { flex: 0 0 145px; color: var(--muted); font-size: 13px; }
.view-row > .v { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.view-row.full { grid-column: 1 / -1; }

/* Record screens with a side rail (enrollment: the program on the left, its
   preferred attendants on the right). The rail is a quarter of the width. */
.rec-split { display: grid; grid-template-columns: 3fr 1fr; gap: 20px; align-items: start; }
.rec-split > * { min-width: 0; }

@media (max-width: 1100px) {
  /* Too narrow for a quarter-width rail to hold a name — stack it under. */
  .rec-split { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .sidebar { overflow-y: visible; }
  .form-grid { grid-template-columns: 1fr; }
  /* Wide tables (e.g. Agencies, whose right-most cell holds "Log in") would be
     clipped by the card's overflow:hidden on a phone — let them scroll across. */
  .card { overflow-x: auto; }
  /* An iPhone zooms in on a field whose text is under 16px when it is
     tapped, and the page stays zoomed after. */
  input, select, textarea, .grid2 input, .grid2 select { font-size: 16px; }
}

/* Inline button spinner (e.g. payroll Process while the batch builds) */
.btnspin { display:inline-block; width:12px; height:12px; border:2px solid rgba(255,255,255,.4); border-top-color:#fff; border-radius:50%; margin-right:6px; vertical-align:-2px; animation: btnspin .8s linear infinite; }
@keyframes btnspin { to { transform: rotate(360deg); } }

/* --- Dashboard -------------------------------------------------------------
   A grid of widget cards: big number, plain-words name, timeframe chips.
   A card's left edge carries its state — green all clear, gold needs a look,
   coral needs attention now. Wide cards span two columns. */
/* The cards flow and stretch to fill each row, so a row never ends in a hole
   whatever the number of cards showing (a wide card asks for two cards' room). */
.dash-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.dash-grid > .empty, .dash-grid > .banner { flex: 1 1 100%; }
.dash-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 14px; cursor: pointer; position: relative; min-height: 130px; display: flex; flex-direction: column; gap: 4px; flex: 1 1 240px; min-width: 0; }
.dash-card.wide { flex: 2 1 494px; }
/* An all-clear card, shrunk into the strip under the grid. */
.dash-card.tucked { display: none; }
.dash-clear { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 14px; padding: 9px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; }
.dash-clear b { color: var(--green-dk); }
.dash-clear a { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); text-decoration: none; }
.dash-clear a:hover { color: var(--ink); text-decoration: underline; }
.dash-clear a svg { width: 13px; height: 13px; color: var(--green-dk); flex: none; }
/* Nothing to measure: no tick, a quiet dash and lighter words (a solid grey
   that still reads at 4.5:1 on white, not a fade). */
.dash-clear a.unmeasured:not(:hover) { color: #66747A; }
.dash-clear a.unmeasured svg { color: #66747A; }
/* Nothing in the strip earned a tick: the heading is not a green "All clear". */
.dash-clear b.quiet { color: var(--muted); }
.dash-switch { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; font-size: 13px; color: var(--ink); cursor: pointer; vertical-align: middle; }
.dash-switch input { width: auto; margin: 0; }
.dash-card:hover { border-color: var(--navy-2); }
.dash-head { display: flex; align-items: center; gap: 10px; }
.dash-head h3 { margin: 0; flex: 1; font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dash-ico { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.dash-ico svg { width: 15px; height: 15px; }
.t-green { background: var(--green-100); color: var(--green-dk); }
.t-coral { background: var(--coral-100); color: var(--coral-ink); }
.t-gold { background: var(--gold-100); color: var(--gold-ink); }
.t-sky { background: var(--sky-100); color: var(--sky-ink); }
.dash-num { font-size: 34px; font-weight: 700; color: var(--ink); line-height: 1.15; font-variant-numeric: tabular-nums; }
/* Wide cards put the big number top-right, next to the title row. */
.dash-card.wide .dash-num { position: absolute; top: 12px; right: 18px; font-size: 40px; }
.dash-card.wide .dash-head { padding-right: 90px; }
.dash-sub { font-size: 12px; color: var(--muted); }
.dash-notes { font-size: 12.5px; line-height: 1.35; color: var(--coral-ink, #9B2C2C); }
.dash-notes div + div { margin-top: 3px; }
.dash-pill { align-self: flex-start; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; margin-top: 2px; }
.dash-pill.ok { background: var(--green-100); color: var(--green-dk); }
.dash-pill.warn { background: var(--gold-100); color: var(--gold-ink); }
.dash-pill.urgent { background: var(--coral-100); color: var(--coral-ink); }
/* Nothing measured yet — not a clean bill of health. */
.dash-pill.muted { background: var(--bg); color: var(--muted); }
.dash-pill.sky { background: var(--sky-100); color: var(--sky-ink); }
.dash-donut { display: flex; justify-content: center; padding: 2px 0; }
.dash-donut text { fill: var(--ink); font-family: var(--font); }
.dash-ranges { margin-top: auto; padding-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.dash-ranges button { font: inherit; font-size: 11.5px; padding: 4px 11px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.dash-ranges button.active { border-color: var(--sky-ink); color: var(--sky-ink); font-weight: 700; }
.dash-alerts { background: var(--coral-100); border: 1px solid #EBC3BB; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.dash-alerts a { color: var(--coral-ink); font-weight: 600; }
/* Customize mode: cards get a grab handle and controls, ranges hide. */
.dash-grid.editing .dash-card { cursor: grab; }
.dash-grid.editing .dash-card.dragging { opacity: .4; }
.dash-tools { position: absolute; top: 8px; right: 10px; display: flex; gap: 4px; }
.dash-tools button { font: inherit; font-size: 12px; line-height: 1; padding: 4px 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.dash-tools button:hover { color: var(--ink); border-color: var(--navy-2); }

/* Form section dividers — a long form (Agency settings) in readable chunks. */
/* Card-section forms (cfg.cardSections): each section a card, two to a row. */
.sec-form { margin-top: 4px; }
.sec-topbar { display: flex; justify-content: flex-end; margin: -6px 0 12px; }
.sec-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.sec-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px 6px; box-shadow: var(--shadow); }
.sec-card.wide { grid-column: 1 / -1; }
.sec-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.sec-head h3 { margin: 0; font-size: 16px; }
.sec-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.sec-ico { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--green-100, #e8f6ea); color: var(--green-dk, #1c9626); }
.sec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.sec-card.wide .sec-grid { grid-template-columns: 1fr 1fr 1fr; }
.sec-grid .full { grid-column: 1 / -1; }
@media (max-width: 1100px) { .sec-cards { grid-template-columns: 1fr; } .sec-card.wide .sec-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .sec-grid, .sec-card.wide .sec-grid { grid-template-columns: 1fr; } }
.form-section { grid-column: 1 / -1; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-section span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.form-section small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* --- Consumer profile (the mockup header + overview) ----------------------- */
.cp-back { display:inline-flex; align-items:center; gap:6px; color:var(--muted); text-decoration:none; font-size:13px; margin-bottom:10px; }
.cp-back:hover { color: var(--ink); }
.cp-head { display:flex; align-items:flex-start; gap:16px; padding:4px 2px 14px; margin-bottom:6px; }
.cp-avatar { width:56px; height:56px; border-radius:50%; background:var(--green-100); color:var(--green-dk);
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:20px; flex:0 0 auto; }
.cp-title { flex:1; min-width:0; }
.cp-name { font-size:22px; font-weight:700; color:var(--ink); display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.cp-meta { display:flex; gap:16px; flex-wrap:wrap; color:var(--muted); font-size:13px; margin-top:8px; }
.cp-meta .ico { opacity:.75; margin-right:4px; vertical-align:-2px; }
.cp-actions { display:flex; gap:8px; flex-wrap:wrap; }
.cp-care { display:grid; grid-template-columns:repeat(auto-fit, minmax(175px, 1fr)); margin-bottom:14px; padding:0; }
.cp-stat { padding:14px 16px; border-left:1px solid var(--line); }
.cp-stat:first-child { border-left:none; }
.cp-stat label { font-size:11px; letter-spacing:.05em; text-transform:uppercase; color:var(--muted); display:block; margin-bottom:5px; }
.cp-stat .v { font-size:15px; font-weight:600; color:var(--ink); }
.cp-cards { display:grid; grid-template-columns:repeat(auto-fill, minmax(360px, 1fr)); gap:14px; align-items:start; }
.cp-card h3 { margin:0 0 12px; font-size:15px; display:flex; align-items:center; gap:8px; }
.cp-card h3 .ico { color:var(--green-dk); }
.cp-punch-body { display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.cp-punch-count { font-size:15px; font-weight:600; color:var(--ink); margin-bottom:2px; }
.cp-punch-text { min-width:0; flex:1 1 150px; }
.cp-punch .dash-ranges { margin-top:12px; }
.cp-edit-ico { margin-left:auto; background:none; border:none; padding:2px 4px; color:var(--muted); cursor:pointer; border-radius:6px; display:inline-flex; }
.cp-edit-ico:hover { color:var(--navy); background:var(--bg); }
.cp-status-pill { cursor:pointer; }
.cp-status-menu { position:absolute; top:calc(100% + 6px); left:0; background:var(--panel); border:1px solid var(--line); border-radius:10px; box-shadow:var(--shadow); padding:6px; min-width:170px; z-index:60; display:flex; flex-direction:column; gap:2px; }
.cp-status-menu button { display:flex; align-items:center; gap:9px; padding:7px 10px; border:none; background:none; border-radius:8px; font:inherit; font-size:13.5px; font-weight:400; color:var(--ink); cursor:pointer; text-align:left; }
.cp-status-menu button:hover { background:var(--bg); }
.cp-status-menu button.current { background:var(--green-100); font-weight:600; }
.cp-status-menu .dot { width:10px; height:10px; border-radius:50%; flex:0 0 auto; }
.cp-kv { display:grid; grid-template-columns:1fr 1fr; gap:12px 16px; }
.cp-kv .full { grid-column:1 / -1; }
.cp-kv label { font-size:11.5px; color:var(--muted); display:block; margin-bottom:2px; }
.cp-kv .v { font-size:13.5px; color:var(--ink); }
.cp-kv .v.none { color:var(--muted); }
.cp-attn-row { display:flex; align-items:center; gap:12px; padding:11px 2px; border-top:1px solid var(--line); cursor:pointer; }
.cp-attn-row:first-of-type { border-top:none; }
.cp-attn-row:hover { background:var(--bg); }
.cp-attn-row .t { flex:1; min-width:0; }
.cp-attn-row .t b { display:block; font-size:13.5px; }
.cp-attn-row .t span { font-size:12.5px; color:var(--muted); }

/* --- List page chrome (stat cards + richer rows) --------------------------- */
.list-sub { color: var(--muted); font-size: 13.5px; margin: -8px 0 14px; }
.ls-cards { display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:14px; margin-bottom:16px; }
.ls-card { display:flex; align-items:center; gap:14px; padding:16px 18px; }
.ls-card label { font-size:12.5px; color:var(--muted); display:block; }
.ls-card .n { font-size:24px; font-weight:700; color:var(--ink); line-height:1.2; }
.ls-card span:last-child > span, .ls-card > div > span { font-size:12px; color:var(--muted); }
.lc-name { display:flex; align-items:center; gap:10px; }
.lc-avatar { width:32px; height:32px; border-radius:50%; background:var(--green-100); color:var(--green-dk);
  display:inline-flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; flex:0 0 auto; }
.lc-name small { display:block; color:var(--muted); font-size:11.5px; font-weight:400; }

/* Permission grid (Roles) — one row per entity, one checkbox per action. */
.permgrid { font-size: 13px; }
.permgrid th, .permgrid td { padding: 7px 10px; }
.permgrid th.act { text-align: center; width: 78px; }
.permgrid td.act { text-align: center; }
.permgrid td.act input { width: auto; margin: 0; cursor: pointer; }
.permgrid td.act span { color: var(--line); }
.permgrid tr.grp td { background: var(--bg); font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); padding: 8px 10px; }
.permgrid td.ent { font-weight: 500; }
.permgrid td.more { width: 40%; }
.permgrid td.more label { display: inline-flex; align-items: center; gap: 5px; margin-right: 14px; white-space: nowrap; }
.permgrid td.more label input { width: auto; margin: 0; cursor: pointer; }
.permgrid input:disabled { cursor: default; opacity: .5; }

/* Caregiver profile pictures: the initial's circle, filled by the photo when there is one. */
.cp-avatar.has-photo, .lc-avatar.has-photo { background:#e6ebf1; overflow:hidden; padding:0; }
.cp-avatar img, .lc-avatar img { width:100%; height:100%; object-fit:cover; display:block; border-radius:50%; }
.cp-avatar-wrap { display:flex; flex-direction:column; align-items:center; gap:4px; flex:0 0 auto; }
.cp-avatar-edit { cursor:pointer; }
.cp-avatar-edit:hover { box-shadow:0 0 0 3px var(--green-100), 0 0 0 4px var(--green-dk); }
.cp-avatar-remove { font-size:11.5px; color:var(--muted); }

/* Ask CareBOS: the round bubble that sits in the corner of every screen. */
.ask-fab { position: fixed; right: 20px; bottom: 20px; width: 52px; height: 52px; border-radius: 50%;
  background: var(--navy); color: #fff; border: none; cursor: pointer; display: flex; align-items: center;
  justify-content: center; box-shadow: 0 4px 14px rgba(13, 36, 64, .35); z-index: 90;
  transition: transform .12s ease, box-shadow .12s ease; padding: 0; overflow: hidden; }
.ask-fab:hover { transform: scale(1.06); box-shadow: 0 6px 18px rgba(13, 36, 64, .45); }
.ask-fab svg { width: 26px; height: 26px; }

/* The Ask CareBOS chat window the corner bubble opens. */
.ask-pop { position: fixed; right: 20px; bottom: 84px; width: 370px; max-width: calc(100vw - 40px);
  height: min(540px, calc(100vh - 120px)); display: flex; flex-direction: column; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 34px rgba(13, 36, 64, .28);
  z-index: 95; overflow: hidden; }
.ask-pop-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--navy);
  color: #fff; font-weight: 600; font-size: 14.5px; }
.ask-pop-head svg { width: 20px; height: 20px; flex: none; }
.ask-pop-head button { background: none; border: none; color: #fff; font-size: 20px; line-height: 1;
  cursor: pointer; padding: 2px 4px; opacity: .8; }
.ask-pop-head button:hover { opacity: 1; }
.ask-pop-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.ask-pop-foot { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.ask-pop-foot input { flex: 1; }

/* --- administer: Test Checklist (ticket board look) --- */
.tcl-head { display:flex; align-items:flex-start; gap:14px; margin-bottom:16px; }
.tcl-head .ico { width:40px; height:40px; border-radius:10px; background:var(--green-100); color:var(--green-dk); display:flex; align-items:center; justify-content:center; flex:0 0 auto; }
.tcl-head .eyebrow { font-size:12px; color:var(--muted); font-weight:600; }
.tcl-head h2 { margin:0; font-size:26px; }
.tcl-head p { color:var(--muted); margin:6px 0 0; font-size:13.5px; max-width:760px; }
.tcl-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:16px; }
.tcl-toolbar .search { width:360px; max-width:100%; }
.tcl-toolbar select { width:auto; }
.tcl-layout { display:grid; grid-template-columns:minmax(0,1fr) 360px; gap:16px; align-items:start; }
@media (max-width: 1100px) { .tcl-layout { grid-template-columns:1fr; } }
.tcl-sec { margin-bottom:16px; }
.tcl-sec-head { display:flex; align-items:center; gap:10px; padding:11px 16px; background:var(--sec-bg, var(--bg)); border-bottom:1px solid var(--line); }
.tcl-sec-head .dot { width:12px; height:12px; border-radius:50%; border:2px solid var(--sec, var(--muted)); background:var(--sec-fill, transparent); flex:0 0 auto; }
.tcl-sec-head b { font-size:15px; }
.tcl-sec-head .spacer { flex:1; }
.tcl-sec-head .tcl-collapse { background:none; border:none; color:var(--muted); cursor:pointer; font-size:16px; padding:2px 6px; }
.tcl-sec table { width:100%; }
.tcl-sec-body.tcl-scroll { overflow-y:auto; }
.tcl-sec-body.tcl-scroll thead th { position:sticky; top:0; background:var(--panel); z-index:1; box-shadow:0 1px 0 var(--line); }
.tcl-sec th { white-space:nowrap; }
.tcl-sec td { vertical-align:top; }
.tcl-sec td.tcl-id { color:var(--muted); font-size:12.5px; white-space:nowrap; }
.tcl-sec td.tcl-nw { white-space:nowrap; }
.tcl-sec .tcl-t { font-weight:600; }
.tcl-sec .tcl-sub { color:var(--muted); font-size:12.5px; margin-top:2px; white-space:pre-wrap; }
.tcl-box { width:20px; height:20px; border-radius:6px; border:2px solid var(--line); background:#fff; color:#fff; font-size:13px; line-height:1; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; padding:0; }
.tcl-box.on { background:var(--green-dk); border-color:var(--green-dk); }
.tcl-box.dashed { border-style:dashed; cursor:default; }
.tcl-av { display:inline-flex; width:24px; height:24px; border-radius:50%; align-items:center; justify-content:center; font-size:10.5px; font-weight:700; color:#fff; vertical-align:middle; margin-right:6px; }
.tcl-avs { display:inline-flex; }
.tcl-avs .tcl-av { margin-right:-6px; border:2px solid #fff; }
.tcl-actions { white-space:nowrap; text-align:right; }
.tcl-actions a { font-size:12px; margin-left:10px; }
.tcl-more { position:relative; display:inline-block; }
.tcl-menu { position:absolute; right:0; top:calc(100% + 4px); background:var(--panel); border:1px solid var(--line); border-radius:10px; box-shadow:var(--shadow); padding:6px; min-width:200px; z-index:60; display:flex; flex-direction:column; }
.tcl-menu a { display:block; padding:7px 10px; border-radius:7px; font-size:13px; color:var(--ink); text-decoration:none; margin:0; text-align:left; }
.tcl-menu a:hover { background:var(--bg); }
.tcl-menu a.danger { color:var(--danger); }
.tcl-drop { border:2px dashed var(--line); border-radius:10px; padding:18px; text-align:center; color:var(--muted); font-size:13px; cursor:pointer; }
.tcl-drop.over { border-color:var(--green-dk); background:var(--green-100); }
.tcl-prog { height:8px; background:var(--bg); border-radius:999px; overflow:hidden; }
.tcl-prog > div { height:100%; background:var(--green-dk); border-radius:999px; }

/* Schedule board — the planned-day card (Add Shift for …): a header strip and
   a list of choices that open when picked. */
.pd-card{max-width:600px;width:96%;padding:22px 24px;position:relative;max-height:92vh;overflow-y:auto}
.pd-header{display:flex;gap:14px;align-items:center;background:var(--sky-100);border-radius:12px;padding:14px 16px}
.pd-avatar{width:48px;height:48px;border-radius:50%;background:#fff;color:var(--sky-ink);font-weight:700;font-size:16px;display:grid;place-items:center;flex:0 0 auto}
.pd-choice{--pd-bg:var(--panel);--pd-ink:var(--navy);border:1.5px solid var(--line);border-radius:12px;background:var(--pd-bg);margin-top:10px}
.pd-choice.pd-green{--pd-bg:var(--green-100);--pd-ink:var(--green-dk)}
.pd-choice.pd-sky{--pd-bg:var(--sky-100);--pd-ink:var(--sky-ink)}
.pd-choice.pd-purple{--pd-bg:#EFEBFA;--pd-ink:#5B4BC4}
.pd-choice.pd-orange{--pd-bg:var(--gold-100);--pd-ink:var(--gold-ink)}
.pd-choice.pd-red{--pd-bg:var(--coral-100);--pd-ink:var(--danger)}
.pd-choice.pd-teal{--pd-bg:#E3F3F0;--pd-ink:#1D7566}
.pd-choice.open{border-color:var(--pd-ink)}
.pd-head{display:flex;gap:12px;align-items:center;padding:12px 14px;cursor:pointer;user-select:none}
.pd-radio{width:18px;height:18px;border-radius:50%;border:2px solid #c9d2dc;background:#fff;flex:0 0 auto;display:grid;place-items:center}
.pd-choice.open .pd-radio{border-color:var(--pd-ink)}
.pd-choice.open .pd-radio::after{content:'';width:9px;height:9px;border-radius:50%;background:var(--pd-ink)}
.pd-ico{width:40px;height:40px;border-radius:50%;background:#fff;color:var(--pd-ink);display:grid;place-items:center;flex:0 0 auto}
.pd-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.pd-text b{font-size:14.5px;color:var(--navy)}
.pd-text span{font-size:12.5px;color:var(--muted)}
.pd-chev{color:var(--pd-ink);font-size:18px;line-height:1;transition:transform .15s}
.pd-choice.open .pd-chev{transform:rotate(180deg)}
.pd-body{display:none;padding:0 14px 14px 68px}
.pd-choice.open .pd-body{display:block}
.pd-body .field{margin-top:8px}
.pd-body select,.pd-body input,.pd-body textarea,.pd-card textarea{background:#fff}
.pd-grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.pd-count{text-align:right;font-size:12px;color:var(--muted);margin-top:4px}
@media (max-width:560px){.pd-body{padding-left:14px}.pd-grid2{grid-template-columns:1fr}.pd-header{flex-wrap:wrap}.pd-header>div:last-child{flex-basis:100%;text-align:left!important;padding-left:62px}}

/* The first column of a list is a real link to the record (so it can be opened
   in a new tab); it looks exactly like the plain text it replaced. */
a.rowlink, a.rowlink:hover, a.rowlink:visited { color: inherit; text-decoration: none; display: block; }

/* administer → Integrations: the agency pick-list is a <details>; hide its own arrow. */
.int-ag > summary::-webkit-details-marker { display: none; }
.int-ag-list label:hover { background: #f4f7fb; }

/* --- Billing → Overview ------------------------------------------------------
   The filter bar, the Action required list and the money cards. Built from the
   pieces the rest of the app already has (cards, chips, the dashboard's status
   pills, tables); only their arrangement is new. On a phone the cards stack in
   one column and every table scrolls sideways inside its own card. */
.bo-bar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; padding: 14px; margin-bottom: 16px; overflow: visible; }
.bo-bar .filters { flex: 1 1 100%; flex-wrap: wrap; }
.bo-bar .field { margin: 0; min-width: 0; }
.bo-bar .field label { font-size: 12px; }
.bo-bar select { min-width: 160px; max-width: 100%; }
.bo-bar-note { flex: 1; min-width: 180px; color: var(--muted); font-size: 12.5px; padding-bottom: 8px; }
.bo-sec { margin-bottom: 20px; }
.bo-sec-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 2px 8px; }
.bo-sec-head h3 { margin: 0; font-size: 15px; }
.bo-sec-head span { color: var(--muted); font-size: 12.5px; }
.bo-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); gap: 12px; }
.bo-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bo-card label { font-size: 12.5px; color: var(--muted); }
.bo-card .n { font-size: 24px; font-weight: 700; line-height: 1.25; color: var(--ink); font-variant-numeric: tabular-nums; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.bo-card .bo-count { font-size: 12.5px; color: var(--ink); }
.bo-card .bo-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bo-note { margin-top: 10px; padding: 9px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; color: var(--muted); }
.bo-q { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.bo-q:last-child { border-bottom: none; }
.bo-q .bo-q-n { align-self: center; margin: 0; min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.bo-q-what { flex: 1; min-width: 0; }
.bo-q-what a { font-weight: 600; color: var(--ink); }
.bo-q-what div { font-size: 12px; color: var(--muted); }
.bo-q-amt { min-width: 96px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bo-q-old { min-width: 132px; font-size: 12.5px; }
.bo-q-old div { font-size: 11.5px; color: var(--muted); }
.bo-q-go { font-weight: 600; white-space: nowrap; }
.bo-detail-head, .bo-back-bar { margin: -6px 2px 10px; font-size: 13.5px; }
.bo-detail-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px 10px; }
.bo-detail-top h3 { margin: 0 0 2px; font-size: 16px; }
.bo-detail-top #boDetailTotal { font-size: 13px; color: var(--muted); }
.bo-detail-top #boDetailTotal b { color: var(--ink); }
.bo-detail-help { padding: 0 16px 12px; font-size: 12.5px; color: var(--muted); max-width: 900px; }
.bo-scroll { overflow-x: auto; border-top: 1px solid var(--line); }
#boDetailTable tbody tr { cursor: default; }
/* Profit and labor cost: the performance cards' final / estimated line, the
   program bars, the two profitability tables and a row's summary tiles. The
   gold "Estimated" pill, the status pills and the tints are the app's own. */
.bo-split { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.bo-split .dash-pill, .bo-card .bo-band, td .bo-band, .bo-tile .dash-pill { align-self: center; margin-top: 0; white-space: nowrap; }
.bo-sec-foot { padding: 10px 14px; font-size: 12.5px; color: var(--muted); }
.bo-sec > div > .bo-sec-foot { padding: 8px 2px 0; }
.bo-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th.bo-num { text-align: right; }
#boProgTable, #boClientTable { font-size: 13px; }
#boProgTable th, #boProgTable td, #boClientTable th, #boClientTable td { padding: 9px 8px; }
#boProgTable th:first-child, #boProgTable td:first-child, #boClientTable th:first-child, #boClientTable td:first-child { padding-left: 14px; }
#boProgTable th:last-child, #boProgTable td:last-child, #boClientTable th:last-child, #boClientTable td:last-child { padding-right: 14px; }
#boProgTable th, #boClientTable th { white-space: normal; vertical-align: bottom; letter-spacing: .02em; }
#boProgTable td:first-child { min-width: 170px; }
.bo-profit-table { font-size: 13px; }
.bo-profit-table th, .bo-profit-table td { padding: 9px 8px; }
.bo-profit-table th:first-child, .bo-profit-table td:first-child { padding-left: 14px; }
.bo-profit-table th:last-child, .bo-profit-table td:last-child { padding-right: 14px; }
.bo-profit-table th { white-space: normal; vertical-align: bottom; letter-spacing: .02em; }
.bo-basis { display: inline-block; min-width: 150px; max-width: 230px; white-space: normal; border-radius: 8px; line-height: 1.3; padding: 3px 8px; }
#boProgTable tbody tr, #boClientTable tbody tr { cursor: default; }
#boProgTable tfoot td, #boClientTable tfoot td { font-weight: 700; border-top: 2px solid var(--line); background: var(--bg); }
.bo-row-note { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: normal; }
.bo-bars { padding: 14px 16px 6px; }
.bo-bar-row { display: grid; grid-template-columns: minmax(90px, 200px) 1fr minmax(84px, auto); gap: 10px; align-items: center; margin-bottom: 8px; }
.bo-bar-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bo-bar-track { position: relative; display: flex; height: 18px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.bo-seg { display: block; height: 100%; }
.bo-seg.wages { background: var(--navy); }
.bo-seg.taxes { background: var(--sky-ink); }
.bo-seg.profit { background: var(--green); }
.bo-seg.loss { background: repeating-linear-gradient(135deg, var(--coral-ink) 0 5px, #d97b6b 5px 10px); }
.bo-bar-track .bo-seg.loss { position: absolute; top: 0; min-width: 3px; }
.bo-bar-num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13px; }
.bo-bar-num.neg { color: var(--danger); }
.bo-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.bo-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bo-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.bo-client-bar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; padding: 12px 14px; }
.bo-client-bar input[type=search] { width: 220px; max-width: 100%; }
.bo-client-bar .filters { flex: 1 1 auto; flex-wrap: wrap; margin: 0; }
.bo-chip-n { font-weight: 500; opacity: .75; margin-left: 2px; }
.bo-busy { opacity: .55; }
/* Against the target gross margin: at or above it, below it, losing money. */
tr.bo-band-green td { background: var(--green-100); }
tr.bo-band-amber td { background: var(--gold-100); }
tr.bo-band-red td { background: var(--coral-100); }
.bo-key { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; color: var(--ink); }
.bo-key.bo-band-green { background: var(--green-100); } .bo-key.bo-band-amber { background: var(--gold-100); } .bo-key.bo-band-red { background: var(--coral-100); }
.bo-est-mark { display: inline-block; padding: 0 6px; border-radius: 999px; font-size: 10.5px; font-weight: 600; background: var(--gold-100); color: var(--gold-ink); border: 1px solid rgba(138,97,21,.25); vertical-align: 1px; }
.bo-est-mark.bo-denied-mark { background: var(--coral-100); color: var(--coral-ink); border-color: rgba(168,59,40,.25); }
.bo-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 8px; padding: 0 16px 12px; }
.bo-tile { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.bo-tile label { display: block; font-size: 11.5px; color: var(--muted); }
.bo-tile > div { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .bo-bar-row { grid-template-columns: 1fr auto; }
  .bo-bar-track { grid-column: 1 / -1; grid-row: 2; }
  .bo-client-bar input[type=search] { width: 100%; }
  .bo-cards { grid-template-columns: 1fr; }
  .bo-bar .field { flex: 1 1 45%; }
  .bo-bar .field select, .bo-bar .field input { width: 100%; min-width: 0; }
  .bo-q { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "n what amt" ". old go"; gap: 4px 12px; align-items: start; }
  .bo-q .bo-q-n { grid-area: n; align-self: start; }
  .bo-q-what { grid-area: what; }
  .bo-q-amt { grid-area: amt; min-width: 0; }
  .bo-q-old { grid-area: old; min-width: 0; }
  .bo-q-go { grid-area: go; text-align: right; }
  .bill-tabs { overflow-x: auto; }
  .bill-tabs .tab { white-space: nowrap; }
}

/* Users & Roles: a row's actions behind one three-dot button. */
.umenu-btn { background: none; border: 1px solid transparent; border-radius: 8px; font-size: 20px; line-height: 1; padding: 4px 10px; cursor: pointer; color: var(--navy); }
.umenu-btn:hover, .umenu-btn[aria-expanded="true"] { background: var(--bg); border-color: var(--line); }
.umenu-list { position: fixed; z-index: 900; min-width: 190px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 6px; text-align: left; white-space: nowrap; }
.umenu-list a, .umenu-list .linked-locked { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; font-size: 14px; }
.umenu-list a:hover, .umenu-list a:focus { background: var(--bg); outline: none; }
