/*
  Perch design system, ported from the Claude Design handoff (TaxCRM.dc.html, Login.dc.html).
  Strict CSP (style-src 'self') forbids inline styles, so every visual rule lives here as a class.
  Breakpoints follow the design: mobile < 760px, wide header >= 1380px.
*/

/*
  Fonts are served by Perch itself (no CDNs, CSP font-src 'self'): Barlow (per weight) and Cormorant (variable,
  500-700), latin and latin-ext subsets from Google Fonts, 2026-10-09. SIL Open Font License 1.1; see
  fonts/Barlow-OFL.txt and fonts/Cormorant-OFL.txt. Browsers fetch a latin-ext file only when a page uses those letters.
*/
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/barlow-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/barlow-400-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/barlow-500-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/barlow-500-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/barlow-600-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/barlow-600-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/barlow-700-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/barlow-700-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fonts/barlow-800-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fonts/barlow-800-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Cormorant'; font-style: normal; font-weight: 500 700; font-display: swap; src: url('../fonts/cormorant-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cormorant'; font-style: normal; font-weight: 500 700; font-display: swap; src: url('../fonts/cormorant-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --navy: #040F2E;
  --cream: #FAF8F3;
  --gold: #C9A84C;
  --gold-hover: #B8963A;
  --gold-ink: #8A6A1C;
  --gold-light: #E4C877;
  --tab-ink: #E9E4D8;
  --ink-2: #3F4658;
  --muted: #5D6272;
  --faint: #8C8677;
  --line: #E6E0D2;
  --line-2: #EDE8DC;
  --line-3: #F2EEE5;
  --hover: #FBF9F4;
  --chip: #F3ECD9;
  --pale-gold: #F6F1E4;
  --menu-hover: #F8F4EA;
  --track: #EFEBE2;
  --input-line: #D8D0BE;
  --box-line: #C8BEA6;
  --white: #FFFFFF;
  --danger: #B42318;
  --danger-bg: #FDECEA;
  --warn: #B45309;
  --ok: #11703F;
  --sans: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Cormorant', Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--navy); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--navy); text-decoration: underline; }
input, select, textarea, button { font-family: inherit; font-size: 15px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy); outline-offset: -1px; }
h1, h2, h3 { margin: 0; }
.serif { font-family: var(--serif); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.spacer { flex: 1; }

/* ---------- App shell ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.hdr { position: sticky; top: 0; z-index: 30; background: var(--navy); color: var(--cream); border-bottom: 1px solid var(--navy); padding-top: env(safe-area-inset-top); }
.hdr-row { display: flex; align-items: center; gap: 20px; padding: 0 24px; height: 64px; }
.hdr-home { display: flex; align-items: center; gap: 10px; }
.hdr-home:hover { text-decoration: none; }
.hdr-logo { height: 62px; width: auto; display: block; margin: 0 -10px 0 -12px; }
.hdr-nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(250,248,243,0.3) transparent; min-width: 0; flex: 0 1 auto; align-self: stretch; }
.hdr-tab { padding: 3px 12px 0; display: flex; align-items: center; font-weight: 600; font-size: 15px; color: var(--tab-ink); border-bottom: 3px solid transparent; white-space: nowrap; }
.hdr-tab:hover { color: var(--gold-light); text-decoration: none; }
.hdr-tab.is-active { color: var(--gold-light); border-bottom-color: var(--gold); }
.hdr-tab.is-soon { opacity: 0.45; cursor: default; }
.hdr-tab.is-soon:hover { color: var(--tab-ink); }
.hdr-mid { flex: 1 1 0; display: flex; justify-content: center; min-width: 0; }
.hdr-search { width: 100%; max-width: 360px; height: 38px; border: 1px solid rgba(250,248,243,0.25); border-radius: 8px; padding: 0 14px; background: rgba(250,248,243,0.08); color: var(--cream); }
.hdr-search::placeholder { color: rgba(250,248,243,0.6); }
.hdr-new { white-space: nowrap; flex-shrink: 0; background: var(--gold); color: var(--navy); border: 0; border-radius: 8px; height: 38px; padding: 0 16px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; }
.hdr-new:hover { background: var(--gold-hover); color: var(--navy); text-decoration: none; }

.me { position: relative; flex-shrink: 0; }
.me > summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 10px 4px 4px; border-radius: 999px; }
.me > summary::-webkit-details-marker { display: none; }
.me > summary:hover { background: rgba(250,248,243,0.08); }
.me-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.me-text { display: flex; flex-direction: column; line-height: 1.2; }
.me-name { font-size: 14px; font-weight: 700; white-space: nowrap; }
.me-role { font-size: 12px; color: #C9C3B3; }
.me-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 41; background: var(--white); color: var(--navy); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 40px -16px rgba(4,15,46,0.35); width: 290px; padding: 8px; display: flex; flex-direction: column; }
.me-menu-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px 6px; }
.me-menu-sep { height: 1px; background: var(--line-2); margin: 6px 0; }
.me-menu-item { padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--gold-ink); background: none; border: 0; text-align: left; width: 100%; }
.me-menu-item:hover { background: var(--menu-hover); text-decoration: none; color: var(--gold-ink); }
.me-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.me-user-av { width: 30px; height: 30px; border-radius: 50%; background: var(--chip); color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.me-user-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.me-user-name { font-weight: 600; font-size: 14px; }
.me-user-role { font-size: 12px; color: var(--muted); }

.page { flex: 1; width: 100%; margin: 0 auto; padding: 24px; }
.stack { display: flex; flex-direction: column; gap: 20px; }

@media (max-width: 1599px) {
  /* With every section's tab in the header, the search box needs the extra width. */
  .hdr-mid .hdr-search { display: none; }
}
@media (max-width: 1379px) {
  .me-text { display: none; }
}
@media (max-width: 759px) {
  input, select, textarea { font-size: 16px !important; }
  .hdr-row { gap: 10px; padding: 0 12px; }
  .hdr-nav, .hdr-new { display: none; }
  .page { padding: 16px 12px 100px; }
}

/* ---------- Text ---------- */
.eyebrow { color: var(--muted); font-size: 14px; font-weight: 600; }
.h1 { font-size: 35px; font-weight: 700; font-family: var(--serif); }
.h-client { font-size: 30px; font-weight: 700; font-family: var(--serif); }
.h-section { font-size: 25px; font-weight: 700; font-family: var(--serif); }
.label-caps { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.label-xs { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.label-sm { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.sub { font-size: 13px; color: var(--muted); }
.sub-strong { font-size: 13px; color: var(--muted); font-weight: 600; }
.link-gold { color: var(--gold-ink); font-weight: 600; font-size: 14px; cursor: pointer; background: none; border: 0; padding: 0; }
.link-gold:hover { color: var(--navy); }
.link-gold-sm { font-size: 13px; font-weight: 700; color: var(--gold-ink); white-space: nowrap; cursor: pointer; background: none; border: 0; padding: 0; }
.link-gold-sm:hover { color: var(--navy); }

/* ---------- Home ---------- */
.home-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.home-title { display: flex; flex-direction: column; gap: 4px; }
.banner-pill { background: #FFF1DB; color: #8A5300; font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 999px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--navy); }
.kpi:hover { border-color: var(--gold); text-decoration: none; color: var(--navy); }
.kpi-label { font-size: 14px; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 39px; font-weight: 700; font-family: var(--serif); }
.kpi-sub { font-size: 13px; color: var(--muted); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 20px; align-items: start; }
.two-col-420 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; align-items: start; }

.pipeline-bar { display: block; width: 100%; height: 14px; border-radius: 999px; overflow: hidden; background: var(--track); }
.pipeline-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.pipeline-item { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.pipeline-swatch { width: 10px; height: 10px; border-radius: 3px; }
.pipeline-label { color: var(--ink-2); }
.pipeline-count { font-weight: 700; margin-left: auto; }
.deadline-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line-3); color: var(--navy); }
.deadline-row:hover { background: var(--hover); text-decoration: none; color: var(--navy); }
.left-due { font-size: 14px; font-weight: 700; }
.left-ok { color: var(--muted); }
.left-soon { color: var(--warn); }
.left-late { color: var(--danger); }
.left-done { color: var(--ok); }

/* ---------- Cards and rows ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.card-clip { overflow: hidden; }
.card-hd { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-hd-lg { padding: 18px 20px; }
.card-hd-text { display: flex; flex-direction: column; gap: 2px; }
.card-title { font-weight: 700; font-size: 16px; }
.card-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.card-empty { padding: 24px 20px; color: var(--muted); font-size: 14px; }
.row { display: flex; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line-3); }
.row-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strong { font-weight: 600; }

/* ---------- Stage chips (Component.STAGES) ---------- */
.chip { justify-self: start; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.chip-sm { font-size: 11px; padding: 4px 9px; }
.stage-0 { background: #FFF1DB; color: #8A5300; }
.stage-1 { background: #F3ECD9; color: #040F2E; }
.stage-2 { background: #EFE8FD; color: #5B35B0; }
.stage-3 { background: #FDE8EF; color: #A1204F; }
.stage-4 { background: #E3F5EC; color: #11703F; }
.stage-5 { background: #11703F; color: #FFFFFF; }
.bar-0 { fill: #F0A640; background: #F0A640; }
.bar-1 { fill: #040F2E; background: #040F2E; }
.bar-2 { fill: #8B63E0; background: #8B63E0; }
.bar-3 { fill: #E0588A; background: #E0588A; }
.bar-4 { fill: #3BB273; background: #3BB273; }
.bar-5 { fill: #11703F; background: #11703F; }

/* ---------- Filters and buttons ---------- */
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill { padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; background: var(--white); color: var(--ink-2); border: 1px solid var(--input-line); }
.filter-pill:hover { text-decoration: none; color: var(--ink-2); }
.filter-pill.is-on { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn { height: 38px; padding: 0 16px; border-radius: 8px; font-weight: 700; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover { text-decoration: none; }
.btn-gold { background: var(--gold); color: var(--navy); border: 0; }
.btn-gold:hover { background: var(--gold-hover); color: var(--navy); }
.btn-plain { background: var(--white); color: var(--ink-2); border: 1px solid var(--input-line); }
.btn-plain:hover { color: var(--ink-2); }
.btn-gold-outline { background: var(--white); color: var(--gold-ink); border: 1px solid var(--input-line); padding: 0 14px; }
.btn-gold-outline:hover { background: var(--pale-gold); color: var(--gold-ink); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Clients ---------- */
.avatar { border-radius: 50%; background: var(--chip); color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.avatar-34 { width: 34px; height: 34px; }
.avatar-38 { width: 38px; height: 38px; }
.clients-mobile { display: none; flex-direction: column; }
.clients-desk { overflow-x: auto; }
.clients-grid-inner { min-width: 760px; }
.ctable { display: grid; grid-template-columns: minmax(0, 2fr) 120px 120px 170px 110px 90px; gap: 12px; padding: 12px 20px; align-items: center; }
.ctable-head { padding: 10px 20px; background: var(--hover); border-bottom: 1px solid var(--line-2); font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ctable-row { border-bottom: 1px solid var(--line-3); font-size: 15px; color: var(--navy); }
.ctable-row:hover { background: var(--hover); text-decoration: none; color: var(--navy); }
.ctable-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ctable-name { font-weight: 600; color: var(--gold-ink); }
.ctable-cell { color: var(--ink-2); }
.ctable-fee { text-align: right; font-weight: 600; }
.right { text-align: right; }
.cmob-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-3); min-height: 60px; color: var(--navy); }
.cmob-row:hover { text-decoration: none; color: var(--navy); }
.empty-row { padding: 32px 20px; color: var(--muted); }
@media (max-width: 759px) {
  .clients-mobile { display: flex; }
  .clients-desk { display: none; }
}

/* ---------- Client page ---------- */
.client-card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.client-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.client-who { display: flex; align-items: flex-start; gap: 14px; flex: 1 1 0; min-width: 0; }
.client-badge { width: 52px; height: 52px; border-radius: 12px; background: var(--gold); color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 21px; font-family: var(--serif); flex-shrink: 0; }
.client-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.client-kind { font-size: 13px; color: var(--muted); font-weight: 600; }
.contact-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.contact-item { display: flex; align-items: center; gap: 6px; min-width: 0; }
.contact-value { overflow-wrap: anywhere; }
.contact-empty { color: var(--faint); }
.contact-addr { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.client-actions { display: flex; gap: 8px; flex-shrink: 0; }
.path-head { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; margin-bottom: -10px; }
.due-pill { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.due-pill.left-ok { background: var(--track); }
.due-pill.left-soon { background: #FFF1DB; }
.due-pill.left-late { background: var(--danger-bg); }
.due-pill.left-done { background: #E3F5EC; }
.due-left { font-size: 12px; font-weight: 700; white-space: nowrap; }
.path { display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; }
.path-seg { flex: 1 1 0; min-width: 0; text-align: center; padding: 10px 8px; font-size: 14px; font-weight: 700; line-height: 1.25; text-wrap: balance; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--track); color: var(--muted); }
.path-seg:first-child { border-radius: 999px 6px 6px 999px; }
.path-seg:last-child { border-radius: 6px 999px 999px 6px; }
.path-seg.is-done { background: #EDE2C3; color: var(--navy); }
.path-seg.is-current { background: var(--navy); color: var(--white); }
.fields-wrap { display: flex; flex-direction: column; border-top: 1px solid var(--line-3); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.field-cell { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; min-width: 0; }
.field-value { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.note-form { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line-2); background: var(--hover); }
.note-input { width: 100%; min-height: 72px; border: 1px solid var(--input-line); border-radius: 8px; padding: 10px 12px; resize: vertical; font: inherit; background: var(--white); color: var(--navy); }
.note-row { border-bottom: 1px solid var(--line-3); padding: 12px 20px; display: flex; flex-direction: column; gap: 4px; }
.note-date { font-size: 13px; color: var(--muted); font-weight: 600; }
.note-text { line-height: 1.5; text-wrap: pretty; white-space: pre-wrap; }
.mask { font-family: ui-monospace, Menlo, monospace; letter-spacing: 0.04em; }
@media (max-width: 759px) {
  .client-actions, .path-head, .path { display: none; }
}

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.input { height: 40px; border: 1px solid var(--input-line); border-radius: 8px; padding: 0 12px; background: var(--white); font-weight: 400; color: var(--navy); min-width: 0; width: 100%; }
.input:disabled { opacity: 0.45; }
.span-all { grid-column: 1 / -1; }
.form-error { padding: 12px 14px; border-radius: 10px; background: var(--danger-bg); color: var(--danger); font-size: 14px; font-weight: 600; line-height: 1.4; }
.box { appearance: none; -webkit-appearance: none; margin: 0; width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--box-line); background: var(--white) center / 12px 12px no-repeat; flex-shrink: 0; cursor: pointer; }
.box:checked { background-color: var(--navy); border-color: var(--navy); background-image: url('../img/check.svg'); }

/* ---------- Modal (server-rendered overlay; works without script) ---------- */
.overlay { position: fixed; inset: 0; background: rgba(4,15,46,0.45); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; }
.overlay-close { position: absolute; inset: 0; }
.modal { position: relative; background: var(--white); border-radius: 14px; width: 100%; max-width: 620px; box-shadow: 0 30px 60px -20px rgba(4,15,46,0.5); }
.modal-hd { padding: 18px 22px; border-bottom: 1px solid var(--line-2); font-weight: 700; font-size: 23px; font-family: var(--serif); }
.modal-bd { padding: 20px 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-height: calc(90vh - 140px); overflow-y: auto; }
.modal-ft { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 8px; }
.svc-head { display: grid; grid-template-columns: minmax(0, 1fr) 150px 100px; gap: 10px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.svc { display: grid; grid-template-columns: minmax(0, 1fr) 150px 100px; gap: 10px; align-items: center; padding: 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--white); }
.svc:has(.box:checked) { border-color: var(--navy); background: #F3F8FE; }
.svc:not(:has(.box:checked)) .input { opacity: 0.45; }
.svc-pick { display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; font-size: 15px; font-weight: 400; color: var(--navy); }
.svc-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.svc-label { font-weight: 700; }
.svc-sub { font-size: 12px; color: var(--muted); }
.svc .input { padding: 0 8px; }
.svc-list { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 759px) {
  .modal-bd { grid-template-columns: 1fr; }
  .svc, .svc-head { grid-template-columns: minmax(0, 1fr) 120px 80px; }
}

/* ---------- Sign-in (Login.dc.html) ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 0.9fr) minmax(0, 1.1fr); }
.auth-aside { background: var(--navy); color: var(--cream); display: flex; flex-direction: column; justify-content: space-between; padding: clamp(48px, 4vw, 80px) clamp(56px, 5vw, 96px); gap: 40px; }
.auth-aside-logo { width: clamp(200px, 15vw, 280px); height: auto; display: block; margin-left: -16px; }
.auth-aside-copy { display: flex; flex-direction: column; gap: 24px; max-width: 680px; }
.auth-aside-title { font-family: var(--serif); font-size: clamp(48px, 5.2vw, 84px); font-weight: 600; line-height: 1.02; color: var(--cream); text-wrap: pretty; }
.auth-aside-text { font-size: clamp(18px, 1.5vw, 24px); line-height: 1.55; color: #D9D3C4; text-wrap: pretty; }
.auth-aside-firm { font-size: 14px; color: #A9A291; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 40px; gap: 28px; }
.auth-mobile-bar { display: none; width: 100%; margin: -24px -20px 0; padding: 22px 20px; background: var(--navy); justify-content: center; box-sizing: content-box; }
.auth-mobile-bar img { height: 60px; width: auto; display: block; }
.auth-box { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 28px; }
.auth-heading { display: flex; flex-direction: column; gap: 6px; }
.auth-title { font-family: var(--serif); font-size: 56px; font-weight: 700; line-height: 1.05; }
.auth-title-sm { font-family: var(--serif); font-size: 38px; font-weight: 700; line-height: 1.05; }
.auth-sub { font-size: 19px; color: var(--muted); }
.auth-text { font-size: 16px; color: var(--muted); line-height: 1.5; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-label { display: flex; flex-direction: column; gap: 6px; font-size: 16px; font-weight: 700; color: var(--ink-2); }
.auth-input { height: 58px; border: 1px solid var(--input-line); border-radius: 10px; padding: 0 14px; background: var(--white); font-size: 18px; font-family: inherit; color: var(--navy); font-weight: 400; }
.auth-input.is-code { font-size: 22px; letter-spacing: 0.18em; text-transform: uppercase; font-family: ui-monospace, Menlo, monospace; }
.auth-btn { height: 60px; border: 0; border-radius: 10px; background: var(--gold); color: var(--navy); font-size: 19px; font-weight: 700; font-family: inherit; cursor: pointer; }
.auth-btn:hover { background: var(--gold-hover); }
.auth-btn:disabled { opacity: 0.6; cursor: progress; }
.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; }
.auth-link { font-size: 15px; font-weight: 600; color: var(--gold-ink); }
.auth-link:hover { color: var(--navy); }
.auth-code { height: 56px; font-size: 26px; letter-spacing: 0.4em; text-align: center; font-family: ui-monospace, Menlo, monospace; }
.auth-btn-plain { display: flex; align-items: center; justify-content: center; background: var(--white); border: 1px solid var(--input-line); font-size: 16px; color: var(--navy); }
.auth-btn-plain:hover { background: var(--pale-gold); color: var(--navy); text-decoration: none; }
button.auth-back { background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.qr-box { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.qr { width: 184px; height: 184px; flex-shrink: 0; background: var(--white); }
.qr-ink { fill: var(--navy); }
.qr-key { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.auth-key { font-family: ui-monospace, Menlo, monospace; font-size: 16px; letter-spacing: 0.06em; color: var(--navy); overflow-wrap: anywhere; }
.auth-alt { display: flex; justify-content: center; gap: 6px; font-size: 17px; color: var(--muted); flex-wrap: wrap; }
.auth-alt a { color: var(--gold-ink); font-weight: 700; }
.auth-back { font-size: 15px; color: var(--muted); font-weight: 600; }
.auth-foot { font-size: 13px; color: var(--faint); text-align: center; }
.auth-foot a { color: var(--gold-ink); }
.auth-note { font-size: 14px; color: var(--muted); line-height: 1.5; border-top: 1px solid var(--line); padding-top: 18px; }
@media (max-width: 899px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
  .auth-main { padding: 24px 20px 40px; }
  .auth-mobile-bar { display: flex; }
}

/* ---------- Error page ---------- */
.plain-page { max-width: 560px; margin: 15vh auto; padding: 0 20px; display: flex; flex-direction: column; gap: 12px; }

/* ---------- Shared additions (staff views: projects, boards, tasks) ---------- */
.stack-18 { gap: 18px; }
.eyebrow-13 { font-size: 13px; }
.card-900 { max-width: 900px; }
.empty-28 { padding: 28px 20px; }
.hint { font-size: 12px; font-weight: 500; color: var(--muted); }
.input-38 { height: 38px; padding: 0 10px; }
.input-36 { height: 36px; padding: 0 10px; }
.input-32 { height: 32px; padding: 0 8px; border-radius: 6px; font-size: 13px; font-weight: 600; }
.input-soft { background: var(--hover); padding: 0 12px; }
.select-strong { font-weight: 600; width: auto; }
.btn-36 { height: 36px; padding: 0 14px; }
.btn-34 { height: 34px; padding: 0 12px; }
.btn-block { width: 100%; height: 48px; }
.btn-row-end { justify-content: flex-end; }
.btn-danger { background: var(--danger); color: var(--white); border: 0; }
.btn-danger:hover { background: #9A1D14; color: var(--white); }
.btn-danger-outline { background: var(--white); color: var(--danger); border: 1px solid #F3C6C1; }
.btn-danger-outline:hover { background: #FEF3F2; color: var(--danger); }
.btn-xs { height: 30px; padding: 0 10px; border: 1px solid var(--input-line); border-radius: 6px; background: var(--white); color: var(--gold-ink); font-size: 13px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; white-space: nowrap; flex-shrink: 0; }
.btn-xs:hover { background: var(--pale-gold); color: var(--gold-ink); text-decoration: none; }
.form-panel { padding: 16px 20px; border-bottom: 1px solid var(--line-2); background: var(--hover); display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.form-panel .field .hint { margin-top: 2px; }
.avatar-22 { width: 22px; height: 22px; font-size: 9px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 32px); background: var(--navy); color: var(--white); padding: 12px 18px; border-radius: 10px; font-weight: 600; font-size: 14px; z-index: 60; box-shadow: 0 12px 30px -10px rgba(4,15,46,0.5); animation: toast-out 0.3s ease 2.6s forwards; }
@keyframes toast-out { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .toast { animation-duration: 0s; } }

/* Custom checkbox as a button (2.9): tasks and document checklists submit a form when clicked. */
.tick { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--box-line); background: var(--white) center / 12px 12px no-repeat; flex-shrink: 0; cursor: pointer; padding: 0; display: inline-block; }
.tick.is-on { background-color: var(--navy); border-color: var(--navy); background-image: url('../img/check.svg'); }
.tick.is-on.tick-green { background-color: var(--ok); border-color: var(--ok); }

/* Native progress bars (2.13): the value attribute sets the fill, so no inline style is needed. */
.meter { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: 999px; background: var(--track); overflow: hidden; --meter: #3BB273; }
.meter::-webkit-progress-bar { background: var(--track); border-radius: 999px; }
.meter::-webkit-progress-value { background: var(--meter); border-radius: 999px; }
.meter::-moz-progress-bar { background: var(--meter); border-radius: 999px; }
.meter-5 { height: 5px; }
.meter-6 { height: 6px; }
.meter-8 { height: 8px; }
.meter-10 { height: 10px; }
.meter-green { --meter: #3BB273; }
.meter-amber { --meter: #F0A640; }
.meter-gold { --meter: var(--gold); }

/* Five-step workflow palette (2.4): closes, onboarding, 1099s, year end. */
.wf-0 { background: #FFF1DB; color: #8A5300; }
.wf-1 { background: #F3ECD9; color: #040F2E; }
.wf-2 { background: #EFE8FD; color: #5B35B0; }
.wf-3 { background: #FDE8EF; color: #A1204F; }
.wf-4, .wf-done { background: #E3F5EC; color: #11703F; }
.wf-none { background: var(--track); color: var(--ink-2); }
.wf-bar-0 { background: #F0A640; }
.wf-bar-1 { background: #040F2E; }
.wf-bar-2 { background: #8B63E0; }
.wf-bar-3 { background: #E0588A; }
.wf-bar-4 { background: #3BB273; }
.chip-xs { font-size: 11px; padding: 2px 8px; }
.chip-tag { font-size: 11px; padding: 2px 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; align-self: flex-start; }
.tag-danger { background: var(--danger-bg); color: var(--danger); }
.kind-tx, .kind-ye { background: #F3ECD9; color: #040F2E; }
.kind-bk { background: #E3F5EC; color: #11703F; }
.kind-ob { background: #FFF1DB; color: #8A5300; }
.kind-nn { background: #EFE8FD; color: #5B35B0; }
a.chip:hover { text-decoration: none; filter: brightness(0.97); }

/* ---------- Client page: project paths and documents (3.3) ---------- */
.path-block { display: flex; flex-direction: column; gap: 10px; }
.path-block .path-head { margin-bottom: 0; }
.path-team { font-size: 12px; font-weight: 600; color: var(--muted); }
a.path-seg:hover { text-decoration: none; filter: brightness(0.96); }
a.path-seg.is-done, a.path-seg.is-done:hover { color: var(--navy); }
a.path-seg.is-current, a.path-seg.is-current:hover { color: var(--white); }
a.path-seg:not(.is-done):not(.is-current):not(.is-complete):hover { color: var(--muted); }
.path-seg.is-complete, a.path-seg.is-complete:hover { background: var(--ok); color: var(--white); }
.fields-wrap > .label-caps { padding-top: 14px; }
.mob-stage { display: none; flex-direction: column; gap: 8px; }
.mob-stage-name { font-family: var(--serif); font-size: 21px; font-weight: 700; }
.doc-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 20px; border: 0; border-bottom: 1px solid var(--line-3); background: var(--white); color: var(--navy); text-align: left; cursor: pointer; font: inherit; }
.doc-row:hover { background: var(--hover); }
.doc-name { font-weight: 500; }
.doc-tag { font-size: 12px; font-weight: 600; color: var(--muted); }
.doc-status { font-size: 13px; font-weight: 600; white-space: nowrap; }
.doc-status.is-in { color: var(--ok); }
.doc-status.is-missing { color: var(--warn); }
@media (max-width: 759px) {
  .mob-stage { display: flex; }
}

/* ---------- Project page (3.4) ---------- */
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; color: var(--muted); flex-wrap: wrap; }
.crumbs a { color: var(--gold-ink); }
.proj-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.proj-line { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.proj-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.due-form { display: flex; align-items: center; gap: 6px; }
.due-input { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 6px 2px 10px; border-radius: 999px; background: var(--chip); color: var(--navy); }
.due-input.left-soon { background: #FFF1DB; color: var(--warn); }
.due-input.left-late { background: var(--danger-bg); color: var(--danger); }
.due-input.left-done { background: #E3F5EC; color: var(--ok); }
.due-input input { border: 0; background: transparent; height: 26px; font-size: 12px; font-weight: 700; color: inherit; padding: 0 2px; }
.assign-card { padding: 12px 16px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; align-items: center; }
.assign-label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.assign-form { display: flex; gap: 6px; align-items: center; min-width: 0; }
.assign-form select { flex: 1; min-width: 0; }
.assign-name { font-size: 14px; font-weight: 600; }
.doc-line { display: flex; align-items: center; border-bottom: 1px solid var(--line-3); }
.doc-line .doc-row { border-bottom: 0; }
.doc-toggle { flex: 1; min-width: 0; }
.doc-remove { width: 32px; height: 32px; margin-right: 12px; border: 0; background: none; color: var(--danger); font-size: 20px; font-weight: 700; cursor: pointer; border-radius: 6px; }
.doc-remove:hover { background: #FEF3F2; }
.doc-add { padding: 14px 20px; display: flex; flex-direction: column; gap: 8px; background: var(--hover); }
.doc-add-row { display: flex; gap: 8px; }
.doc-add-row .input { flex: 1; }
.note-meta { font-size: 12px; font-weight: 700; color: var(--muted); }

/* ---------- Task rows (2.14) and the Tasks view (3.6) ---------- */
.task-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 20px; border-bottom: 1px solid var(--line-3); }
.task-row.is-editing { background: var(--hover); border-bottom: 0; }
.task-check { margin-top: 1px; }
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.task-text { font-weight: 500; overflow-wrap: anywhere; }
.task-text.is-done { color: var(--faint); }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--muted); align-items: center; }
.task-client { color: var(--gold-ink); font-weight: 600; }
.task-project { color: var(--ink-2); font-weight: 600; }
.task-repeat { color: #5B35B0; font-weight: 700; }
.task-due { font-size: 13px; font-weight: 700; white-space: nowrap; margin-top: 2px; }
.due-faint { color: var(--faint); }
.due-late { color: var(--danger); }
.due-today { color: var(--warn); }
.due-soon { color: var(--ink-2); }
.due-ok { color: var(--muted); }
.task-edit { padding: 4px 20px 16px 52px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; background: var(--hover); border-bottom: 1px solid var(--line-3); }
.task-add { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.task-add-text { flex: 1; min-width: 200px; width: auto; }
.task-add-client { max-width: 220px; width: auto; }
@media (max-width: 759px) {
  .task-edit { padding: 4px 16px 16px; }
  .task-row { padding: 12px 16px; }
}

/* ---------- Stage confirmation (2.15b) ---------- */
.overlay-top { z-index: 300; }
.confirm { position: relative; background: var(--white); border-radius: 14px; width: 100%; max-width: 460px; padding: 22px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 30px 60px -20px rgba(4,15,46,0.5); }
.confirm-title { font-family: var(--serif); font-size: 22px; font-weight: 700; line-height: 1.3; }
.confirm-sub { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.confirm-box { background: var(--hover); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.confirm-box-hd { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.confirm-task { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }

/* ---------- Boards: Returns and Books (2.6, 2.7, 2.12) ---------- */
.board-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.board-switches { display: flex; gap: 10px; flex-wrap: wrap; }
.seg { display: flex; background: var(--line-2); border-radius: 10px; padding: 3px; }
.seg-item { padding: 7px 16px; border-radius: 8px; font-weight: 700; font-size: 14px; white-space: nowrap; color: var(--ink-2); }
.seg-item:hover { text-decoration: none; color: var(--navy); }
.seg-item.is-on { background: var(--white); color: var(--navy); box-shadow: 0 1px 3px rgba(4,15,46,0.15); }
.stats-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; color: var(--navy); }
a.stat:hover { border-color: var(--gold); text-decoration: none; color: var(--navy); }
.stat.is-on { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.stat-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat-value { font-family: var(--serif); font-size: 30px; font-weight: 700; }
.stat-navy { color: var(--navy); }
.stat-warn { color: var(--warn); }
.stat-danger { color: var(--danger); }
.stat-ok { color: var(--ok); }
.stat-amber { color: #8A5300; }
.stat-purple { color: #5B35B0; }
.filter-bar { padding: 10px 12px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-q { flex: 1 1 220px; width: auto; }
.board-wrap { overflow-x: auto; }
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: start; min-width: 860px; }
.board-col { background: var(--cream); border: 1px solid #E1E8F1; border-radius: 12px; min-height: 480px; overflow: hidden; }
.board-col-bar { height: 4px; }
.board-col-hd { padding: 12px 14px 10px; border-bottom: 1px solid #E1E8F1; display: flex; flex-direction: column; gap: 4px; }
.board-col-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-weight: 800; font-size: 14px; line-height: 1.25; text-wrap: balance; }
.board-count { font-size: 12px; font-weight: 800; color: var(--ink-2); background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; }
.board-col-total { font-size: 12px; font-weight: 600; color: var(--muted); }
.board-col-bd { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.board-card { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 1px 2px rgba(4,15,46,0.04); }
.board-card:hover { border-color: var(--gold); box-shadow: 0 6px 16px -8px rgba(10,102,228,0.35); }
.board-card-link { position: absolute; inset: 0; border-radius: 10px; }
.board-name { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.board-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.form-tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--track); color: var(--ink-2); white-space: nowrap; }
.board-period { font-size: 12px; font-weight: 700; color: var(--ink-2); text-align: right; }
.board-progress { display: flex; flex-direction: column; gap: 4px; }
.board-progress-text { font-size: 11px; font-weight: 600; color: var(--muted); }
.board-foot { display: flex; align-items: center; gap: 8px; padding-top: 7px; border-top: 1px solid var(--line-3); }
.board-left { font-size: 12px; font-weight: 700; white-space: nowrap; }
.board-advance { position: relative; z-index: 1; width: 28px; height: 26px; border-radius: 6px; border: 1px solid #CFE0F6; background: var(--white); color: var(--gold-ink); font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; font-size: 14px; }
.board-advance:hover { background: var(--pale-gold); color: var(--gold-ink); text-decoration: none; }
.board-empty { border: 1.5px dashed var(--input-line); border-radius: 10px; padding: 18px 10px; text-align: center; font-size: 13px; color: var(--faint); }
.board-mobile-only { display: none; }
.gt-board-inner { min-width: 1080px; }
.gt-board { display: grid; grid-template-columns: minmax(200px, 1.6fr) 100px 150px 130px 130px 110px 120px 80px; gap: 12px; padding: 11px 20px; align-items: center; }
.gt-board.ctable-head { padding: 10px 20px; }
.list-progress { display: flex; align-items: center; gap: 8px; }
.list-progress .meter { flex: 1; }
.list-progress-text { font-size: 12px; font-weight: 600; color: var(--muted); }
.list-due { display: flex; flex-direction: column; font-size: 14px; }
.list-period { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.next-btn { font-size: 12px; font-weight: 700; color: var(--gold-ink); padding: 4px 8px; border-radius: 6px; border: 1px solid #CFE0F6; background: var(--white); cursor: pointer; white-space: nowrap; font-family: inherit; }
.next-btn:hover { background: var(--pale-gold); color: var(--gold-ink); text-decoration: none; }
.cmob-board { min-height: 64px; padding: 12px 16px; }
.cmob-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 16px; }
.cmob-sub { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
@media (max-width: 759px) {
  .stats-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg-desk, .board-desk { display: none; }
  .board-mobile-only { display: block; }
}

/* ---------- Home: month-end close card (3.1) ---------- */
.close-progress { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line-2); }
.close-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.close-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line-3); color: var(--navy); }
.close-row:hover { background: var(--hover); text-decoration: none; color: var(--navy); }
.close-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.close-steps { display: flex; gap: 4px; }
.close-step { width: 26px; height: 26px; border-radius: 7px; border: 1.5px solid var(--input-line); background: var(--white); color: var(--muted); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.close-step.is-done { background: #3BB273; border-color: #3BB273; color: var(--white); }
.close-status { min-width: 118px; text-align: center; }

/* ---------- Invoices (3.8) and shared bits ---------- */
.h-card { font-size: 23px; font-weight: 700; font-family: var(--serif); }
.no-access { padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.no-access-text { margin: 0; color: var(--ink-2); max-width: 480px; line-height: 1.5; }
.strong-700 { font-weight: 700; }
.kpis-200 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi-static:hover { border-color: var(--line); }
.kpi-value-35 { font-size: 35px; }
.btn-40 { height: 40px; padding: 0 14px; }
.btn-sm { height: 32px; padding: 0 12px; border-radius: 6px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; font-family: inherit; }
.btn-sm-gold { background: var(--white); color: var(--gold-ink); border: 1px solid var(--input-line); }
.btn-sm-gold:hover { background: var(--pale-gold); color: var(--gold-ink); text-decoration: none; }
.row-link { color: var(--navy); }
.row-link:hover { background: var(--hover); text-decoration: none; color: var(--navy); }
.inv-paid { background: #E3F5EC; color: #11703F; }
.inv-sent { background: #F3ECD9; color: #040F2E; }
.inv-overdue { background: #FDE7E5; color: #B42318; }
.inv-draft { background: var(--track); color: var(--ink-2); }
.inv-scheduled { background: #F1ECFD; color: #5B35B0; }
.inv-void { background: var(--track); color: var(--muted); }
.inv-meta { font-size: 11px; font-weight: 600; color: var(--navy); }
.inv-meta-inline { margin-left: 8px; }
.inv-amount { min-width: 70px; text-align: right; }
.gt-invoices-inner { min-width: 720px; }
.gt-invoices { display: grid; grid-template-columns: 110px minmax(0, 2fr) 110px 110px 110px 100px 120px 64px; gap: 12px; padding: 12px 20px; align-items: center; }
.gt-invoices.ctable-head { padding: 10px 20px; }
.inv-mob { padding: 14px 16px; border-bottom: 1px solid var(--line-3); display: flex; flex-direction: column; gap: 10px; }
.inv-mob-top { display: flex; gap: 12px; align-items: flex-start; }
.inv-mob-amount { font-weight: 800; font-variant-numeric: tabular-nums; }
.inv-mob-actions { display: flex; gap: 8px; align-items: center; }
.inv-editor { padding: 16px 20px; border-bottom: 1px solid var(--line-2); background: var(--hover); display: flex; flex-direction: column; gap: 14px; }
.inv-title { font-family: var(--serif); font-size: 18px; font-weight: 700; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.inv-grid-wide { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.inv-status { display: flex; align-items: center; gap: 8px; height: 38px; }
.inv-next { height: 38px; display: flex; align-items: center; font-weight: 600; color: var(--navy); }
.inv-lines { display: flex; flex-direction: column; gap: 8px; }
.inv-line { display: grid; grid-template-columns: minmax(0, 1fr) 120px 28px; gap: 8px; align-items: center; }
.inv-line .input { width: 100%; }
.inv-line-head { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.inv-remove { border: 0; background: none; color: var(--faint); font-size: 18px; cursor: pointer; width: 28px; height: 28px; border-radius: 6px; }
.inv-remove:hover { background: var(--track); color: var(--danger); }
.inv-line-foot { display: flex; justify-content: space-between; align-items: center; padding-right: 36px; }
.inv-total { font-weight: 800; }
.inv-memo { min-height: 56px; }
.field .note-input, .field textarea { font-weight: 400; font-size: 15px; }

/* ---------- Time tracking card (3.3) ---------- */
.timer-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.timer-note { flex: 1; min-width: 160px; width: auto; }
.time-clock { font-family: ui-monospace, Menlo, monospace; font-size: 20px; font-weight: 700; min-width: 96px; }
.time-elsewhere { padding: 10px 20px; background: #FFF7E8; color: #8A5300; font-size: 13px; font-weight: 600; border-bottom: 1px solid #F3DFB5; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); height: 36px; }
.staff-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 20px; border-bottom: 1px solid var(--line-3); }
.staff-chip { background: var(--pale-gold); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 600; }
.time-row { flex-wrap: wrap; }
.time-dur { min-width: 64px; text-align: right; }
.card-foot { padding: 12px 20px; }

/* ---------- Reports (3.9) ---------- */
.sub-14 { font-size: 14px; }
.sub-12 { font-size: 12px; }
.pill-strong { font-weight: 700; }
.rp-filters { padding: 16px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.rp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.rp-stat { padding: 16px 20px; gap: 4px; }
.rp-stat-label { font-weight: 700; }
.rp-group-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) 80px 130px; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line-3); }
.rp-bar { display: block; width: 100%; height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.rp-navy { fill: #040F2E; }
.rp-sand { fill: #E3D3A3; }
.rp-green { fill: #1F9D5C; }
.rp-red { fill: #E5484D; }
.rp-amber { fill: #F2B544; }
.rp-row { display: flex; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line-3); }
.rp-date { font-size: 13px; color: var(--muted); min-width: 84px; }
.rp-value { min-width: 72px; text-align: right; }
@media (max-width: 759px) {
  .rp-group-row { grid-template-columns: minmax(0, 1fr) auto; }
  .rp-group-row .rp-bar { grid-column: 1 / -1; }
  .rp-row { flex-wrap: wrap; }
}

/* ---------- Admin (3.14) ---------- */
.h-admin { font-family: var(--serif); font-size: 28px; font-weight: 700; }
.admin-pills { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
.admin-pills .filter-pill { white-space: nowrap; }
.card-960 { max-width: 960px; width: 100%; }
.solo-card { padding: 16px 20px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: #FFF7E8; border-color: #F3DFB5; }
.solo-form { display: flex; gap: 8px; align-items: center; }
.solo-code { width: 130px; letter-spacing: 0.1em; }
.issued-card { padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; border-color: var(--gold); }
.issued-code { font-size: 24px; font-weight: 700; letter-spacing: 0.12em; }
.gt-team-inner { min-width: 860px; }
.gt-team { display: grid; grid-template-columns: minmax(0, 1.6fr) 190px 80px 110px 130px 130px; gap: 12px; padding: 12px 20px; align-items: center; }
.gt-team.ctable-head { padding: 10px 20px; }
.is-faded { opacity: 0.6; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.count-link { font-weight: 700; color: var(--gold-ink); text-decoration: underline; text-underline-offset: 3px; }
.link-danger-sm { font-size: 13px; font-weight: 700; color: var(--danger); background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.link-danger-sm:hover { text-decoration: underline; }
.link-faint-sm { font-size: 13px; color: var(--faint); background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.link-faint-sm:hover { color: var(--danger); }
.btn-navy { background: var(--navy); color: var(--cream); border: 0; }
.btn-navy:hover { background: #0B1B45; color: var(--cream); }
.gt-teamreport-inner { min-width: 760px; }
.gt-teamreport { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) 90px 160px 120px 170px; gap: 12px; padding: 11px 20px; align-items: center; }
.gt-teamreport.ctable-head { padding: 10px 20px; }
.clients-desk-always { display: block !important; }
.center { text-align: center; justify-self: center; }
.gt-roles-inner { min-width: 900px; }
.gt-roles { display: grid; grid-template-columns: minmax(0, 1.8fr) repeat(6, 92px); gap: 0; align-items: center; }
.gt-roles.ctable-head { padding: 10px 20px; }
.roles-group { padding: 16px 20px 8px; font-family: var(--serif); font-size: 19px; font-weight: 700; }
.roles-row { padding: 12px 20px 12px 32px; border-bottom: 1px solid var(--line-3); }
.roles-foot { padding: 12px 20px; background: var(--hover); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.perm-cell { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--box-line); background: var(--white) center / 13px 13px no-repeat; cursor: pointer; padding: 0; display: inline-block; vertical-align: middle; }
.perm-cell.is-on { background-color: var(--navy); border-color: var(--navy); background-image: url('../img/check.svg'); }
.perm-cell.is-locked { background-color: #A9A089; border-color: #A9A089; cursor: default; }
.form-error-inset { margin: 16px 20px 0; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; padding: 20px; }
.card-foot-split { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line-2); padding: 14px 20px; }
.pay-text { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.5; max-width: 620px; }
.gt-pricing-inner { min-width: 600px; }
.gt-pricing { display: grid; grid-template-columns: minmax(0, 1.6fr) 140px 220px 80px; gap: 12px; padding: 12px 20px; align-items: center; }
.gt-pricing.ctable-head { padding: 10px 20px; }
.fee-input { width: 110px; height: 34px; }
.sec-row { display: flex; gap: 16px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-3); }
.sec-row-stack { flex-direction: column; align-items: stretch; gap: 8px; }
.sec-networks { min-height: 64px; font-family: ui-monospace, Menlo, monospace; }
.switch { width: 44px; height: 26px; border-radius: 999px; background: var(--input-line); position: relative; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(4,15,46,0.25); }
.switch.is-on { background: var(--navy); }
.switch.is-on::after { left: 21px; }
.switch.is-locked { opacity: 0.7; }
.code-line { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.log-row { align-items: flex-start; }
.digest-count { min-width: 30px; height: 30px; border-radius: 999px; background: var(--track); color: var(--navy); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; }
.log-text { line-height: 1.4; }
.avatar-30 { width: 30px; height: 30px; font-size: 12px; }
.avatar-plain { background: var(--track); color: var(--ink-2); }

/* ---------- Files (3.13) ---------- */
.fs { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.fs-tree { flex: 0 1 300px; min-width: 260px; }
.fs-tree-top { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line-2); }
.h-tree { font-family: var(--serif); font-size: 21px; font-weight: 700; }
.fs-list { max-height: 640px; overflow-y: auto; padding: 6px 0; }
.fs-client { display: flex; align-items: center; gap: 8px; padding: 8px 14px; color: var(--navy); }
.fs-client:hover { background: var(--hover); text-decoration: none; color: var(--navy); }
.fs-client.is-open { background: var(--pale-gold); }
.fs-client-name { flex: 1; min-width: 0; font-size: 14px; }
.fs-caret { width: 16px; color: var(--ink-2); font-size: 12px; }
.fs-tile { width: 26px; height: 26px; border-radius: 7px; background: var(--chip); color: var(--navy); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fs-count { font-size: 12px; color: var(--faint); }
.fs-node { display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin: 0 8px; border-radius: 8px; color: var(--navy); font-size: 14px; font-weight: 500; }
.fs-node:hover { background: var(--pale-gold); text-decoration: none; color: var(--navy); }
.fs-node.is-on { background: var(--chip); }
.fs-node-name { flex: 1; min-width: 0; }
.depth-0 { padding-left: 24px; }
.depth-1 { padding-left: 40px; }
.depth-2 { padding-left: 56px; }
.depth-3 { padding-left: 72px; }
.depth-4 { padding-left: 88px; }
.depth-5 { padding-left: 104px; }
.fs-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--box-line); flex-shrink: 0; }
.fs-dot.is-shared { background: #3BB273; }
.fs-new { display: block; padding: 8px 24px; }
.fs-legend { padding: 12px 16px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.fs-pane { flex: 1 1 520px; min-width: 0; border-width: 2px; }
.fs-head { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; border-bottom: 1px solid var(--line-2); }
.crumb-folder { color: var(--navy); font-weight: 600; }
.fs-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fs-tabs { display: flex; gap: 6px; }
.mini-btn { font-size: 13px; font-weight: 700; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-2); }
.mini-btn:hover, .mini-btn.is-on { background: var(--pale-gold); text-decoration: none; color: var(--ink-2); }
.mini-danger { color: var(--danger); }
.mini-danger:hover, .mini-danger.is-on { color: var(--danger); }
.fs-panel { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--hover); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px; }
.fs-panel .input { width: auto; flex: 1 1 200px; }
.fs-panel.is-danger { background: #FEF3F2; border-color: #F3C6C1; color: #7A271A; font-size: 14px; }
.portal-strip { display: flex; gap: 10px; align-items: center; background: var(--menu-hover); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.upload-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.file-input { font-size: 14px; max-width: 100%; }
.sel-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 20px; background: var(--pale-gold); border-bottom: 1px solid var(--line); font-size: 13px; }
.sel-bar .input { width: auto; }
.ext-tile { width: 40px; height: 30px; border-radius: 6px; font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ext-pdf { background: #FDE7E5; color: #B42318; }
.ext-sheet { background: #E3F5EC; color: #11703F; }
.ext-doc { background: #F3ECD9; color: #040F2E; }
.ext-image { background: #EFE8FD; color: #5B35B0; }
.ext-other { background: var(--track); color: var(--ink-2); }
.ext-dir { background: #FFF1DB; color: #8A5300; }
.file-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 11px 20px; border-bottom: 1px solid var(--line-3); }
.file-row .row-text { flex: 1 1 200px; }
.by-client { color: #5B35B0; font-weight: 600; }
.by-staff { color: var(--ink-2); font-weight: 600; }
.share-toggle { font-size: 13px; font-weight: 700; color: var(--muted); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); }
.share-toggle.is-on { color: #11703F; border-color: #A6DDC0; background: #E3F5EC; }
.share-toggle:hover { text-decoration: none; }
.file-edit { flex-basis: 100%; margin: 4px 0 2px 32px; padding: 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--hover); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.drop-hint { padding: 22px 20px; text-align: center; font-size: 14px; color: var(--muted); }

/* ---------- Client page: portal access (3.3) ---------- */
.issued-inline { padding: 14px 20px; display: flex; flex-direction: column; gap: 6px; background: #FFF7E8; border-bottom: 1px solid #F3DFB5; }
.portal-row { flex-wrap: wrap; }
.portal-edit { padding: 0 20px 14px 66px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line-3); }
.perm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-chip { font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--muted); cursor: pointer; font-family: inherit; }
.perm-chip.is-on { background: var(--chip); color: var(--navy); border-color: #BCD3F2; }
@media (max-width: 759px) {
  .portal-edit { padding: 0 16px 14px; }
}

/* ---------- Messages (3.12) ---------- */
.chat { display: flex; flex-wrap: wrap; overflow: hidden; }
.chat-list { flex: 1 1 280px; max-width: 340px; min-width: 240px; border-right: 1px solid var(--line-2); height: 720px; display: flex; flex-direction: column; }
.chat-list-top { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-list-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.chat-h1 { font-family: var(--serif); font-size: 23px; font-weight: 700; }
.chat-list-body { overflow-y: auto; flex: 1; padding-bottom: 12px; }
.chat-sec { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px 6px; }
.chat-sec-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.chat-sec-empty { display: block; padding: 4px 20px 8px; font-size: 13px; color: var(--faint); }
.chat-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 0 8px; border-radius: 8px; color: var(--navy); }
.chat-item:hover { background: var(--menu-hover); text-decoration: none; color: var(--navy); }
.chat-item.is-on { background: var(--chip); }
.chat-av { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0; }
.chat-av-channel { background: var(--track); color: var(--ink-2); border-radius: 8px; font-size: 15px; }
.chat-av-support { background: #FFF1DB; color: #8A5300; border-radius: 8px; }
.chat-av-client { background: #E3F5EC; color: #11703F; }
.chat-av-dm { background: var(--chip); color: var(--navy); }
.chat-item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-item-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.chat-item-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-name.is-unread { font-weight: 800; }
.chat-item-time { font-size: 11px; color: var(--faint); white-space: nowrap; }
.chat-item-preview { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-unread { min-width: 20px; height: 20px; border-radius: 999px; background: var(--gold); color: var(--navy); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 6px; }
.chat-thread { flex: 999 1 420px; min-width: 0; height: 720px; display: flex; flex-direction: column; }
.chat-thread-hd { padding: 14px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 12px; }
.chat-thread-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-h2 { font-family: var(--serif); font-size: 21px; font-weight: 700; }
.chat-thread-sub { font-size: 13px; color: var(--muted); }
.chat-back, .chat-details-link { display: none; font-size: 14px; font-weight: 700; color: var(--gold-ink); white-space: nowrap; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.chat-pick { margin: auto; color: var(--muted); padding: 40px 20px; text-align: center; }
.chat-sys { align-self: center; font-size: 12px; color: var(--muted); background: var(--menu-hover); border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 12px; text-align: center; }
.chat-msg { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; max-width: 78%; }
.chat-msg.is-mine { align-self: flex-end; align-items: flex-end; }
.chat-msg-meta { font-size: 12px; color: var(--muted); }
.chat-msg-who { font-weight: 700; color: #26364D; }
.bubble { padding: 10px 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--track); color: var(--navy); border-radius: 14px 14px 14px 4px; }
.bubble.is-client { background: #E3F5EC; }
.bubble.is-mine { background: var(--navy); color: var(--white); border-radius: 14px 14px 4px 14px; }
.chat-compose { padding: 12px 16px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; align-items: stretch; }
.chat-input { flex: 1; min-width: 0; min-height: 42px; max-height: 140px; border: 1px solid var(--input-line); border-radius: 10px; padding: 10px 12px; resize: vertical; font: inherit; color: var(--navy); }
.chat-send { height: auto; min-height: 42px; }
.chat-details { flex: 1 1 260px; max-width: 320px; border-left: 1px solid var(--line-2); padding: 20px; display: flex; flex-direction: column; gap: 18px; height: 720px; overflow-y: auto; }
.chat-facts { display: flex; flex-direction: column; gap: 12px; }
.chat-fact { display: flex; flex-direction: column; gap: 3px; }
.chat-route { display: flex; gap: 8px; align-items: center; }
.chat-members { display: flex; flex-direction: column; gap: 10px; }
.chat-member { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.chat-people { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 10px; max-height: 260px; overflow-y: auto; padding: 6px 0; }
.chat-person { display: flex; align-items: center; gap: 10px; padding: 7px 12px; cursor: pointer; }
.chat-person:hover { background: var(--hover); }
.chat-priority { border: 0; padding: 0; margin: 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chat-priority legend { margin-bottom: 6px; }
.chat-priority-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--input-line); font-size: 14px; font-weight: 600; cursor: pointer; }
.chat-help-text { min-height: 110px; }
.modal-540 { max-width: 540px; max-height: 90vh; display: flex; flex-direction: column; }
.modal-bd-1 { grid-template-columns: 1fr; }
.hdr-badge { margin-left: 6px; font-size: 11px; font-weight: 800; background: var(--gold); color: var(--navy); border-radius: 999px; padding: 1px 7px; }
@media (max-width: 759px) {
  .chat-list, .chat-thread, .chat-details { max-width: none; flex-basis: 100%; height: calc(100dvh - 190px); border: 0; }
  .chat-at-list .chat-thread, .chat-at-list .chat-details { display: none; }
  .chat-at-thread .chat-list, .chat-at-thread .chat-details { display: none; }
  .chat-at-details .chat-list, .chat-at-details .chat-thread { display: none; }
  .chat-back, .chat-details-link { display: inline; }
  .chat-msg { max-width: 90%; }
}
@media (min-width: 760px) {
  .chat-back-details { display: none; }
}

/* ---------- Client page: contact changes, engagement, related clients, agreements (3.3) ---------- */
.pending-banner { background: #FFF7E8; border: 1px solid #F3DFB5; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.pending-title { font-size: 14px; font-weight: 800; color: #6B4400; }
.pending-line { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.pending-new { color: var(--navy); }
.pending-form { display: flex; flex-direction: column; gap: 8px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink-2); line-height: 1.45; cursor: pointer; }
.check-row .box { margin-top: 1px; }
.client-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.client-actions form { display: contents; }
.contact-edit { margin-top: 10px; max-width: 760px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.fields-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.eng-panel { margin-top: 12px; padding: 16px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--hover); display: flex; flex-direction: column; gap: 14px; }
.eng-form { max-width: 240px; }
.eng-head { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 12px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.eng-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 12px; align-items: center; background: var(--white); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.eng-row:has(.box:checked) { border-color: var(--navy); }
.rel-row { gap: 12px; }
.rel-name { color: var(--gold-ink); }
.rel-name:hover { color: var(--navy); }
.rel-x { background: none; border: 0; font-size: 18px; color: var(--faint); cursor: pointer; padding: 0 4px; line-height: 1; }
.rel-x:hover { color: var(--danger); }
.avatar-person { background: #EFE8FD; color: #5B35B0; }
.agr-panel { padding: 16px 20px; border-bottom: 1px solid var(--line-2); background: var(--hover); display: flex; flex-direction: column; gap: 12px; }
.agr-pick { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.agr-pick .field { flex: 1 1 240px; max-width: 360px; }
.agr-preview { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; max-height: 220px; overflow-y: auto; font-size: 13px; line-height: 1.55; color: var(--ink-2); background: var(--white); display: flex; flex-direction: column; gap: 10px; }
.agr-warn { font-size: 13px; font-weight: 600; color: #8A5300; }
.agr-row { flex-wrap: wrap; }
.agr-row form { display: inline-flex; }

/* ---------- Reminders (3.7) ---------- */
.rm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 20px; align-items: start; }
.rm-form { padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.rm-label-row { display: flex; justify-content: space-between; gap: 12px; }
.rm-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.rm-chip { padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--menu-hover); border: 1px solid #CFE0F6; color: var(--navy); }
.rm-chip:hover { background: var(--chip); text-decoration: none; color: var(--navy); }
.rm-recipients { border: 1px solid var(--line); border-radius: 10px; max-height: 240px; overflow-y: auto; }
.rm-recipient { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line-3); cursor: pointer; font-weight: 400; color: var(--navy); }
.rm-recipient:last-child { border-bottom: 0; }
.rm-recipient:hover { background: var(--hover); }
.rm-channel { font-size: 14px; font-weight: 700; color: var(--navy); }
.rm-body { min-height: 200px; line-height: 1.5; }
.rm-merge { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); margin-top: -12px; }
.merge-chip { padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--track); color: var(--ink-2); font-family: inherit; }
.rm-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.rm-preview { background: var(--hover); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.rm-preview-body { font-size: 14px; color: #26364D; white-space: pre-wrap; line-height: 1.5; }
.rm-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.rm-row { padding: 14px 20px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--line-3); }
.rm-row:last-child { border-bottom: 0; }
.rm-row-chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rm-to { font-size: 14px; color: var(--ink-2); }
.rm-row-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.rm-row-foot form { display: inline-flex; }
.rm-delete { background: none; border: 0; padding: 0; font-size: 13px; font-weight: 700; color: var(--faint); cursor: pointer; font-family: inherit; }
.rm-delete:hover { color: var(--danger); }

/* ---------- Workshops (3.11) ---------- */
.ws-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.ws-head-text { display: flex; flex-direction: column; gap: 4px; }
.h-page { font-family: var(--serif); font-size: 28px; font-weight: 700; }
.ws-head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ws-form { padding: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.ws-filters { align-items: center; }
.vdivider { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.two-col-440 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 20px; align-items: start; }
.ws-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line-3); color: var(--navy); }
.ws-row:last-child { border-bottom: 0; }
.ws-row:hover { background: var(--hover); text-decoration: none; color: var(--navy); }
.ws-row.is-on { background: #F3F8FE; }
.ws-date { width: 52px; border-radius: 10px; padding: 6px 0; background: var(--pale-gold); display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.ws-month { font-size: 11px; font-weight: 800; color: var(--gold-ink); }
.ws-day { font-family: var(--serif); font-size: 23px; font-weight: 700; line-height: 1; }
.ws-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ws-business { background: var(--chip); color: var(--navy); }
.ws-personal { background: #FDEDE3; color: #9A3A0B; }
.ws-format { background: var(--track); color: var(--ink-2); }
.ws-seats { min-width: 96px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.ws-seat-text { font-size: 13px; white-space: nowrap; }
.ws-seats .meter { width: 96px; }
.ws-detail-top { padding: 20px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--line-2); }
.ws-title { font-family: var(--serif); font-size: 23px; font-weight: 700; }
.ws-desc { font-size: 14px; color: var(--ink-2); line-height: 1.5; margin: 0; }
.ws-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 4px 16px; }
.ws-collected { font-size: 14px; font-weight: 700; color: var(--ok); }
.ws-add { padding: 14px 20px; background: var(--hover); border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 10px; }
.ws-add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ws-add-row .input { flex: 1 1 160px; width: auto; }
.att-row { gap: 10px; flex-wrap: wrap; }
.att-row form { display: inline-flex; }
.chip-btn { border: 0; cursor: pointer; font-family: inherit; }
.link-danger { background: none; border: 0; padding: 0; font-size: 13px; font-weight: 700; color: var(--danger); cursor: pointer; font-family: inherit; }
.ws-search { width: 220px; }
.ws-export-note { display: block; padding: 8px 20px 0; }
.con-row { display: flex; align-items: center; gap: 12px; padding: 8px 20px 8px 0; border-bottom: 1px solid var(--line-3); }
.con-row.is-open { background: var(--hover); border-bottom: 0; }
.con-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 6px 0 6px 20px; color: var(--navy); flex-wrap: wrap; }
.con-main:hover { text-decoration: none; color: var(--navy); }
.con-av { background: var(--track); color: var(--ink-2); font-weight: 800; }
.con-sessions { display: flex; flex-direction: column; min-width: 150px; font-size: 13px; }
.con-detail { padding: 4px 20px 16px 68px; background: var(--hover); border-bottom: 1px solid var(--line-3); display: flex; flex-direction: column; gap: 10px; }
.con-detail form { display: inline-flex; }
.con-history { border: 1px solid var(--line-2); border-radius: 8px; background: var(--white); }
.con-history-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--line-3); }
.con-history-row:last-child { border-bottom: 0; }
@media (max-width: 759px) {
  .con-detail { padding: 4px 16px 16px; }
  .ws-search { width: 100%; }
}
