/* Tax Returns module styles for the CLIENT portal — txr-* block plus the
   staff helper classes the module markup uses, every helper scoped to the
   tax-returns section so nothing leaks into the rest of the portal. */

/* ============================================================
   Tax Returns (SARS module) — txr-*
   Tokens only; radius canon 8/12/16/999; type ramp 11/12/13/15/17/18/21.
   No shadows, no chevrons (standing style rules).
   ============================================================ */
.txr-body { display: grid; gap: 16px; }
.txr-intro { margin: 0 0 12px; font-size: 13px; color: var(--muted); max-width: 720px; }
.txr-empty { font-size: 13px; color: var(--muted); padding: 18px 0; }
.txr-muted { color: var(--muted); }
.txr-danger { color: var(--ac-danger, #8C2412); }

.txr-list-head { display: grid; gap: 12px; }
.txr-new-row { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.txr-inline-label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; }
.txr-inline-label select { min-width: 220px; }
.txr-row-actions { display: flex; gap: 8px; white-space: nowrap; }

/* Editor header */
.txr-editor-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.txr-editor-title { display: flex; align-items: baseline; gap: 10px; flex: 1; }
.txr-editor-title h3 { margin: 0; font-family: "Marcellus", serif; font-size: 21px; font-weight: 400; }
.txr-status-label { min-width: 150px; }
.txr-status-label select { min-height: 38px; padding: 6px 12px; }
.txr-save-state { font-size: 11px; font-weight: 600; color: var(--muted); }
.txr-save-state.is-saved { color: var(--ac-success, #136639); }

/* Step indicator */
.txr-steps { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.txr-step {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 7px 14px 7px 8px; cursor: pointer;
  font-family: "Quicksand", sans-serif; font-size: 12px; font-weight: 700;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.txr-step:hover { border-color: var(--brand); color: var(--ink); }
.txr-step.is-active { background: var(--brand); border-color: var(--brand); color: #FFFFFF; }
.txr-step-num {
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--ac-surface2, rgba(13,27,46,0.06)); font-size: 11px; color: inherit;
}
.txr-step.is-active .txr-step-num { background: rgba(255,255,255,0.22); }
.txr-step-join { flex: 0 0 14px; height: 1px; background: var(--line); }

/* Live summary band — labels in Marcellus (matches the rest of the app's
   heading font), figures in Quicksand bold (a geometric sans reads more
   clearly at-a-glance for numerals than the display serif). */
.txr-summary-band {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 22px 30px;
  border: 1px solid var(--line); border-radius: 16px; padding: 24px 28px;
  background: var(--ac-surface2, #F5F8FC);
}
.txr-stat { display: grid; gap: 7px; }
.txr-stat-label { font-family: "Marcellus", serif; font-size: 13px; font-weight: 400; color: var(--muted); }
.txr-stat-value { font-family: "Quicksand", sans-serif; font-size: 20px; font-weight: 700; letter-spacing: 0.01em; color: var(--ink); }
.txr-stat-due { border-left: 2px solid var(--line); padding-left: 22px; }
.txr-stat-due.is-refund .txr-stat-value { color: var(--ac-success, #136639); }
.txr-stat-due.is-owing .txr-stat-value { color: var(--ac-danger, #8C2412); }
.txr-summary-error { font-size: 13px; color: var(--ac-danger, #8C2412); }

/* Step body + cards */
.txr-step-body { display: grid; gap: 14px; }
.txr-card .txr-card-hint { font-size: 12px; color: var(--muted); margin-left: auto; padding-left: 12px; text-align: right; }
/* .doc-section-body carries no padding of its own (elsewhere in the app that
   div is a plain flex wrapper for pre-padded children) — txr-card-body was
   relying on that non-existent padding, so every field sat flush against the
   card's edges. Scoped to this module rather than touching the shared class. */
.txr-card-body { display: grid; gap: var(--gap-section); padding: var(--pad-panel); }   /* 16px / 20px */
.txr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--gap-section) var(--space-5); }
.txr-field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; align-content: start; }
.txr-field-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.txr-field-wide { grid-column: 1 / -1; }
.txr-static { font-size: 13px; font-weight: 500; color: var(--ink); padding: 12px 0 0; }
.txr-check { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; padding: 6px 0; }
.txr-check input { min-height: 0; width: 17px; height: 17px; accent-color: var(--brand); }
.txr-note { font-size: 12px; color: var(--muted); border-left: 2px solid var(--brand); padding: 4px 0 4px 12px; margin: 0; }
.txr-computed { font-size: 12px; color: var(--ink); background: var(--ac-surface2, #F5F8FC); border-radius: 8px; padding: 9px 12px; margin: 0; }
.txr-computed.is-warn { color: var(--ac-warning, #8A5C0A); }

/* Tooltip pill — a custom bubble, not the native `title` attribute (which
   needs a ~1s hover dwell and never responds to click/touch). Shown on
   hover/keyboard-focus via CSS, and toggled by a delegated click handler in
   tax-returns.js for touch/click users. Flat panel, no shadow (house rule). */
.txr-tip {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--muted);
  font-size: 9px; font-weight: 700; cursor: help; flex: 0 0 auto;
}
.txr-tip:hover, .txr-tip:focus, .txr-tip.is-open { border-color: var(--brand); color: var(--brand); }
/* Anchored to the icon's left edge by default, then nudged by --tip-shift
   (a pixel offset tax-returns.js computes per-icon so both bubble edges stay
   within the viewport — a plain left/right "flip" wasn't enough: on a narrow
   phone screen an icon in the middle third overflows the right edge when
   left-anchored AND overflows the left edge when simply flipped to
   right-anchored). --tip-maxw likewise shrinks the bubble on very narrow
   viewports where even a shifted 240px bubble wouldn't fit with margin. */
.txr-tip::after {
  content: attr(data-tip);
  /* --tip-shift is applied via `left`, not `transform` — transform only
     moves the painted position and is excluded from scrollWidth/overflow
     calculations, which would silently leave a phantom horizontal scrollbar
     on narrow viewports even though the bubble visually looked shifted. */
  position: absolute; z-index: 60;
  top: calc(100% + 9px); left: var(--tip-shift, 0px);
  transform: translateY(-4px);
  width: max-content; max-width: var(--tip-maxw, 240px);
  background: #161C33; color: #FFFFFF;
  font-family: "Quicksand", sans-serif; font-size: 12px; font-weight: 500; line-height: 1.45;
  text-align: left; white-space: normal;
  border-radius: 8px; padding: 9px 11px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.txr-tip:hover::after, .txr-tip:focus::after, .txr-tip.is-open::after {
  opacity: 1;}
[data-theme="dark"] .txr-tip::after { background: #202B47; border: 1px solid rgba(238,232,223,0.14); }

/* Notes / AI analysis */
.txr-notes-block { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.txr-notes-block > .admin-inline-action { justify-self: start; }
.txr-analysis-card { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.txr-analysis-assessment { margin: 0; font-size: 13px; line-height: 1.55; }
.txr-analysis-group h4 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.txr-analysis-group ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; display: grid; gap: 3px; }
.txr-analysis-group.is-risk li { color: var(--ac-warning, #8A5C0A); }
.txr-suggested { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; padding: 4px 0; }

/* Documents step */
.txr-upload-row { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.txr-upload-hint { font-size: 11px; color: var(--muted); }

/* Drag-and-drop upload zone — dashed border reads as "drop target" without a
   shadow/glow (house rule); brand-tinted fill on dragover for clear feedback. */
.txr-dropzone {
  display: grid; justify-items: center; gap: 6px; text-align: center;
  border: 1.5px dashed var(--line); border-radius: 16px;
  padding: 28px 20px; cursor: pointer; color: var(--muted);
  background: var(--ac-surface2, #F5F8FC);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.txr-dropzone:hover, .txr-dropzone:focus { border-color: var(--brand); color: var(--ink); }
.txr-dropzone.is-dragover { border-color: var(--brand); background: var(--brand-soft, rgba(78,122,151,0.10)); color: var(--ink); }
.txr-dropzone-icon { color: var(--brand); }
.txr-dropzone-text { margin: 0; font-size: 13px; }
.txr-dropzone-text strong { font-weight: 700; color: var(--ink); }
.txr-dropzone .txr-upload-hint { margin: 0; }

/* In-flight upload queue */
.txr-upload-queue:empty { display: none; }
.txr-upload-queue { display: grid; gap: 6px; }
.txr-queue-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 12px;
}
.txr-queue-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.txr-queue-status { color: var(--muted); white-space: nowrap; }
.txr-queue-row.is-analysing .txr-queue-status { color: var(--brand); }
.txr-queue-row.is-error { border-color: var(--ac-danger, #8C2412); }
.txr-queue-row.is-error .txr-queue-status { color: var(--ac-danger, #8C2412); }
.txr-doc-card {
  display: grid;
  gap: 12px;
  padding: 18px 20px 20px;
}
.txr-doc-card .txr-extract-row { padding: 10px 14px; }
.txr-doc-card .txr-extract-warnings { padding: 2px 4px 2px 22px; }
.txr-doc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.txr-doc-name { font-size: 13px; font-weight: 600; color: var(--brand); text-decoration: none; }
.txr-doc-name:hover { text-decoration: underline; }
.txr-doc-meta { font-size: 11px; color: var(--muted); }
.txr-doc-head .txr-danger { margin-left: auto; }
.txr-doc-summary { margin: 0; font-size: 13px; line-height: 1.5; }
.txr-extract-table { display: grid; gap: 6px; }
.txr-extract-row {
  display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(90px, auto) minmax(120px, 1fr) auto;
  align-items: center; gap: 12px; padding: 7px 10px;
  background: var(--ac-surface2, #F5F8FC); border-radius: 8px;
}
.txr-extract-label { font-size: 12px; font-weight: 600; display: grid; }
.txr-extract-label em { font-style: normal; font-weight: 500; font-size: 11px; color: var(--muted); }
.txr-extract-value { font-size: 13px; font-family: "Marcellus", serif; text-align: right; }
.txr-conf { position: relative; display: flex; align-items: center; gap: 8px; height: 8px; }
.txr-conf i { display: block; height: 4px; border-radius: 2px; background: var(--line); min-width: 4px; max-width: 80px; flex: 0 1 auto; }
.txr-conf.is-high i { background: var(--ac-success, #136639); }
.txr-conf.is-mid i { background: var(--ac-warning, #8A5C0A); }
.txr-conf.is-low i { background: var(--ac-danger, #8C2412); }
.txr-conf b { font-size: 11px; font-weight: 700; color: var(--muted); }
.txr-extract-warnings { margin: 0; padding-left: 18px; font-size: 12px; color: var(--ac-warning, #8A5C0A); display: grid; gap: 3px; }
.txr-doc-checklist { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.txr-doc-checklist h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.txr-doc-checklist ul { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 3px; }
.txr-doc-checklist li.is-missing { color: var(--ac-danger, #8C2412); }

/* Review step */
.txr-review-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.txr-review-top h3 { margin: 0; font-family: "Marcellus", serif; font-size: 18px; font-weight: 400; }
[data-section="tax-returns"] .txr-review-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.txr-lines { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.txr-line { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 9px 16px; font-size: 13px; border-bottom: 1px solid var(--line); }
.txr-line:last-child { border-bottom: 0; }
.txr-line span { display: grid; }
.txr-line em { font-style: normal; font-size: 11px; color: var(--muted); }
.txr-line strong { font-family: "Marcellus", serif; font-weight: 400; white-space: nowrap; }
.txr-line.is-total { background: var(--ac-surface2, #F5F8FC); font-weight: 700; }
.txr-line.is-total strong { font-size: 15px; }
.txr-line.is-deduction strong { color: var(--ac-success, #136639); }
.txr-line.is-tax strong, .txr-line.is-paid strong { color: var(--ink); }
.txr-review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.txr-review-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.txr-review-card h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.txr-review-card ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; display: grid; gap: 4px; }
.txr-review-card p { margin: 0; font-size: 13px; color: var(--muted); }
.txr-review-card.is-missing li.is-missing { color: var(--ac-danger, #8C2412); }
.txr-review-card.is-warnings li { color: var(--ac-warning, #8A5C0A); }
.txr-review-card.is-opps li { color: var(--ac-success, #136639); }
.txr-ai-review { display: grid; gap: 12px; border: 1px solid var(--brand); border-radius: 16px; padding: 16px 18px; }
.txr-ai-review-head { display: flex; align-items: center; gap: 12px; }
.txr-ai-review-head h3 { margin: 0; font-family: "Marcellus", serif; font-size: 17px; font-weight: 400; }

/* Nav row */
.txr-nav-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 4px; }

/* Mobile */
@media (max-width: 720px) {
  .txr-grid { grid-template-columns: 1fr; }
  .txr-extract-row { grid-template-columns: 1fr auto; grid-auto-flow: row; }
  .txr-conf { display: none; }
  .txr-steps { gap: 6px; }
  .txr-step-join { display: none; }
  .txr-editor-head { align-items: start; }
}

/* Dark theme: the semantic greens/reds/ambers are tuned for light surfaces —
   lift them for legibility on the dark navy (same per-case pattern as
   .admin-stat-line--overdue above). */
[data-theme="dark"] .txr-stat-due.is-refund .txr-stat-value,
[data-theme="dark"] .txr-line.is-deduction strong,
[data-theme="dark"] .txr-review-card.is-opps li,
[data-theme="dark"] .txr-conf.is-high i + b,
[data-theme="dark"] .txr-save-state.is-saved { color: #7FBF9A; }
[data-theme="dark"] .txr-conf.is-high i { background: #7FBF9A; }
[data-theme="dark"] .txr-stat-due.is-owing .txr-stat-value,
[data-theme="dark"] .txr-danger,
[data-theme="dark"] .txr-doc-checklist li.is-missing,
[data-theme="dark"] .txr-review-card.is-missing li.is-missing,
[data-theme="dark"] .txr-summary-error { color: #E89B8C; }
[data-theme="dark"] .txr-conf.is-low i { background: #E89B8C; }
[data-theme="dark"] .txr-computed.is-warn,
[data-theme="dark"] .txr-extract-warnings,
[data-theme="dark"] .txr-review-card.is-warnings li,
[data-theme="dark"] .txr-analysis-group.is-risk li { color: #D9B36A; }
[data-theme="dark"] .txr-conf.is-mid i { background: #D9B36A; }
[data-theme="dark"] .txr-queue-row.is-error { border-color: #E89B8C; }
[data-theme="dark"] .txr-queue-row.is-error .txr-queue-status { color: #E89B8C; }
@media (max-width: 720px) {
  .txr-card .doc-section-head--toggle { flex-wrap: wrap; }
  .txr-card .txr-card-hint { margin-left: 0; padding-left: 0; text-align: left; flex-basis: 100%; }
  .txr-summary-band { grid-template-columns: repeat(2, 1fr); gap: 16px 20px; padding: 18px 20px; }
  .txr-stat-due { border-left: 0; padding-left: 0; }
  .txr-dropzone { padding: 20px 14px; }
}

/* ── FICA Compliance card (Phase 1) ─────────────────────────────────────────
   Semantic risk colours (good/warning/critical) are separate from the brand
   accent, per the design system. No shadows; radius on canon. */
.cmp-card {
  border: 1px solid var(--line, #E4E7EC);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
  background: var(--card, #FFFFFF);
}
.cmp-card:empty { display: none; }
[data-theme="dark"] .cmp-card { background: #0D1B2E; }

.cmp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cmp-title { font-family: 'Marcellus', serif; font-weight: 400; font-size: 18px; margin: 0; color: var(--ink, #0D1B2E); }
[data-theme="dark"] .cmp-title { color: #EEE8DF; }

.cmp-reassess {
  font-family: 'Quicksand', sans-serif; font-size: 12px; font-weight: 600;
  color: var(--ink, #0D1B2E); background: transparent;
  border: 1px solid var(--line, #E4E7EC); border-radius: 999px; padding: 6px 14px;
  cursor: pointer; box-shadow: none; transition: background .12s ease;
}
.cmp-reassess:hover { background: rgba(105,141,170,0.10); }
[data-theme="dark"] .cmp-reassess { color: #EAF0F6; border-color: rgba(255,255,255,0.16); }
[data-theme="dark"] .cmp-reassess:hover { background: rgba(255,255,255,0.06); }

.cmp-loading, .cmp-empty { font-family: 'Quicksand', sans-serif; font-size: 13px; color: var(--muted, #526073); margin: 0; }

.cmp-verdict { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cmp-band {
  font-family: 'Quicksand', sans-serif; font-size: 13px; font-weight: 700;
  padding: 4px 12px; border-radius: 999px;
}
.cmp-band--low    { background: rgba(12,163,12,0.12);  color: #0a7d0a; }
.cmp-band--medium { background: rgba(250,178,25,0.16); color: #9a6a00; }
.cmp-band--high   { background: rgba(208,59,59,0.12);  color: #c0392b; }
[data-theme="dark"] .cmp-band--low    { color: #6FCF6F; }
[data-theme="dark"] .cmp-band--medium { color: #FAB219; }
[data-theme="dark"] .cmp-band--high   { color: #F0908C; }
.cmp-tier  { font-family: 'Quicksand', sans-serif; font-size: 13px; font-weight: 600; color: var(--ink, #0D1B2E); }
[data-theme="dark"] .cmp-tier { color: #EAF0F6; }
.cmp-score { font-family: 'Quicksand', sans-serif; font-size: 12px; color: var(--muted, #526073); font-variant-numeric: tabular-nums; }

.cmp-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cmp-flag {
  font-family: 'Quicksand', sans-serif; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(208,59,59,0.10); color: #c0392b;
}
[data-theme="dark"] .cmp-flag { color: #F0908C; }

.cmp-factors { display: flex; flex-direction: column; margin-bottom: 12px; }
.cmp-factor {
  display: grid; grid-template-columns: 1fr 1fr 40px; gap: 10px; align-items: center;
  padding: 6px 0; font-family: 'Quicksand', sans-serif; font-size: 13px;
}
.cmp-factor + .cmp-factor { border-top: 1px solid var(--line-soft, rgba(13,27,46,0.06)); }
.cmp-factor-name { color: var(--muted, #526073); }
.cmp-factor-val  { color: var(--ink, #0D1B2E); }
[data-theme="dark"] .cmp-factor-val { color: #EAF0F6; }
.cmp-factor-score { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink, #0D1B2E); }
[data-theme="dark"] .cmp-factor-score { color: #EAF0F6; }
.cmp-factor--unresolved .cmp-factor-val { color: #9a6a00; font-style: italic; }
[data-theme="dark"] .cmp-factor--unresolved .cmp-factor-val { color: #FAB219; }

.cmp-unresolved {
  border-left: 2px solid rgba(250,178,25,0.6); padding: 4px 0 4px 12px; margin-bottom: 12px;
}
.cmp-unresolved-title { font-family: 'Quicksand', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #9a6a00; }
[data-theme="dark"] .cmp-unresolved-title { color: #FAB219; }
.cmp-unresolved ul, .cmp-req ul { margin: 4px 0 0; padding-left: 16px; }
.cmp-unresolved li, .cmp-req li { font-family: 'Quicksand', sans-serif; font-size: 12px; color: var(--muted, #526073); line-height: 1.5; }

.cmp-req { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line-soft, rgba(13,27,46,0.06)); }
@media (max-width: 620px) { .cmp-req { grid-template-columns: 1fr; } }
.cmp-req-label { font-family: 'Quicksand', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted, #526073); }

.cmp-foot { font-family: 'Quicksand', sans-serif; font-size: 11px; color: var(--muted, #526073); margin: 8px 0 0; line-height: 1.5; }

/* Sanctions screening block within the compliance card */
.cmp-screen { padding: 12px 0; border-top: 1px solid var(--line-soft, rgba(13,27,46,0.06)); margin-bottom: 4px; }
.cmp-screen-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cmp-screen-label { font-family: 'Quicksand', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted, #526073); }
.cmp-screen-status { font-family: 'Quicksand', sans-serif; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.cmp-screen-status--clear  { background: rgba(12,163,12,0.12);  color: #0a7d0a; }
.cmp-screen-status--review { background: rgba(250,178,25,0.16); color: #9a6a00; }
.cmp-screen-status--hit    { background: rgba(208,59,59,0.12);  color: #c0392b; }
[data-theme="dark"] .cmp-screen-status--clear  { color: #6FCF6F; }
[data-theme="dark"] .cmp-screen-status--review { color: #FAB219; }
[data-theme="dark"] .cmp-screen-status--hit    { color: #F0908C; }
.cmp-screen-list { margin: 8px 0 0; padding-left: 16px; }
.cmp-screen-list li { font-family: 'Quicksand', sans-serif; font-size: 12.5px; color: var(--ink, #0D1B2E); line-height: 1.55; }
[data-theme="dark"] .cmp-screen-list li { color: #EAF0F6; }
.cmp-screen-none { font-family: 'Quicksand', sans-serif; font-size: 12px; color: var(--muted, #526073); margin: 6px 0 0; }
.cmp-ver-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; font-family: 'Quicksand', sans-serif; font-size: 13px; }
.cmp-ver-name { color: var(--ink, #0D1B2E); }
[data-theme="dark"] .cmp-ver-name { color: #EAF0F6; }

/* Compliance card head actions + disposition control (Phase 3) */
.cmp-head-actions { display: flex; align-items: center; gap: 8px; }
.cmp-report-btn {
  font-family: 'Quicksand', sans-serif; font-size: 12px; font-weight: 600; text-decoration: none;
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink, #0D1B2E);
  transition: background 130ms ease;
}
.cmp-report-btn:hover { background: rgba(105,141,170,0.10); }
[data-theme="dark"] .cmp-report-btn { color: #EAF0F6; border-color: rgba(255,255,255,0.16); }
[data-theme="dark"] .cmp-report-btn:hover { background: rgba(255,255,255,0.06); }

.cmp-disp { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding: 12px; border-radius: 12px; background: rgba(105,141,170,0.07); }
[data-theme="dark"] .cmp-disp { background: rgba(255,255,255,0.05); }
.cmp-disp-label { flex-basis: 100%; font-family: 'Quicksand', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted, #526073); }
.cmp-disp-select, .cmp-disp-note {
  font-family: 'Quicksand', sans-serif; font-size: 13px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card, #fff); color: var(--ink, #0D1B2E);
}
.cmp-disp-note { flex: 1; min-width: 220px; }
[data-theme="dark"] .cmp-disp-select, [data-theme="dark"] .cmp-disp-note { background: rgba(7,16,30,0.55); color: #EAF0F6; }
.cmp-disp-save {
  font-family: 'Quicksand', sans-serif; font-size: 12px; font-weight: 600; padding: 8px 16px;
  border: 0; border-radius: 999px; background: #161C33; color: #fff; cursor: pointer;
}
[data-theme="dark"] .cmp-disp-save { background: #3F5E85; color: #EEE8DF; }
.cmp-disp-status { font-size: 12px; color: var(--muted, #526073); }
.cmp-disp--done { justify-content: space-between; }
.cmp-disp-current { font-family: 'Quicksand', sans-serif; font-size: 13px; color: var(--ink, #0D1B2E); }
[data-theme="dark"] .cmp-disp-current { color: #EAF0F6; }
.cmp-disp-meta { font-size: 11px; color: var(--muted, #526073); }
.cmp-disp-edit { font-family: 'Quicksand', sans-serif; font-size: 12px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink, #0D1B2E); cursor: pointer; }
[data-theme="dark"] .cmp-disp-edit { color: #EAF0F6; border-color: rgba(255,255,255,0.16); }
.cmp-review { display: inline-block; margin-left: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: rgba(105,141,170,0.12); color: var(--muted, #526073); }
.cmp-review--due { background: rgba(217,119,6,0.14); color: #b45309; }
[data-theme="dark"] .cmp-review--due { color: #F0B24E; }


[data-section="tax-returns"] .panel-head {
  margin-bottom: 20px;
}
[data-section="tax-returns"] .panel-head h2 {
  font-size: 18px !important;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
[data-section="tax-returns"] .admin-inline-action {
  box-shadow: none;
}

/* Ensure OneDrive icon sits perfectly centred in the button */
[data-section="tax-returns"] .sync-sharepoint-btn {
  gap: 6px;
}
[data-section="tax-returns"] .sync-sharepoint-btn svg {
  display: block;
  flex-shrink: 0;
}
[data-section="tax-returns"] .sync-fathom-btn {
  gap: 6px;
}
[data-section="tax-returns"] .sync-fathom-btn svg {
  display: block;
  flex-shrink: 0;
}

[data-section="tax-returns"] .panel-head h2 {
  font-size: 18px !important;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Client identity header ──────────────────────────────── */
[data-section="tax-returns"] .client-id-panel-head {
  background: var(--surface, #f5f6f7);
  border-radius: 2px;
  border-bottom: none;
  padding: 20px 24px;
  margin-bottom: 20px;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

[data-section="tax-returns"] [data-theme="dark"] .client-id-panel-head {
  background: rgba(255,255,255,0.04);
}

[data-section="tax-returns"] .client-id-header {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1 1 0;
  min-width: 0;
}

[data-section="tax-returns"] .client-id-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  padding-right: 20px;
}

[data-section="tax-returns"] .client-id-header-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted, #6b7280);
  font-family: var(--font-body, Quicksand, sans-serif);
}

[data-section="tax-returns"] .client-id-header-id {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink, #1D1E1E);
  letter-spacing: 0.02em;
  font-family: var(--font-body, Quicksand, sans-serif);
}

[data-section="tax-returns"] .client-id-header-divider {
  width: 1px;
  align-self: stretch;
  background: var(--line, rgba(0,0,0,0.1));
  margin-right: 20px;
  flex-shrink: 0;
}

[data-section="tax-returns"] .client-id-header-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

[data-section="tax-returns"] .client-id-header-name {
  font-size: 21px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
  color: var(--brand, #161C33) !important;
  font-family: var(--font-heading, Marcellus, serif) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2 !important;
  max-width: 100%;
}

[data-section="tax-returns"] [data-theme="dark"] .client-id-header-name {
  color: #fff !important;
}

[data-section="tax-returns"] .client-id-header-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

[data-section="tax-returns"] .client-id-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

[data-section="tax-returns"] .client-id-meta-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted, #6b7280);
  font-family: var(--font-body, Quicksand, sans-serif);
}

[data-section="tax-returns"] .client-id-meta-value {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink, #1D1E1E);
  font-family: var(--font-body, Quicksand, sans-serif);
}

[data-section="tax-returns"] [data-theme="dark"] .client-id-meta-value {
  color: rgba(255,255,255,0.8);
}

/* ── Search row ──────────────────────────────────────────── */
[data-section="tax-returns"] .search-row,
[data-section="tax-returns"] .actions {
  display: flex;
  gap: 12px;
  align-items: end;
}

/* Search panel — identity-card style header */
[data-section="tax-returns"] #searchPanel {
  border-radius: var(--radius-outer); /* match all other .panel containers */
}

[data-section="tax-returns"] #searchPanel .panel-summary {
  padding: 18px 24px;
  background: #FFF;
  min-height: 72px;
}

[data-section="tax-returns"] [data-theme="dark"] #searchPanel .panel-summary {
  background: rgba(255,255,255,0.04);
}

/* No-client empty state */
[data-section="tax-returns"] .search-client-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 0;
  min-width: 0;
}

[data-section="tax-returns"] .search-client-icon {
  flex-shrink: 0;
  color: var(--muted);
  opacity: 0.6;
}

[data-section="tax-returns"] .search-client-prompt {
  font-family: Marcellus, Georgia, serif;
  font-size: 18px;
  color: var(--muted);
  letter-spacing: -0.01em;
}

/* Loaded-client state */
[data-section="tax-returns"] .search-client-loaded {
  flex: 1 1 0;
  min-width: 0;
}

/* ── Desktop search dropdown (bar never changes visually) ───── */

/* Hide legacy panel-body on desktop */
@media (min-width: 901px) {
  [data-section="tax-returns"] .search-panel-body-legacy {
    display: none !important;
  }
  [data-section="tax-returns"] #searchPanelDetails[open] > .search-panel-body-legacy {
    display: none !important;
  }
}

/* Input row — matches the bar's padding (18px 24px) so the icon stays put */
[data-section="tax-returns"] .desktop-search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;                 /* same as .search-client-empty gap */
  min-height: 72px;          /* same as the bar's min-height */
  padding: 0 24px;           /* same horizontal padding as the bar */
  box-sizing: border-box;
  border-bottom: 1px solid var(--line);
}

/* The dropdown's search icon must look identical to the bar's */
[data-section="tax-returns"] .desktop-search-input-row .search-client-icon {
  flex-shrink: 0;
  color: var(--muted);
  opacity: 0.6;
}

[data-section="tax-returns"] .desktop-search-input {
  flex: 1;
  min-width: 0;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: var(--ink) !important;
  font-family: Marcellus, Georgia, serif;
  font-size: 18px;           /* match the bar's "Search for a client" size */
  letter-spacing: -0.01em;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1.4;
  -webkit-appearance: none;
}
[data-section="tax-returns"] .desktop-search-input::placeholder { color: var(--muted); opacity: 0.6; }
[data-section="tax-returns"] .desktop-search-input::-webkit-search-cancel-button { display: none; }
[data-section="tax-returns"] [data-theme="dark"] .desktop-search-input { color: #EEE8DF !important; }

[data-section="tax-returns"] .desktop-search-close-btn {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  padding: 0;
  border: none !important;
  border-radius: 50%;
  background: rgba(13,27,46,0.08) !important;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: none !important;
  transition: background 140ms ease;
}
[data-section="tax-returns"] .desktop-search-close-btn:hover { background: rgba(13,27,46,0.16) !important; }
[data-section="tax-returns"] [data-theme="dark"] .desktop-search-close-btn {
  background: rgba(197,209,220,0.12) !important;
  color: #EEE8DF;
}

/* Desktop search dropdown — REPLACES the bar in place when searching.
   NO own border/radius/shadow: the parent #searchPanel (.panel) already provides
   a single 1px border + 20px radius + overflow:hidden, which frames and clips this.
   This avoids the double-stroke and keeps the same rounded top corners as the bar. */
[data-section="tax-returns"] .desktop-search-dropdown {
  background: var(--panel, #fff);
  border: none;
  border-radius: 0;
  box-shadow: none;
  max-height: 440px;
  overflow-y: auto;
  padding: 0 0 8px;
}
[data-section="tax-returns"] .desktop-search-dropdown.hidden { display: none !important; }

[data-section="tax-returns"] [data-theme="dark"] .desktop-search-dropdown {
  background: #182638;
}

/* When searching: hide the original "Search for a client" bar so ONLY the
   dropdown (its own input + recent clients) shows — replaces the bar in place. */
[data-section="tax-returns"] #searchPanel.is-searching > #searchPanelDetails { display: none !important; }

/* No visual change to the bar when search is open */
[data-section="tax-returns"] #searchPanel.is-searching .panel-summary {
  /* intentionally empty — bar must NOT change on click */
}

/* Results container gutter */
[data-section="tax-returns"] .desktop-search-results {
  padding: 6px 10px 2px;
}

/* Desktop results rows */
[data-section="tax-returns"] .desktop-search-section-label {
  font-family: 'Quicksand', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 4px 6px;
}

[data-section="tax-returns"] .desktop-search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  background: transparent;
  border: none !important;
  width: 100%;
  text-align: left;
  font-family: 'Quicksand', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  box-shadow: none !important;
  transition: background 120ms ease;
}
[data-section="tax-returns"] .desktop-search-result-item:hover { background: rgba(13,27,46,0.05) !important; }
/* "New" pill on newly-registered, not-yet-opened clients in the search dropdown. */
[data-section="tax-returns"] .desktop-search-new {
  display: inline-block;
  margin-right: 8px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  background: #1A5C45;
  padding: 2px 7px;
  border-radius: 999px;
  vertical-align: middle;
}
[data-section="tax-returns"] [data-theme="dark"] .desktop-search-new { background: #2E7D5B; }
[data-section="tax-returns"] .desktop-search-result-id {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  flex-shrink: 0;
}
[data-section="tax-returns"] [data-theme="dark"] .desktop-search-result-item { color: #EEE8DF; }
[data-section="tax-returns"] [data-theme="dark"] .desktop-search-result-item:hover { background: rgba(197,209,220,0.07) !important; }

[data-section="tax-returns"] .grow { flex: 1; }

/* ── Labels & fields ─────────────────────────────────────── */
[data-section="tax-returns"] label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

[data-section="tax-returns"] select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(13,27,46,0.13);
  border-radius: 12px;
  padding: 11px 14px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

[data-section="tax-returns"] input,
[data-section="tax-returns"] textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(13,27,46,0.13);
  border-radius: 12px;
  padding: 11px 14px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

[data-section="tax-returns"] textarea {
  resize: vertical;
  min-height: 360px;
}

[data-section="tax-returns"] input:focus,
[data-section="tax-returns"] textarea:focus,
[data-section="tax-returns"] select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: none;
}

/* ── Auth grid ───────────────────────────────────────────── */
[data-section="tax-returns"] .auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

[data-section="tax-returns"] .top-gap { margin-top: 16px; }
[data-section="tax-returns"] .form-actions { margin-top: 22px; }

[data-section="tax-returns"] .selection-panel {
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

[data-section="tax-returns"] .selection-head {
  margin-bottom: 18px;
}

[data-section="tax-returns"] .selection-head h3 {
  margin-bottom: 6px;
}

[data-section="tax-returns"] .selection-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

[data-section="tax-returns"] .pack-list {
  display: grid;
  gap: 14px;
}

[data-section="tax-returns"] .pack-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-outer);
  background: rgba(255,255,255,0.88);
  overflow: hidden;
}

[data-section="tax-returns"] .pack-card[open] {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}

[data-section="tax-returns"] .pack-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
}

[data-section="tax-returns"] .pack-summary::-webkit-details-marker {
  display: none;
}

[data-section="tax-returns"] .pack-summary-toggle {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 180ms ease;
  flex: 0 0 auto;
  margin-right: 4px;
}

[data-section="tax-returns"] .pack-card[open] .pack-summary-toggle {
  transform: rotate(-135deg);
}

[data-section="tax-returns"] .pack-toggle,
[data-section="tax-returns"] .document-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

[data-section="tax-returns"] .pack-toggle {
  flex: 1 1 auto;
}

[data-section="tax-returns"] .pack-toggle input,
[data-section="tax-returns"] .document-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

[data-section="tax-returns"] .checkbox-ui {
  width: 20px;
  height: 20px;
  border-radius: 8px;
  border: 1px solid rgba(13,27,46,0.18);
  background: #fff;
  flex: 0 0 auto;
  margin-top: 1px;
  position: relative;
}

[data-section="tax-returns"] .pack-toggle input:checked + .checkbox-ui,
[data-section="tax-returns"] .document-toggle input:checked + .checkbox-ui {
  background: #1C3149;
  border-color: #1C3149;
}

[data-section="tax-returns"] .pack-toggle input:checked + .checkbox-ui::after,
[data-section="tax-returns"] .document-toggle input:checked + .checkbox-ui::after,
[data-section="tax-returns"] .pack-toggle input:indeterminate + .checkbox-ui::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

[data-section="tax-returns"] .pack-toggle input:indeterminate + .checkbox-ui::after {
  left: 4px;
  top: 8px;
  width: 10px;
  height: 0;
  border-width: 0 0 2px 0;
  transform: none;
}

[data-section="tax-returns"] .pack-copy {
  display: grid;
  gap: 3px;
}

[data-section="tax-returns"] .pack-copy strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

[data-section="tax-returns"] .pack-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

[data-section="tax-returns"] .pack-documents {
  display: grid;
  gap: 10px;
  padding: 14px 18px 16px 50px;
  border-top: 1px solid var(--line);
}

/* ── Standalone company document groups ─────────────────── */
[data-section="tax-returns"] .company-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-outer);
  overflow: hidden;
}

[data-section="tax-returns"] .company-group-head {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(105,141,170,0.08);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-family: Marcellus, serif;
  letter-spacing: 0.03em;
  color: var(--ink);
  cursor: pointer;
}

[data-section="tax-returns"] .company-group-head::-webkit-details-marker { display: none; }

[data-section="tax-returns"] details.company-group:not([open]) .company-group-head {
  border-bottom: none;
}

[data-section="tax-returns"] details.company-group[open] .pack-summary-toggle {
  transform: rotate(-135deg);
}

[data-section="tax-returns"] .company-group-documents {
  padding: 6px 0;
}

[data-section="tax-returns"] .company-group-documents .document-toggle {
  padding: 8px 14px;
}

[data-section="tax-returns"] .document-toggle span:last-child {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

[data-section="tax-returns"] .admin-dashboard-card {
  padding: 0;
  overflow: hidden;
}

/* backdrop-filter on <details> creates a stacking context that can freeze the painted
   clipping boundary at the card's initial (empty) height — removing it on auth group
   cards that start empty and grow when JS fills them. The opaque --panel background
   means the blur effect is invisible anyway. */
[data-section="tax-returns"] .admin-authorisation-group:not(.authorisation-create-panel) {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

[data-section="tax-returns"] .meeting-notes-empty-state {
  border-color: rgba(13, 27, 46, 0.22) !important;
}
[data-section="tax-returns"] [data-theme="dark"] .meeting-notes-empty-state {
  border-color: rgba(197, 209, 220, 0.28) !important;
}

[data-section="tax-returns"] .admin-dashboard-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  min-height: 58.34px;
  border-bottom: 1px solid var(--line);
  background: #F7F8FA;
}

[data-section="tax-returns"] summary.admin-dashboard-head {
  cursor: pointer;
  list-style: none;
}

[data-section="tax-returns"] summary.admin-dashboard-head::-webkit-details-marker {
  display: none;
}

/* When the group is collapsed the summary is the only visible content —
   its border-bottom would sit on top of the panel's own bottom border,
   producing a double line. Hide it unless the group is open. */
[data-section="tax-returns"] .admin-authorisation-group:not([open]) > summary.admin-dashboard-head {
  border-bottom: none;
}

[data-section="tax-returns"] .admin-authorisation-group .pack-summary-toggle {
  margin-left: 6px;
}

/* Push the toggle to the far right in simple h3-only dashboard heads */
[data-section="tax-returns"] summary.admin-dashboard-head > h3 {
  flex: 1;
}

/* ── Send All group (button + dropdown) ─────────────────────────────── */
[data-section="tax-returns"] .send-all-group {
  position: relative;
  display: flex;
  align-items: center;
}

[data-section="tax-returns"] .send-all-btn {
  font-size: 11px;
  padding: 5px 12px;
  white-space: nowrap;
}

[data-section="tax-returns"] [data-theme="dark"] .send-all-btn {
  border-color: rgba(139,175,200,0.35);
  color: #8BAFC8;
}

[data-section="tax-returns"] .send-all-menu {
  /* Concentric corners: the items fill this menu's padding box, so their radius
     is derived from these two values (see .send-all-menu-item). Change either
     and the item radius follows automatically. */
  --menu-radius: 12px;
  --menu-pad: 6px;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 200;
  min-width: 230px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, rgba(13,27,46,0.12));
  border-radius: var(--menu-radius);
  box-shadow: none;
  padding: var(--menu-pad);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

[data-section="tax-returns"] .send-all-menu-item {
  appearance: none;
  display: grid;
  grid-template-columns: 16px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 2px;
  align-items: start;
  width: 100%;
  padding: 10px 12px;
  border: none;
  /* Concentric with .send-all-menu: outer radius − the gap between them (the
     menu's padding). Was a hardcoded 8px, which bulged past the menu's corner
     arc. Expressed as calc so it stays correct if either value changes. */
  border-radius: calc(var(--menu-radius, 12px) - var(--menu-pad, 6px));
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

[data-section="tax-returns"] .send-all-menu-item svg {
  grid-row: 1;
  grid-column: 1;
  margin-top: 2px;
}

[data-section="tax-returns"] .send-all-menu-item:hover {
  background: rgba(105,141,170,0.10);
}

[data-section="tax-returns"] .send-all-menu-sub {
  grid-column: 2;
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
}


[data-section="tax-returns"] [data-theme="dark"] .send-all-menu {
  background: #162033;
  border-color: rgba(139,175,200,0.2);
  box-shadow: none;
}

[data-section="tax-returns"] [data-theme="dark"] .send-all-menu-item:hover {
  background: rgba(105,141,170,0.12);
}


/* ── Refresh icon button (Lottie autorenew, 1.5× nav icon = 27px) ───── */
[data-section="tax-returns"] .refresh-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(13,27,46,0.13);
  background: rgba(105,141,170,0.08);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 150ms ease, border-color 150ms ease;
  box-shadow: none;
}

[data-section="tax-returns"] .refresh-icon-btn:hover:not(:disabled) {
  background: rgba(105,141,170,0.16);
  border-color: rgba(105,141,170,0.35);
  transform: none;
  box-shadow: none;
}

[data-section="tax-returns"] .refresh-icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

[data-section="tax-returns"] .refresh-lottie-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  color: inherit;
}

[data-section="tax-returns"] .refresh-lottie-icon svg,
[data-section="tax-returns"] .refresh-lottie-icon .nav-icon-fallback {
  width: 27px;
  height: 27px;
  display: block;
}

[data-section="tax-returns"] .refresh-lottie-icon .nav-icon-lottie {
  width: 27px !important;
  height: 27px !important;
  min-width: 27px;
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

[data-section="tax-returns"] .refresh-lottie-icon .nav-icon-lottie svg {
  width: 27px !important;
  height: 27px !important;
}

[data-section="tax-returns"] .refresh-lottie-icon.has-lottie .nav-icon-fallback { opacity: 0; }

[data-section="tax-returns"] [data-theme="dark"] .refresh-icon-btn {
  border-color: rgba(139,175,200,0.22);
  background: rgba(78,122,151,0.10);
  color: #8BAFC8;
}

[data-section="tax-returns"] [data-theme="dark"] .refresh-icon-btn:hover:not(:disabled) {
  background: rgba(78,122,151,0.20);
  border-color: rgba(139,175,200,0.38);
}

[data-section="tax-returns"] .admin-authorisation-group[open] > summary .pack-summary-toggle {
  transform: rotate(-135deg);
}

/* ── Create Authorisations: summary floats as its own card when open ── */
[data-section="tax-returns"] .authorisation-create-panel[open] {
  border: none;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}

[data-section="tax-returns"] .authorisation-create-panel > summary.admin-dashboard-head {
  background: #F7F8FA;
}

[data-section="tax-returns"] .authorisation-create-panel[open] > summary.admin-dashboard-head {
  border: 1px solid var(--line);
  border-radius: var(--radius-outer);
  background: #F7F8FA;   /* opaque — a backdrop blur here had nothing to blur */
  margin-bottom: 10px;
}

[data-section="tax-returns"] [data-theme="dark"] .authorisation-create-panel > summary.admin-dashboard-head {
  background: #1C3149;
}

[data-section="tax-returns"] [data-theme="dark"] .authorisation-create-panel[open] > summary.admin-dashboard-head {
  background: #1C3149;
}

/* ── In progress / Completed: unified card — header + table in one rounded card ── */
/* overflow: hidden stays from .admin-dashboard-card — clips table to card border-radius */
/* Send All dropdown uses position: fixed (set by JS) to escape the overflow container */
[data-section="tax-returns"] .admin-authorisation-group:not(.authorisation-create-panel)[open] > summary.admin-dashboard-head {
  border-radius: 0;
  margin-bottom: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: #F7F8FA;
  border-bottom: none;
}
[data-section="tax-returns"] [data-theme="dark"] .admin-authorisation-group:not(.authorisation-create-panel)[open] > summary.admin-dashboard-head {
  background: #1C3149;
}

[data-section="tax-returns"] .create-authorisation-body {
  padding: 0;
}

/* ── Create-auth two-column layout ────────────────────────── */
[data-section="tax-returns"] .create-auth-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 0 20px 20px;
}

[data-section="tax-returns"] .create-auth-layout > .selection-panel {
  flex: 1 1 0;
  min-width: 0;
}

/* ── Basket panel ─────────────────────────────────────────── */
[data-section="tax-returns"] .basket-panel {
  flex: 0 0 330px;
  width: 330px;
  background: rgba(255,255,255,0.97);
  border: 1px solid var(--line);
  border-radius: var(--radius-outer);
  overflow: hidden;
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
}

[data-section="tax-returns"] .basket-header {
  padding: 16px 18px 13px;
  border-bottom: 1px solid var(--line);
}

[data-section="tax-returns"] .basket-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

[data-section="tax-returns"] .basket-title {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

[data-section="tax-returns"] .basket-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  border-radius: 12px;
  background: #161C33;
  color: #C5D1DC;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  transition: transform 160ms cubic-bezier(.34,1.56,.64,1);
}

[data-section="tax-returns"] .basket-sub {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

[data-section="tax-returns"] .basket-body {
  flex: 1;
  min-height: 72px;
  max-height: 260px;
  overflow-y: auto;
}

[data-section="tax-returns"] .basket-empty {
  padding: 20px 18px;
}
[data-section="tax-returns"] .basket-empty p { margin: 0; }

[data-section="tax-returns"] .basket-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(13,27,46,0.06);
}
[data-section="tax-returns"] .basket-item:last-child { border-bottom: none; }

[data-section="tax-returns"] .basket-item-icon {
  flex-shrink: 0;
  color: var(--muted);
}

[data-section="tax-returns"] .basket-item-body {
  flex: 1;
  min-width: 0;
}

[data-section="tax-returns"] .basket-item-name {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

[data-section="tax-returns"] .basket-item-group {
  display: block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-top: 2px;
}

[data-section="tax-returns"] .basket-item-remove {
  flex-shrink: 0;
  appearance: none;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  background: rgba(13,27,46,0.07);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: background 120ms, color 120ms;
}
[data-section="tax-returns"] .basket-item-remove:hover:not(:disabled) {
  background: rgba(140,36,18,0.12);
  color: var(--danger);
  transform: none;
  box-shadow: none;
  opacity: 1;
}

/* ── Basket item actions (note btn + remove) ──────────────── */
[data-section="tax-returns"] .basket-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Note button — circular icon */
[data-section="tax-returns"] .basket-item-note-btn {
  flex-shrink: 0;
  appearance: none;
  border: 1.5px solid rgba(13,27,46,0.14);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: border-color 120ms, background 120ms, color 120ms;
}
[data-section="tax-returns"] .basket-item-note-btn:hover:not(:disabled) {
  border-color: #161C33;
  background: rgba(13,27,46,0.06);
  color: #161C33;
  transform: none;
  box-shadow: none;
  opacity: 1;
}
[data-section="tax-returns"] .basket-item-note-btn.has-note {
  border-color: #136639;
  background: rgba(19,102,57,0.08);
  color: #136639;
}
[data-section="tax-returns"] [data-theme="dark"] .basket-item-note-btn {
  border-color: rgba(139,175,200,0.25);
  color: #8BAFC8;
}
[data-section="tax-returns"] [data-theme="dark"] .basket-item-note-btn:hover:not(:disabled) {
  border-color: #8BAFC8;
  background: rgba(139,175,200,0.10);
  color: #c6d8e6;
}
[data-section="tax-returns"] [data-theme="dark"] .basket-item-note-btn.has-note {
  border-color: #4fd98a;
  background: rgba(51,179,108,0.14);
  color: #4fd98a;
}

/* Note preview text below doc name */
[data-section="tax-returns"] .basket-item-note-preview {
  display: block;
  font-size: 11px;
  color: #136639;
  font-style: italic;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
[data-section="tax-returns"] [data-theme="dark"] .basket-item-note-preview { color: #4fd98a; }

/* Inline custom doc name input in doc list */
/* The "Other" row holds its name field: let the row wrap so the input drops to
   its own full-width line below the checkbox + label instead of being crushed
   in beside them. */
[data-section="tax-returns"] .create-auth-doc-item:has(.doc-req-inline-input) { flex-wrap: wrap; }
[data-section="tax-returns"] .doc-req-inline-input {
  flex: 1 0 100%;
  width: 100%;
  box-sizing: border-box;
  margin: 8px 0 0 0;      /* own full-width line within the row's padding */
  padding: 9px 12px;
  border: 1px solid rgba(13,27,46,0.18);
  border-radius: 8px;
  font-family: 'Quicksand', sans-serif;
  font-size: 13px;
  background: #fff;
  color: var(--ink);
}
[data-section="tax-returns"] .doc-req-inline-input:focus { outline: none; border-color: #698DAA; }
[data-section="tax-returns"] [data-theme="dark"] .doc-req-inline-input {
  background: rgba(0,0,0,0.2);
  border-color: rgba(139,175,200,0.22);
  color: #EEE8DF;
}

/* ── Document Request note modal ───────────────────────────── */
[data-section="tax-returns"] .doc-note-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-section="tax-returns"] .doc-note-modal.hidden { display: none; }

[data-section="tax-returns"] .doc-note-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13,27,46,0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

[data-section="tax-returns"] .doc-note-dialog {
  position: relative;
  background: #fff;
  border-radius: var(--radius-outer);
  box-shadow: none;
  width: min(480px, calc(100vw - 32px));
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
[data-section="tax-returns"] [data-theme="dark"] .doc-note-dialog {
  background: #0F1D30;
  border: 1px solid rgba(78,122,151,0.22);
}

[data-section="tax-returns"] .doc-note-dialog-title {
  font-family: 'Marcellus', serif;
  font-size: 18px;
  font-weight: 400;
  color: #161C33;
  margin: 0;
}
[data-section="tax-returns"] [data-theme="dark"] .doc-note-dialog-title { color: #EEE8DF; }

[data-section="tax-returns"] .doc-note-dialog-sub {
  font-family: 'Quicksand', sans-serif;
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

[data-section="tax-returns"] .doc-note-textarea {
  width: 100%;
  min-height: 100px;
  padding: 11px 13px;
  border: 1px solid rgba(13,27,46,0.16);
  border-radius: 12px;
  font-family: 'Quicksand', sans-serif;
  font-size: 13px;
  color: var(--ink);
  background: #f9fbff;
  resize: vertical;
  outline: none;
  transition: border-color 150ms;
}
[data-section="tax-returns"] .doc-note-textarea:focus { border-color: #698DAA; }
[data-section="tax-returns"] [data-theme="dark"] .doc-note-textarea {
  background: rgba(0,0,0,0.2);
  border-color: rgba(139,175,200,0.22);
  color: #EEE8DF;
}

[data-section="tax-returns"] .doc-note-dialog-footer {
  display: flex;
  justify-content: flex-end;
}

[data-section="tax-returns"] .doc-note-done-btn {
  background: #161C33;
  color: #C5D1DC;
  border: none;
  border-radius: 999px;
  padding: 10px 28px;
  font-family: 'Quicksand', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  transition: background 130ms;
}
[data-section="tax-returns"] .doc-note-done-btn:hover { background: #1f2d50; opacity: 1; transform: none; box-shadow: none; }
[data-section="tax-returns"] [data-theme="dark"] .doc-note-done-btn { background: #1C3149; color: #8AAFC8; }
[data-section="tax-returns"] [data-theme="dark"] .doc-note-done-btn:hover { background: #223b57; }

/* ── Basket footer ─────────────────────────────────────────── */
[data-section="tax-returns"] .basket-footer {
  padding: 14px 18px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

[data-section="tax-returns"] .basket-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

[data-section="tax-returns"] .basket-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

[data-section="tax-returns"] .basket-input {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid rgba(13,27,46,0.15);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 12px;
  color: var(--ink);
}
[data-section="tax-returns"] .basket-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: none;
}

/* ── Delivery toggle ───────────────────────────────────────── */
[data-section="tax-returns"] .basket-delivery {
  display: flex;
  gap: 7px;
}

[data-section="tax-returns"] .basket-delivery-option {
  flex: 1;
  cursor: pointer;
}

[data-section="tax-returns"] .basket-delivery-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

[data-section="tax-returns"] .basket-delivery-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1.5px solid rgba(13,27,46,0.12);
  background: rgba(105,141,170,0.10);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  transition: border-color 130ms, box-shadow 130ms;
  white-space: nowrap;
  width: 100%;
}

[data-section="tax-returns"] .basket-delivery-option input:checked + span {
  border-color: var(--brand);
  box-shadow: none;
}

/* ── Send CTA ──────────────────────────────────────────────── */
[data-section="tax-returns"] .basket-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 12px 16px;
  background: #161C33;
  color: #C5D1DC;
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  transition: opacity 150ms ease, transform 130ms ease, box-shadow 150ms ease;
}
[data-section="tax-returns"] .basket-send-btn:hover:not(:disabled) {
  opacity: 0.88;
  box-shadow: none;
}

[data-section="tax-returns"] .basket-send-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border-radius: 8px;
  background: rgba(197,209,220,0.22);
  font-size: 11px;
  font-weight: 700;
}

[data-section="tax-returns"] .basket-disclaimer {
  margin: 0;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

[data-section="tax-returns"] .basket-fill-divider {
  height: 1px;
  background: var(--line);
  margin: 10px 0 4px;
  opacity: 0.6;
}

[data-section="tax-returns"] .basket-fill-btn {
  background: transparent !important;
  color: var(--ink) !important;
  border: 1.5px solid var(--line) !important;
  box-shadow: none !important;
}
[data-section="tax-returns"] .basket-fill-btn:hover:not(:disabled) {
  background: var(--panel) !important;
  box-shadow: none !important;
}

[data-section="tax-returns"] .basket-fill-status {
  margin: 6px 0 0;
  font-size: 10px;
  min-height: 14px;
  color: var(--muted);
}
[data-section="tax-returns"] .basket-fill-status.is-error { color: var(--danger); }
[data-section="tax-returns"] .basket-fill-status.is-success { color: var(--success); }
[data-section="tax-returns"] .basket-fill-status.is-info { color: var(--muted); }
[data-section="tax-returns"] .basket-fill-link { color: var(--success); text-decoration: underline; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  [data-section="tax-returns"] .create-auth-layout {
    flex-direction: column;
  }
  [data-section="tax-returns"] .basket-panel {
    flex: 0 0 auto;
    width: 100%;
    position: static;
  }
}

/* ── Dark mode ─────────────────────────────────────────────── */
[data-section="tax-returns"] [data-theme="dark"] .basket-panel {
  background: #0F1D30;
  border-color: rgba(78,122,151,0.22);
}

[data-section="tax-returns"] [data-theme="dark"] #createAuthorisation {
  background: #1C3149;
  color: #8AAFC8;
  border-color: transparent;
}
[data-section="tax-returns"] [data-theme="dark"] #createAuthorisation:hover:not(:disabled) {
  background: #223b57;
  color: #c6d8e6;
}
[data-section="tax-returns"] [data-theme="dark"] .basket-badge {
  background: #1C3149;
  color: #8AAFC8;
}

[data-section="tax-returns"] [data-theme="dark"] .basket-header,
[data-section="tax-returns"] [data-theme="dark"] .basket-footer {
  border-color: rgba(78,122,151,0.18);
}

[data-section="tax-returns"] [data-theme="dark"] .basket-item {
  border-bottom-color: rgba(78,122,151,0.10);
}

[data-section="tax-returns"] [data-theme="dark"] .basket-input {
  background: rgba(0,0,0,0.18);
  border-color: rgba(139,175,200,0.2);
  color: #EEE8DF;
}

[data-section="tax-returns"] [data-theme="dark"] .basket-delivery-option span {
  border-color: rgba(139,175,200,0.2);
  background: rgba(0,0,0,0.15);
  color: #8BAFC8;
}

/* Remove button shadows in dark mode */
[data-section="tax-returns"] [data-theme="dark"] button {
  box-shadow: none;
}
[data-section="tax-returns"] [data-theme="dark"] button:hover:not(:disabled) {
  box-shadow: none;
}
[data-section="tax-returns"] [data-theme="dark"] .basket-send-btn {
  background: #3F5E85;
  color: #EEE8DF;
  border: 1px solid rgba(139,175,200,0.25);
  box-shadow: none;
}
[data-section="tax-returns"] [data-theme="dark"] .basket-send-btn:hover:not(:disabled) {
  background: #4d6f9a;
  box-shadow: none;
}

[data-section="tax-returns"] .admin-dashboard-head .group-count {
  position: static;
  transform: none;
}

[data-section="tax-returns"] .admin-dashboard-head h3 {
  margin: 0;
  font-family: 'Marcellus', serif;
  font-size: 17px;
  flex: 0 0 auto;
}

/* Heading + pill grouped tightly on the LEFT — used by FICA document sections */
[data-section="tax-returns"] .auth-group-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

/* Heading + pill + count grouped inline, flex:1 pushes send-all/toggle right */
[data-section="tax-returns"] .auth-head-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

[data-section="tax-returns"] .auth-head-label h3 {
  margin: 0;
}

[data-section="tax-returns"] .admin-dashboard-list {
  display: flex;
  flex-direction: column;
}

[data-section="tax-returns"] .dashboard-list-item {
  appearance: none;
  display: grid;
  gap: 14px;
  align-items: center;
  padding: 18px 22px;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-decoration: none;
  text-align: left;
  box-shadow: none;
}

[data-section="tax-returns"] .admin-dashboard-list > :last-child:not(.auth-table-row) {
  border-bottom: 0;
}

[data-section="tax-returns"] .dashboard-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(105,141,170,0.45);
  box-shadow: none;
}

[data-section="tax-returns"] .dashboard-item-dot.is-complete {
  background: #33b36c;
  box-shadow: none;
}

[data-section="tax-returns"] .dashboard-item-dot.is-progress {
  background: #d4a33d;
  box-shadow: none;
}

[data-section="tax-returns"] .dashboard-item-dot.is-required {
  background: #b24d37;
  box-shadow: none;
}

/* Awaiting-advisor: amber dot with subtle pulse to signal partial completion */
[data-section="tax-returns"] .dashboard-item-dot.is-progress[data-status="awaiting-advisor"] {
  animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%,
100% { opacity: 1; }
  50% { opacity: 0.45; }
}

[data-section="tax-returns"] .dashboard-item-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  align-items: flex-start; /* prevent pills/badges from stretching full width */
}

[data-section="tax-returns"] .dashboard-item-copy strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

[data-section="tax-returns"] .dashboard-item-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 400;
}

[data-section="tax-returns"] .dashboard-item-copy .document-request-note,
[data-section="tax-returns"] .dashboard-item-copy .document-request-file,
[data-section="tax-returns"] .auth-request-detail {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 400;
}

[data-section="tax-returns"] .dashboard-item-copy .document-request-file,
[data-section="tax-returns"] .auth-request-file {
  color: var(--ink-soft);
}

[data-section="tax-returns"] .authorisation-timeline-row {
  display: block;
}

[data-section="tax-returns"] .dashboard-item-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-family: 'Quicksand', sans-serif;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  text-transform: capitalize;
}

[data-section="tax-returns"] .dashboard-item-pill.is-complete {
  background: rgba(51,179,108,0.14);
  color: #16824a;
}

[data-section="tax-returns"] .dashboard-item-pill.is-progress {
  background: rgb(255 172 0 / 25%);
  color: #d9ac31;
}

[data-section="tax-returns"] .dashboard-item-pill.is-required {
  background: rgba(140,36,18,0.10);
  color: #b24d37;
}

[data-section="tax-returns"] .dashboard-empty {
  padding: 20px 22px;
}

/* Staff attribution pill — "Created by X" / "Awaiting X" */
[data-section="tax-returns"] .staff-creator-pill,
[data-section="tax-returns"] .staff-awaiting-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
  margin-top: 3px;
}

[data-section="tax-returns"] .staff-creator-pill {
  color: var(--brand);
  background: rgba(78, 122, 151, 0.1);
  border: 1px solid rgba(78, 122, 151, 0.22);
}

[data-section="tax-returns"] .staff-awaiting-pill {
  color: #7a6030;
  background: rgba(196, 154, 48, 0.12);
  border: 1px solid rgba(196, 154, 48, 0.28);
}

[data-section="tax-returns"] [data-theme="dark"] .staff-creator-pill {
  color: rgba(197, 209, 220, 0.85);
  background: rgba(78, 122, 151, 0.18);
  border-color: rgba(78, 122, 151, 0.35);
}

[data-section="tax-returns"] [data-theme="dark"] .staff-awaiting-pill {
  color: rgba(220, 195, 120, 0.9);
  background: rgba(196, 154, 48, 0.15);
  border-color: rgba(196, 154, 48, 0.3);
}

[data-section="tax-returns"] .dashboard-list-item.admin-authorisation-item,
[data-section="tax-returns"] .dashboard-list-item.advisor-task-item {
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 16px 22px;
  align-items: center;
}

/* Refined card background on hover */
[data-section="tax-returns"] .dashboard-list-item.advisor-task-item:hover {
  background: rgba(78,122,151,0.04);
  transition: background 140ms ease;
}
[data-section="tax-returns"] [data-theme="dark"] .dashboard-list-item.advisor-task-item:hover {
  background: rgba(197,209,220,0.04);
}

/* No side borders on the advisor tasks list — only row dividers */
[data-section="tax-returns"] #advisorTasksBody .admin-dashboard-list {
  border: none;
  border-radius: 0;
  overflow: visible;
}

/* "Open to Sign" inside advisor task — outlined pill, consistent with ghost actions */
[data-section="tax-returns"] .advisor-task-item .admin-inline-action--link {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(13, 27, 46, 0.22);
  padding: 0 16px;
  min-height: 36px;
  font-size: 12px;
  white-space: nowrap;
}
[data-section="tax-returns"] .advisor-task-item .admin-inline-action--link:hover {
  background: rgba(13, 27, 46, 0.05);
  border-color: rgba(13, 27, 46, 0.35);
  box-shadow: none;
}
[data-section="tax-returns"] [data-theme="dark"] .advisor-task-item .admin-inline-action--link {
  background: transparent;
  color: #C5D1DC;
  border-color: rgba(197, 209, 220, 0.28);
}
[data-section="tax-returns"] [data-theme="dark"] .advisor-task-item .admin-inline-action--link:hover {
  background: rgba(197, 209, 220, 0.07);
  border-color: rgba(197, 209, 220, 0.45);
}

[data-section="tax-returns"] .admin-authorisation-actions {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

[data-section="tax-returns"] .admin-authorisation-actions .icon-button {
  position: static;
  transform: none;
}

[data-section="tax-returns"] .admin-authorisation-actions .icon-button:hover {
  transform: none;   /* cancel the base hover's translateY(-50%) centering — these are inline */
}

/* View icon button — blue hover instead of red */
[data-section="tax-returns"] .admin-authorisation-actions .icon-button.view-document:hover {
  background: rgba(13,27,46,0.10);
  color: var(--brand, #161C33);
  border-color: rgba(13,27,46,0.18);
}

[data-section="tax-returns"] [data-theme="dark"] .admin-authorisation-actions .icon-button.view-document:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.2);
}

/* ── Hover-reveal actions (documents, meeting notes, correspondence) ── */
[data-section="tax-returns"] #documentsList .admin-authorisation-item .admin-authorisation-actions,
[data-section="tax-returns"] #correspondenceList .meeting-note-card .icon-button.delete-correspondence {
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
[data-section="tax-returns"] #documentsList .admin-authorisation-item:hover .admin-authorisation-actions,
[data-section="tax-returns"] #documentsList .admin-authorisation-item:focus-within .admin-authorisation-actions,
[data-section="tax-returns"] #correspondenceList .meeting-note-card:hover .icon-button.delete-correspondence,
[data-section="tax-returns"] #correspondenceList .meeting-note-card:focus-within .icon-button.delete-correspondence {
  opacity: 1;
  pointer-events: auto;
}

/* Meeting note Watch/× buttons: only visible when the card is open */
[data-section="tax-returns"] #meetingNotesList .meeting-note-card .meeting-note-head-actions {
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
[data-section="tax-returns"] #meetingNotesList .meeting-note-card[open] .meeting-note-head-actions {
  opacity: 1;
  pointer-events: auto;
}

/* ── Other Documents: collapsible, closed by default ─────── */

/* Toggle header — looks and behaves like other interactive rows */
[data-section="tax-returns"] .doc-section-head--toggle {
  cursor: pointer;
  user-select: none;
  transition: background 140ms ease;
}

[data-section="tax-returns"] .doc-section-head--toggle:hover {
  background: rgba(105,141,170,0.10);
}

[data-section="tax-returns"] [data-theme="dark"] .doc-section-head--toggle:hover {
  background: rgba(255,255,255,0.06);
}

[data-section="tax-returns"] .doc-section-head--toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

/* Body hidden until .is-open is toggled on */
[data-section="tax-returns"] .doc-section-collapsible .admin-dashboard-list {
  display: none;
}

[data-section="tax-returns"] .doc-section-collapsible.is-open .admin-dashboard-list {
  display: flex;
}

/* Suppress border-bottom whether collapsed or expanded — matches the auth group behaviour */
[data-section="tax-returns"] .doc-section-collapsible:not(.is-open) .doc-section-head--toggle,
[data-section="tax-returns"] .doc-section-collapsible.is-open .doc-section-head--toggle {
  border-bottom: none;
}

/* ── Docs-style table (Completed Authorisations + Other Documents) ── */
[data-section="tax-returns"] .docs-table-wrap {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(16,24,48,0.08);
  border-radius: var(--radius-outer, 16px);
  overflow-x: auto;
}
[data-section="tax-returns"] .docs-table { width: 100%; border-collapse: collapse; }
[data-section="tax-returns"] .docs-table thead th {
  text-align: left;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 13px;
  line-height: 17.36px;
  letter-spacing: 0.01em;
  text-transform: capitalize;
  color: var(--muted);
  padding: 14px 16px;
  border-bottom: 1px solid rgba(16,24,48,0.08);
  white-space: nowrap;
}
[data-section="tax-returns"] .docs-table tbody td {
  font-family: 'Quicksand', sans-serif;
  font-weight: 400;
  font-size: 13px;
  line-height: 20.15px;
  color: #434343;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(16,24,48,0.06);
  vertical-align: middle;
}
[data-section="tax-returns"] .docs-table tbody tr:last-child td { border-bottom: none; }
[data-section="tax-returns"] .docs-row:hover { background: rgba(105,141,170,0.06); }
[data-section="tax-returns"] .docs-c-icon {
  width: 52px;
  padding: 10px 8px 10px 0;
  vertical-align: middle;
}
[data-section="tax-returns"] .doc-inst-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(13,27,46,0.10);
  background: rgba(255,255,255,0.90);
  color: #698DAA;
  flex-shrink: 0;
}
[data-section="tax-returns"] .doc-inst-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
[data-section="tax-returns"] .doc-inst-icon svg {
  width: 18px;
  height: 18px;
}
[data-section="tax-returns"] [data-theme="dark"] .doc-inst-icon {
  background: rgba(15,29,48,0.80);
  border-color: rgba(139,175,200,0.16);
  color: #8BAFC8;
}
/* Dark-mode logo variants: show inst-logo-dark, hide inst-logo-light */
[data-section="tax-returns"] .inst-logo-dark { display: none; }
[data-section="tax-returns"] [data-theme="dark"] .inst-logo-light { display: none; }
[data-section="tax-returns"] [data-theme="dark"] .inst-logo-dark { display: block; }
/* DOCUMENT NAME header: align with section title padding via colspan=2 */
[data-section="tax-returns"] .docs-table th.docs-c-title { padding-left: 0; }
/* Dashboard "Requires Your Signature" section head: 20px */
[data-section="tax-returns"] #advisorTasksBody .docs-table th.docs-c-title { padding-left: 20px; }
/* Documents page sections (In Progress / Signed / Uploaded) section head: 22px */
[data-section="tax-returns"] .admin-authorisation-group .docs-table th.docs-c-title { padding-left: 22px; }
[data-section="tax-returns"] .docs-c-title { font-weight: 600; color: var(--text, #0D1B2E); overflow-wrap: anywhere; word-break: break-word; }
[data-section="tax-returns"] .docs-c-title strong { font-weight: 600; }
/* Actions column header sits flush right, above the right-aligned action buttons */
[data-section="tax-returns"] .docs-table th.col-actions { text-align: right; }
[data-section="tax-returns"] .docs-c-note { color: var(--muted); max-width: 280px; }
[data-section="tax-returns"] .docs-c-date { color: var(--muted); white-space: nowrap; }
[data-section="tax-returns"] .docs-c-created { color: var(--muted); white-space: nowrap; }
[data-section="tax-returns"] .docs-c-status { white-space: nowrap; }
[data-section="tax-returns"] .docs-muted { color: var(--muted); opacity: 0.6; }
[data-section="tax-returns"] .docs-file {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit; max-width: 100%;
}
/* Keep the file chip inside its column so it can't overlap the next column */
[data-section="tax-returns"] .docs-table td.docs-c-file { overflow: hidden; }
/* File column that also carries the delete control: chip fills, bin sits at the end */
[data-section="tax-returns"] .docs-file-action { display: flex; align-items: center; gap: 12px; }
[data-section="tax-returns"] .docs-file-action .docs-file { flex: 1 1 auto; min-width: 0; }
[data-section="tax-returns"] .docs-file-action .icon-button {
  flex: 0 0 auto; position: static; transform: none;
  margin-left: auto;
}

/* Animated trash (Lottie) icon for delete buttons — static SVG fallback until hover */
[data-section="tax-returns"] .del-lottie {
  display: inline-flex; width: 16px; height: 16px; line-height: 0;
  align-items: center; justify-content: center;
}
[data-section="tax-returns"] .del-lottie-fallback { width: 16px; height: 16px; display: block; }
[data-section="tax-returns"] .del-lottie-anim { width: 16px; height: 16px; display: none; }
[data-section="tax-returns"] .del-lottie.has-lottie .del-lottie-anim { display: block; }
[data-section="tax-returns"] .del-lottie.has-lottie .del-lottie-fallback { display: none; }
/* Red hover state for all delete controls (Lottie inherits via currentColor) */
[data-section="tax-returns"] .delete-authorisation:hover,
[data-section="tax-returns"] .delete-document:hover,
[data-section="tax-returns"] .delete-prospect:hover,
[data-section="tax-returns"] .docs-row-delete:hover,
[data-section="tax-returns"] .delete-meeting-note:hover,
[data-section="tax-returns"] .delete-correspondence:hover {
  color: #c0392b;
  background: rgba(192,57,43,0.10);
}
[data-section="tax-returns"] .docs-table .ftype { width: 28px; height: 34px; }
[data-section="tax-returns"] .docs-table .ftype span { font-size: 9px; font-weight: 700; color: var(--ac-steel, #698DAA); }
[data-section="tax-returns"] .docs-fname {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text, #0D1B2E);
}
[data-section="tax-returns"] a.docs-file:hover .docs-fname { color: var(--ac-steel, #698DAA); text-decoration: underline; }
[data-section="tax-returns"] .docs-status-cell { display: inline-flex; align-items: center; gap: 10px; }
[data-section="tax-returns"] .docs-row-delete {
  opacity: 0; pointer-events: none;
  width: 30px; height: 30px; padding: 0;
  background: rgba(13,27,46,0.06); border: 1px solid rgba(13,27,46,0.10); cursor: pointer;
  color: var(--muted); border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: opacity 140ms ease, color 140ms ease, background 140ms ease;
}
[data-section="tax-returns"] .docs-row:hover .docs-row-delete { opacity: 1; pointer-events: auto; }
[data-section="tax-returns"] .docs-row-delete:hover { color: #c0392b; background: rgba(192,57,43,0.10); border-color: rgba(192,57,43,0.20); }
[data-section="tax-returns"] .docs-row-delete svg { width: 15px; height: 15px; }
[data-section="tax-returns"] .docs-hint { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
[data-section="tax-returns"] .docs-status-actions { display: inline-flex; align-items: center; gap: 6px; }
/* ftype chip (file type badge) — replicated from portal.css */
[data-section="tax-returns"] .ftype {
  flex-shrink: 0;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 38px;
  background: rgba(63,94,133,0.10);
  border: 1px solid rgba(104,136,168,0.22);
  border-radius: 4px 4px 4px 4px;
}
[data-section="tax-returns"] .ftype::before {
  content: "";
  position: absolute; top: 0; right: 0;
  width: 8px; height: 8px;
  border-style: solid;
  border-width: 0 8px 8px 0;
  border-color: transparent rgba(104,136,168,0.35) transparent transparent;
}
[data-section="tax-returns"] .ftype span { font-family: 'Quicksand', sans-serif; font-size: 9px; font-weight: 700; letter-spacing: 0.06em; color: #3F5E85; }
/* Completed tables: actions column header is invisible; icons fade in on row hover */
[data-section="tax-returns"] .docs-table--completed th.col-actions { color: transparent; user-select: none; }
[data-section="tax-returns"] .docs-table--completed .docs-row-actions {
  opacity: 0; pointer-events: none;
  transition: opacity 140ms ease;
  display: inline-flex; align-items: center; gap: 6px;
}
[data-section="tax-returns"] .docs-table--completed .docs-row:hover .docs-row-actions {
  opacity: 1; pointer-events: auto;
}
/* Admin: always show actions and header text — no hover-reveal */
[data-section="tax-returns"] .admin-dashboard-list .docs-table--completed th.col-actions {
  color: inherit;
  user-select: auto;
}
[data-section="tax-returns"] .admin-dashboard-list .docs-table--completed .docs-row-actions {
  opacity: 1;
  pointer-events: auto;
}
[data-section="tax-returns"] .admin-dashboard-list .docs-row-delete {
  opacity: 1;
  pointer-events: auto;
}
[data-section="tax-returns"] [data-theme="dark"] .docs-table-wrap { border-color: rgba(78,122,151,0.2); }
[data-section="tax-returns"] [data-theme="dark"] .docs-table thead th { border-bottom-color: rgba(139,175,200,0.15); color: rgba(170,195,215,0.7); }
[data-section="tax-returns"] [data-theme="dark"] .docs-table tbody td { border-bottom-color: rgba(139,175,200,0.10); color: #B8C8D8; }
[data-section="tax-returns"] [data-theme="dark"] .docs-row:hover { background: rgba(139,175,200,0.07); }
[data-section="tax-returns"] [data-theme="dark"] .docs-c-title,
[data-section="tax-returns"] [data-theme="dark"] .docs-fname { color: #EAF0F6; }
[data-section="tax-returns"] [data-theme="dark"] .ftype { background: rgba(63,94,133,0.22); border-color: rgba(139,175,200,0.15); }
[data-section="tax-returns"] [data-theme="dark"] .ftype::before { border-color: transparent rgba(104,136,168,0.3) transparent transparent; }
/* Flush: remove table wrap's own border when it sits inside a card that already has one */
[data-section="tax-returns"] .admin-dashboard-list > .docs-table-wrap,
[data-section="tax-returns"] .admin-dashboard-list .docs-table-wrap { border: none; border-radius: 0; background: transparent; }
[data-section="tax-returns"] .admin-authorisation-group .docs-table-wrap { overflow: hidden; }

[data-section="tax-returns"] .admin-inline-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(13,27,46,0.12);
  background: rgba(105,141,170,0.10);
  color: var(--ink);
  text-decoration: none;
  font-family: 'Quicksand', sans-serif;
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
  cursor: pointer;
}

[data-section="tax-returns"] .admin-inline-action--link {
  background: transparent;
}

/* ── Document row action hierarchy ───────────────────────────
   Three tiers, consistent across light and dark:
   • Sign  (prepare-authorisation / action-sign) → primary, dark-blue filled
   • Portal / Email (send-to-portal / send-via-email) → secondary, grey filled
   • Follow Up / Open (follow-up-task-btn / action-ghost) → tertiary, outline */
[data-section="tax-returns"] .prepare-authorisation,
[data-section="tax-returns"] .action-sign {
  background: #161C33;
  color: #FFFFFF;
  border-color: transparent;
}
[data-section="tax-returns"] .prepare-authorisation:hover,
[data-section="tax-returns"] .action-sign:hover {
  background: #262F4E;
  color: #FFFFFF;
}

[data-section="tax-returns"] .send-to-portal,
[data-section="tax-returns"] .send-via-email {
  background: rgba(13,27,46,0.06);
  border-color: rgba(13,27,46,0.12);
  color: var(--ink);
}
[data-section="tax-returns"] .send-to-portal:hover,
[data-section="tax-returns"] .send-via-email:hover {
  background: rgba(13,27,46,0.11);
  border-color: rgba(13,27,46,0.20);
}

[data-section="tax-returns"] .follow-up-task-btn,
[data-section="tax-returns"] .action-ghost {
  background: transparent;
  border-color: rgba(13,27,46,0.22);
  color: var(--ink);
}
[data-section="tax-returns"] .follow-up-task-btn:hover,
[data-section="tax-returns"] .action-ghost:hover {
  background: rgba(13,27,46,0.05);
  border-color: rgba(13,27,46,0.35);
}

[data-section="tax-returns"] [data-theme="dark"] .prepare-authorisation,
[data-section="tax-returns"] [data-theme="dark"] .action-sign {
  background: #2B4E74;
  color: #EAF2F9;
  border-color: transparent;
  box-shadow: none;
}
[data-section="tax-returns"] [data-theme="dark"] .prepare-authorisation:hover,
[data-section="tax-returns"] [data-theme="dark"] .action-sign:hover {
  background: #35608C;
  color: #FFFFFF;
}
[data-section="tax-returns"] [data-theme="dark"] .follow-up-task-btn,
[data-section="tax-returns"] [data-theme="dark"] .action-ghost {
  background: transparent;
  border-color: rgba(197,209,220,0.28);
  color: #C5D1DC;
}
[data-section="tax-returns"] [data-theme="dark"] .follow-up-task-btn:hover,
[data-section="tax-returns"] [data-theme="dark"] .action-ghost:hover {
  background: rgba(197,209,220,0.08);
  border-color: rgba(197,209,220,0.45);
}

/* ── Buttons ─────────────────────────────────────────────── */
[data-section="tax-returns"] button {
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, #698DAA 100%);
  box-shadow: none;
  transition: opacity 160ms ease, transform 140ms ease, box-shadow 160ms ease;
}

[data-section="tax-returns"] #searchClient,
[data-section="tax-returns"] #createAuthorisation,
[data-section="tax-returns"] .actions button {
  background: #1C3149;
  color: #8BAFC8;
  box-shadow: none;
}

[data-section="tax-returns"] #searchClient:hover:not(:disabled),
[data-section="tax-returns"] #createAuthorisation:hover:not(:disabled),
[data-section="tax-returns"] .actions button:hover:not(:disabled) {
  background: #223b57;
  color: #c6d8e6;
  box-shadow: none;
}

[data-section="tax-returns"] button:hover:not(:disabled) {
  opacity: 0.90;
  box-shadow: none;
}

[data-section="tax-returns"] button:active:not(:disabled) { transform: translateY(0); }

[data-section="tax-returns"] button.ghost {
  color: var(--ink);
  background: rgba(105,141,170,0.10);
  border: 1px solid rgba(13,27,46,0.11);
  box-shadow: none;
}

[data-section="tax-returns"] button.ghost:hover { background: rgba(105,141,170,0.18); box-shadow: none; }

/* ── Authorisation accordion groups ─────────────────────── */
[data-section="tax-returns"] .authorisation-groups {
  display: grid;
  gap: 16px;
  align-items: start;
}

[data-section="tax-returns"] .authorisation-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-outer);
  background: rgba(105,141,170,0.06);
  padding: 0 16px 16px;
  width: 100%;
  max-width: none;
  margin-inline: 0;
  align-self: auto;
  transition: border-color 180ms ease;
}

[data-section="tax-returns"] .authorisation-group:hover { border-color: rgba(105,141,170,0.30); }

[data-section="tax-returns"] .authorisation-group summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  cursor: pointer;
  height: 54px;
  padding: 0 8px;
  font-family: Marcellus, serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
  box-sizing: border-box;
  margin: 0;
  position: relative;
}

/* Non-collapsable document section headers */
[data-section="tax-returns"] .admin-dashboard-head.non-collapsable {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  height: 54px;
  padding: 0 22px;
  line-height: 1;
  box-sizing: border-box;
  margin: 0;
  cursor: default;
}

[data-section="tax-returns"] .group-heading {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  line-height: 1;
  text-align: left;
}

[data-section="tax-returns"] .group-icon {
  width: 20px;
  height: 20px;
  color: var(--brand);
  stroke: var(--brand);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

[data-section="tax-returns"] .group-icon-bg { fill: rgba(105,141,170,0.50); stroke: none; }

[data-section="tax-returns"] .authorisation-group summary::-webkit-details-marker { display: none; }

[data-section="tax-returns"] .group-count {
  min-width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(105,141,170,0.14);
  color: var(--brand);
  font-family: 'Quicksand', sans-serif;
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
  line-height: 1;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

[data-section="tax-returns"] .group-count.group-count--pending {
  background: rgba(179,129,42,0.14);
  color: #B3812A;
}

[data-section="tax-returns"] .group-count.group-count--completed {
  background: rgba(62,124,95,0.14);
  color: #3E7C5F;
}

/* ── "Created By" avatar cell (Documents tables) ── */
[data-section="tax-returns"] .docs-who { display: flex; align-items: center; gap: 9px; min-width: 0; }
[data-section="tax-returns"] .docs-avatar {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(104,136,168,0.16); color: #3F5E85;
  font-size: 11px; font-weight: 700;
}
[data-section="tax-returns"] .docs-who-name { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-section="tax-returns"] .docs-who-empty { color: var(--muted); }
[data-section="tax-returns"] [data-theme="dark"] .docs-avatar { background: rgba(104,136,168,0.22); color: #B3C4D6; }

/* ── Search box in the Signed Documents header ── */
/* Collapsed to a 46px circle (same footprint as .theme-toggle), expanding to a
   full search field on click. The CONTAINER owns the border/background/radius
   so the collapsed state is a true circle; the input inside is transparent. */
[data-section="tax-returns"] .docs-search {
  position: relative;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  /* It sits in a flex header; without this it gets shrunk to a sliver because
     the input inside carries min-width:0. */
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg, #FFF);
  cursor: pointer;
  overflow: hidden;
  transition: width .22s ease, border-color .15s ease;
}
[data-section="tax-returns"] .docs-search:hover { border-color: #88A3BE; }
/* Fixed widths rather than the old `width:300px; max-width:38vw` — a vw cap can
   squeeze the field to nothing; the narrow-screen size is set explicitly below. */
[data-section="tax-returns"] .docs-search.is-open { width: 300px; cursor: default; }
[data-section="tax-returns"] .docs-search:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Icon: dead-centre in the circle when collapsed, left-aligned when open. */
[data-section="tax-returns"] .docs-search svg {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: var(--muted); pointer-events: none;
  transition: left .22s ease, transform .22s ease;
}
[data-section="tax-returns"] .docs-search.is-open svg { left: 15px; transform: translate(0, -50%); }

[data-section="tax-returns"] .docs-search input {
  width: 100%; min-width: 0; box-sizing: border-box;
  font-family: 'Quicksand', sans-serif; font-size: 13px; color: var(--ink);
  background: transparent; border: none; border-radius: 999px;
  padding: 9px 34px 9px 38px; outline: none; min-height: 0;
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
[data-section="tax-returns"] .docs-search.is-open input { opacity: 1; pointer-events: auto; }
/* No glow (house rule) — the container's border signals focus. */
[data-section="tax-returns"] .docs-search input:focus { border-color: transparent; }
[data-section="tax-returns"] .docs-search input::-webkit-search-cancel-button { display: none; }

[data-section="tax-returns"] .docs-search-close {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  display: none; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0;
  border: none; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer;
}
[data-section="tax-returns"] .docs-search.is-open .docs-search-close { display: inline-flex; }
[data-section="tax-returns"] .docs-search-close:hover { background: rgba(13,27,46,0.06); color: var(--ink); }

[data-section="tax-returns"] [data-theme="dark"] .docs-search { background: rgba(10,15,31,0.5); }
[data-section="tax-returns"] [data-theme="dark"] .docs-search input { color: #EAF0F6; }
[data-section="tax-returns"] [data-theme="dark"] .docs-search-close:hover { background: rgba(238,232,223,0.10); }
/* Only reveal the search box when its section is expanded */
[data-section="tax-returns"] .admin-authorisation-group:not([open]) .docs-search { display: none; }

/* Marcellus section headings in the Documents tab (matches the design) */
[data-section="tax-returns"] #authorisationsPanel .admin-dashboard-head h3 { font-family: 'Marcellus', serif; font-weight: 400; letter-spacing: 0.01em; }

/* ── Documents page header row + "Prepare a Document" button ── */

/* The portal styles its own panel headings with an accent bar — suppress
   inside this section so the heading matches the staff portal exactly. */
[data-section="tax-returns"] .panel-head h2::before, [data-section="tax-returns"] .panel-head h2::after { display: none; content: none; }
[data-section="tax-returns"] .panel-head h2 { border-left: none; padding-left: 0; }

/* ── Wizard controls the staff sheet defines but the portal never had ──────
   tax-returns.js is shared verbatim between the two portals, and emits
   .doc-section-card and .btn-prepare-doc. Both live only in admin.css, so in
   the client portal the wizard's steps rendered as bare unbordered blocks and
   the "Continue" button — the only control that advances the wizard — fell
   back to the generic `button` rule while "Back" beside it looked correct.
   Scoped copies, kept byte-for-byte in step with admin.css. */
[data-section="tax-returns"] .doc-section-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-outer);
  background: #FFFFFF;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
[data-theme="dark"] [data-section="tax-returns"] .doc-section-card {
  background: #0F1D30;
  border-color: rgba(78,122,151,0.22);
}

[data-section="tax-returns"] .btn-prepare-doc {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'Quicksand', sans-serif; font-size: 13px; font-weight: 600;
  color: #FFFFFF; background: #161C33; border: 1px solid transparent;
  border-radius: 999px; padding: 8px 16px; cursor: pointer; white-space: nowrap;
  transition: background .15s ease;
}
[data-section="tax-returns"] .btn-prepare-doc svg { width: 24px; height: 24px; flex-shrink: 0; }
[data-section="tax-returns"] .btn-prepare-doc:hover { background: #1A2447; }
[data-theme="dark"] [data-section="tax-returns"] .btn-prepare-doc { background: #202C44; color: #A6C0DA; border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] [data-section="tax-returns"] .btn-prepare-doc:hover { background: #283656; }

[data-section="tax-returns"] .btn-prepare-doc.btn-invite-secondary {
  background: transparent;
  color: var(--ink, #161C33);
  border: 1px solid var(--line);
}
[data-section="tax-returns"] .btn-prepare-doc.btn-invite-secondary:hover { background: rgba(105,141,170,0.10); }
[data-theme="dark"] [data-section="tax-returns"] .btn-prepare-doc.btn-invite-secondary {
  color: #EAF0F6;
  border-color: rgba(255,255,255,0.16);
}
[data-theme="dark"] [data-section="tax-returns"] .btn-prepare-doc.btn-invite-secondary:hover { background: rgba(255,255,255,0.06); }

/* ── Mobile: Tax Returns table → labelled cards ──────────────────
   The generic mobile rules above hide the table head and switch the table to
   display:block, but only .docs-row gets a card grid. The tax returns list uses
   .txr-row, so on a phone its cells stacked with no column names at all. Each
   cell carries a data-label; show it as the row's own key/value pair. */
@media (max-width: 640px) {
  [data-section="tax-returns"] .docs-table tr.txr-row {
    display: block;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(16,24,48,0.08);
  }
  [data-section="tax-returns"] .docs-table tr.txr-row:last-child { border-bottom: none; }
  [data-section="tax-returns"] .docs-table tr.txr-row > td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 4px 0;
    border: none;
  }
  [data-section="tax-returns"] .docs-table tr.txr-row > td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-family: 'Quicksand', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: capitalize;
    color: var(--muted);
  }
  /* Cells with no label (the actions column) get the full width. */
  [data-section="tax-returns"] .docs-table tr.txr-row > td:not([data-label])::before { content: none; }
  [data-section="tax-returns"] .docs-table tr.txr-row > td.txr-row-actions {
    justify-content: flex-end;
    gap: 8px;
    padding-top: 10px;
  }
}
