/* ──────────────────────────────────────────────────────────────────────────
   Folio - Books By Jessica client operations
   Brand: cheerful berry, violet and blush with professional restraint
   Breakpoints:
     Desktop  > 1024px
     Tablet   768 – 1024px  → hamburger drawer
     Phone   ≤ 767px       → mobile-warning, stacked layouts, write-action hides
   ────────────────────────────────────────────────────────────────────────── */

/* ── Design tokens ── */
:root {
  color-scheme: light;
  --color-primary:       #f472b6;   /* blush pink - primary action */
  --color-primary-light: #f9a8d4;
  --color-primary-deep:  #6b46c1;   /* violet */
  --color-accent:        #6b46c1;
  --color-primary-text:  #2d2340;   /* deep plum - headings */
  --error:               #c43d63;

  --bg:            #fffdfd;
  --bg-elev:       #ffffff;
  --bg-tile:       #ffffff;
  --bg-tile-hover: #fadde8;
  --bg-subtle:     #f5f1f6;

  --text:        #2d2340;
  --text-muted:  #766d80;
  --border:      #eadfe8;

  --blue-pale:   #fadde8;
  --blue-deep:   #6b46c1;
  --accent-pale: #fff7c9;
  --yellow:      #fde68a;
  --warning-bg: #fff8e6;
  --warning-border: #e0b85c;
  --warning-text: #6b4a08;
  --ok-bg: #e9f6ec;
  --ok-border: #a9d7b2;
  --ok-text: #1f7a3d;

  --radius:      13px;
  --radius-sm:   9px;
  --shadow:      0 10px 32px rgba(45, 35, 64, .07);
  --shadow-sm:   0 4px 18px rgba(45, 35, 64, .06);

  --serif: 'Fraunces', 'Georgia', 'Times New Roman', serif;
  --sans:  'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:  'DM Mono', ui-monospace, SFMono-Regular, Consolas, monospace;

  --btn-contrast: #3b1730;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --color-primary: #f08abc; --color-primary-light: #d982aa;
  --color-primary-deep: #b69aff; --color-accent: #c1a7ff;
  --color-primary-text: #f5eefa; --error: #f07d9e;
  --bg: #17131d; --bg-elev: #211a29; --bg-tile: #241c2d; --bg-tile-hover: #35263c;
  --bg-subtle: #2d2435;
  --text: #eee7f2; --text-muted: #b7aabd; --border: #44364c;
  --blue-pale: #38263b; --blue-deep: #c1a7ff; --accent-pale: #3a3420; --yellow: #d9b85d;
  --warning-bg: #3b3017; --warning-border: #725d22; --warning-text: #ffe19a;
  --ok-bg: #193b27; --ok-border: #286843; --ok-text: #a9e8bc;
  --shadow: 0 12px 34px rgba(0,0,0,.28); --shadow-sm: 0 5px 20px rgba(0,0,0,.22);
  --btn-contrast: #301324;
}

:root[data-theme="dark"] body { background:radial-gradient(circle at 92% 3%, rgba(107,70,193,.18), transparent 26rem),var(--bg); }
:root[data-theme="dark"] .nav { background:rgba(23,19,29,.96); }
:root[data-theme="dark"] .nav-search-input,
:root[data-theme="dark"] .form-stack input { background:var(--bg-elev); }
:root[data-theme="dark"] table thead th { background:#1c1623; }
:root[data-theme="dark"] table tbody tr:hover { background:var(--bg-tile-hover); }
:root[data-theme="dark"] mark { background:#675825; color:#fff4bd; }
:root[data-theme="dark"] .flash-success { background:#173524; border-color:#286843; color:#a9e8bc; }
:root[data-theme="dark"] .flash-warning { background:#3b3017; border-color:#725d22; color:#ffe19a; }
:root[data-theme="dark"] .flash-error,
:root[data-theme="dark"] .alert-error { background:#411d29; border-color:#80384f; color:#ffc0d1; }
:root[data-theme="dark"] .badge-draft { background:#38313d; color:#d0c4d5; }
:root[data-theme="dark"] .badge-assigned { background:#493c1d; color:#ffe09a; }
:root[data-theme="dark"] .badge-approved { background:#193b27; color:#a9e8bc; }
:root[data-theme="dark"] .badge-returned,
:root[data-theme="dark"] .badge-urgent { background:#47202d; color:#ffc0d1; border-color:#713247; }
:root[data-theme="dark"] .mail-row-failed,
:root[data-theme="dark"] .mail-failure-panel,
:root[data-theme="dark"] .audit-row-alert { background:#351b25; }
:root[data-theme="dark"] .mail-failure-panel { border-color:#713247; }
:root[data-theme="dark"] .mail-failure-panel .card-title { color:#ffc0d1; }
:root[data-theme="dark"] .affiliation-bbj,
:root[data-theme="dark"] .affiliation-bnb { background:#38263b; color:#efc5df; border-color:#60405f; }
:root[data-theme="dark"] .account-hold-editor { background:#411d29; border-color:#80384f; }
:root[data-theme="dark"] .account-hold-toggle { color:#ffc0d1; }
/* A few older staff screens still use inline alert fills.  Keep their
   semantics readable in dark mode rather than allowing a light strip with
   pale text to leak through. */
:root[data-theme="dark"] [style*="background:#fff4f2"],
:root[data-theme="dark"] [style*="background:#fde4ec"],
:root[data-theme="dark"] [style*="background:#fef2f2"] {
  background:#351b25 !important; color:#ffc0d1 !important;
}
:root[data-theme="dark"] [style*="background:#fffbeb"],
:root[data-theme="dark"] [style*="background:#fff8ed"] {
  background:#3b3017 !important; color:#ffe19a !important;
}

@media print {
  :root { color-scheme:light; --bg:#fffdfd; --bg-elev:#fff; --bg-tile:#fff; --text:#2d2340; --text-muted:#766d80; --border:#eadfe8; --color-primary-text:#2d2340; --blue-pale:#fadde8; }
  body { background:#fff !important; color:#2d2340 !important; }
}

/* Admin workflow timeline: compact vertical map + right-side editor. */
.pipeline-legend { display:flex; flex-wrap:wrap; gap:14px; width:min(900px,100%); margin:0 0 16px 32px; color:var(--text-muted); font-size:12px; }
.pipeline-legend .branch { color:var(--color-primary); }
.pipeline-timeline { position:relative; width:min(1000px,100%); padding:8px 32px 20px; overflow:visible; }
.pipeline-connectors { position:absolute; inset:0; z-index:0; overflow:visible; pointer-events:none; }
.pipeline-connector { fill:none; stroke:var(--text-muted); stroke-width:3; opacity:.72; }
.pipeline-connector.branch { stroke:var(--color-primary); stroke-width:3.5; opacity:.9; }
#pipeline-arrow-main path { fill:var(--text-muted); }
#pipeline-arrow-branch path { fill:var(--color-primary); }
.pipeline-stage { display:block; z-index:1; width:min(430px,calc(50% - 38px)); margin:0 0 24px; background:var(--bg-elev); border:1px solid var(--border); border-radius:var(--radius); position:relative; box-shadow:var(--shadow-sm); }
.pipeline-stage summary { list-style:none; cursor:pointer; padding:17px 18px; display:grid; grid-template-columns:auto 1fr auto; gap:10px; align-items:center; min-height:76px; }
.pipeline-stage summary::-webkit-details-marker { display:none; }
.pipeline-stage-copy { min-width:0; display:flex; flex-direction:column; gap:4px; }
.pipeline-stage summary small { color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pipeline-branch { margin-left:auto; border:2px solid var(--color-primary-light); }
.pipeline-out-of-band { margin-left:auto; border-style:dashed; opacity:.82; }
.pipeline-branch .pipeline-dot { background:var(--color-primary); }
.pipeline-branch-label { color:var(--color-primary); font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.automation-cue { display:block; width:max-content; max-width:100%; padding:5px 9px; border-radius:6px; font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.email-cue { color:var(--info-text, #23558a); background:var(--info-bg, #e9f3ff); }
.action-cue { color:var(--ok-text, #237804); background:var(--ok-bg, #e9f6ec); }
.stage-action { display:grid; gap:5px; margin:0 0 14px; padding:12px; border:1px solid var(--ok-border, #a9d7b2); border-radius:var(--radius); background:var(--ok-bg, #e9f6ec); color:var(--text); }
.stage-action strong { font-size:14px; }
.stage-action .eyebrow { color:var(--ok-text); }
.stage-action p { margin:0; color:var(--text-muted); font-size:13px; line-height:1.45; }
.pathway-step { flex:1; min-width:120px; padding:10px 12px; border-radius:8px; text-align:center; font-size:12px; font-weight:600; }
.pathway-step small { display:block; font-size:10px; opacity:.78; }
.pathway-step-done { background:var(--ok-bg); color:var(--ok-text); border:1px solid var(--ok-border); }
.pathway-step-current { background:#7c3a87; color:#fff; border:1px solid #7c3a87; }
.pathway-step-payment { background:#c26420; color:#fff; border:1px solid #d47a32; }
.pathway-step-upcoming { background:#f1edf3; color:#8a8093; border:1px solid transparent; }
:root[data-theme="dark"] .pathway-step-current { background:#873f93; border-color:#9d55a8; }
:root[data-theme="dark"] .pathway-step-payment { background:#a94f16; color:#fff4e5; border-color:#e08137; }
:root[data-theme="dark"] .pathway-step-upcoming { background:#302737; color:#b7aabd; border-color:#44364c; }
.partner-page-header { margin-bottom:14px; }
.partner-page-header h1 { font-size:30px; }
.partner-summary { display:flex; flex-wrap:wrap; gap:8px 24px; margin:0 0 14px; padding:8px 14px; border:1px solid var(--border); border-radius:var(--radius); background:var(--bg-tile); color:var(--text-muted); font-size:13px; box-shadow:var(--shadow-sm); }
.partner-summary strong { color:var(--color-primary-text); font-size:16px; margin-right:4px; }
.partner-return-group { display:grid; gap:8px; margin-top:14px; }
.partner-return-group > h2 { margin:0; font-family:var(--serif); font-size:20px; color:var(--color-primary-text); }
.partner-return-group > .card-subtitle { margin:-5px 0 0; }
.partner-return-card { display:grid; gap:9px; padding:13px 16px; margin-bottom:0; }
.partner-return-head { display:flex; justify-content:space-between; gap:20px; align-items:flex-start; }
.partner-return-head h2 { margin:0 0 2px; font-family:var(--serif); font-size:18px; color:var(--color-primary-text); }
.partner-return-head p { margin:0; color:var(--text-muted); font-size:13px; }
.partner-return-meta { display:flex; align-items:center; justify-content:flex-end; gap:10px; color:var(--text-muted); font-size:11px; white-space:nowrap; }
.partner-return-meta > div { display:flex; align-items:center; gap:7px; }
.partner-pathway { display:flex; gap:6px; overflow-x:auto; padding-bottom:2px; }
.partner-pathway .pathway-step { min-width:105px; padding:6px 8px; line-height:1.2; }
.partner-message { position:relative; width:max-content; max-width:100%; }
.partner-message > summary { list-style:none; cursor:pointer; }
.partner-message > summary::-webkit-details-marker { display:none; }
.partner-message form { position:absolute; z-index:5; right:0; display:flex; gap:8px; align-items:end; width:min(620px,calc(100vw - 90px)); margin-top:7px; padding:10px; border:1px solid var(--border); border-radius:var(--radius); background:var(--bg-elev); box-shadow:var(--shadow); }
.partner-message textarea { flex:1; }
.partner-closed { margin-top:22px; }
.partner-closed > summary { cursor:pointer; color:var(--text-muted); font-weight:700; }
@media(max-width:700px){.partner-return-head{display:grid}.partner-return-meta{justify-content:flex-start;flex-wrap:wrap;white-space:normal}.partner-return-meta>div{flex-wrap:wrap}.partner-message{position:relative}.partner-message form{right:auto;left:0;display:grid;width:calc(100vw - 64px)}}
.deal-next-action { display:block; margin-top:4px; color:var(--text-muted); font-size:11px; line-height:1.35; }
.workflow-gate { display:grid; gap:8px; margin:12px 0; padding:12px; border:1px solid var(--warning-border); border-radius:var(--radius); background:var(--warning-bg); color:var(--warning-text); }
.interim-due-panel { background:var(--warning-bg); border:1px solid var(--warning-border); border-radius:var(--radius); padding:12px; margin-top:5px; display:grid; gap:7px; color:var(--warning-text); }
.interim-due-total { display:flex; justify-content:space-between; border-top:2px solid var(--warning-border); padding-top:7px; font-size:17px; font-weight:800; }
.mail-row-failed { background:#fff4f2; }
.audit-row-alert { background:#fff4f2; }
.mail-failure-panel { border-color:#e8b3a8; background:#fff4f2; }
.mail-failure-panel .card-title { color:#8a2445; }
.pipeline-dot { position:absolute; left:-8px; width:13px; height:13px; border:3px solid var(--bg-elev); border-radius:50%; background:var(--text-muted); box-shadow:0 0 0 2px currentColor; }
.pipeline-plus { border:1px solid var(--border); border-radius:50%; width:28px; height:28px; display:grid; place-items:center; transition:.15s; color:var(--text-muted); }
.pipeline-stage:hover { border-color:var(--color-primary-light); }
.pipeline-stage:hover .pipeline-plus, .pipeline-stage[open] .pipeline-plus { color:var(--btn-contrast); background:var(--color-primary); border-color:var(--color-primary); transform:rotate(45deg); }
.pipeline-stage[open]::before { content:""; position:fixed; inset:0; z-index:998; background:rgba(12,8,15,.42); backdrop-filter:blur(2px); }
.pipeline-stage form { position:fixed; z-index:999; top:0; right:0; bottom:0; width:min(680px,92vw); overflow-y:auto; padding:28px 32px 48px; background:var(--bg-elev); border-left:1px solid var(--border); box-shadow:-18px 0 50px rgba(0,0,0,.22); animation:pipeline-fly-in .2s ease-out; }
@keyframes pipeline-fly-in { from{transform:translateX(30px);opacity:.5} to{transform:translateX(0);opacity:1} }
.pipeline-flyout-head { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-bottom:24px; padding-bottom:18px; border-bottom:1px solid var(--border); }
.pipeline-flyout-head h2 { margin:2px 0 0; font-family:var(--serif); font-size:28px; color:var(--color-primary-text); }
.pipeline-close { border:1px solid var(--border); background:var(--bg); color:var(--text); border-radius:50%; width:38px; height:38px; font-size:25px; line-height:1; cursor:pointer; }
.pipeline-close:hover { background:var(--bg-tile-hover); }
.pipeline-add { width:min(900px,100%); margin-left:32px; }
.trigger-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:12px 0; }
.trigger-card { background:var(--bg); border:1px dashed var(--border); padding:12px; border-radius:var(--radius); }
.trigger-card h3 { font-size:13px; margin:0 0 8px; }
@media(max-width:700px){.pipeline-legend{margin-left:12px}.pipeline-timeline{padding:8px 12px 20px}.pipeline-stage,.pipeline-branch,.pipeline-out-of-band{width:calc(100% - 28px);margin-left:0}.pipeline-branch{margin-left:28px}.pipeline-stage form{width:100vw;padding:22px 18px 40px}.pipeline-add{margin-left:12px;width:calc(100% - 24px)}.trigger-grid{grid-template-columns:1fr}.automation-cue{white-space:normal}}

* { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--sans); font-size: 14px;
  color: var(--text);
  background: radial-gradient(circle at 92% 3%, #fadde866, transparent 26rem), var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout shell ── */
.main { max-width: 1240px; margin: 0 auto; padding: 42px 32px 72px; min-height: calc(100vh - 140px); }
.main.main-wide { max-width: 2100px; }
.footer { padding: 20px 28px; text-align: center; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); }

/* Two-column deal detail on wide screens; cards flow within a column. */
.deal-columns { display: grid; gap: 20px; align-items: start; }
.deal-columns > .deal-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.deal-columns .card { max-width: none; }

/* Signature placement keeps the field controls visible while a multi-page
   document is scrolled. Long T183 packages otherwise turn placement into a
   repeated trip between the bottom of the document and the send controls. */
.signature-placement-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(340px, 2fr); gap: 20px; align-items: start; }
.signature-document-scroll { max-height: calc(100vh - 220px); overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; }
.signature-document-pages { padding: 16px; }
.signature-placement-controls { position: sticky; top: 16px; }
.signature-placement-controls .card { max-width: none; }
.client-help-resolved { margin-top: 12px; }
.client-help-resolved > summary { cursor: pointer; color: var(--color-primary-text); font-weight: 700; font-size: 13px; }
.client-help-resolved > summary::marker { color: var(--color-primary); }
.deal-documents-card { order:1; }
.deal-fees-card { order:2; }
.deal-history-card { order:3; }
.deal-fees-summary { cursor:pointer; list-style:none; display:flex; justify-content:space-between; align-items:center; gap:12px; }
.deal-fees-summary::-webkit-details-marker { display:none; }
.deal-fees-summary .card-title { margin:0; }
.deal-fees-summary::after { content:"+"; flex:0 0 auto; color:var(--text-muted); font-size:20px; line-height:1; }
.deal-fees-card[open] .deal-fees-summary { margin-bottom:16px; }
.deal-fees-card[open] .deal-fees-summary::after { content:"−"; }
@media (min-width: 1200px) { .deal-columns { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (min-width: 1800px) { .deal-columns { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); } }

.page-header { margin-bottom: 28px; }
.page-header h1 { font-family: var(--serif); font-size: 36px; color: var(--color-primary-text); font-weight: 600; letter-spacing: -.01em; line-height: 1.08; margin: 0 0 6px; }
.page-header p  { color: var(--text-muted); font-size: 14px; margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .13em; font-size: 11px; font-weight: 700; color: var(--color-primary); margin-bottom: 4px; }

/* ── Nav - light sticky topbar (drawer for links) ── */
.nav { background: #fffdfd; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; height: 66px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--color-primary-text); }
.nav-logo { height: 34px; width: auto; display: block; }
.nav-sep { opacity: .35; margin: 0 2px; }
.nav-product { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.nav-brand-mark { display: grid; place-items: center; width: 34px; height: 38px; border: 3px solid var(--color-primary-deep); border-radius: 8px; background: var(--blue-pale); color: var(--color-primary-deep); font-family: var(--serif); font-size: 15px; font-weight: 600; }
.eyebrow { font-size:11px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em;margin-bottom:4px; }
.affiliation-bbj { background:#fdebf5;color:#8c3066;border:1px solid #edbad5; }
.affiliation-bnb { background:#f1e7f5;color:#663575;border:1px solid #d5b9dd; }
.login-brand-mark { width:64px;height:64px;border-radius:18px;margin:0 auto 18px;display:grid;place-items:center;background:linear-gradient(135deg,var(--color-primary),var(--color-primary-deep));color:#fff;font-size:25px;font-weight:800;box-shadow:0 10px 24px rgba(124,58,135,.22); }
.nav-right {
  position: fixed; top: 0; right: -320px; bottom: 0;
  width: 288px; max-width: 80vw;
  background: linear-gradient(180deg, #211a29 0%, #17131d 100%);
  flex-direction: column; align-items: stretch; justify-content: flex-start;
  padding: 64px 18px 24px; gap: 4px;
  transition: right .25s ease;
  z-index: 999; overflow-y: auto;
  box-shadow: -4px 0 24px rgba(0,0,0,.25);
  display: flex;
}
.nav-right.open { right: 0; }
.nav-user { font-size: 13px; color: rgba(255,255,255,.7); padding-right: 12px; border-right: 1px solid rgba(255,255,255,.2); margin-right: 8px; }
.nav-link { color: var(--text-muted); text-decoration: none; font-size: 13px; font-weight: 600; padding: 8px 11px; border-radius: var(--radius-sm); transition: background .15s, color .15s; }
.nav-link:hover, .nav-link.active { background: var(--blue-pale); color: var(--color-primary-text); }
.nav-logout { color: rgba(255,255,255,.55); margin-left: 8px; }

/* ── Hamburger / drawer ── */
.nav-hamburger { display: block; background: none; border: none; color: var(--color-primary-text); font-size: 22px; line-height: 1; cursor: pointer; padding: 6px 10px; border-radius: var(--radius-sm); }
.nav-hamburger:hover { background: var(--blue-pale); }
.nav-drawer-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 998; opacity: 0; transition: opacity .25s; }
.nav-drawer-backdrop.open { display: block; opacity: 1; }
.nav-new-btn { font-size: 13px !important; padding: 6px 14px !important; white-space: nowrap; }
.nav-bar-right { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-shrink: 0; }
.nav-desktop-links { display: flex; align-items: center; gap: 2px; }

.theme-toggle { display:grid; place-items:center; width:34px; height:34px; border:1px solid var(--border); border-radius:999px; background:var(--bg-elev); color:var(--text); cursor:pointer; font-size:16px; flex-shrink:0; }
.theme-toggle:hover { background:var(--bg-tile-hover); }

/* ── Nav global search ── */
.nav-search-wrap {
  position: relative;
  flex: 1;
  max-width: 480px;
  min-width: 140px;
  margin-left: 16px;
}
.nav-search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 15px; pointer-events: none; line-height: 1;
}
.nav-search-input {
  width: 100%; padding: 8px 12px 8px 32px;
  border: 1px solid var(--border); border-radius: 999px;
  background: #fff; color: var(--text);
  font-family: inherit; font-size: 13px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.nav-search-input::placeholder { color: var(--text-muted); }
.nav-search-input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px #f472b622; }
.nav-search-dropdown {
  position: absolute; top: calc(100% + 8px);
  left: 50%; transform: translateX(-50%);
  width: 420px; max-width: 92vw;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.18); z-index: 600;
  max-height: 520px; overflow-y: auto;
}
.nav-search-dropdown:empty { display: none; }
.search-results-body { padding: 6px 0; }
.search-group { }
.search-group-label {
  padding: 8px 14px 4px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.search-group:first-child .search-group-label { border-top: none; }
.search-result-item {
  display: block; padding: 8px 14px;
  text-decoration: none; color: var(--text);
  transition: background .1s;
}
.search-result-item:hover, .search-result-item.kbd-focus { background: var(--bg-tile-hover); }
.search-result-historical { opacity: .58; }
.search-result-historical:hover, .search-result-historical.kbd-focus { opacity: 1; }
.search-result-title { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.35; }
.search-result-meta {
  font-size: 12px; color: var(--text-muted);
  display: flex; gap: 0; flex-wrap: wrap; margin-top: 2px;
}
.search-result-meta span + span::before { content: " · "; white-space: pre; opacity: .6; }
.search-result-snippet { font-style: italic; }
.search-state { color: var(--color-primary-text); font-weight: 600; }
.search-no-results { padding: 20px 14px; font-size: 13px; color: var(--text-muted); text-align: center; }
mark { background: #fef08a; color: inherit; border-radius: 2px; padding: 0 1px; }

/* ── Nav dropdown (Create New) ── */
.nav-dropdown-wrap { position: relative; }
.nav-dropdown-trigger { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.25); font-weight: 600; cursor: pointer; }
.nav-dropdown-trigger:hover { background: rgba(255,255,255,.25); }
.nav-dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0;
  padding-top: 6px;
  background: transparent; min-width: 160px; z-index: 500;
}
.nav-dropdown-menu-inner {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.12); overflow: hidden;
}
.nav-dropdown-wrap:hover .nav-dropdown-menu,
.nav-dropdown-wrap:focus-within .nav-dropdown-menu { display: block; }
.nav-dropdown-item { display: block; padding: 10px 16px; color: var(--text); text-decoration: none; font-size: 13px; font-weight: 500; transition: background .1s; }
.nav-dropdown-item:hover { background: var(--bg-tile-hover); color: var(--color-primary-text); }

/* ── Cards ── */
.card { background: var(--bg-tile); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 28px; margin-bottom: 20px; }
.card-title { font-family: var(--serif); font-size: 21px; color: var(--color-primary-text); margin: 0 0 4px; font-weight: 600; letter-spacing: -.01em; }
.card-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; border: 1px solid transparent; font-family: inherit; transition: transform .1s, box-shadow .15s, background .15s, border-color .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary   { background: var(--color-primary); color: var(--btn-contrast); border-color: var(--color-primary); box-shadow: 0 5px 16px #f472b644; }
.btn-primary:hover { background: #ec5da8; }
.btn-secondary { background: var(--bg-elev); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-tile-hover); border-color: var(--color-primary-light); }
.btn-danger    { background: var(--error); color: #fff; border-color: var(--error); }
.btn-danger:hover { background: #a83052; }
.btn-gold      { background: var(--yellow); color: #6b4b00; border-color: var(--yellow); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ── Stats / metrics ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat-box { background: var(--bg-tile); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: left; box-shadow: var(--shadow-sm); }
.stat-number { font-family: var(--serif); font-size: 32px; font-weight: 600; letter-spacing: -.01em; color: var(--color-primary-text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

/* ── Badges + chips ── */
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.badge-draft     { background: #f1edf3; color: #6b6377; }
.badge-assigned  { background: #fff3cf; color: #8a6d00; }

/* Contact work-drive folders: retain a visible "new" cue without forcing
   unreadable light text and buttons into the dark theme. */
.workdrive-folder { border:1px solid var(--border); border-radius:9px; overflow:hidden; }
.workdrive-folder summary { cursor:pointer; display:flex; justify-content:space-between; align-items:center; gap:12px; padding:11px 13px; list-style:none; }
.workdrive-folder summary::-webkit-details-marker { display:none; }
.workdrive-folder summary::before { content:'▸'; color:var(--text-muted); margin-right:8px; }
.workdrive-folder[open] summary::before { content:'▾'; }
.workdrive-folder-count { color:var(--text-muted); font-size:12px; margin-left:8px; }
.workdrive-folder .table-wrap { border-top:1px solid var(--border); padding:0 13px; }
.workdrive-new { background:#fffdf3; }
:root[data-theme="dark"] .workdrive-new { background:#332c17; }
.badge-submitted { background: var(--blue-pale); color: #a3306e; }
.badge-returned  { background: #fde4ec; color: #a83052; }
.badge-approved  { background: #e3f1e6; color: #2f7a45; }
.badge-info      { background: #ece7fb; color: #5b3ca8; }
.badge-urgent    { background: #fde4ec; color: #c43d63; border: 1px solid #f3b6cb; }
.tag-chip { display: inline-block; padding: 3px 10px; background: var(--blue-pale); color: var(--color-primary-text); border-radius: 999px; font-size: 12px; font-weight: 600; }
.tag-chip-primary { background:#6b46c1; color:#fff; }

/* Compact linked-record rows on client cards. A long deal name may wrap, but
   the status remains a fixed, readable column instead of being squeezed off. */
.contact-linked-row { display:block; padding:8px 0; border-bottom:1px solid var(--border); font-size:13px; text-decoration:none; color:var(--text); }
.contact-linked-row-head { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:8px; }
.contact-linked-row-title { min-width:0; overflow-wrap:anywhere; }
.contact-linked-row .badge { white-space:nowrap; }

/* ── Forms ── */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
/* Applies everywhere, not just inside .form-group, so a stray filter/inline
   input matches the same look instead of falling back to the browser default.
   .nav-search-input keeps its own pill/icon treatment. */
input[type="text"]:not(.nav-search-input), input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="tel"], input[type="search"]:not(.nav-search-input),
input[type="url"], input:not([type]), select, textarea {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--sans); font-size: 14px; color: var(--text); background: var(--bg-elev);
  transition: border-color .15s;
}
.form-group input, .form-group select, .form-group textarea, textarea { width: 100%; }
textarea { min-height: 100px; resize: vertical; }
input[type="text"]:not(.nav-search-input):focus, input[type="email"]:focus, input[type="password"]:focus,
input[type="number"]:focus, input[type="date"]:focus, input[type="tel"]:focus, input[type="search"]:not(.nav-search-input):focus,
input[type="url"]:focus, input:not([type]):focus, select:focus, textarea:focus { outline: none; border-color: var(--color-primary); }
input[readonly], textarea[readonly] { background: var(--bg); color: var(--text-muted); }
input[type="file"] { color: var(--text-muted); font-size: 13px; }
input[type="file"]::file-selector-button {
  padding: 6px 14px; margin-right: 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elev); color: var(--text); font-family: var(--sans); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: border-color .15s, background .15s;
}
input[type="file"]::file-selector-button:hover { background: var(--bg); }
.form-hint { font-size: 12px; color: var(--text-muted); margin: 4px 0 0; }
.work-order-choice-list { display: flex; flex-wrap: wrap; gap: 10px; }
.work-order-choice-list-compact { gap: 8px; }
.form-group label.work-order-choice {
  position: relative; display: inline-block; flex: 0 1 auto; width: auto;
  min-width: 0; margin: 0; font-size: 14px; letter-spacing: normal;
  text-transform: none; cursor: pointer;
}
.form-group .work-order-choice > span {
  display: block; padding: 8px 16px; border: 2px solid var(--border);
  border-radius: var(--radius); background: var(--bg-elev); color: var(--text);
  line-height: 1.25; transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.work-order-choice-list-compact .work-order-choice > span { padding: 7px 15px; font-size: 13px; }
.form-group .work-order-choice input[type="radio"] {
  position: absolute; width: 1px; height: 1px; margin: 0; padding: 0;
  border: 0; opacity: 0; pointer-events: none;
}
.form-group .work-order-choice input[type="radio"]:checked + span {
  border-color: var(--color-primary); background: var(--color-primary); color: #fff;
}
.form-group .work-order-choice input[type="radio"]:focus-visible + span {
  outline: 2px solid var(--color-primary); outline-offset: 2px;
}
label.inline-checkbox {
  display: inline-flex; width: auto; align-items: center; gap: 7px; margin: 0;
  font-family: var(--sans); font-size: 12px; font-weight: 500; color: var(--text-muted);
  text-transform: none; letter-spacing: normal; cursor: pointer; line-height: 1.3;
}
label.inline-checkbox input[type="checkbox"],
label.inline-checkbox input[type="radio"] {
  width: 16px; height: 16px; flex: 0 0 16px; margin: 0; padding: 0;
  accent-color: var(--color-primary);
}
.ticket-billing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.ticket-billing-grid .ticket-rate-field { grid-column: 1 / -1; }
.ticket-billing-grid .form-group { min-width: 0; }
.contract-option-choice { position: relative; display: block; cursor: pointer; }
.contract-option-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.contract-option-choice > span { display:flex; justify-content:space-between; gap:12px; padding:10px 12px; border:2px solid var(--border); border-radius:var(--radius); background:var(--bg-elev); color:var(--text); }
.contract-option-choice input:checked + span { border-color:var(--color-primary); background:var(--color-primary); color:#fff; }
.contract-option-choice input:focus-visible + span { outline:2px solid var(--color-primary); outline-offset:2px; }
.form-row, .form-row-3, .form-row-4 { display: grid; gap: 16px; margin-bottom: 16px; }
.form-row   { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: repeat(3, 1fr); }
.form-row-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
table thead th { text-align: left; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; padding: 12px 16px; background: #fcf8fb; border-bottom: 1px solid var(--border); }
table tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border); }
table tbody tr:hover { background: #fdf6fa; }

/* ── Flashes ── */
.flash-container { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 10px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 500; }
.flash-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.flash-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.flash-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }

/* ── Login - split-screen (brand panel + card) ── */
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(400px, .85fr); background: var(--bg-elev); }
.login-brand {
  background: linear-gradient(150deg, #2d2340, #51368a);
  color: #fff; padding: clamp(44px, 7vw, 120px);
  display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.login-brand::after {
  content: ''; position: absolute; width: 460px; height: 460px; border-radius: 50%;
  background: var(--color-primary); opacity: .13; right: -180px; bottom: -180px;
}
.login-brand > * { position: relative; z-index: 1; max-width: 520px; }
.login-brand .eyebrow { color: var(--yellow); margin-bottom: 14px; }
.login-brand h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(40px, 5vw, 68px); line-height: 1.05; margin: 0 0 22px; }
.login-brand p { color: #e6dff2; font-size: 17px; line-height: 1.6; margin: 0; }
.login-logo-plate { display:inline-flex; align-items:center; align-self:flex-start; padding:10px 14px; margin-bottom:22px; background:#fffdfd; border:1px solid rgba(244,114,182,.28); border-radius:12px; box-shadow:0 8px 24px rgba(0,0,0,.16); }
.login-logo-plate img { display:block; height:38px; width:auto; }
.hero-calculator {
  width: 78px; height: 92px; border: 4px solid var(--color-primary); border-radius: 14px;
  padding: 11px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  transform: rotate(-4deg); margin-bottom: 30px;
}
.hero-calculator span { grid-column: 1 / -1; background: rgba(244,114,182,.3); border-radius: 3px; }
.hero-calculator i { background: var(--yellow); border-radius: 3px; }
.hero-calculator b { background: var(--color-primary); border-radius: 3px; grid-row: 3 / 5; grid-column: 3; }

.login-card {
  align-self: center; width: 100%; max-width: 560px; justify-self: center;
  padding: clamp(36px, 7vw, 96px);
}
.login-card .eyebrow { color: var(--color-primary); }
.login-card h1, .login-card h2 { font-family: var(--serif); font-size: 34px; color: var(--color-primary-text); font-weight: 600; letter-spacing: -.01em; margin: 4px 0; }
.login-card > p, .login-card .muted { color: var(--text-muted); font-size: 14px; margin: 6px 0 0; }
.form-stack { display: grid; gap: 16px; margin-top: 28px; }
.form-stack label { display: grid; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text); }
.form-stack input { width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; background: #fff; color: var(--text); }
.form-stack input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px #f472b622; }
.form-stack .btn { margin-top: 6px; }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin-top: 16px; font-size: 13px; }
.alert-error { background: #fde4ec; color: #8a2445; }
.login-switch { margin-top: 26px; font-size: 13px; color: var(--text-muted); }

@media (max-width: 860px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-brand { min-height: 38vh; padding: 44px 28px; }
  .login-card { max-width: none; padding: 40px 28px; }
}

/* ── Reusable grid utilities (collapse on ≤1024px) ── */
.split-2-col  { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.review-2-col { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.review-action-panel { position: sticky; top: 72px; }

/* ── Mobile patterns: write-action hide + readonly notice ── */
.mobile-readonly-notice { display: none; }

.mobile-only { display: none; }

/* ── Mobile plan-card list (pair with .desktop-only on the table) ── */
.plan-cards-list { display: none; }
.plan-card { display: block; text-decoration: none; color: var(--text); background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.plan-card:active { border-color: var(--color-primary); }
.plan-card-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-card-customer { font-weight: 700; font-size: 15px; line-height: 1.25; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-card-row > *:last-child { flex-shrink: 0; }
.plan-card-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.plan-card-meta span:not(:first-child)::before { content: "·"; margin-right: 8px; opacity: .5; }
.plan-card-divider { height: 1px; background: var(--border); margin: 10px 0; }

/* ── Mobile document cards (pair with .desktop-only on the documents table) ──
   A .plan-card is a single tap target; a document row needs several actions
   (view, download, mark sensitive, delete) so this is a plain card, not a link. */
.doc-cards-list { display: none; }
.doc-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.doc-card + .doc-card { margin-top: 10px; }
.doc-card-name { font-weight: 700; font-size: 14px; line-height: 1.3; word-break: break-word; }
.doc-card-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 5px; }
.doc-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.doc-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.doc-card-signature { font-size: 12px; color: var(--text-muted); margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Aging-summary strip (invoices list) - 6 tiles, collapses on phone ── */
.aging-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 20px; }

/* ──────────────────────────────────────────────────────────────────────────
   Responsive
   ────────────────────────────────────────────────────────────────────────── */

/* Drawer inner styles (dark slide-out panel) */
.nav-right .nav-user {
  border-right: none; border-bottom: 1px solid rgba(255,255,255,.2);
  padding: 0 0 12px; margin: 0 0 12px; font-size: 14px; color: #fff;
}
.nav-right .nav-link { padding: 12px 14px; font-size: 14px; border-radius: var(--radius-sm); color: rgba(255,255,255,.85); }
.nav-right .nav-link:hover, .nav-right .nav-link.active { background: rgba(255,255,255,.12); color: #fff; }
.nav-right .nav-logout { margin-left: 0; margin-top: 12px; border-top: 1px solid rgba(255,255,255,.2); padding-top: 18px; }

@media (max-width: 1024px) {
  /* Hide desktop shortcut links - drawer handles navigation */
  .nav-desktop-links { display: none; }

  /* Stack two-column layouts on tablet */
  .split-2-col  { grid-template-columns: 1fr; }
  .review-2-col { grid-template-columns: 1fr; }
  .review-action-panel { position: static; }
  .signature-placement-layout { grid-template-columns: 1fr; }
  .signature-document-scroll { max-height: none; overflow: visible; padding-right: 0; }
  .signature-placement-controls { position: static; }
}

@media (max-width: 900px) {
  .form-row, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
  .ticket-billing-grid { grid-template-columns: 1fr; }
  .ticket-billing-grid .ticket-rate-field { grid-column: auto; }
}

@media (max-width: 768px) {
  .main { padding: 24px 16px; }
  .nav { padding: 0 12px; }
  /* Search stays visible - shrinks to fit beside hamburger */
  .nav-search-wrap { flex: 1; min-width: 0; }
  .nav-search-input { font-size: 12px; padding: 6px 10px 6px 28px; }
}

@media (max-width: 767px) {
  /* Phone: swap dashboard tables for stacked cards */
  .desktop-only { display: none !important; }
  .mobile-only  { display: block !important; }
  .plan-cards-list { display: flex; flex-direction: column; gap: 10px; }
  .doc-cards-list { display: block; }

  /* Phone: aging-summary strip goes 3-wide (2 rows) instead of 6 cramped tiles */
  .aging-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .aging-grid .field-label { font-size: 10px; }

  /* Phone: hide write-action elements, show readonly notice */
  .write-action { display: none !important; }
  .mobile-readonly-notice {
    display: block;
    background: #fffbeb; border: 1px solid #fcd34d; border-left: 4px solid #f59e0b;
    border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px;
    font-size: 13px; color: #78350f; line-height: 1.5;
  }
  .mobile-readonly-notice strong { color: #78350f; }
}

/* Print: blank for users we don't want exporting form contents.
   Wrap the body or main content in a parent with class `print-blocked` on a
   per-user basis (e.g. via {% if current_user.role == 'rep' %}) to enable. */
@media print {
  .print-blocked,
  .attendance-tray { display: none !important; }
}

/* ── Color tokens used in settings test result ── */
:root {
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-danger:  #dc2626;
}

/* ── Bottom drawer components ── */
.tt-tab-btn {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  font-family: inherit;
  transition: background .15s, color .15s, border-color .15s;
  box-shadow: 0 -2px 8px rgba(0,0,0,.07);
}
.tt-tab-btn:hover { background: var(--bg-tile-hover); color: var(--text); }
.tt-drawer {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px;
  box-shadow: 0 -4px 24px rgba(0,0,0,.14);
}
.tt-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.tt-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: var(--radius);
  font-family: inherit;
}
.tt-close-btn:hover { background: var(--bg-tile-hover); color: var(--text); }

/* ── Attendance Time Clock Drawer ── */
.attendance-tray {
  position: fixed;
  bottom: 0;
  left: 24px;
  z-index: 495;
  width: 340px;
}
.attendance-tray .tt-tab-btn { justify-content: center; }
.attendance-tray.attendance-active .tt-tab-btn { background:#15803d;color:#fff;border-color:#166534; }
.attendance-state-dot { width:9px;height:9px;border-radius:50%;background:#9ca3af;display:inline-block; }
.attendance-state-dot.attendance-working { background:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.18); }
.attendance-state-dot.attendance-lunch { background:#f59e0b;box-shadow:0 0 0 3px rgba(245,158,11,.18); }
@media (max-width: 1024px) {
  .attendance-tray { left:12px;right:12px;width:auto;z-index:997; }
  .attendance-tray .tt-drawer { max-height:70vh;overflow-y:auto;padding:16px; }
}

.tt-pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  animation: pulse-green 1.4s infinite;
}

/* ── Customer account holds ── */
.account-hold-alert {
  display:flex; flex-direction:column; gap:4px; margin:0 0 18px; padding:14px 16px;
  color:#7f1d1d; background:#fef2f2; border:2px solid #dc2626; border-radius:var(--radius);
}
.account-hold-inline { margin-top:5px; color:#b91c1c; font-size:12px; font-weight:700; }
.account-hold-badge { margin-left:7px; padding:2px 7px; color:#fff; background:#b91c1c; border-radius:10px; font-size:10px; text-transform:uppercase; }
.account-hold-editor { margin-bottom:20px; padding:16px; background:#fef2f2; border:1px solid #fca5a5; border-radius:var(--radius); }
.account-hold-toggle { display:flex; align-items:flex-start; gap:10px; color:#7f1d1d; cursor:pointer; }
/* Google Places (New) web component. The native form input remains hidden
   alongside it so manual values and existing page scripts keep working. */
gmp-place-autocomplete.places-address-input {
  display: block;
  width: 100%;
  min-width: 0;
  color-scheme: light;
  font-family: var(--sans);
  font-size: 14px;
}
/* Live password guidance used by staff invites/resets and the client portal. */
.password-requirements{list-style:none;padding:0;margin:0 0 14px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px 12px;font-size:12px;color:var(--color-danger,#a52f4e);}
.password-requirements li{display:flex;align-items:center;gap:6px;transition:color .15s ease;}
.password-requirements li.password-rule-ok{color:var(--color-success,#267441);}
.password-match{font-size:12px;color:var(--color-danger,#a52f4e);margin:4px 0 0;min-height:18px;}
.password-match.password-match-ok{color:var(--color-success,#267441);}
@media(max-width:480px){.password-requirements{grid-template-columns:1fr;}}

/* Partner return progress becomes a compact milestone strip on phones. */
.partner-mobile-progress,.partner-mobile-progress-label{display:none;}
@media(max-width:767px){
  .partner-return-card{padding:13px 14px;gap:10px;}
  .partner-return-head h2{font-size:18px;}
  .partner-mobile-progress{display:flex;align-items:stretch;gap:4px;width:100%;height:34px;}
  .partner-progress-segment{flex:1 1 0;min-width:0;border-radius:6px;border:1px solid var(--border);background:var(--bg);}
  .partner-progress-done{background:var(--ok-bg);border-color:var(--ok-border);}
  .partner-progress-current,.partner-progress-payment{flex:5 1 112px;display:grid;place-items:center;padding:0 8px;color:#fff;font-size:11px;font-weight:700;text-align:center;line-height:1.1;}
  .partner-progress-current{background:#873f93;border-color:#9d55a8;}
  .partner-progress-payment{background:#b85b1c;border-color:#d47a32;color:#fff8ef;}
  .partner-progress-upcoming{background:#f1edf3;border-color:#e2d9e5;}
  :root[data-theme="dark"] .partner-progress-upcoming{background:#302737;border-color:#44364c;}
  .partner-mobile-progress-label{display:block;margin-top:-4px;color:var(--ok-text);font-size:11px;font-weight:700;}
}

.partner-tabs{display:none;gap:5px;margin:0 0 10px;padding-bottom:4px;overflow-x:auto;}
.partner-tabs a{flex:0 0 auto;padding:8px 12px;border:1px solid var(--border);border-radius:999px;color:var(--text-muted);font-size:12px;font-weight:700;text-decoration:none;background:var(--bg-tile);}
.partner-tabs a:hover,.partner-tabs a.active{background:var(--color-primary);border-color:var(--color-primary);color:var(--btn-contrast);}
.partner-invoice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.partner-invoice-card{display:grid;gap:12px;margin:0;padding:18px;}
.partner-invoice-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;}
.partner-invoice-head .eyebrow{margin:0 0 2px;}
.partner-invoice-head h2{margin:0;font-family:var(--serif);font-size:22px;color:var(--color-primary-text);}
.partner-invoice-work{margin:0;color:var(--text-muted);font-size:13px;}
.partner-invoice-amounts{display:grid;grid-template-columns:repeat(3,1fr);margin:0;padding:10px 0;border-top:1px solid var(--border);border-bottom:1px solid var(--border);}
.partner-invoice-amounts div{display:grid;gap:2px;}
.partner-invoice-amounts dt{color:var(--text-muted);font-size:11px;text-transform:uppercase;letter-spacing:.05em;}
.partner-invoice-amounts dd{margin:0;font-size:16px;font-weight:700;}
.partner-invoice-amounts .invoice-due{text-align:right;}
.partner-invoice-actions{display:flex;gap:8px;flex-wrap:wrap;}
@media(max-width:767px){
  .partner-page-header{display:none;}
  .partner-tabs{display:flex;margin-top:-8px;}
  .partner-summary{gap:6px 12px;padding:7px 10px;}
  .partner-summary strong{font-size:14px;}
  .partner-invoice-grid{grid-template-columns:1fr;}
  .partner-invoice-card{padding:14px;gap:10px;}
  .partner-invoice-actions .btn{flex:1;text-align:center;}
}
