/* Dorset Care 3A */
:root {
  --teal:   #0f766e;
  --teal2:  #0b5f59;
  --navy:   #18314f;
  --accent: #0ea5a0;
  --pending:#e88a00;
  --danger: #c0392b;
  --success:#27ae60;
  --bg:     #eef4f2;
  --card:   #ffffff;
  --border: #d8e0e6;
  --text:   #1f2f3d;
  --muted:  #6b7c88;
  --row-alt:#f7faf9;
  --surface:#f8fbfa;
  --shadow: 0 14px 36px rgba(24,49,79,.10);
  --shadow-sm: 0 4px 14px rgba(24,49,79,.08);
}

* { box-sizing:border-box; margin:0; padding:0; }
body {
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  background:
    radial-gradient(circle at 10% 0%, rgba(14,165,160,.10), transparent 28rem),
    linear-gradient(180deg,#f8fbfa 0%, var(--bg) 48%, #edf3f6 100%);
  color:var(--text);
  font-size:14px;
}
.aws-site-ribbon {
  background:#0f766e !important;
  font-size:12px !important;
  padding:6px 12px !important;
}
.aws-site-ribbon + #login-page { padding-top:26px; }
.aws-site-ribbon + #login-page + #app #navbar,
.aws-site-ribbon ~ #app #navbar { top:26px; }
.aws-site-ribbon ~ #app #content { padding-top:40px; }

/* ── Layout ── */
#app { display:none; flex-direction:column; min-height:100vh; }
#app.app-ready { display:flex; }
#navbar  {
  background:rgba(24,49,79,.96);
  backdrop-filter:blur(12px);
  color:#fff;
  padding:0 24px;
  display:flex;
  align-items:center;
  min-height:58px;
  gap:12px;
  overflow-x:auto;
  overflow-y:hidden;
  position:sticky;
  top:0;
  z-index:100;
  box-shadow:0 8px 26px rgba(12,28,48,.18);
}
#navbar::-webkit-scrollbar { height:4px; }
#navbar::-webkit-scrollbar-thumb { background:rgba(255,255,255,.22); border-radius:999px; }
#navbar .brand { font-size:17px; font-weight:800; letter-spacing:0; flex:1; min-width:190px; }
#navbar .brand span { color:#79e0cd; font-weight:650; }
.login-logo-img {
  display:block;
  width:min(240px, 72vw);
  height:auto;
  margin:0 auto 10px;
}
.site-env-pill {
  background:#107d73;
  border:1px solid rgba(255,255,255,.55);
  border-radius:999px;
  box-shadow:0 0 0 2px rgba(93,217,193,.18);
  color:#fff;
  flex-shrink:0;
  font-size:11px;
  font-weight:800;
  letter-spacing:.6px;
  line-height:1;
  padding:7px 11px;
}
.nav-btn {
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.16);
  color:#fff;
  padding:7px 12px;
  border-radius:6px;
  cursor:pointer;
  font-size:13px;
  font-weight:650;
  transition:background .18s, transform .18s, border-color .18s;
}
.nav-btn:hover { background:rgba(255,255,255,.14); border-color:rgba(255,255,255,.34); transform:translateY(-1px); }
.nav-btn.active {
  background:#f59e0b !important;
  border-color:#ffd37a !important;
  box-shadow:0 0 0 2px rgba(245,158,11,.26), inset 0 -3px 0 rgba(255,255,255,.35);
  color:#10233a !important;
  font-weight:850;
}
.nav-btn.active:hover {
  background:#fbbf24 !important;
  transform:none;
}
#content { flex:1; padding:26px 24px 34px; max-width:1480px; margin:0 auto; width:100%; }

/* ── Cards ── */
.card { background:var(--card); border-radius:8px; border:1px solid var(--border); padding:20px; margin-bottom:16px; box-shadow:var(--shadow-sm); }
.card-title { font-size:15px; font-weight:700; color:var(--navy); margin-bottom:14px; display:flex; align-items:center; gap:8px; }

/* ── Buttons ── */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:8px 15px; border-radius:6px; border:none; cursor:pointer; font-size:13px; font-weight:700; transition:all .18s; white-space:nowrap; }
.btn-primary  { background:var(--teal);  color:#fff; }
.btn-primary:hover  { background:var(--teal2); box-shadow:0 8px 18px rgba(15,118,110,.20); transform:translateY(-1px); }
.btn-secondary{ background:#fff; color:var(--teal); border:1.5px solid var(--teal); }
.btn-secondary:hover{ background:#f0faf9; transform:translateY(-1px); }
.btn-danger   { background:var(--danger); color:#fff; }
.btn-danger:hover   { background:#a93226; }
.btn-warning  { background:var(--pending); color:#fff; }
.btn-sm       { padding:4px 10px; font-size:12px; }

/* ── PRODA Source Control ─────────────────────────────────────────────── */
.proda-source-hdr .page-actions {
  display:flex;
  gap:10px;
  align-items:center;
}
.proda-source-summary-grid {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
  margin-bottom:14px;
}
.proda-summary-card {
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  box-shadow:var(--shadow-sm);
  padding:14px 16px;
}
.proda-summary-card span {
  color:var(--muted);
  display:block;
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.proda-summary-card strong {
  color:var(--navy);
  display:block;
  font-size:28px;
  margin-top:4px;
}
.proda-summary-line {
  color:#526275;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:6px;
}
.proda-summary-line b { color:var(--teal); }
.proda-summary-card small {
  color:var(--muted);
  display:block;
  margin-top:6px;
}
.proda-summary-ledger {
  background:linear-gradient(180deg,#ffffff 0%,#f4fffd 100%);
  border-color:#b7ebe5;
}
.proda-summary-ledger span::after {
  color:var(--teal);
  content:' · StatementX ledger';
  font-weight:850;
  letter-spacing:0;
  text-transform:none;
}
.statementx-proda-card-beta {
  border-color:rgba(180, 103, 0, .28);
  background:linear-gradient(180deg, #fffaf0 0%, #ffffff 100%);
}
.statementx-source-banner {
  display:grid;
  gap:3px;
  margin:12px 0;
  padding:12px 14px;
  border:1px solid rgba(20, 128, 116, .22);
  border-radius:8px;
  background:#f2fbf8;
  color:var(--ink);
}
.statementx-source-banner strong {
  color:var(--teal);
  font-size:11px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.statementx-source-banner span { font-weight:800; }
.statementx-source-banner em {
  color:var(--muted);
  font-style:normal;
  font-weight:700;
  font-size:12px;
}
.proda-source-toolbar {
  align-items:center;
  display:flex;
  gap:14px;
  justify-content:space-between;
  margin-bottom:10px;
  padding:14px;
}
.proda-source-tabs {
  background:#eef7f5;
  border:1px solid #cbe5df;
  border-radius:8px;
  display:inline-flex;
  padding:3px;
}
.proda-source-tabs button {
  background:transparent;
  border:0;
  border-radius:6px;
  color:var(--teal2);
  cursor:pointer;
  font-weight:800;
  padding:8px 12px;
}
.proda-source-tabs button.active {
  background:var(--teal);
  color:#fff;
  box-shadow:0 4px 10px rgba(15,118,110,.18);
}
.proda-source-filters {
  display:grid;
  grid-template-columns:minmax(240px, 1fr) 210px 150px 210px 160px 160px;
  gap:10px;
  flex:1;
}
.proda-source-filters input,
.proda-source-filters select {
  border:1px solid #cdd8e3;
  border-radius:6px;
  color:var(--text);
  font-size:13px;
  min-height:38px;
  padding:8px 10px;
}
.proda-source-legend {
  color:#526275;
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  margin:4px 0 10px;
}
.proda-source-legend span {
  align-items:center;
  display:inline-flex;
  gap:7px;
}
.legend-dot {
  border-radius:999px;
  display:inline-block;
  height:10px;
  width:10px;
}
.legend-diff { background:#f7b4a5; }
.legend-edited { background:#ffe58a; }
.legend-missing { background:#f4c06e; }
.legend-hidden { background:#9aa4b2; }
.proda-source-table-card {
  overflow:hidden;
  padding:0;
}
.proda-source-table-wrap {
  max-height:68vh;
  overflow:auto;
}
.proda-source-table {
  border-collapse:separate;
  border-spacing:0;
  font-size:12px;
  min-width:1950px;
  width:100%;
}
.proda-source-table th {
  background:#eaf5f1;
  border-bottom:1px solid #a9c9be;
  color:#264b43;
  font-size:11px;
  font-weight:850;
  letter-spacing:.04em;
  padding:9px 10px;
  position:sticky;
  text-align:left;
  text-transform:uppercase;
  top:0;
  z-index:2;
  white-space:nowrap;
}
.proda-source-table td {
  background:#fff;
  border-bottom:1px solid #e2e8ee;
  color:#223242;
  padding:7px 10px;
  vertical-align:middle;
  white-space:nowrap;
}
.proda-source-table .sticky-col {
  box-shadow:2px 0 0 rgba(216,224,230,.75);
  left:0;
  min-width:230px;
  position:sticky;
  z-index:3;
}
.proda-source-table td.sticky-col {
  background:#fff;
}
.proda-source-table td.sticky-col strong {
  color:var(--navy);
  display:block;
}
.proda-source-table td.sticky-col span {
  color:#667789;
  display:block;
  margin-top:2px;
}
.proda-source-table tr.proda-row-danger td { background:#fff8f6; }
.proda-source-table tr.proda-row-warning td { background:#fffaf0; }
.proda-source-table tr.proda-row-ok td { background:#fbfffd; }
.proda-source-table tr.proda-row-hidden td {
  background:#eef1f4 !important;
  color:#6b7280;
}
.proda-source-table tr.proda-row-hidden td:not(.cell-diff):not(.cell-edited) {
  opacity:.74;
}
.proda-source-table tr.proda-row-hidden td.sticky-col {
  background:#e9edf1 !important;
}
.proda-source-table .cell-diff {
  background:#ffe4de !important;
  color:#8f2d1e;
  font-weight:800;
}
.proda-source-table .cell-edited {
  background:#fff4bd !important;
  box-shadow:inset 0 -2px 0 #d9a900;
  font-weight:800;
}
.proda-source-table input {
  background:rgba(255,255,255,.64);
  border:1px solid transparent;
  border-radius:4px;
  color:inherit;
  font:inherit;
  min-width:92px;
  padding:5px 6px;
}
.proda-source-table input:focus {
  background:#fff;
  border-color:var(--teal);
  box-shadow:0 0 0 2px rgba(15,118,110,.14);
  outline:none;
}
.proda-source-table tfoot td {
  background:#182333;
  border-top:2px solid #0f766e;
  bottom:0;
  color:#fff;
  font-weight:850;
  position:sticky;
  z-index:4;
}
.proda-source-table tfoot td.sticky-col {
  background:#101b2a !important;
  z-index:5;
}
.proda-source-table tfoot td.sticky-col strong,
.proda-source-table tfoot td.sticky-col span {
  color:#fff;
}
.proda-source-table .proda-total-number {
  color:#d9fff7;
  text-align:right;
}
.proda-status-pill {
  border-radius:999px;
  display:inline-flex;
  font-size:11px;
  font-weight:850;
  padding:4px 8px;
}
.proda-status-pill.ok { background:#dcfce7; color:#166534; }
.proda-status-pill.danger { background:#fee2e2; color:#991b1b; }
.proda-status-pill.warning { background:#fef3c7; color:#92400e; }
.proda-status-pill.muted { background:#edf2f7; color:#526275; }
.proda-status-pill.hidden-pill { background:#d7dde5; color:#46515f; }
.proda-fund-pill {
  background:#edf7f5;
  border:1px solid #cce2dd;
  border-radius:999px;
  color:var(--teal2);
  display:inline-flex;
  font-size:11px;
  font-weight:850;
  padding:4px 8px;
}
.proda-action-cell {
  min-width:160px;
}
.proda-action-cell .btn {
  margin-right:6px;
}
.proda-source-file {
  color:#526275;
  max-width:260px;
  overflow:hidden;
  text-overflow:ellipsis;
}
.proda-source-pager {
  align-items:center;
  background:#fbfdff;
  border-top:1px solid var(--border);
  display:flex;
  gap:10px;
  justify-content:flex-end;
  padding:10px 14px;
}
.proda-source-pager span {
  color:#526275;
  font-weight:700;
}

/* ── StatementX Beta ───────────────────────────────────────────────────── */
.statementx-hdr .page-actions {
  align-items:center;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.statementx-control-panel {
  align-items:end;
  display:grid;
  gap:14px;
  grid-template-columns:240px repeat(2, minmax(0,1fr));
  margin-bottom:14px;
  padding:16px;
}
.statementx-control-panel label,
.statementx-control-label {
  color:var(--muted);
  display:block;
  font-size:11px;
  font-weight:850;
  letter-spacing:.08em;
  margin-bottom:6px;
  text-transform:uppercase;
}
.statementx-control-panel input {
  border:1px solid #cdd8e3;
  border-radius:6px;
  color:var(--text);
  min-height:40px;
  padding:8px 10px;
  width:100%;
}
.statementx-control-panel strong {
  color:var(--navy);
  display:block;
}
.statementx-control-panel small {
  color:#526275;
  display:block;
  margin-top:3px;
}
.statementx-simple-summary {
  display:grid;
  gap:12px;
  margin-bottom:14px;
}
.statementx-decision-panel {
  align-items:stretch;
  background:linear-gradient(135deg, #f8fbfc 0%, #eefbf8 100%);
  border:1px solid rgba(18, 132, 118, .24);
  border-radius:10px;
  box-shadow:var(--shadow-sm);
  display:grid;
  gap:14px;
  grid-template-columns:minmax(0,1fr) minmax(260px,360px);
  padding:18px;
}
.statementx-decision-panel.warning {
  background:linear-gradient(135deg, #fffaf0 0%, #f8fbfc 100%);
  border-color:#fde68a;
}
.statementx-decision-panel.danger {
  background:linear-gradient(135deg, #fff5f5 0%, #f8fbfc 100%);
  border-color:#fecaca;
}
.statementx-decision-main span,
.statementx-decision-action strong,
.statementx-simple-card span {
  color:var(--teal);
  display:block;
  font-size:11px;
  font-weight:900;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.statementx-decision-panel.warning .statementx-decision-main span,
.statementx-decision-panel.warning .statementx-decision-action strong,
.statementx-simple-card.warning span {
  color:#92400e;
}
.statementx-decision-panel.danger .statementx-decision-main span,
.statementx-decision-panel.danger .statementx-decision-action strong,
.statementx-simple-card.danger span {
  color:#991b1b;
}
.statementx-decision-main h3 {
  color:var(--navy);
  font-size:28px;
  line-height:1.15;
  margin:8px 0 8px;
}
.statementx-decision-main p,
.statementx-decision-action span,
.statementx-plain-note span {
  color:#526275;
  line-height:1.5;
}
.statementx-decision-action {
  background:rgba(255,255,255,.8);
  border:1px solid rgba(18, 132, 118, .16);
  border-radius:8px;
  display:grid;
  gap:6px;
  padding:14px;
}
.statementx-simple-cards {
  display:grid;
  gap:10px;
  grid-template-columns:repeat(4, minmax(0,1fr));
}
.statementx-simple-card {
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  padding:13px 14px;
}
.statementx-simple-card.ok {
  background:#f0fdf4;
  border-color:#bbf7d0;
}
.statementx-simple-card.warning {
  background:#fffaf0;
  border-color:#fde68a;
}
.statementx-simple-card.danger {
  background:#fff5f5;
  border-color:#fecaca;
}
.statementx-simple-card.muted {
  background:#f8fafc;
}
.statementx-simple-card strong {
  color:var(--navy);
  display:block;
  font-size:22px;
  line-height:1.15;
  margin-top:6px;
}
.statementx-simple-card small {
  color:#526275;
  display:block;
  line-height:1.35;
  margin-top:5px;
}
.statementx-plain-note {
  align-items:flex-start;
  background:#f8fbfc;
  border:1px solid var(--border);
  border-radius:8px;
  display:flex;
  gap:10px;
  padding:12px 14px;
}
.statementx-plain-note strong {
  color:var(--navy);
  flex:0 0 auto;
}
.statementx-disclosure-card {
  background:#fff;
  border:1px solid var(--border);
  border-radius:10px;
  box-shadow:var(--shadow-sm);
  display:block;
  margin-bottom:14px;
  overflow:hidden;
}
.statementx-disclosure-card > summary {
  align-items:center;
  cursor:pointer;
  display:flex;
  gap:12px;
  list-style:none !important;
  list-style-type:none !important;
  padding:15px 18px;
}
.statementx-disclosure-card > summary::-webkit-details-marker {
  display:none !important;
}
.statementx-disclosure-card > summary::marker {
  content:'';
  color:transparent;
  font-size:0;
}
.statementx-disclosure-card > summary strong {
  color:var(--navy);
  display:block;
  font-size:16px;
}
.statementx-disclosure-card > summary small {
  color:#526275;
  display:block;
  line-height:1.4;
  margin-top:2px;
}
.statementx-disclosure-card > summary em {
  background:#edf2f7;
  border-radius:999px;
  color:#526275;
  font-style:normal;
  font-weight:850;
  margin-left:auto;
  padding:6px 10px;
  white-space:nowrap;
}
.statementx-disclosure-card[open] > summary {
  border-bottom:1px solid var(--border);
}
.statementx-disclosure-card[open] > summary .statementx-caret {
  transform:rotate(90deg);
}
.statementx-disclosure-body {
  display:grid;
  gap:14px;
  padding:16px;
}
.statementx-inner-panel {
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  overflow:hidden;
}
.statementx-upload-card {
  margin-bottom:14px;
  overflow:hidden;
  padding:0;
}
.statementx-upload-main {
  align-items:stretch;
  display:grid;
  gap:18px;
  grid-template-columns:minmax(0,1fr) minmax(320px,420px);
  padding:18px;
}
.statementx-eyebrow {
  color:var(--teal);
  display:block;
  font-size:11px;
  font-weight:900;
  letter-spacing:.14em;
  margin-bottom:6px;
  text-transform:uppercase;
}
.statementx-upload-main h3 {
  color:var(--navy);
  font-size:20px;
  margin:0;
}
.statementx-upload-main p {
  color:#526275;
  line-height:1.5;
  margin:8px 0 0;
  max-width:760px;
}
.statementx-upload-box {
  align-items:stretch;
  background:#f8fbfc;
  border:1px dashed #a8c5d8;
  border-radius:10px;
  display:grid;
  gap:10px;
  padding:14px;
}
.statementx-upload-box input[type=file] {
  height:1px;
  opacity:0;
  overflow:hidden;
  position:absolute;
  width:1px;
}
.statementx-upload-box label {
  align-items:center;
  background:#fff;
  border:1px solid #cdd8e3;
  border-radius:8px;
  color:var(--navy);
  cursor:pointer;
  display:flex;
  font-weight:850;
  justify-content:center;
  min-height:42px;
  padding:10px 12px;
}
.statementx-upload-box span {
  color:#526275;
  font-size:12px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.statementx-source-rules {
  border-top:1px solid var(--border);
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
}
.statementx-source-rules div {
  border-right:1px solid var(--border);
  padding:14px 18px;
}
.statementx-source-rules div:last-child { border-right:0; }
.statementx-source-rules strong {
  color:var(--navy);
  display:block;
  font-size:12px;
  letter-spacing:.08em;
  margin-bottom:4px;
  text-transform:uppercase;
}
.statementx-source-rules span {
  color:#526275;
  display:block;
  line-height:1.45;
}
.statementx-upload-result {
  border-top:1px solid var(--border);
}
.statementx-upload-result:empty {
  display:none;
}
.statementx-upload-result-grid {
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
}
.statementx-upload-result-grid div {
  border-right:1px solid var(--border);
  padding:12px 18px;
}
.statementx-upload-result-grid div:last-child { border-right:0; }
.statementx-upload-result-grid strong {
  color:var(--teal);
  display:block;
  font-size:20px;
}
.statementx-upload-result-grid span,
.statementx-upload-notes {
  color:#526275;
}
.statementx-upload-notes {
  background:#f8fbfc;
  border-top:1px solid var(--border);
  padding:12px 18px;
}
.statementx-upload-notes strong {
  color:var(--navy);
  display:block;
  margin-bottom:6px;
}
.statementx-upload-notes p,
.statementx-upload-notes ul {
  margin:0;
}
.statementx-upload-notes ul {
  padding-left:18px;
}
.statementx-summary-grid {
  display:grid;
  gap:12px;
  grid-template-columns:repeat(auto-fit, minmax(220px,1fr));
  margin-bottom:14px;
}
.statementx-readiness-card {
  margin-bottom:14px;
}
.statementx-readiness {
  padding:16px;
}
.statementx-readiness-lead {
  align-items:flex-start;
  background:#f8fbfc;
  border:1px solid var(--border);
  border-radius:8px;
  display:flex;
  gap:14px;
  justify-content:space-between;
  margin-bottom:12px;
  padding:12px 14px;
}
.statementx-readiness-lead strong {
  color:var(--teal);
  flex:0 0 auto;
  font-weight:900;
}
.statementx-readiness-lead span,
.statementx-readiness-note span,
.statementx-readiness-explain span {
  color:#526275;
  line-height:1.45;
}
.statementx-readiness-grid {
  display:grid;
  gap:12px;
  grid-template-columns:repeat(4, minmax(0,1fr));
  margin-bottom:12px;
}
.statementx-readiness-metric {
  border:1px solid var(--border);
  border-radius:8px;
  padding:12px 14px;
}
.statementx-readiness-metric.ok { background:#f0fdf4; border-color:#bbf7d0; }
.statementx-readiness-metric.warning { background:#fffaf0; border-color:#fde68a; }
.statementx-readiness-metric.danger { background:#fff5f5; border-color:#fecaca; }
.statementx-readiness-metric span {
  color:var(--muted);
  display:block;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.statementx-readiness-metric strong {
  color:var(--navy);
  display:block;
  font-size:26px;
  margin-top:4px;
}
.statementx-readiness-metric small {
  color:#526275;
  display:block;
  margin-top:4px;
}
.statementx-readiness-note {
  align-items:center;
  background:#f0fdfa;
  border:1px solid #99f6e4;
  border-radius:8px;
  display:flex;
  gap:12px;
  margin-bottom:12px;
  padding:12px 14px;
}
.statementx-readiness-note strong {
  color:var(--teal);
  flex:0 0 auto;
}
.statementx-readiness-buckets {
  display:grid;
  gap:10px;
}
.statementx-readiness-bucket {
  border:1px solid var(--border);
  border-radius:8px;
  overflow:hidden;
}
.statementx-readiness-bucket.ok { border-color:#bbf7d0; }
.statementx-readiness-bucket.warning { border-color:#fde68a; }
.statementx-readiness-bucket.danger { border-color:#fecaca; }
.statementx-readiness-bucket summary,
.statementx-readiness-issues summary {
  align-items:center;
  cursor:pointer;
  display:flex;
  gap:8px;
  list-style:none;
  padding:12px 14px;
}
.statementx-readiness-bucket summary::-webkit-details-marker,
.statementx-readiness-issues summary::-webkit-details-marker {
  display:none;
}
.statementx-readiness-bucket summary strong {
  color:var(--navy);
  font-size:15px;
}
.statementx-readiness-bucket summary em {
  color:#526275;
  font-style:normal;
  font-weight:800;
  margin-left:auto;
}
.statementx-readiness-bucket[open] > summary .statementx-caret,
.statementx-readiness-issues[open] > summary .statementx-caret {
  transform:rotate(90deg);
}
.statementx-readiness-bucket-body {
  border-top:1px solid var(--border);
  padding:12px;
}
.statementx-readiness-explain {
  display:grid;
  gap:10px;
  grid-template-columns:1fr 1fr;
  margin-bottom:10px;
}
.statementx-readiness-explain p {
  background:#f8fbfc;
  border:1px solid var(--border);
  border-radius:8px;
  margin:0;
  padding:10px 12px;
}
.statementx-readiness-explain strong {
  color:var(--navy);
  display:block;
  margin-bottom:3px;
}
.statementx-readiness-client {
  align-items:start;
  border-top:1px solid #edf2f7;
  display:grid;
  gap:10px;
  grid-template-columns:minmax(220px,1.1fr) minmax(270px,.9fr);
  padding:12px 0;
}
.statementx-readiness-client:first-of-type {
  border-top:0;
}
.statementx-readiness-client > div:first-child strong {
  color:var(--navy);
  display:block;
}
.statementx-readiness-client > div:first-child span,
.statementx-readiness-client > div:first-child small {
  color:#526275;
  display:block;
  margin-top:2px;
}
.statementx-readiness-client p {
  color:#526275;
  grid-column:1 / -1;
  margin:0;
}
.statementx-readiness-client .btn {
  justify-self:start;
}
.statementx-readiness-client-numbers {
  display:grid;
  gap:6px;
  grid-template-columns:repeat(4, minmax(0,1fr));
}
.statementx-readiness-client-numbers span,
.statementx-readiness-client-numbers strong {
  background:#f8fbfc;
  border:1px solid var(--border);
  border-radius:999px;
  color:#526275;
  display:block;
  font-size:12px;
  font-weight:850;
  padding:6px 8px;
  text-align:center;
}
.statementx-readiness-client-numbers strong.ok { color:var(--teal); }
.statementx-readiness-client-numbers strong.danger { color:#b42318; }
.statementx-readiness-issues {
  border:1px solid var(--border);
  border-radius:8px;
  grid-column:1 / -1;
  overflow:hidden;
}
.statementx-readiness-issues summary {
  padding:9px 10px;
}
.statementx-readiness-issues summary span:not(.statementx-caret) {
  color:var(--navy);
  font-weight:850;
}
.statementx-readiness-issues summary small {
  color:#607086;
  margin-left:auto;
}
.statementx-readiness-mini-wrap {
  border-top:1px solid var(--border);
  overflow:auto;
}
.statementx-readiness-mini-table th,
.statementx-readiness-mini-table td {
  font-size:12px;
  white-space:nowrap;
}
.statementx-readiness-mini-table td span {
  color:#607086;
  display:block;
}
.statementx-readiness-more {
  background:#f8fbfc;
  border:1px dashed var(--border);
  border-radius:8px;
  color:#526275;
  font-weight:800;
  margin-top:10px;
  padding:10px 12px;
}
.statementx-metric {
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  box-shadow:var(--shadow-sm);
  padding:14px 16px;
}
.statementx-metric.ok { background:#f0fdf4; border-color:#bbf7d0; }
.statementx-metric.warning { background:#fffaf0; border-color:#fde68a; }
.statementx-metric.danger { background:#fff5f5; border-color:#fecaca; }
.statementx-metric span,
.statementx-proda-card span {
  color:var(--muted);
  display:block;
  font-size:11px;
  font-weight:850;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.statementx-metric strong {
  color:var(--navy);
  display:block;
  font-size:23px;
  margin-top:5px;
}
.statementx-metric small {
  color:#526275;
  display:block;
  margin-top:5px;
}
.statementx-ledger-card {
  margin-bottom:14px;
}
.statementx-ledger {
  padding:16px;
}
.statementx-ledger-metrics {
  display:grid;
  gap:12px;
  grid-template-columns:repeat(4, minmax(0,1fr));
  margin-bottom:16px;
}
.statementx-ledger-metrics div {
  background:#f8fbfc;
  border:1px solid var(--border);
  border-radius:8px;
  padding:12px 14px;
}
.statementx-ledger-metrics span {
  color:var(--muted);
  display:block;
  font-size:11px;
  font-weight:850;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.statementx-ledger-metrics strong {
  color:var(--navy);
  display:block;
  font-size:22px;
  margin-top:5px;
}
.statementx-ledger-metrics small {
  color:#526275;
  display:block;
  margin-top:4px;
}
.statementx-ledger-grid {
  display:grid;
  gap:14px;
  grid-template-columns:1fr 1fr;
  margin-bottom:14px;
}
.statementx-ledger-table-wrap {
  border:1px solid var(--border);
  border-radius:8px;
  overflow:auto;
}
.statementx-ledger-table-wrap h4 {
  background:#f8fbfc;
  border-bottom:1px solid var(--border);
  color:var(--navy);
  font-size:14px;
  margin:0;
  padding:12px 14px;
}
.statementx-ledger-table {
  border-collapse:separate;
  border-spacing:0;
  font-size:12px;
  min-width:760px;
  width:100%;
}
.statementx-ledger-table th {
  background:#e9f4ed;
  color:#214032;
  font-size:11px;
  letter-spacing:.04em;
  padding:9px 10px;
  text-align:right;
  text-transform:uppercase;
  white-space:nowrap;
}
.statementx-ledger-table th:first-child,
.statementx-ledger-table td:first-child {
  text-align:left;
}
.statementx-ledger-table td {
  border-bottom:1px solid #e5edf3;
  color:#1f2f44;
  padding:9px 10px;
  text-align:right;
  vertical-align:top;
  white-space:nowrap;
}
.statementx-ledger-table tr:last-child td {
  border-bottom:0;
}
.statementx-ledger-table td strong {
  color:var(--navy);
  display:block;
}
.statementx-ledger-table td span {
  color:#667789;
  display:block;
  margin-top:2px;
  white-space:normal;
}
.statementx-ledger-table td small {
  color:#526275;
  display:block;
  font-size:11px;
  line-height:1.35;
  margin-top:4px;
  white-space:normal;
}
.statementx-continuity-wrap {
  margin-top:14px;
}
.statementx-continuity-note {
  align-items:center;
  background:#f8fbfc;
  border-bottom:1px solid var(--border);
  display:grid;
  gap:8px;
  grid-template-columns:180px minmax(0,1fr) auto;
  padding:12px 14px;
}
.statementx-continuity-note strong {
  color:var(--navy);
}
.statementx-continuity-note span {
  color:#526275;
  line-height:1.45;
}
.statementx-continuity-note em {
  color:var(--teal2);
  font-style:normal;
  font-weight:850;
  white-space:nowrap;
}
.statementx-continuity-table {
  min-width:1160px;
}
.statementx-continuity-table .statementx-pill {
  margin:0 4px 4px 0;
}
.statementx-lifecycle-stack {
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  max-width:260px;
}
.statementx-continuity-row.danger td {
  background:#fff8f6;
}
.statementx-continuity-row.warning td {
  background:#fffaf0;
}
.statementx-continuity-row.ok td {
  background:#fbfffd;
}
.statementx-diff-bad {
  color:#b42318 !important;
  font-weight:900;
}
.statementx-pill {
  border-radius:999px;
  display:inline-flex;
  font-size:11px;
  font-weight:850;
  padding:4px 8px;
}
.statementx-pill.ok { background:#dcfce7; color:#166534; }
.statementx-pill.danger { background:#fee2e2; color:#991b1b; }
.statementx-pill.warning { background:#fef3c7; color:#92400e; }
.statementx-pill.muted { background:#edf2f7; color:#526275; }
.statementx-resolution-card {
  margin-bottom:14px;
}
.statementx-resolution {
  padding:16px;
}
.statementx-resolution-metrics {
  display:grid;
  gap:12px;
  grid-template-columns:repeat(4, minmax(0,1fr));
  margin-bottom:12px;
}
.statementx-resolution-metrics div,
.statementx-freeze-banner,
.statementx-resolution-note {
  background:#f8fbfc;
  border:1px solid var(--border);
  border-radius:8px;
  padding:12px 14px;
}
.statementx-resolution-metrics div.ok {
  background:#f0fdf4;
  border-color:#bbf7d0;
}
.statementx-resolution-metrics div.warning {
  background:#fffaf0;
  border-color:#fde68a;
}
.statementx-resolution-metrics span {
  color:var(--muted);
  display:block;
  font-size:11px;
  font-weight:850;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.statementx-resolution-metrics strong {
  color:var(--navy);
  display:block;
  font-size:22px;
  margin-top:5px;
}
.statementx-resolution-metrics small {
  color:#526275;
  display:block;
  margin-top:4px;
}
.statementx-freeze-banner {
  align-items:center;
  display:grid;
  gap:8px;
  grid-template-columns:220px minmax(0,1fr) auto;
  margin-bottom:12px;
}
.statementx-freeze-banner strong {
  color:var(--navy);
}
.statementx-freeze-banner span,
.statementx-freeze-banner small {
  color:#526275;
}
.statementx-freeze-banner.frozen,
.statementx-freeze-banner.ok {
  background:#f0fdf4;
  border-color:#bbf7d0;
}
.statementx-freeze-banner.frozen_with_unresolved {
  background:#fffaf0;
  border-color:#fde68a;
}
.statementx-freeze-banner.muted {
  background:#f8fafc;
}
.statementx-resolution-note {
  align-items:flex-start;
  display:flex;
  gap:10px;
  margin-bottom:12px;
}
.statementx-resolution-note strong {
  color:var(--teal);
  white-space:nowrap;
}
.statementx-resolution-note span {
  color:#526275;
  line-height:1.45;
}
.statementx-resolution-table-wrap {
  border:1px solid var(--border);
  border-radius:8px;
  overflow:auto;
}
.statementx-resolution-table {
  min-width:1180px;
}
.statementx-resolution-table td:nth-child(3),
.statementx-resolution-table td:nth-child(4) {
  max-width:220px;
  white-space:normal;
}
.statementx-resolution-row.warning td {
  background:#fffaf0;
}
.statementx-resolution-row.ok td {
  background:#fbfffd;
}
.statementx-resolution-actions {
  min-width:280px;
}
.statementx-resolution-actions .btn {
  margin:0 4px 4px 0;
}
.statementx-resolution-footer {
  align-items:center;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:flex-end;
  padding-top:12px;
}
.statementx-resolution-footer span {
  color:#526275;
  margin-right:auto;
}
.statementx-client-trace-section {
  background:#fbfefe;
  border:1px solid rgba(18, 132, 118, .18);
  border-radius:8px;
  padding:14px;
}
.statementx-client-trace {
  min-height:92px;
}
.statementx-trace-card {
  display:grid;
  gap:12px;
}
.statementx-trace-head {
  align-items:center;
  display:flex;
  gap:12px;
  justify-content:space-between;
}
.statementx-trace-head strong {
  color:var(--navy);
  display:block;
  font-size:16px;
}
.statementx-trace-head span:not(.statementx-pill) {
  color:#607086;
  display:block;
  font-size:12px;
  margin-top:3px;
}
.statementx-trace-metrics {
  display:grid;
  gap:8px;
  grid-template-columns:repeat(3, minmax(0,1fr));
}
.statementx-trace-metric {
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  padding:10px 12px;
}
.statementx-trace-metric.ok {
  background:#f0fdf4;
  border-color:#bbf7d0;
}
.statementx-trace-metric.danger {
  background:#fff5f5;
  border-color:#fecaca;
}
.statementx-trace-metric span {
  color:#657489;
  display:block;
  font-size:10px;
  font-weight:850;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.statementx-trace-metric strong {
  color:var(--navy);
  display:block;
  font-size:18px;
  margin-top:5px;
}
.statementx-trace-metric small,
.statementx-trace-notes {
  color:#5b6b80;
  font-size:12px;
}
.statementx-trace-notes {
  background:#fffaf0;
  border:1px solid #fde68a;
  border-radius:8px;
  margin:0;
  padding:10px 12px 10px 28px;
}
.statementx-trace-table-wrap {
  border:1px solid var(--border);
  border-radius:8px;
  overflow:auto;
}
.statementx-trace-table-wrap h5 {
  background:#f2f7f7;
  border-bottom:1px solid var(--border);
  color:var(--navy);
  font-size:13px;
  margin:0;
  padding:10px 12px;
}
.statementx-trace-table,
.statementx-trace-payment-table {
  min-width:860px;
}
.statementx-trace-detail-row td {
  background:#fff !important;
  padding:0;
}
.statementx-trace-details {
  border-top:1px solid var(--border);
}
.statementx-trace-details summary {
  align-items:center;
  cursor:pointer;
  display:flex;
  gap:8px;
  list-style:none;
  padding:10px 12px;
}
.statementx-trace-details summary::-webkit-details-marker {
  display:none;
}
.statementx-caret {
  align-items:center;
  color:var(--teal);
  display:inline-flex;
  flex:0 0 16px;
  font-size:20px;
  font-weight:900;
  height:16px;
  justify-content:center;
  line-height:1;
  transition:transform .18s ease;
  width:16px;
}
.statementx-caret::before {
  content:'›';
}
.statementx-trace-details[open] .statementx-caret {
  transform:rotate(90deg);
}
.statementx-trace-details summary span:not(.statementx-caret) {
  color:var(--navy);
  font-weight:850;
}
.statementx-trace-details summary small {
  color:#607086;
  font-size:12px;
  margin-left:auto;
}
.statementx-trace-detail-grid {
  display:grid;
  gap:12px;
  grid-template-columns:1fr;
  padding:0 12px 12px;
}
.statementx-trace-detail-grid section {
  border:1px solid var(--border);
  border-radius:8px;
  overflow:hidden;
}
.statementx-trace-detail-grid h6 {
  background:#f7fbfb;
  border-bottom:1px solid var(--border);
  color:#0f766e;
  font-size:12px;
  letter-spacing:.06em;
  margin:0;
  padding:9px 10px;
  text-transform:uppercase;
}
.statementx-trace-mini-table-wrap {
  overflow:auto;
}
.statementx-trace-source-table {
  min-width:980px;
}
.statementx-trace-source-table td span {
  color:#607086;
  display:block;
  font-size:11px;
  margin-top:2px;
}
.statementx-trace-row.danger td {
  background:#fff5f5;
}
.statementx-trace-row.warning td {
  background:#fffaf0;
}
.statementx-trace-row.ok td {
  background:#fbfffd;
}
.statementx-layout {
  display:grid;
  gap:14px;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  margin-bottom:14px;
}
.statementx-card {
  overflow:hidden;
  padding:0;
}
.statementx-section-head {
  align-items:center;
  border-bottom:1px solid var(--border);
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
}
.statementx-section-head h3 {
  color:var(--navy);
  font-size:18px;
  margin:0;
}
.statementx-section-head span {
  color:#667789;
  font-weight:750;
}
.statementx-check-list,
.statementx-file-list,
.statementx-next-steps,
.statementx-proda-grid {
  padding:14px 16px;
}
.statementx-check-item {
  align-items:flex-start;
  border:1px solid var(--border);
  border-radius:8px;
  display:grid;
  gap:10px;
  grid-template-columns:18px minmax(0,1fr) auto;
  margin-bottom:10px;
  padding:12px;
}
.statementx-check-item.ok { background:#f6fffb; border-color:#bbf7d0; }
.statementx-check-item.warning { background:#fffaf0; border-color:#fde68a; }
.statementx-check-item.danger { background:#fff5f5; border-color:#fecaca; }
.statementx-check-item.muted { background:#f8fafc; }
.statementx-check-icon {
  border:2px solid currentColor;
  border-radius:999px;
  color:var(--teal);
  height:12px;
  margin-top:3px;
  width:12px;
}
.statementx-check-item.danger .statementx-check-icon { color:#b42318; }
.statementx-check-item.warning .statementx-check-icon { color:#a16207; }
.statementx-check-item strong {
  color:var(--navy);
  display:block;
}
.statementx-check-item p {
  color:#526275;
  margin:3px 0 0;
}
.statementx-check-item em,
.statementx-file-row em {
  border-radius:999px;
  font-size:11px;
  font-style:normal;
  font-weight:850;
  padding:4px 8px;
  white-space:nowrap;
}
.statementx-check-item.ok em,
.statementx-file-row em.ok { background:#dcfce7; color:#166534; }
.statementx-check-item.warning em,
.statementx-file-row em.warning { background:#fef3c7; color:#92400e; }
.statementx-check-item.danger em { background:#fee2e2; color:#991b1b; }
.statementx-check-item.muted em,
.statementx-file-row em.muted { background:#edf2f7; color:#526275; }
.statementx-proda-grid {
  display:grid;
  gap:12px;
  grid-template-columns:1fr 1fr;
}
.statementx-proda-card {
  border:1px solid var(--border);
  border-radius:8px;
  padding:14px;
}
.statementx-proda-card strong {
  color:var(--navy);
  display:block;
  font-size:26px;
  margin-top:4px;
}
.statementx-proda-line {
  color:#526275;
  display:flex;
  flex-wrap:wrap;
  gap:9px;
  margin-top:6px;
}
.statementx-proda-line b { color:var(--teal); }
.statementx-proda-card small { color:#667789; display:block; margin-top:7px; }
.statementx-file-row {
  align-items:center;
  border-bottom:1px solid #e5edf3;
  display:flex;
  gap:12px;
  justify-content:space-between;
  padding:11px 0;
}
.statementx-file-row:first-child { padding-top:0; }
.statementx-file-row strong {
  color:var(--navy);
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
}
.statementx-file-row span {
  color:#667789;
  display:block;
  margin-top:3px;
}
.statementx-step {
  align-items:flex-start;
  display:flex;
  gap:10px;
  margin-bottom:12px;
}
.statementx-step span {
  align-items:center;
  background:#e6f7f3;
  border-radius:999px;
  color:var(--teal);
  display:inline-flex;
  font-weight:900;
  height:24px;
  justify-content:center;
  width:24px;
}
.statementx-step.warning span {
  background:#fef3c7;
  color:#92400e;
}
.statementx-step p {
  color:#334155;
  margin:2px 0 0;
}
.statementx-step p strong {
  color:var(--navy);
  display:block;
}
.statementx-step p small {
  color:#526275;
  display:block;
  line-height:1.45;
  margin-top:3px;
}
.proda-audit-body {
  max-height:60vh;
  overflow:auto;
}
.proda-monitor-filters {
  display:grid;
  grid-template-columns:170px 170px minmax(280px, 1fr) auto;
  gap:10px;
  margin-bottom:12px;
}
.proda-monitor-filters input,
.proda-monitor-filters select {
  border:1px solid #cdd8e3;
  border-radius:6px;
  color:var(--text);
  font-size:13px;
  min-height:38px;
  padding:8px 10px;
}
.proda-monitor-body {
  max-height:62vh;
  overflow:auto;
}
.proda-audit-table {
  border-collapse:separate;
  border-spacing:0;
  font-size:12px;
  min-width:860px;
  width:100%;
}
.proda-audit-table th {
  background:#eef7f5;
  border-bottom:1px solid #c9ddd8;
  color:#264b43;
  font-size:11px;
  font-weight:850;
  letter-spacing:.04em;
  padding:9px 10px;
  text-align:left;
  text-transform:uppercase;
}
.proda-audit-table td {
  border-bottom:1px solid #e1e8ef;
  color:#223242;
  padding:9px 10px;
  vertical-align:top;
}
.proda-audit-table td:last-child {
  max-width:260px;
  white-space:normal;
}
.proda-monitor-table td strong {
  color:var(--navy);
  display:block;
}
.proda-monitor-table td span,
.proda-monitor-table td small {
  color:#64748b;
  display:block;
  margin-top:2px;
}
.proda-monitor-table tr.proda-monitor-hidden td {
  background:#eef1f4;
  color:#667085;
}
.proda-monitor-footer {
  align-items:center;
  gap:10px;
}
.proda-monitor-footer span {
  color:#526275;
  font-weight:750;
  margin-right:auto;
}
@media(max-width:980px) {
  .proda-source-summary-grid { grid-template-columns:1fr; }
  .proda-source-toolbar { align-items:stretch; flex-direction:column; }
  .proda-source-filters { grid-template-columns:1fr; }
  .proda-monitor-filters { grid-template-columns:1fr; }
  .proda-source-hdr .page-actions { flex-wrap:wrap; justify-content:flex-start; }
}
.btn-icon     { padding:5px 8px; }
.btn:disabled { opacity:.5; cursor:not-allowed; }
a.btn { text-decoration:none; }

/* ── Tables ── */
.tbl-wrap { overflow-x:auto; border-radius:8px; border:1px solid var(--border); background:#fff; }
table  { width:100%; border-collapse:collapse; background:var(--card); }
thead tr { background:#17445f; color:#fff; }
th { padding:9px 10px; text-align:left; font-size:12px; font-weight:600; white-space:nowrap; }
.sortable { cursor:pointer; user-select:none; position:relative; padding-right:22px; }
.sortable::after { content:'↕'; position:absolute; right:8px; top:50%; transform:translateY(-50%); font-size:11px; opacity:.45; }
.sortable.sort-asc::after { content:'↑'; opacity:1; }
.sortable.sort-desc::after { content:'↓'; opacity:1; }
td { padding:8px 10px; font-size:13px; border-bottom:1px solid var(--border); vertical-align:middle; }
tr:last-child td { border-bottom:none; }
tr.alt { background:var(--row-alt); }
tr:hover td { background:#edf7f5; }
.num { text-align:right; font-variant-numeric:tabular-nums; }
.neg-num { color:var(--danger) !important; font-weight:700; }
.count-pill { background:#e7eef8; color:var(--navy); border:1px solid var(--border); border-radius:999px; padding:3px 10px; font-size:12px; font-weight:600; }

/* ── Forms ── */
.form-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:12px; }
.form-group { display:flex; flex-direction:column; gap:4px; }
.form-group label { font-size:12px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.4px; }
.form-group input, .form-group select, .form-group textarea {
  padding:8px 10px; border:1.5px solid var(--border); border-radius:6px;
  font-size:13px; color:var(--text); background:#fff; transition:border .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline:none; border-color:var(--teal); }
.form-group input[readonly] { background:#f5f5f5; color:var(--muted); }
.form-group select[multiple] {
  min-height: 94px;
  padding: 6px 8px;
}
.form-group select[multiple] option {
  border-radius: 4px;
  padding: 5px 7px;
}
.form-group textarea { min-height:68px; resize:vertical; }
.textarea-wide { grid-column:1/-1; }
.form-section {
  border:1px solid var(--border);
  border-radius:8px;
  margin-top:14px;
  padding:0;
  background:#fbfdfc;
}
.form-section summary {
  color:var(--navy);
  cursor:pointer;
  font-size:14px;
  font-weight:850;
  padding:12px 14px;
}
.form-section[open] summary { border-bottom:1px solid var(--border); }
.form-section .form-grid { padding:14px; }

/* ── Badges ── */
.badge { display:inline-block; padding:3px 9px; border-radius:999px; font-size:11px; font-weight:800; letter-spacing:.1px; }
.badge-active  { background:#d5f0e8; color:#1a6640; }
.badge-pending { background:#fdeec8; color:#8a5100; }
.badge-inactive{ background:#eee;    color:#888; }
.badge-warning-soft { background:#fff4d8; color:#8a5100; }
.badge-danger-soft { background:#fde8e8; color:#a23a34; }
.badge-admin   { background:#dde8ff; color:#1a3080; }
.badge-draft   { background:#eee;    color:#555; }
.badge-approved{ background:#d5f0e8; color:#1a6640; }
.badge-zoho { border:1px solid rgba(0,0,0,.06); }
.badge-zoho-synced { background:#d5f0e8; color:#1a6640; }
.badge-zoho-changed { background:#fdeec8; color:#8a5100; }
.badge-zoho-failed { background:#fde8e8; color:#a23a34; }
.badge-zoho-blocked { background:#fde8e8; color:#a23a34; }
.badge-zoho-setup_required { background:#e7eef8; color:#1a3080; }
.badge-zoho-not_ready,
.badge-zoho-not_synced { background:#eee; color:#555; }

/* ── Page header ── */
.page-hdr { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; flex-wrap:wrap; gap:14px; }
.page-hdr h2 { font-size:23px; color:var(--navy); letter-spacing:0; }
.page-subtitle { color:var(--muted); margin-top:5px; line-height:1.45; }
.page-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.admin-hero {
  background:rgba(255,255,255,.72);
  border:1px solid rgba(216,224,230,.88);
  border-radius:8px;
  box-shadow:var(--shadow-sm);
  padding:16px;
}

/* ── Email Template Center ── */
.email-template-shell { display:flex; flex-direction:column; gap:14px; }
.email-template-hero {
  align-items:center;
  background:rgba(255,255,255,.86);
  border:1px solid rgba(216,224,230,.95);
  border-radius:8px;
  box-shadow:var(--shadow-sm);
  display:flex;
  gap:24px;
  justify-content:space-between;
  padding:22px;
}
.email-template-hero h2 { color:var(--navy); font-size:28px; letter-spacing:0; }
.email-template-hero img {
  height:62px;
  max-width:260px;
  object-fit:contain;
}
.email-template-actions {
  align-items:center;
  display:flex;
  gap:14px;
  justify-content:space-between;
}
.email-template-note {
  color:#42536a;
  font-size:13px;
  line-height:1.45;
}
.email-template-layout {
  display:grid;
  grid-template-columns:minmax(320px, .9fr) minmax(420px, 1.5fr);
  gap:16px;
}
.email-template-list-card,
.email-preview-card { margin-bottom:0; }
.email-template-list {
  display:flex;
  flex-direction:column;
  gap:8px;
}
.email-template-row {
  align-items:center;
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  color:var(--text);
  cursor:pointer;
  display:flex;
  gap:12px;
  justify-content:space-between;
  padding:12px;
  text-align:left;
  transition:border-color .16s, background .16s, transform .16s;
}
.email-template-row:hover { border-color:rgba(15,118,110,.45); background:#f5fbfa; transform:translateY(-1px); }
.email-template-row.active {
  background:#edf9f7;
  border-color:var(--teal);
  box-shadow:inset 4px 0 0 var(--teal);
}
.email-template-row strong { display:block; color:var(--navy); font-size:14px; }
.email-template-row small { color:var(--muted); display:block; margin-top:3px; }
.email-template-row-meta {
  align-items:flex-end;
  color:var(--muted);
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:94px;
}
.email-template-row-meta b,
.email-template-row-meta em { font-size:11px; font-style:normal; text-transform:uppercase; }
.email-preview-toolbar {
  align-items:center;
  border-bottom:1px solid var(--border);
  display:flex;
  justify-content:space-between;
  margin:-2px 0 14px;
  padding-bottom:12px;
}
.email-preview-toolbar strong { color:var(--navy); display:block; }
.email-preview-toolbar span { color:var(--muted); font-size:12px; }
.email-preview-paper {
  background:#fff;
  border:1px solid #dbe5e9;
  border-radius:8px;
  box-shadow:0 10px 26px rgba(24,49,79,.08);
  color:#203148;
  line-height:1.55;
  padding:26px;
}
.email-preview-brand {
  align-items:flex-end;
  border-bottom:3px solid var(--teal);
  display:flex;
  gap:14px;
  justify-content:space-between;
  margin-bottom:18px;
  padding-bottom:14px;
}
.email-preview-brand img { height:46px; max-width:210px; object-fit:contain; }
.email-preview-brand span {
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  letter-spacing:.7px;
  text-transform:uppercase;
}
.email-preview-subject {
  color:var(--navy);
  font-size:20px;
  font-weight:850;
  margin-bottom:18px;
}
.email-preview-body { white-space:normal; }
.email-preview-signature {
  border-left:3px solid rgba(15,118,110,.32);
  color:#33465f;
  margin-top:22px;
  padding-left:12px;
}
.email-preview-meta {
  background:#f3f7f7;
  border:1px solid var(--border);
  border-radius:6px;
  color:var(--muted);
  font-size:12px;
  margin-top:18px;
  padding:10px 12px;
}
.email-template-modal,
.email-send-modal { max-width:1180px; width:min(1180px, 94vw); }
.email-template-editor-grid {
  display:grid;
  grid-template-columns:minmax(420px, 1fr) minmax(360px, .85fr);
  gap:18px;
}
.email-send-grid {
  align-items:start;
  display:grid;
  gap:18px;
  grid-template-columns:minmax(420px, 1fr) minmax(360px, .85fr);
}
.email-send-fields .textarea-wide {
  grid-column:1/-1;
}
.email-send-preview-panel {
  position:sticky;
  top:12px;
}
.email-template-editor-fields textarea { min-height:260px; }
.template-variable-box {
  align-items:center;
  background:#f7fbfa;
  border:1px dashed #bdd4d0;
  border-radius:8px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
  padding:12px;
}
.template-variable-box strong {
  color:var(--navy);
  margin-right:4px;
}
.template-variable-box span {
  background:#e9f4f2;
  border:1px solid #d1e5e1;
  border-radius:999px;
  color:#24514c;
  font-family:ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size:12px;
  padding:4px 8px;
}
.modal-preview { max-height:620px; overflow:auto; }
.control-input {
  padding:8px 12px;
  border:1.5px solid var(--border);
  border-radius:6px;
  font-size:13px;
  min-width:260px;
  background:#fff;
}
.control-input:focus { outline:none; border-color:var(--teal); box-shadow:0 0 0 3px rgba(15,118,110,.10); }
.search-bar { display:flex; gap:8px; align-items:center; }
.search-bar input { padding:7px 12px; border:1.5px solid var(--border); border-radius:5px; font-size:13px; min-width:200px; }
.search-bar select { padding:7px 12px; border:1.5px solid var(--border); border-radius:5px; font-size:13px; background:#fff; }
.client-filter-bar input { min-width:140px; }
.client-meta { font-size:12px; line-height:1.35; color:var(--muted); white-space:nowrap; }
#page-clients .page-hdr > div:last-child {
  flex:1 1 640px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
#page-clients .page-hdr .search-bar:first-child {
  flex:1 1 240px;
  min-width:220px;
}
#page-clients .client-filter-bar {
  flex:2 1 430px;
  flex-wrap:wrap;
}
#page-clients .client-filter-bar select { flex:1 1 120px; }
#page-clients .client-filter-bar input { flex:1 1 135px; }
#page-clients #client-search { width:100%; }

/* ── Clients Workbench ── */
.clients-workbench-hero {
  align-items:stretch;
  background:#fff;
  border:1px solid #d8e4ec;
  border-radius:14px;
  box-shadow:0 18px 44px rgba(16,24,40,.08);
  display:grid;
  gap:18px;
  grid-template-columns:minmax(0,1.1fr) minmax(520px,.9fr);
  margin-bottom:14px;
  padding:22px;
}
.clients-eyebrow {
  color:#0f766e;
  display:block;
  font-size:11px;
  font-weight:950;
  letter-spacing:.12em;
  margin-bottom:7px;
  text-transform:uppercase;
}
.clients-workbench-hero h2 {
  color:#172033;
  font-size:32px;
  font-weight:950;
  line-height:1.05;
  margin:0;
}
.clients-insight-grid {
  display:grid;
  gap:10px;
  grid-template-columns:repeat(4,minmax(0,1fr));
}
.clients-insight-grid div {
  background:linear-gradient(180deg,#f8fbfc 0%,#fff 100%);
  border:1px solid #dce8ef;
  border-radius:10px;
  padding:13px 14px;
}
.clients-insight-grid div.attention {
  background:#fff7ed;
  border-color:#fed7aa;
}
.clients-insight-grid span {
  color:#667085;
  display:block;
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
  margin-bottom:5px;
  text-transform:uppercase;
}
.clients-insight-grid strong {
  color:#172033;
  display:block;
  font-size:24px;
  font-weight:950;
  line-height:1.05;
}
.clients-insight-grid small {
  color:#667085;
  display:block;
  font-size:11px;
  font-weight:700;
  margin-top:4px;
}
.clients-filter-panel {
  align-items:end;
  background:#f8fbfc;
  border:1px solid #d8e4ec;
  border-radius:12px;
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-bottom:14px;
  padding:14px;
}
.clients-search-wrap,
.clients-date-filter {
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
}
.clients-search-wrap {
  flex:1 1 440px;
}
.clients-date-filter {
  flex:0 1 560px;
}
.clients-search-wrap label,
.clients-date-filter label {
  color:#667085;
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.clients-search-wrap input,
.clients-date-filter select,
.clients-date-filter input {
  background:#fff;
  border:1.5px solid #cbd8e2;
  border-radius:8px;
  color:#172033;
  font-size:13px;
  min-height:38px;
  padding:8px 11px;
}
.clients-search-wrap input:focus,
.clients-date-filter select:focus,
.clients-date-filter input:focus {
  border-color:#0f766e;
  box-shadow:0 0 0 3px rgba(15,118,110,.1);
  outline:none;
}
.clients-filter-panel .client-filter-bar {
  align-items:center;
  display:flex !important;
  flex-wrap:nowrap !important;
  gap:8px;
  width:auto !important;
}
#page-clients .clients-filter-panel .client-filter-bar select,
#page-clients .clients-filter-panel .client-filter-bar input,
#page-clients .clients-filter-panel .client-filter-bar button {
  flex:0 0 auto;
  height:38px;
  max-height:38px;
  min-height:38px;
}
#page-clients .clients-filter-panel .client-filter-bar select {
  width:150px;
}
#page-clients .clients-filter-panel .client-filter-bar input {
  min-width:0;
  width:165px;
}
.clients-date-filter label {
  white-space:nowrap;
}
.clients-filter-actions {
  align-items:center;
  display:flex;
  flex:0 0 auto;
  gap:10px;
  justify-content:flex-end;
  white-space:nowrap;
}
.clients-searchbar-panel {
  align-items:end !important;
  display:grid !important;
  grid-template-columns:minmax(320px,1fr) auto !important;
  min-height:0 !important;
  padding:12px 14px !important;
}
.clients-searchbar-panel .clients-search-wrap,
.clients-searchbar-panel .clients-filter-actions {
  align-self:end !important;
  height:auto !important;
  min-height:0 !important;
}
.clients-searchbar-panel .clients-search-wrap input {
  height:38px !important;
  max-height:38px !important;
  min-height:38px !important;
}
.finance-filter-panel {
  grid-template-columns:minmax(280px,2fr) 140px minmax(140px,1fr) 150px 150px auto !important;
}
.finance-filter-panel .clients-search-wrap {
  flex:initial;
}
.finance-filter-panel .statement-control,
.finance-filter-panel .clients-filter-actions {
  min-width:0;
}
.finance-filter-panel .statement-control select,
.finance-filter-panel .statement-control input,
.finance-filter-panel .clients-filter-actions .btn {
  height:38px;
  min-height:38px;
  width:100%;
}
#page-clients .client-table-card {
  border-radius:12px;
  overflow:hidden;
  padding:0;
}
#page-clients .client-table-card .tbl-wrap {
  border:0;
  border-radius:12px;
}
#clients-table thead tr {
  background:#eef5f7;
  color:#334155;
}
#clients-table th {
  border-bottom:1px solid #d8e4ec;
  color:#475467;
  font-size:10px;
  font-weight:900;
  letter-spacing:.07em;
  padding:11px 10px;
  text-transform:uppercase;
}
#clients-table td {
  border-bottom:1px solid #e5edf3;
  padding:11px 10px;
}
#clients-table tr:hover td {
  background:#f5fbfa;
}
.client-name-link {
  background:transparent;
  border:0;
  color:#172033;
  cursor:pointer;
  display:block;
  font:inherit;
  padding:0;
  text-align:left;
}
.client-name-link strong {
  color:#172033;
  display:block;
  font-size:14px;
  font-weight:900;
  line-height:1.25;
}
.client-name-link span {
  color:#667085;
  display:block;
  font-size:12px;
  font-weight:650;
  margin-top:3px;
}
.client-name-link:hover strong {
  color:#0f766e;
}
.client-warning-text {
  color:#b42318;
  font-weight:900;
}
.client-sync-text {
  border:0;
  border-radius:999px;
  cursor:pointer;
  display:inline-flex;
  font-size:11px;
  font-weight:900;
  padding:4px 8px;
}
.client-sync-text:focus-visible {
  outline:3px solid rgba(20,184,166,.28);
  outline-offset:2px;
}
.client-sync-text.ready { background:#dcfce7; color:#166534; }
.client-sync-text.warning { background:#fef3c7; color:#92400e; }
.client-sync-text.blocked { background:#fee2e2; color:#991b1b; }
.client-sync-text.muted { background:#eef2f6; color:#475467; }
.client-card-status-row .client-sync-text {
  border-radius:999px;
  font-size:11px;
  font-weight:900;
  padding:5px 8px;
}
.client-sync-reason-modal {
  max-width:560px;
}
.client-sync-reason-head {
  align-items:center;
  border:1px solid var(--border);
  border-radius:10px;
  display:flex;
  gap:14px;
  justify-content:space-between;
  margin-bottom:14px;
  padding:14px;
}
.client-sync-reason-head.ready { background:#f0fdf4; border-color:#bbf7d0; }
.client-sync-reason-head.warning { background:#fffbeb; border-color:#fde68a; }
.client-sync-reason-head.blocked { background:#fff1f2; border-color:#fecaca; }
.client-sync-reason-head.muted { background:#f8fafc; border-color:#dbe4ef; }
.client-sync-reason-head span,
.client-sync-reason-note {
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}
.client-sync-reason-head strong {
  color:var(--text);
  display:block;
  font-size:16px;
  margin:3px 0;
}
.client-sync-reason-head small {
  color:var(--muted);
  display:block;
  font-size:12px;
  font-weight:700;
}
.client-sync-reason-list {
  display:grid;
  gap:8px;
  margin:0;
  padding:0;
}
.client-sync-reason-list li {
  background:#f8fafc;
  border:1px solid #dbe4ef;
  border-radius:8px;
  color:#1f2a44;
  font-weight:800;
  line-height:1.45;
  list-style:none;
  padding:10px 12px;
}
.client-sync-reason-note {
  border-top:1px solid var(--border);
  margin-top:14px;
  padding-top:12px;
}
.client-status-badge {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.client-status-stack {
  align-items:center;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.business-unit-badges {
  align-items:center;
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  min-width: 120px;
}
.business-unit-select-preview {
  align-items:center;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  min-height:28px;
  padding-top:2px;
}
.business-unit-select-preview .muted {
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}
.business-unit-badge,
.business-unit-card-tag {
  background:#e8f6f3;
  border:1px solid #b7ded8;
  border-radius:999px;
  color:#0f766e !important;
  display:inline-flex;
  font-size:10px;
  font-weight:900;
  line-height:1;
  padding:5px 7px;
  white-space:nowrap;
}
.business-unit-badges .muted {
  color:var(--muted);
  font-size:12px;
}
.client-table-card .muted {
  color:var(--muted);
}
.client-transfer-badge {
  background:#fef3c7;
  border:1px solid #facc15;
  border-radius:999px;
  color:#92400e;
  display:inline-flex;
  font-size:11px;
  font-weight:950;
  padding:4px 8px;
  white-space:nowrap;
}
.client-row-actions {
  white-space:nowrap;
}
.client-record-card {
  border-radius:12px;
  padding:16px;
}
.client-record-card.needs-review {
  border-color:#fecaca;
}
.client-card-status-row {
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin:0 0 12px;
}
.client-card-status-row span {
  background:#eef2f6;
  border-radius:999px;
  color:#475467;
  font-size:11px;
  font-weight:900;
  padding:5px 8px;
}
.client-card-status-row .ready { background:#dcfce7; color:#166534; }
.client-card-status-row .active { background:#dcfce7; color:#166534; }
.client-card-status-row .warning { background:#fef3c7; color:#92400e; }
.client-card-status-row .danger,
.client-card-status-row .blocked { background:#fee2e2; color:#991b1b; }
.client-card-status-row .muted { background:#eef2f6; color:#475467; }
.client-card-status-row .warning,
.client-card-status-row .client-transfer-badge { background:#fef3c7; border-color:#facc15; color:#92400e; }
.client-card-status-row .blocked { background:#fee2e2; color:#991b1b; }

@media(max-width:1180px) {
  .clients-workbench-hero {
    grid-template-columns:1fr;
  }
  .clients-date-filter {
    flex:1 1 520px;
  }
  .clients-filter-actions {
    justify-content:space-between;
  }
}

@media(max-width:760px) {
  .clients-workbench-hero {
    border-radius:12px;
    padding:18px;
  }
  .clients-workbench-hero h2 {
    font-size:27px;
  }
  .clients-insight-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .clients-filter-panel {
    padding:12px;
  }
  .clients-filter-panel .client-filter-bar,
  .clients-filter-actions {
    align-items:stretch;
    display:grid;
    grid-template-columns:1fr;
  }
  #page-clients .clients-filter-panel .client-filter-bar select,
  #page-clients .clients-filter-panel .client-filter-bar input,
  #page-clients .clients-filter-panel .client-filter-bar button {
    width:100%;
  }
  .clients-filter-actions .btn {
    width:100%;
  }
  .clients-searchbar-panel {
    grid-template-columns:1fr !important;
  }
}

/* Final Clients toolbar guard: keep desktop filters compact even with legacy rules. */
#page-clients .clients-filter-panel {
  align-items:end !important;
  display:grid !important;
  grid-template-columns:minmax(360px,1fr) minmax(520px,auto) auto !important;
  min-height:0 !important;
  height:auto !important;
  padding:12px 14px !important;
}
#page-clients .clients-search-wrap,
#page-clients .clients-date-filter,
#page-clients .clients-filter-actions {
  align-self:end !important;
  height:auto !important;
  min-height:0 !important;
}
#page-clients .clients-search-wrap input,
#page-clients .clients-date-filter select,
#page-clients .clients-date-filter input,
#page-clients .clients-date-filter button {
  height:38px !important;
  max-height:38px !important;
  min-height:38px !important;
}
#page-clients .clients-filter-panel .client-filter-bar {
  align-items:center !important;
  display:flex !important;
  flex-wrap:nowrap !important;
  width:auto !important;
}

@media(max-width:1180px) {
  #page-clients .clients-filter-panel {
    grid-template-columns:1fr !important;
  }
  #page-clients .clients-filter-panel .client-filter-bar {
    flex-wrap:wrap !important;
  }
}

@media(max-width:760px) {
  #page-clients .clients-filter-panel .client-filter-bar,
  #page-clients .clients-filter-actions {
    display:grid !important;
    grid-template-columns:1fr !important;
  }
  #page-clients .clients-filter-panel .client-filter-bar select,
  #page-clients .clients-filter-panel .client-filter-bar input,
  #page-clients .clients-filter-panel .client-filter-bar button {
    width:100% !important;
  }
}

#page-clients .clients-searchbar-panel {
  display:grid !important;
  grid-template-columns:minmax(320px,1fr) auto !important;
  height:auto !important;
  min-height:0 !important;
  padding:12px 14px !important;
}
#page-clients .clients-searchbar-panel .clients-search-wrap,
#page-clients .clients-searchbar-panel .clients-filter-actions {
  height:auto !important;
  min-height:0 !important;
}
#page-clients .clients-searchbar-panel input,
#page-clients .clients-searchbar-panel .btn,
#page-clients .clients-searchbar-panel .count-pill {
  max-height:38px !important;
}
@media(max-width:760px) {
  #page-clients .clients-searchbar-panel {
    grid-template-columns:1fr !important;
  }
}

/* ── Budget Summary ── */
.summary-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.smry-tbl { width:100%; border-collapse:collapse; font-size:13px; }
.smry-tbl th { background:var(--teal); color:#fff; padding:8px 12px; text-align:right; }
.smry-tbl th:first-child { text-align:left; }
.smry-tbl td { padding:6px 12px; border-bottom:1px solid var(--border); text-align:right; }
.smry-tbl td:first-child { text-align:left; }
.smry-tbl tr.section-hdr td { background:#e8f4f4; font-weight:700; color:var(--teal); }
.smry-tbl tr.total-row td { background:var(--navy); color:#fff; font-weight:700; }
.smry-tbl tr.avail-row td { background:var(--teal); color:#fff; font-weight:700; }
.smry-tbl tr.alloc-row td { background:#222; color:#fff; font-weight:700; }
.summary-client-card { border:1px solid var(--border); border-radius:8px; padding:16px 18px; margin-bottom:16px; background:linear-gradient(180deg,#f8fbfc 0%, #ffffff 100%); }
.summary-client-title { font-size:16px; font-weight:700; color:var(--navy); margin-bottom:12px; }
.summary-client-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:10px 14px; }
.summary-client-item { border:1px solid #e5edf2; border-radius:6px; padding:10px 12px; background:#fff; }
.summary-client-label { font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.4px; margin-bottom:4px; }
.summary-client-value { font-size:14px; color:var(--navy); font-weight:600; word-break:break-word; }
.summary-section-title { font-size:16px; font-weight:700; color:var(--navy); margin:22px 0 10px; }
.summary-note { font-size:12px; color:var(--muted); margin-bottom:8px; }
.summary-detail-wrap { overflow-x:auto; border:1px solid var(--border); border-radius:8px; margin-top:8px; }
.summary-detail-tbl { width:100%; border-collapse:collapse; font-size:12px; }
.summary-detail-tbl thead tr { background:var(--teal); color:#fff; }
.summary-detail-tbl th { padding:8px; font-size:11px; }
.summary-detail-tbl td { padding:6px 8px; border-bottom:1px solid var(--border); vertical-align:top; }
.summary-detail-tbl tr:nth-child(even) td { background:#fafcfd; }
.summary-detail-tbl tr.total-row td { background:var(--navy); color:#fff; font-weight:700; }
.summary-modal-footer {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}
.summary-language-actions,
.summary-export-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.summary-export-actions {
  justify-content: center;
}

.client-zoho-lock-note {
  align-items: flex-start;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #1e3a8a;
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.45;
  margin: 0 0 14px;
  padding: 11px 13px;
}
.client-zoho-lock-note strong {
  color: #172554;
  font-size: 13px;
  font-weight: 850;
}
.client-zoho-lock-note span {
  font-size: 13px;
}

/* ── Client Profile Workspace ── */
.client-profile-hdr { align-items:center; }
.client-profile-actions { align-items:center; display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-end; }
.client-profile-hero { margin-bottom:14px; }
.client-profile-command {
  background:
    linear-gradient(135deg, rgba(9,87,82,.98), rgba(14,116,144,.94)),
    #0f766e;
  border:1px solid rgba(255,255,255,.25);
  border-radius:14px;
  box-shadow:0 22px 60px rgba(16,24,40,.16);
  color:#fff;
  display:grid;
  gap:22px;
  grid-template-columns:minmax(0,1fr) minmax(300px,380px);
  overflow:hidden;
  padding:28px;
  position:relative;
}
.client-profile-command::after {
  background:linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,0));
  content:"";
  height:220px;
  position:absolute;
  right:-76px;
  top:-88px;
  transform:rotate(18deg);
  width:280px;
}
.client-profile-command-main,
.client-profile-next-panel { position:relative; z-index:1; }
.client-profile-kicker {
  color:#b9f4e8;
  display:block;
  font-size:11px;
  font-weight:900;
  letter-spacing:.12em;
  margin-bottom:10px;
  text-transform:uppercase;
}
.client-profile-command h3 {
  color:#fff;
  font-size:34px;
  font-weight:950;
  letter-spacing:0;
  line-height:1.05;
  margin:0 0 10px;
}
.client-profile-command p {
  color:rgba(255,255,255,.82);
  font-size:14px;
  font-weight:650;
  line-height:1.5;
  margin:0;
  max-width:760px;
}
.client-profile-meta-strip {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:20px;
}
.client-profile-meta-strip span {
  background:rgba(255,255,255,.11);
  border:1px solid rgba(255,255,255,.22);
  border-radius:999px;
  color:#fff;
  display:inline-flex;
  gap:7px;
  padding:8px 10px;
  white-space:nowrap;
}
.client-profile-meta-strip em {
  color:#b9f4e8;
  font-style:normal;
  font-weight:900;
}
.client-profile-next-panel {
  align-self:stretch;
  background:rgba(255,255,255,.94);
  border:1px solid rgba(255,255,255,.8);
  border-radius:12px;
  color:#172033;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:18px;
}
.client-profile-next-panel span {
  color:#667085;
  font-size:10px;
  font-weight:900;
  letter-spacing:.1em;
  margin-bottom:7px;
  text-transform:uppercase;
}
.client-profile-next-panel strong {
  color:#0f766e;
  display:block;
  font-size:24px;
  font-weight:950;
  line-height:1.1;
}
.client-profile-next-panel p {
  color:#475467;
  font-size:13px;
  margin:9px 0 15px;
}
.client-profile-signal-row {
  background:#fff;
  border:1px solid #d8e4ec;
  border-radius:0 0 14px 14px;
  border-top:0;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  margin:0 16px;
  overflow:hidden;
}
.client-profile-signal-row div {
  border-right:1px solid #e5edf3;
  padding:13px 16px;
}
.client-profile-signal-row div:last-child { border-right:0; }
.client-profile-signal-row span {
  color:#667085;
  display:block;
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
  margin-bottom:4px;
  text-transform:uppercase;
}
.client-profile-signal-row strong {
  color:#172033;
  display:block;
  font-size:14px;
  font-weight:900;
  overflow-wrap:anywhere;
}
.client-profile-sequence {
  align-items:center;
  background:#fff;
  border:1px solid #d8e4ec;
  border-radius:12px;
  box-shadow:0 10px 28px rgba(16,24,40,.05);
  display:grid;
  gap:16px;
  grid-template-columns:minmax(260px,.8fr) minmax(0,1.2fr);
  margin:14px 0 16px;
  padding:16px;
}
.client-profile-sequence-title {
  color:#0f766e;
  display:block;
  font-size:11px;
  font-weight:950;
  letter-spacing:.1em;
  margin-bottom:5px;
  text-transform:uppercase;
}
.client-profile-sequence p {
  color:#56657a;
  font-size:13px;
  font-weight:650;
  line-height:1.45;
  margin:0;
}
.client-profile-sequence-steps {
  align-items:center;
  display:grid;
  gap:8px;
  grid-template-columns:repeat(5,minmax(0,1fr));
}
.client-profile-sequence-steps span {
  align-items:center;
  background:#f4f8fb;
  border:1px solid #dce8ef;
  border-radius:999px;
  color:#334155;
  display:flex;
  font-size:12px;
  font-weight:900;
  justify-content:center;
  min-height:34px;
  padding:7px 9px;
  text-align:center;
}
.client-profile-workflow-grid { display:grid; gap:12px; grid-template-columns:repeat(4,minmax(0,1fr)); margin-bottom:16px; }
.client-profile-workflow-card {
  appearance:none;
  background:#fff;
  border:1px solid #d8e4ec;
  border-top:4px solid #94a3b8;
  border-radius:10px;
  box-shadow:0 10px 24px rgba(16,24,40,.05);
  cursor:pointer;
  display:flex;
  flex-direction:column;
  min-height:148px;
  padding:16px;
  text-align:left;
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.client-profile-workflow-card .workflow-step {
  align-self:flex-start;
  background:#eef7f6;
  border:1px solid #c8e4df;
  border-radius:999px;
  color:#0f766e;
  font-size:10px;
  font-weight:950;
  letter-spacing:.06em;
  margin-bottom:10px;
  padding:4px 8px;
}
.client-profile-workflow-card:hover {
  border-color:#a8c4d2;
  box-shadow:0 18px 34px rgba(16,24,40,.1);
  transform:translateY(-2px);
}
.client-profile-workflow-card.ready { border-top-color:#0f766e; }
.client-profile-workflow-card.warning { border-top-color:#b45309; }
.client-profile-workflow-card.blocked { border-top-color:#b42318; }
.client-profile-workflow-card .workflow-label { color:#667085; display:block; font-size:10px; font-weight:900; letter-spacing:.08em; margin-bottom:9px; text-transform:uppercase; }
.client-profile-workflow-card strong { color:#172033; display:block; font-size:21px; font-weight:950; line-height:1.15; margin-bottom:7px; }
.client-profile-workflow-card p { color:#56657a; font-size:12px; font-weight:650; line-height:1.4; margin:0 0 12px; }
.client-profile-workflow-card .workflow-action { color:#0f766e; display:block; font-size:12px; font-weight:900; margin-top:auto; }
.client-profile-layout { align-items:start; display:grid; gap:16px; grid-template-columns:minmax(0,1fr) minmax(320px,400px); }
.client-profile-main-card, .client-profile-budget-section { min-width:0; }
.client-profile-main-card .client-profile-card-title { align-items:center; display:flex; justify-content:space-between; gap:12px; }
.client-profile-sync-btn { flex:0 0 auto; }
.client-profile-side { display:grid; gap:16px; min-width:0; }
.client-profile-info-grid { display:grid; gap:12px; grid-template-columns:1fr; }
.client-profile-info-section {
  background:#fff;
  border:1px solid #dce8ef;
  border-radius:10px;
  overflow:hidden;
}
.client-profile-info-section summary {
  align-items:center;
  background:#f8fbfc;
  color:#172033;
  cursor:pointer;
  display:flex;
  font-size:13px;
  font-weight:950;
  gap:8px;
  letter-spacing:.02em;
  list-style:none;
  padding:12px 14px;
}
.client-profile-info-section summary::-webkit-details-marker { display:none; }
.client-profile-info-section[open] summary { border-bottom:1px solid #e3ebf1; }
.client-profile-section-grid {
  display:grid;
  gap:10px;
  grid-template-columns:repeat(3,minmax(0,1fr));
  padding:12px;
}
.client-profile-info-item { background:#f8fbfc; border:1px solid #dce8ef; border-radius:8px; min-height:62px; padding:10px 12px; }
.client-profile-info-item.new-transfer { background:#fffbeb; border-color:#facc15; }
.client-profile-info-item span { color:#667085; display:block; font-size:10px; font-weight:900; letter-spacing:.06em; margin-bottom:5px; text-transform:uppercase; }
.client-profile-info-item strong { color:#172033; display:block; font-size:13px; line-height:1.35; overflow-wrap:anywhere; }
.client-profile-info-item.wide { grid-column:1/-1; }
.client-profile-html-value { display:block; }
.client-profile-html-value .business-unit-badges { margin-top:2px; }
.client-profile-info-item.new-transfer span,
.client-profile-info-item.new-transfer strong { color:#92400e; }
.client-profile-care-meter { border:1px solid #d8e4ec; border-radius:8px; margin-bottom:12px; padding:12px; }
.client-profile-care-meter.ready { background:#ecfdf3; border-color:#bbf7d0; }
.client-profile-care-meter.warning { background:#fff7ed; border-color:#fed7aa; }
.client-profile-care-meter.blocked { background:#fff1f1; border-color:#fecaca; }
.client-profile-care-meter strong { color:#172033; display:block; font-size:18px; font-weight:900; margin-bottom:3px; }
.client-profile-care-meter span { color:#56657a; font-size:12px; font-weight:750; }
.client-profile-missing-list { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:12px; }
.client-profile-missing-list span { background:#fff1f1; border:1px solid #fecaca; border-radius:999px; color:#b42318; font-size:11px; font-weight:850; padding:5px 8px; }
.client-profile-care-excerpt { border-top:1px solid #e3ebf1; padding-top:12px; }
.client-profile-care-excerpt span { color:#667085; display:block; font-size:10px; font-weight:900; letter-spacing:.06em; margin:10px 0 4px; text-transform:uppercase; }
.client-profile-care-excerpt p { color:#172033; font-size:13px; line-height:1.45; margin:0; }
.client-profile-quick-actions { display:grid; gap:9px; }
.client-profile-quick-actions .btn { justify-content:center; width:100%; }
.client-profile-budget-section { margin-top:16px; }
.client-profile-budget-section .card-title { align-items:center; display:flex; justify-content:space-between; }
.client-profile-budget-list { border:1px solid #dce8ef; border-radius:10px; overflow:hidden; }
.client-profile-budget-row { align-items:center; background:#fff; border-bottom:1px solid #e6edf3; display:grid; gap:12px; grid-template-columns:minmax(220px,1fr) 120px 190px 100px; padding:12px 14px; }
.client-profile-budget-row:nth-child(even) { background:#fbfdff; }
.client-profile-budget-row:last-child { border-bottom:0; }
.client-profile-budget-row strong { color:#172033; display:block; font-weight:900; }
.client-profile-budget-row span { color:#56657a; display:block; font-size:12px; font-weight:650; margin-top:2px; }
.client-profile-budget-actions { display:flex; justify-content:flex-end; }
.zoho-locked-field,
.zoho-locked-field:disabled {
  background: #f1f5f9 !important;
  border-color: #d8e2ec !important;
  color: #667085 !important;
  cursor: not-allowed;
  opacity: 1;
}

/* ── Detail table ── */
.detail-tbl th { font-size:11px; padding:7px 6px; }
.detail-tbl td { font-size:12px; padding:5px 6px; }
.detail-tbl input, .detail-tbl select {
  border:1px solid var(--border); border-radius:3px; padding:3px 5px; font-size:12px;
  width:100%; background:#fff;
}
.detail-tbl input[readonly] { background:#f5f5f5; }
.detail-tbl tr.total-row td { background:#222; color:#fff; font-weight:700; }

/* ── Modal ── */
.modal-overlay { position:fixed; inset:0; background:rgba(15,27,41,.56); z-index:200; display:flex; align-items:center; justify-content:center; padding:20px; }
.modal { background:#fff; border-radius:10px; width:100%; max-width:860px; max-height:90vh; display:flex; flex-direction:column; box-shadow:0 24px 72px rgba(0,0,0,.28); border:1px solid rgba(255,255,255,.72); overflow:hidden; }
.modal-hdr { padding:16px 20px; border-bottom:1px solid var(--border); display:flex; justify-content:space-between; align-items:center; background:linear-gradient(180deg,#fff,#f8fbfa); }
.modal-hdr h3 { font-size:16px; color:var(--navy); font-weight:700; }
.modal-body { padding:20px; overflow-y:auto; flex:1; }
.modal-footer { padding:14px 20px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:10px; }

.user-access-modal {
  max-width: 760px;
}
.feature-permissions-field {
  grid-column: 1 / -1;
}
.feature-permissions-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.feature-permission-group {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.feature-permission-group h4 {
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  margin: 0 0 8px;
  text-transform: uppercase;
}
.feature-check {
  align-items: center;
  background: #fff;
  border: 1px solid #dfe8ef;
  border-radius: 7px;
  color: #26384f;
  display: flex;
  font-size: 13px;
  font-weight: 750;
  gap: 9px;
  margin-top: 7px;
  min-height: 36px;
  padding: 8px 9px;
}
.feature-check input {
  height: 16px;
  width: 16px;
}
.feature-check.locked {
  background: #edf8f5;
  border-color: #bce2d7;
  color: #126a60;
}
.feature-permissions-note,
.feature-access-summary {
  color: var(--muted);
  font-size: 12px;
}
.feature-permissions-note {
  margin-top: 8px;
}
.close-btn { background:none; border:none; font-size:20px; cursor:pointer; color:var(--muted); line-height:1; }

/* ── Provider search popup ── */
.provider-search-tbl { font-size:12px; }
.provider-search-tbl tr:hover td { background:#d0eeee; cursor:pointer; }
.provider-search-tbl tr.status-pending td { background:#fff9ee; }

/* ── Tabs ── */
.tabs { display:flex; gap:0; border-bottom:2px solid var(--border); margin-bottom:16px; }
.tab  { padding:9px 18px; cursor:pointer; font-size:13px; font-weight:600; color:var(--muted); border-bottom:2px solid transparent; margin-bottom:-2px; transition:all .15s; }
.tab.active { color:var(--teal); border-bottom-color:var(--teal); }
.tab:hover  { color:var(--teal); }
.tab-content { display:none; }
.tab-content.active { display:block; }

/* ── Login ── */
#login-page { min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#102f45 0%,#0f766e 100%); }
#login-page.login-hidden { display:none; }
.login-box { background:#fff; padding:40px; border-radius:12px; width:min(380px, calc(100vw - 24px)); max-width:380px; box-shadow:0 20px 60px rgba(0,0,0,.3); }
.login-box .logo { text-align:center; margin-bottom:24px; }
.login-box .logo h1 { color:var(--navy); font-size:22px; }
.login-box .logo p  { color:var(--muted); font-size:13px; margin-top:4px; }
.login-box .logo .site-env-login {
  display:inline-block;
  background:#e3f7f1;
  border:1px solid #8bd8c4;
  border-radius:999px;
  color:#0f766e;
  font-size:11px;
  font-weight:800;
  letter-spacing:.8px;
  margin-top:10px;
  padding:5px 11px;
}
.login-box .form-group { margin-bottom:14px; }
.login-error { background:#fde8e8; color:var(--danger); padding:8px 12px; border-radius:5px; font-size:13px; margin-bottom:12px; }

/* ── Alerts ── */
.alert { padding:10px 14px; border-radius:5px; margin-bottom:12px; font-size:13px; }
.alert-success { background:#d5f0e8; color:#1a6640; }
.alert-error   { background:#fde8e8; color:var(--danger); }
.alert-info    { background:#ddeeff; color:#1a3080; }
.alert-warning { background:#fff4d8; color:#7a4a00; }
.zoho-sync-strip {
  align-items:center;
  background:#f6fbfb;
  border:1px solid #cfe5e2;
  border-radius:8px;
  color:var(--text);
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  padding:10px 12px;
}
.zoho-sync-strip strong { color:var(--navy); }
.zoho-sync-blocked { background:#fff7ec; border-color:#f1c88a; }
.zoho-strip-warning { color:#8a5100; font-weight:800; }
.zoho-sync-result { line-height:1.45; }
.zoho-issue-list { margin:7px 0 0 18px; padding:0; }
.zoho-issue-list li { margin:3px 0; }
.zoho-setup-note {
  background:rgba(255,255,255,.62);
  border-left:3px solid var(--pending);
  margin-top:8px;
  padding:8px 10px;
}
.zoho-preview { margin-top:8px; }
.zoho-preview summary { cursor:pointer; font-weight:800; }
.zoho-preview pre {
  background:#10233a;
  border-radius:6px;
  color:#fff;
  font-size:11px;
  margin:8px 0 0;
  max-height:220px;
  overflow:auto;
  padding:10px;
}

/* ── Loading spinner ── */
.spinner { display:inline-block; width:20px; height:20px; border:2px solid var(--border); border-top-color:var(--teal); border-radius:50%; animation:spin .7s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ── Export buttons row ── */
.export-row { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.provider-item-cell { display:flex; flex-direction:column; align-items:flex-start; gap:4px; min-width:150px; }
.provider-mini-badge { font-size:10px; padding:2px 7px; white-space:normal; }
.budget-item-actions { display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; min-width:128px; }
.compliance-alert { margin-top:4px; }
.compliance-note { font-size:12px; margin-top:4px; opacity:.88; }
.field-hint { color:var(--muted); font-size:12px; line-height:1.35; margin-top:2px; }
.help-launch-btn,
.context-help-btn,
.field-help {
  align-items: center;
  appearance: none;
  background: #eef8f6;
  border: 1px solid #b9e4dd;
  border-radius: 999px;
  color: #0b6f68;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.help-launch-btn {
  flex: 0 0 auto;
  font-size: 14px;
  height: 34px;
  margin-left: 2px;
  width: 34px;
}
.context-help-btn {
  font-size: 12px;
  height: 24px;
  margin-left: 6px;
  vertical-align: 2px;
  width: 24px;
}
.field-help {
  font-size: 10px;
  height: 18px;
  margin-left: 4px;
  vertical-align: 1px;
  width: 18px;
}
.help-launch-btn:hover,
.context-help-btn:hover,
.field-help:hover {
  background: #0f766e;
  border-color: #0f766e;
  box-shadow: 0 6px 14px rgba(15, 118, 110, .18);
  color: #fff;
}
.inline-help-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: #0b6f68;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  margin-left: 6px;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.help-scrim {
  background: rgba(15, 23, 42, .42);
  inset: 0;
  position: fixed;
  z-index: 640;
}
.help-scrim[hidden] {
  display: none;
}
.help-drawer {
  background: #fff;
  border-left: 1px solid #dce5ec;
  bottom: 0;
  box-shadow: -24px 0 70px rgba(15, 23, 42, .22);
  display: flex;
  flex-direction: column;
  max-width: 100vw;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateX(104%);
  transition: transform .22s ease;
  width: min(440px, 92vw);
  z-index: 660;
}
.help-drawer.open {
  transform: translateX(0);
}
body.help-open {
  overflow: hidden;
}
.help-drawer-hdr {
  align-items: center;
  border-bottom: 1px solid #e4ebf1;
  display: flex;
  justify-content: space-between;
  min-height: 72px;
  padding: 16px 18px;
}
.help-eyebrow {
  color: #0f766e;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.help-drawer-hdr h3 {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
}
.help-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 28px;
}
.help-quicklinks {
  background: #fff;
  border-bottom: 1px solid #eef2f6;
  display: flex;
  gap: 7px;
  margin: -16px -18px 16px;
  overflow-x: auto;
  padding: 12px 18px;
  position: sticky;
  top: 0;
  z-index: 1;
}
.help-topic-btn {
  appearance: none;
  background: #f6f8fb;
  border: 1px solid #dce5ec;
  border-radius: 999px;
  color: #475467;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 850;
  min-height: 32px;
  padding: 7px 11px;
}
.help-topic-btn.active,
.help-topic-btn:hover {
  background: #e6f6f3;
  border-color: #9edbd1;
  color: #0b6f68;
}
.help-section {
  border-bottom: 1px solid #edf1f5;
  margin: 0;
  padding: 18px 0;
  scroll-margin-top: 64px;
}
.help-section:first-of-type {
  padding-top: 4px;
}
.help-section h4 {
  color: #20324a;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 10px;
}
.help-copy,
.help-list,
.help-steps {
  color: #344054;
  font-size: 13px;
  line-height: 1.55;
}
.help-list,
.help-steps {
  margin-left: 18px;
}
.help-list li,
.help-steps li {
  margin: 8px 0;
}
.help-callout {
  background: #f1fbf9;
  border-left: 3px solid #0f766e;
  border-radius: 6px;
  color: #1f3f3b;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
  margin-top: 12px;
  padding: 10px 12px;
}
.help-section.help-focus {
  animation: helpPulse 1.2s ease;
}
@keyframes helpPulse {
  0% { background: #eefaf7; box-shadow: 0 0 0 0 rgba(15, 118, 110, .22); }
  100% { background: transparent; box-shadow: 0 0 0 18px rgba(15, 118, 110, 0); }
}
.provider-filter-bar { display:flex; gap:6px; flex-wrap:wrap; }
.provider-filter-bar .active-filter {
  background:var(--teal);
  border-color:var(--teal);
  color:#fff;
}
.metric-button {
  appearance:none;
  cursor:pointer;
  font:inherit;
  text-align:left;
}
.metric-button:hover { border-color:#8bcfc7; box-shadow:var(--shadow); }
.metric-pending { border-color:#f0d292; background:#fffaf0; }

/* ── Responsive ── */
@media(max-width:768px) {
  #content { padding:12px; }
  .summary-grid { grid-template-columns:1fr; }
  .form-grid { grid-template-columns:1fr; }
}

/* ── Breadcrumb ── */
.breadcrumb { font-size:13px; color:var(--muted); margin-bottom:14px; display:flex; gap:6px; align-items:center; }
.breadcrumb a { color:var(--teal); text-decoration:none; cursor:pointer; }
.breadcrumb a:hover { text-decoration:underline; }

/* ── Batch Edit inputs ── */
.batch-inp {
  width: 100%;
  padding: 3px 6px;
  border: 1.5px solid var(--teal);
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  background: #f0faff;
  box-sizing: border-box;
}
.batch-inp:focus {
  outline: none;
  border-color: var(--navy);
  background: #fff;
}
.batch-inp.num { text-align: right; }
select.batch-inp { padding: 3px 4px; }
#services-admin-tbody.batch-mode td { padding: 3px 6px; }

/* ── Provider profile view ── */
.metric-strip {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:12px;
  margin:0 0 14px;
}
.metric-card {
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  box-shadow:var(--shadow-sm);
  padding:14px 16px;
}
.metric-label { color:var(--muted); font-size:11px; font-weight:800; letter-spacing:.5px; text-transform:uppercase; }
.metric-value { color:var(--navy); font-size:24px; font-weight:850; line-height:1.1; margin-top:5px; }
.provider-admin-list,
.provider-picker-list {
  display:flex;
  flex-direction:column;
  gap:12px;
}
.provider-master-panel {
  background:#fff;
  border:1px solid #d8e6ec;
  border-radius:8px;
  box-shadow:var(--shadow-sm);
  margin:14px 0;
  padding:14px;
}
.provider-master-head {
  align-items:flex-start;
  display:flex;
  gap:14px;
  justify-content:space-between;
  margin-bottom:10px;
}
.provider-master-head h3 {
  color:var(--navy);
  font-size:17px;
  font-weight:850;
  margin:0 0 4px;
}
.provider-master-head p {
  color:var(--muted);
  font-size:13px;
  line-height:1.4;
  margin:0;
}
.provider-master-summary {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:10px;
}
.provider-master-summary span {
  background:#f2f8fa;
  border:1px solid #d8e6ec;
  border-radius:999px;
  color:#31596b;
  font-size:12px;
  font-weight:750;
  padding:6px 10px;
}
.provider-master-summary strong { color:var(--navy); }
.provider-master-list {
  display:grid;
  gap:8px;
  max-height:420px;
  overflow:auto;
  padding-right:4px;
}
.provider-master-card {
  border:1px solid var(--border);
  border-radius:8px;
  overflow:hidden;
}
.provider-master-card summary {
  align-items:center;
  background:#fbfdfe;
  cursor:pointer;
  display:flex;
  gap:10px;
  list-style:none;
  padding:12px;
}
.provider-master-card summary::-webkit-details-marker { display:none; }
.provider-master-detail-grid {
  border-top:1px solid var(--border);
  display:grid;
  gap:10px;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  padding:12px;
}
.provider-master-detail-grid span {
  color:var(--muted);
  display:block;
  font-size:11px;
  font-weight:800;
  letter-spacing:.4px;
  text-transform:uppercase;
}
.provider-master-detail-grid strong {
  color:var(--text);
  display:block;
  font-size:13px;
  font-weight:750;
  line-height:1.35;
  margin-top:3px;
  word-break:break-word;
}
.provider-master-upload {
  align-items:center;
  border-top:1px solid var(--border);
  display:grid;
  gap:8px;
  grid-template-columns:minmax(180px,1fr) 150px 170px 92px minmax(120px,.8fr);
  padding:12px;
}
.provider-master-upload input,
.provider-master-upload select {
  border:1px solid var(--border);
  border-radius:6px;
  color:var(--text);
  font:inherit;
  min-width:0;
  padding:7px 8px;
}
.provider-master-upload span {
  color:var(--muted);
  font-size:12px;
  font-weight:750;
}
.provider-master-compliance-row,
.provider-master-restricted {
  align-items:center;
  border-top:1px solid var(--border);
  color:var(--muted);
  display:flex;
  gap:10px;
  justify-content:space-between;
  padding:10px 12px;
}
.provider-master-restricted {
  background:#f8fbfc;
  font-size:12px;
  font-weight:750;
}
.provider-compliance-modal .modal-body { max-height:78vh; }
.provider-compliance-summary {
  display:grid;
  gap:10px;
  grid-template-columns:repeat(4,minmax(0,1fr));
  margin-bottom:14px;
}
.provider-compliance-summary div {
  background:#f7fbfb;
  border:1px solid #d8e6ec;
  border-radius:8px;
  padding:12px;
}
.provider-compliance-summary div.warn {
  background:#fff6f3;
  border-color:#f2b8aa;
}
.provider-compliance-summary span,
.provider-compliance-summary em {
  color:var(--muted);
  display:block;
  font-size:11px;
  font-style:normal;
  font-weight:850;
  letter-spacing:.5px;
  text-transform:uppercase;
}
.provider-compliance-summary strong {
  color:var(--navy);
  display:block;
  font-size:24px;
  font-weight:900;
  line-height:1.1;
  margin:4px 0;
}
.provider-compliance-layout {
  display:grid;
  gap:14px;
  grid-template-columns:minmax(0,1.15fr) minmax(360px,.85fr);
}
.provider-compliance-card {
  border:1px solid var(--border);
  border-radius:8px;
  overflow:hidden;
  padding:14px;
}
.provider-compliance-card h4,
.provider-compliance-card h5 {
  color:var(--navy);
  margin:0;
}
.provider-compliance-card h4 { font-size:16px; }
.provider-compliance-card h5 {
  background:#edf7f6;
  border:1px solid #d2e7e4;
  border-radius:8px;
  color:var(--teal-dark);
  font-size:12px;
  letter-spacing:.7px;
  margin:14px 0 8px;
  padding:8px 10px;
  text-transform:uppercase;
}
.section-title-row {
  align-items:flex-start;
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.small { font-size:12px; }
.provider-compliance-check {
  align-items:flex-start;
  border:1px solid #dfeaf0;
  border-radius:8px;
  display:grid;
  gap:12px;
  grid-template-columns:minmax(220px,1fr) minmax(420px,1.25fr);
  margin-bottom:8px;
  padding:10px;
}
.provider-compliance-check-main strong {
  color:var(--text);
  display:block;
  font-size:13px;
  font-weight:850;
  margin-bottom:4px;
}
.provider-compliance-check-main span {
  color:var(--muted);
  display:block;
  font-size:12px;
  line-height:1.4;
}
.provider-compliance-check-controls {
  align-items:center;
  display:grid;
  gap:7px;
  grid-template-columns:86px 120px 132px minmax(120px,1fr) 64px;
}
.provider-compliance-check-controls input,
.provider-compliance-check-controls select,
.provider-compliance-upload-grid input,
.provider-compliance-upload-grid select {
  border:1px solid var(--border);
  border-radius:6px;
  color:var(--text);
  font:inherit;
  min-width:0;
  padding:7px 8px;
}
.provider-compliance-status {
  border-radius:999px;
  display:inline-flex;
  font-size:11px;
  font-weight:850;
  justify-content:center;
  padding:5px 8px;
  white-space:nowrap;
}
.provider-compliance-status.status-verified { background:#d9f7e5; color:#0f7a3b; }
.provider-compliance-status.status-uploaded { background:#eaf3ff; color:#225ea8; }
.provider-compliance-status.status-not_applicable { background:#eef1f4; color:#55616f; }
.provider-compliance-status.status-expired,
.provider-compliance-status.status-rejected,
.provider-compliance-status.status-missing { background:#fde5e1; color:#a32216; }
.provider-compliance-upload-grid {
  display:grid;
  gap:10px;
  grid-template-columns:repeat(3,minmax(0,1fr));
}
.provider-compliance-upload-grid .textarea-wide { grid-column:span 3; }
.provider-compliance-upload-actions {
  align-items:center;
  display:flex;
  gap:10px;
  margin:10px 0 12px;
}
.provider-compliance-doc-list {
  display:grid;
  gap:8px;
  margin:8px 0 14px;
}
.provider-compliance-doc {
  align-items:center;
  background:#fbfdfe;
  border:1px solid var(--border);
  border-radius:8px;
  display:flex;
  gap:10px;
  justify-content:space-between;
  padding:10px;
}
.provider-compliance-doc strong {
  color:var(--text);
  display:block;
  font-size:13px;
}
.provider-compliance-doc span {
  color:var(--muted);
  display:block;
  font-size:12px;
  margin-top:3px;
}
.provider-compliance-source {
  background:#e9f5f3;
  border-radius:999px;
  color:var(--teal-dark) !important;
  font-weight:850;
  padding:5px 8px;
}
.provider-group-card {
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  box-shadow:var(--shadow-sm);
  overflow:hidden;
}
.provider-group-card[open] { box-shadow:var(--shadow); }
.provider-group-card.provider-group-has-issues {
  border-color:#f3b8b5;
}
.provider-group-summary {
  display:flex;
  align-items:center;
  gap:14px;
  list-style:none;
  padding:15px 16px;
  cursor:pointer;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbfa 100%);
}
.provider-group-summary::-webkit-details-marker { display:none; }
.provider-group-summary::before {
  content:'';
  width:10px;
  height:10px;
  border-right:2px solid var(--teal);
  border-bottom:2px solid var(--teal);
  transform:rotate(-45deg);
  transition:transform .18s;
  flex-shrink:0;
}
.provider-group-card[open] .provider-group-summary::before { transform:rotate(45deg); }
.provider-title-block { min-width:0; flex:1; }
.provider-title {
  color:var(--navy);
  font-size:16px;
  font-weight:850;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  flex-shrink:0;
}
.provider-meta {
  color:var(--muted);
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  font-size:12px;
  margin-top:4px;
}
.provider-issue-line {
  margin-top:8px;
}
.provider-issue-badges {
  display:inline-flex;
  flex-wrap:wrap;
  gap:6px;
  vertical-align:middle;
}
.provider-issue-badge {
  background:#fff1f0;
  border:1px solid #f3b8b5;
  border-radius:999px;
  color:#b42318;
  display:inline-flex;
  font-size:11px;
  font-weight:850;
  line-height:1.2;
  padding:3px 8px;
  white-space:nowrap;
}
.provider-issue-badge.provider-issue-warning {
  background:#fff7e6;
  border-color:#f4c36a;
  color:#9a5b00;
}
.provider-service-list {
  border-top:1px solid var(--border);
  display:flex;
  flex-direction:column;
}
.provider-service-row {
  display:grid;
  grid-template-columns:minmax(220px,1.8fr) 82px repeat(4,minmax(92px,.7fr)) minmax(130px,.9fr);
  gap:10px;
  align-items:center;
  padding:12px 16px;
  border-bottom:1px solid var(--border);
}
.provider-service-row:last-child { border-bottom:none; }
.provider-service-row:hover { background:#f5fbfa; }
.provider-service-row.provider-row-has-issues {
  background:#fff8f7;
  border-left:3px solid #d92d20;
}
.provider-service-row.provider-row-has-issues:hover {
  background:#fff1f0;
}
.provider-service-row.provider-row-has-issues.row-muted {
  opacity:1;
}
.provider-service-row.provider-row-has-issues .provider-service-name {
  color:#991b1b;
}
.provider-service-main { min-width:0; }
.provider-service-name { color:var(--text); font-weight:750; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.provider-service-id { color:var(--muted); font-size:12px; margin-top:2px; }
.provider-cell-label { color:var(--muted); display:block; font-size:10px; font-weight:800; letter-spacing:.4px; text-transform:uppercase; }
.provider-cell-value { color:var(--text); display:block; font-size:13px; font-weight:700; margin-top:2px; }
.provider-row-action-set { display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; }
.provider-row-action-set .btn { padding-left:8px; padding-right:8px; }
.provider-picker-list {
  max-height:460px;
  overflow:auto;
  padding-right:4px;
}
.provider-picker-card {
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  overflow:visible;
}
.provider-picker-group-card {
  display:block;
}
.provider-picker-summary {
  align-items:center;
  background:#f8fafc;
  border-radius:8px 8px 0 0;
  cursor:pointer;
  display:flex;
  gap:12px;
  list-style:none;
  min-height:58px;
  padding:13px 14px;
}
.provider-picker-summary::-webkit-details-marker { display:none; }
.provider-picker-summary::before {
  border-bottom:2px solid var(--teal);
  border-right:2px solid var(--teal);
  content:'';
  flex:0 0 auto;
  height:9px;
  transform:rotate(45deg);
  transition:transform .16s ease;
  width:9px;
}
.provider-picker-group-card:not([open]) .provider-picker-summary {
  border-radius:8px;
}
.provider-picker-group-card:not([open]) .provider-picker-summary::before {
  transform:rotate(-45deg);
}
.provider-picker-service-list {
  border-top:1px solid var(--border);
  display:flex;
  flex-direction:column;
}
.provider-picker-card h4 {
  background:#f8fbfa;
  border-bottom:1px solid var(--border);
  color:var(--navy);
  font-size:15px;
  margin:0;
  padding:12px 14px;
}
.provider-picker-option {
  display:grid;
  grid-template-columns:minmax(240px,1.8fr) repeat(5,minmax(82px,.65fr)) 96px;
  gap:10px;
  align-items:center;
  border-bottom:1px solid var(--border);
  min-height:72px;
  padding:11px 14px;
  cursor:pointer;
  overflow:visible;
}
.provider-picker-option:last-child { border-bottom:none; }
.provider-picker-option:hover { background:#eaf8f5; }
.provider-link-results { display:flex; flex-direction:column; gap:8px; max-height:420px; overflow:auto; }
.provider-link-option {
  align-items:center;
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  display:grid;
  gap:10px;
  grid-template-columns:minmax(220px,1fr) 92px 92px 96px;
  padding:10px 12px;
}
.provider-profile-head {
  display:flex;
  align-items:flex-end;
  gap:14px;
  margin-bottom:10px;
}
.provider-name-field { flex:1; }
.provider-profile-actions { padding-bottom:1px; }
.provider-profile-hint {
  background:#eef8f5;
  border:1px solid #cce6df;
  border-radius:8px;
  color:#245f58;
  font-size:13px;
  line-height:1.45;
  margin-bottom:14px;
  padding:11px 13px;
}
.provider-profile-section {
  border:1px solid #d9e7ed;
  border-radius:8px;
  margin-bottom:12px;
  overflow:hidden;
}
.provider-profile-section summary {
  align-items:center;
  background:#f7fbfc;
  color:var(--navy);
  cursor:pointer;
  display:flex;
  font-size:14px;
  font-weight:850;
  gap:8px;
  list-style:none;
  padding:11px 13px;
}
.provider-profile-section summary::-webkit-details-marker { display:none; }
.provider-profile-section summary::before {
  border-bottom:2px solid var(--teal);
  border-right:2px solid var(--teal);
  content:'';
  height:8px;
  transform:rotate(-45deg);
  transition:transform .16s ease;
  width:8px;
}
.provider-profile-section[open] summary::before { transform:rotate(45deg); }
.provider-profile-section .form-grid {
  padding:13px;
}
.provider-profile-section input[readonly] {
  background:#f5f7f8;
  color:#5f7180;
}
.provider-service-editor-wrap {
  border:1px solid var(--border);
  border-radius:8px;
  overflow:auto;
  max-height:56vh;
}
.provider-service-editor { min-width:1060px; }
.provider-service-editor thead tr { background:#17445f; }
.provider-service-editor td { padding:8px; }
.provider-service-editor input,
.provider-service-editor select,
.provider-service-editor textarea {
  width:100%;
  border:1px solid var(--border);
  border-radius:6px;
  color:var(--text);
  font:inherit;
  padding:7px 8px;
}
.provider-service-editor textarea { min-height:34px; resize:vertical; }
.provider-service-editor .service-id-input { min-width:170px; }
.provider-service-editor .loaded-rate {
  background:#f5f7f8;
  color:var(--navy);
  font-weight:800;
}
.row-muted { opacity:.58; }
.empty-state {
  background:#fff;
  border:1px dashed #b9c8d2;
  border-radius:8px;
  color:var(--muted);
  padding:28px;
  text-align:center;
}
.empty-state strong {
  color:var(--navy);
  display:block;
  font-size:16px;
  margin-bottom:6px;
}
.responsive-card-list {
  display:none;
  flex-direction:column;
  gap:12px;
}
.record-card {
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  box-shadow:var(--shadow-sm);
  padding:14px;
}
.record-card-main {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.record-card-title {
  color:var(--navy);
  font-size:16px;
  font-weight:850;
  line-height:1.25;
}
.record-card-subtitle {
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
  margin-top:3px;
}
.record-card-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.record-card-grid div {
  background:var(--surface);
  border:1px solid #e5edf0;
  border-radius:7px;
  padding:9px 10px;
  min-width:0;
}
.record-card-grid span,
.record-card-edit-grid label {
  color:var(--muted);
  display:block;
  font-size:10px;
  font-weight:850;
  letter-spacing:.45px;
  text-transform:uppercase;
}
.record-card-grid strong {
  color:var(--text);
  display:block;
  font-size:13px;
  line-height:1.25;
  margin-top:3px;
  word-break:break-word;
}
.record-card-edit-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}
.record-card-edit-grid .notes-field { grid-column:1/-1; }
.record-card-edit-grid input,
.record-card-edit-grid select {
  border:1px solid var(--border);
  border-radius:6px;
  color:var(--text);
  font:inherit;
  margin-top:4px;
  padding:8px 9px;
  width:100%;
}
.record-card-actions {
  display:flex;
  gap:8px;
  justify-content:flex-end;
  margin-top:12px;
}

@media(max-width:980px) {
  #navbar {
    align-items:center;
    flex-wrap:nowrap;
    min-height:56px;
    padding:8px 12px;
  }
  #navbar .brand { flex:0 0 auto; min-width:178px; }
  #nav-admin-btns { gap:8px; flex:0 0 auto; }
  #nav-user { flex:0 0 auto; }
  .site-env-pill { flex:0 0 auto; }
  #content { padding:18px 12px 28px; }
  .provider-service-row,
  .provider-picker-option {
    grid-template-columns:1fr 1fr;
  }
  .provider-service-row .btn,
  .provider-picker-option .btn { grid-column:1/-1; }
  .provider-profile-head { align-items:stretch; flex-direction:column; }
  .provider-master-head { align-items:stretch; flex-direction:column; }
  .provider-master-head .btn { width:100%; }
  .provider-master-list { max-height:none; }
}

@media(max-width:760px) {
  .budget-table-card,
  .service-items-card .tbl-wrap { display:none; }
  #budgets-card-list,
  #items-card-list,
  #zoho-export-card-list { display:flex; }
  .provider-profile-modal { max-width:calc(100vw - 24px) !important; }
  .provider-profile-modal .modal-body { padding:16px; }
  .provider-profile-modal .modal-footer {
    align-items:stretch;
    flex-direction:column-reverse;
  }
  .provider-profile-modal .modal-footer .btn { width:100%; }
  .provider-service-editor-wrap {
    border:0;
    border-radius:0;
    max-height:none;
    overflow:visible;
  }
  .provider-service-editor,
  .provider-service-editor tbody,
  .provider-service-editor tr,
  .provider-service-editor td {
    display:block;
    min-width:0;
    width:100%;
  }
  .provider-service-editor thead { display:none; }
  .provider-service-editor tr {
    background:#fff;
    border:1px solid var(--border);
    border-radius:8px;
    box-shadow:var(--shadow-sm);
    margin-bottom:12px;
    padding:12px;
  }
  .provider-service-editor td {
    border:0;
    margin-bottom:10px;
    padding:0;
  }
  .provider-service-editor td::before {
    content:attr(data-label);
    color:var(--muted);
    display:block;
    font-size:11px;
    font-weight:800;
    letter-spacing:.5px;
    margin-bottom:5px;
    text-transform:uppercase;
  }
  .provider-service-editor .provider-service-cell::before,
  .provider-service-editor .provider-row-actions::before { display:none; }
  .provider-service-editor .provider-row-actions {
    display:flex;
    justify-content:flex-end;
    margin-bottom:0;
    padding-top:2px;
  }
  .provider-service-editor .service-id-input { min-width:0; }
  .page-hdr { align-items:stretch; flex-direction:column; }
  #page-clients .page-hdr > div:last-child {
    display:grid !important;
    grid-template-columns:1fr;
    flex:0 0 auto;
    width:100%;
  }
  #page-clients .search-bar,
  #page-clients .client-filter-bar {
    display:grid;
    grid-template-columns:1fr;
  }
  .page-actions,
  .search-bar,
  .client-filter-bar { width:100%; }
  .control-input,
  .search-bar input,
  .search-bar select,
  .client-filter-bar input { min-width:0; width:100%; }
  .record-card-grid { grid-template-columns:1fr; }
  .record-card-edit-grid { grid-template-columns:1fr 1fr; }
}

/* ── UI refresh 2026-04-30: modern Dorset operations workspace ── */
:root {
  --teal: #0f8a7e;
  --teal2: #0b6f68;
  --navy: #20324a;
  --accent: #2563eb;
  --pending: #b7791f;
  --danger: #b42318;
  --success: #168052;
  --bg: #f4f6f8;
  --card: #ffffff;
  --border: #d9e1e8;
  --text: #172033;
  --muted: #667085;
  --row-alt: #f8fafc;
  --surface: #f8fafc;
  --shadow: 0 18px 44px rgba(16, 24, 40, .10);
  --shadow-sm: 0 7px 18px rgba(16, 24, 40, .055);
  --focus: 0 0 0 3px rgba(15, 138, 126, .18);
}

html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  min-width: 320px;
  text-rendering: optimizeLegibility;
}

.aws-site-ribbon {
  background: #0b6f68 !important;
  border-bottom: 1px solid rgba(255,255,255,.18);
  font-size: 11px !important;
  letter-spacing: .08em !important;
  padding: 7px 12px !important;
  text-transform: uppercase;
}

#navbar {
  backdrop-filter: none;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid rgba(217,225,232,.92);
  box-shadow: 0 10px 28px rgba(16,24,40,.07);
  color: var(--text);
  gap: 8px;
  min-height: 64px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 10px 22px;
  scrollbar-width: thin;
  scrollbar-color: rgba(15,118,110,.28) transparent;
  -webkit-backdrop-filter: none;
}
#navbar .brand {
  color: var(--text);
  font-size: 16px;
  font-weight: 850;
  letter-spacing: 0;
  min-width: 215px;
}
#navbar .brand span {
  color: var(--teal);
  font-weight: 800;
}
#navbar .brand.brand-3a {
  align-items: center;
  display: flex;
  flex: 1 0 auto;
  gap: 10px;
  min-width: 220px;
}
#navbar .brand.brand-3a img {
  display: block;
  height: 38px;
  max-width: 190px;
  object-fit: contain;
  width: auto;
}
#navbar .brand.brand-3a span {
  color: var(--teal);
  display: inline-flex;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1;
}
#nav-admin-btns {
  align-items: center;
  gap: 8px;
}
.nav-admin-area {
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.nav-menu {
  flex: 0 0 auto;
  position: relative;
}
.nav-menu-toggle {
  gap: 8px;
}
.nav-menu-toggle::after {
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  content: "";
  display: inline-block;
  height: 6px;
  margin-top: -3px;
  transform: rotate(45deg);
  transition: transform .16s ease;
  width: 6px;
}
.nav-menu.open .nav-menu-toggle::after {
  margin-top: 2px;
  transform: rotate(225deg);
}
.nav-menu-panel {
  background: #fff;
  border: 1px solid #dce5ec;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .18);
  display: none;
  flex-direction: column;
  gap: 4px;
  min-width: 230px;
  padding: 8px;
  position: fixed;
  right: 0;
  right: 22px;
  top: 74px;
  z-index: 12050;
}
.aws-site-ribbon ~ #app .nav-menu-panel {
  top: 98px;
}
.nav-menu.open .nav-menu-panel {
  display: flex !important;
}
.nav-menu-panel::before {
  border-bottom: 8px solid #fff;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  content: "";
  position: absolute;
  right: 18px;
  top: -8px;
}
.nav-menu-panel .nav-btn {
  color: #334155;
  justify-content: flex-start;
  min-height: 38px;
  text-align: left;
  width: 100%;
}
.nav-menu-panel .nav-btn.active {
  background: #e6f6f3 !important;
  border-color: #b9e4dd !important;
  box-shadow: none;
  color: #0b6f68 !important;
}
#nav-user {
  align-items: center;
  appearance: none;
  background: #f1f5f9;
  border: 1px solid #dde5ee;
  border-radius: 999px;
  color: #475467 !important;
  cursor: pointer;
  display: inline-flex;
  font-size: 12px !important;
  font-weight: 750;
  line-height: 1;
  padding: 8px 11px;
  white-space: nowrap;
}
#nav-user:hover,
#nav-user:focus-visible {
  background: #e6f6f3;
  border-color: #9edbd1;
  color: #0b6f68 !important;
  outline: none;
}
.my-account-modal {
  max-width: 680px;
}
.my-account-modal #me-username[readonly] {
  background: #f8fafc;
  color: #667085;
}
.site-env-pill {
  background: #e6f6f3;
  border: 1px solid #9edbd1;
  box-shadow: none;
  color: #0b6f68;
  letter-spacing: .06em;
}
.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #475467;
  font-size: 12px;
  font-weight: 750;
  min-height: 36px;
  padding: 8px 11px;
}
.nav-btn:hover {
  background: #f2f7f6;
  border-color: #d5e7e4;
  color: var(--teal2);
  transform: none;
}
.nav-btn.active {
  background: #103a37 !important;
  border-color: #103a37 !important;
  box-shadow: 0 6px 16px rgba(15, 58, 55, .18);
  color: #fff !important;
}
.nav-btn.active:hover {
  background: #103a37 !important;
  color: #fff !important;
}
#navbar span[style*="v1.0"] {
  color: #98a2b3 !important;
}

#content {
  max-width: 1560px;
  padding: 28px 26px 46px;
}
.page {
  animation: pageIn .16s ease-out;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-hdr {
  align-items: flex-start;
  margin-bottom: 18px;
}
.page-hdr h2 {
  color: var(--text);
  font-size: 24px;
  font-weight: 860;
  line-height: 1.18;
}
.page-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}
.page-actions,
.search-bar,
.client-filter-bar,
.export-row,
.budget-actions {
  gap: 8px;
}
.admin-hero {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.card {
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 18px;
}
.card-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
  justify-content: space-between;
  margin-bottom: 13px;
}

.btn {
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  min-height: 36px;
  padding: 8px 14px;
}
.btn-primary {
  background: #0f766e;
  color: #fff;
}
.btn-primary:hover {
  background: #0b6f68;
  box-shadow: 0 8px 18px rgba(15, 118, 110, .18);
  transform: none;
}
.btn-secondary {
  background: #fff;
  border: 1px solid #cfd9e3;
  color: #334155;
}
.btn-secondary:hover {
  background: #f8fafc;
  border-color: #aebdcc;
  transform: none;
}
.btn-warning {
  background: #a15c07;
  color: #fff;
}
.btn-danger {
  background: #b42318;
  color: #fff;
}
.btn-sm {
  min-height: 30px;
  padding: 5px 10px;
}
.btn-icon {
  min-width: 34px;
  padding-left: 8px;
  padding-right: 8px;
}
.btn:focus-visible,
.nav-btn:focus-visible,
.close-btn:focus-visible,
.help-launch-btn:focus-visible,
.context-help-btn:focus-visible,
.field-help:focus-visible,
.inline-help-link:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.control-input,
.search-bar input,
.search-bar select,
.form-group input,
.form-group select,
.form-group textarea,
.detail-tbl input,
.detail-tbl select {
  border: 1px solid #cfd9e3;
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 10px;
}
.form-group label {
  color: #667085;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
}
.form-grid {
  gap: 14px;
}

.tbl-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: none;
}
table {
  border-collapse: separate;
  border-spacing: 0;
}
thead tr {
  background: #f8fafc;
  color: #334155;
}
th {
  border-bottom: 1px solid var(--border);
  color: #475467;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .02em;
  padding: 11px 12px;
  text-transform: uppercase;
}
td {
  border-bottom: 1px solid #edf1f5;
  color: #253346;
  padding: 11px 12px;
}
tbody tr:hover td {
  background: #f4faf8;
}
tr.alt {
  background: #fbfcfe;
}
.detail-tbl th {
  font-size: 10px;
  padding: 9px 7px;
}
.detail-tbl td {
  font-size: 12px;
  padding: 7px;
}
.detail-tbl tr.total-row td,
.smry-tbl tr.total-row td,
.summary-detail-tbl tr.total-row td {
  background: #20324a;
  color: #fff;
}
.smry-tbl th,
.summary-detail-tbl thead tr {
  background: #0f766e;
}
.smry-tbl th,
.summary-detail-tbl th {
  background: #0f766e;
  border-bottom-color: #0b5f59;
  color: #fff;
}
.summary-detail-wrap,
.summary-client-card {
  border-radius: 8px;
}

.badge {
  border: 1px solid rgba(16, 24, 40, .06);
  font-size: 11px;
  letter-spacing: 0;
  white-space: nowrap;
}
.badge-active,
.badge-approved,
.badge-zoho-synced {
  background: #dcfce7;
  color: #166534;
}
.badge-pending,
.badge-warning-soft,
.badge-zoho-changed {
  background: #fef3c7;
  color: #92400e;
}
.badge-danger-soft,
.badge-zoho-failed,
.badge-zoho-blocked {
  background: #fee2e2;
  color: #991b1b;
}
.badge-draft,
.badge-zoho-not_ready,
.badge-zoho-not_synced {
  background: #f1f5f9;
  color: #475569;
}

.alert {
  border: 1px solid transparent;
  border-radius: 8px;
  line-height: 1.5;
}
.alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
}
.alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #854d0e;
}
.alert-success {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}
.alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.breadcrumb {
  background: transparent;
  color: #667085;
  margin-bottom: 12px;
}
.breadcrumb a {
  color: #0f766e;
  font-weight: 750;
}

.budget-actions {
  align-items: center;
  border-top: 1px solid #edf1f5;
  padding-top: 14px;
}
.export-row {
  align-items: center;
}
.export-row .btn {
  min-height: 34px;
}

.modal-overlay {
  background: rgba(15, 23, 42, .58);
  padding: 24px;
}
.modal {
  border-radius: 8px;
  box-shadow: 0 28px 84px rgba(15, 23, 42, .32);
  max-height: min(92vh, 980px);
}
.modal-hdr {
  background: #fff;
  min-height: 58px;
}
.modal-hdr h3 {
  color: var(--text);
  font-size: 17px;
  font-weight: 850;
}
.modal-body {
  background: #fbfcfd;
}
.modal-footer {
  background: #fff;
}
.close-btn {
  border-radius: 8px;
  color: #64748b;
  height: 34px;
  width: 34px;
}
.close-btn:hover {
  background: #f1f5f9;
}

.client-profile-modal .modal-body > h4,
.client-profile-modal h4 {
  color: #20324a !important;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .03em;
  margin: 18px 0 10px !important;
  text-transform: uppercase;
}
.client-profile-modal .modal-body > h4:first-child {
  margin-top: 0 !important;
}
.form-section {
  background: #fff;
  border: 1px solid #dce5ec;
  border-radius: 8px;
  overflow: hidden;
}
.form-section summary {
  background: #f8fafc;
  color: #20324a;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 850;
  list-style: none;
}
.form-section summary::-webkit-details-marker { display: none; }
.form-section[open] summary {
  border-bottom: 1px solid #e4ebf1;
}
.form-section .form-grid {
  padding: 16px;
}
.textarea-wide textarea {
  min-height: 92px;
}
.collapse-arrow {
  align-items:center;
  border:1px solid #b7ded8;
  border-radius:999px;
  color:#0f766e;
  display:inline-flex;
  flex:0 0 auto;
  font-size:16px;
  font-weight:950;
  height:20px;
  justify-content:center;
  line-height:1;
  transition:transform .16s ease;
  width:20px;
}
.collapse-arrow::before { content:'›'; transform:translateY(-1px); }
details[open] > summary .collapse-arrow { transform:rotate(90deg); }

.provider-group-summary,
.provider-picker-card h4 {
  background: #f8fafc;
}
.provider-picker-option,
.provider-service-row,
.provider-link-option {
  border-bottom-color: #edf1f5;
}
.provider-picker-option:hover,
.provider-service-row:hover {
  background: #f4faf8;
}
.provider-picker-summary {
  background: #f8fafc;
}

.record-card {
  border: 1px solid #dce5ec;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 16px;
}
.record-card-kicker {
  color: #667085;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
  margin-bottom: 3px;
  text-transform: uppercase;
}
.record-card-title {
  color: #172033;
  font-size: 16px;
  letter-spacing: 0;
}
.record-card-subtitle {
  color: #667085;
  font-size: 12px;
}
.record-card-grid {
  gap: 8px;
}
.record-card-grid div {
  background: #f8fafc;
  border-color: #e4ebf1;
}
.record-card-grid span,
.record-card-edit-grid label {
  color: #667085;
  letter-spacing: .04em;
}
.record-card-actions {
  border-top: 1px solid #edf1f5;
  padding-top: 12px;
}
.record-card-main > span {
  flex-shrink: 0;
}

#clients-table {
  min-width: 1380px;
}
#clients-table th,
#clients-table td {
  white-space: nowrap;
}
#clients-table th:nth-child(2),
#clients-table td:nth-child(2) {
  max-width: 250px;
  min-width: 180px;
  white-space: normal;
}
#clients-table th:last-child,
#clients-table td:last-child {
  background: #fff;
  box-shadow: -12px 0 18px rgba(16,24,40,.06);
  position: sticky;
  right: 0;
  z-index: 2;
}
#clients-table th:last-child {
  background: #f8fafc;
  z-index: 4;
}
#clients-table tr.alt td:last-child {
  background: #fbfcfe;
}
#clients-table tr:hover td:last-child {
  background: #f4faf8;
}

#login-page {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .92), rgba(32, 50, 74, .96)),
    #20324a;
}
.login-box {
  border-radius: 8px;
  box-shadow: 0 24px 72px rgba(15, 23, 42, .30);
  padding: 34px;
}
.login-box .logo h1 {
  color: #172033;
  font-size: 24px;
  font-weight: 880;
}
.login-box .logo p {
  color: #667085;
}

.calculator-layout {
  align-items: start;
}

/* ── Statements workbench ── */
.statement-page-hdr {
  align-items: center;
  background: #fff;
  border: 1px solid #d9e3ea;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
  margin: -2px 0 8px;
  padding: 10px 16px;
}
.statement-page-hdr h2 {
  font-size: 22px;
  letter-spacing: -.01em;
}
.statement-page-hdr .page-subtitle {
  font-size: 12px;
  margin-top: 2px;
  max-width: 680px;
}
.statement-primary-actions,
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}
.statement-primary-actions .btn {
  font-size: 12px;
  min-height: 32px;
  padding: 7px 13px;
}
.statement-control-band {
  align-items: end;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
  display: grid;
  gap: 8px;
  grid-template-areas:
    "quarter month language status business search";
  grid-template-columns: minmax(120px, .7fr) minmax(150px, .8fr) minmax(180px, 1fr) minmax(110px, .62fr) minmax(180px, 1fr) minmax(260px, 1.55fr);
  margin-bottom: 8px;
  padding: 8px 12px;
}
.statement-control {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.statement-control-period {
  display: none;
}
.statement-control-quarter { grid-area: quarter; }
.statement-control-month { grid-area: month; }
.statement-control-language { grid-area: language; }
.statement-control-business-unit { grid-area: business; }
.statement-search-control { grid-area: search; min-width:0; }
.statement-control-status { grid-area: status; }
.statement-control-quarter,
.statement-control-month,
.statement-control-language,
.statement-control-business-unit,
.statement-search-control,
.statement-control-status {
  min-width: 0;
}
.statement-control-title {
  color: var(--navy);
  font-size: 14px;
  font-weight: 900;
}
.statement-control-subtitle {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.statement-control label {
  color: #607086;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .45px;
  text-transform: uppercase;
}
.statement-control input,
.statement-control select {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  min-height: 32px;
  min-width: 0;
  padding: 6px 9px;
  text-overflow: ellipsis;
  width: 100%;
}
.statement-control input:focus,
.statement-control select:focus {
  border-color: var(--teal);
  outline: none;
}
.statement-metric-strip {
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(150px, .85fr) minmax(120px, .65fr) minmax(120px, .65fr) minmax(120px, .65fr) minmax(135px, .72fr) minmax(220px, 1.2fr);
  margin-bottom: 8px;
}
.statement-metric {
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 7px;
  grid-template-columns: auto auto minmax(0, 1fr);
  min-height: 42px;
  padding: 8px 10px;
}
.statement-metric span,
.statement-detail-grid span,
.statement-money-grid span {
  color: #657489;
  display: block;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .45px;
  text-transform: uppercase;
}
.statement-metric strong {
  color: var(--navy);
  display: block;
  font-size: 17px;
  line-height: 1.15;
  margin-top: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.statement-metric small {
  color: var(--muted);
  display: block;
  margin-top: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.statement-metric.good {
  border-color: rgba(39, 174, 96, .35);
  background: #f3fbf6;
}
.statement-metric.warning {
  border-color: rgba(232, 138, 0, .38);
  background: #fffaf0;
}
.statement-metric.danger {
  border-color: rgba(192, 57, 43, .34);
  background: #fff6f5;
}
.statement-workbench {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(320px, 420px) minmax(960px, 1fr);
}
.statement-batch-layout {
  display:grid;
  gap:14px;
  grid-template-columns:minmax(420px, .78fr) minmax(620px, 1.22fr);
}
.statement-batch-controls .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.statement-batch-wide-field,
.statement-pages-field {
  grid-column:1/-1;
}
.statement-page-checks {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.statement-page-check {
  align-items:center;
  background:#f7fbfa;
  border:1px solid #d7e4e2;
  border-radius:999px;
  color:var(--navy);
  display:inline-flex;
  font-size:12px;
  font-weight:800;
  gap:7px;
  min-height:34px;
  padding:7px 10px;
}
.statement-page-check-cover {
  background:#f3fbf8;
  border-color:#9dd7cd;
  color:#0f766e;
}
.statement-page-check input {
  accent-color:var(--teal);
}
.statement-filter-checks {
  align-content:flex-start;
  background:#fff;
  border:1.5px solid var(--border);
  border-radius:8px;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  max-height:128px;
  min-height:72px;
  overflow:auto;
  padding:8px;
}
.statement-filter-checks-compact {
  min-height:72px;
}
.statement-filter-check {
  align-items:center;
  background:#f8fbfc;
  border:1px solid #d7e4e2;
  border-radius:999px;
  color:var(--navy);
  display:inline-flex;
  font-size:12px;
  font-weight:800;
  gap:6px;
  line-height:1.15;
  min-height:30px;
  padding:6px 9px;
}
.statement-filter-check:has(input:checked) {
  background:#eaf7f4;
  border-color:#9dd7cd;
  color:#0f766e;
}
.statement-filter-check input {
  accent-color:var(--teal);
  margin:0;
}
.statement-filter-empty {
  align-items:center;
  color:var(--muted);
  display:flex;
  font-size:12px;
  font-weight:700;
  min-height:52px;
}
.statement-output-picker {
  align-items:center;
  background:#f8fbfc;
  border:1px solid #d7e4e2;
  border-radius:8px;
  display:flex;
  gap:14px;
  justify-content:space-between;
  margin:12px 18px 0;
  padding:12px 14px;
}
.statement-output-picker strong,
.statement-output-picker span {
  display:block;
}
.statement-output-picker strong {
  color:var(--navy);
  font-size:13px;
  font-weight:950;
}
.statement-output-picker > div:first-child span {
  color:var(--muted);
  font-size:12px;
  font-weight:650;
  margin-top:3px;
}
.statement-preview-page-checks {
  flex:0 1 auto;
  justify-content:flex-end;
}
.statement-output-mode-control {
  align-items:stretch;
  display:flex;
  flex:0 0 230px;
  flex-direction:column;
  gap:4px;
}
.statement-output-mode-control span,
.statement-output-version-field label {
  color:var(--muted);
  font-size:11px;
  font-weight:950;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.statement-output-mode-control select,
.statement-output-version-field select {
  background:#fff;
  border:1.5px solid var(--border);
  border-radius:8px;
  color:var(--navy);
  min-height:36px;
  padding:7px 10px;
}
.statement-output-mode-control small,
.statement-output-mode-note {
  color:#607087;
  font-size:11px;
  font-weight:700;
  line-height:1.35;
}
.statement-output-mode-note {
  background:#ecfdf5;
  border:1px solid #b7e4d3;
  border-radius:8px;
  color:#0f766e;
  display:inline-block;
  margin-top:7px;
  padding:6px 8px;
}
.statement-preview-page-checks .statement-page-check:last-child {
  background:#fff7ed;
  border-color:#fed7aa;
  color:#92400e;
}
.statement-batch-selected-list {
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height:calc(100vh - 340px);
  min-height:310px;
  overflow:auto;
  padding-right:2px;
}
.statement-batch-list-head {
  align-items:center;
  display:flex;
  gap:12px;
  justify-content:space-between;
  margin-bottom:14px;
}
.statement-batch-list-head .card-title {
  align-items:center;
  display:flex;
  gap:10px;
  margin-bottom:0;
}
.statement-batch-list-actions {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.statement-batch-client {
  align-items:center;
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  display:flex;
  gap:12px;
  justify-content:space-between;
  padding:11px 12px;
  transition:background .16s, border-color .16s, box-shadow .16s;
}
.statement-batch-client:hover {
  background:#f5faf8;
  border-color:#b9d9d3;
}
.statement-batch-client.selected {
  background:#eef8f6;
  border-color:#89cabe;
  box-shadow:inset 4px 0 0 var(--teal);
}
.statement-batch-client input {
  accent-color:var(--teal);
  flex:0 0 auto;
  height:18px;
  width:18px;
}
.statement-batch-client > div {
  flex:1 1 auto;
  min-width:0;
}
.statement-batch-client strong {
  color:var(--navy);
  display:block;
}
.statement-batch-client span:not(.statement-badge) {
  color:var(--muted);
  display:block;
  font-size:12px;
  margin-top:3px;
}
.statement-batch-results {
  border-top:1px solid var(--border);
  margin-top:14px;
  padding-top:14px;
}
.statement-batch-progress {
  background:#e6edf5;
  border-radius:999px;
  height:8px;
  margin-top:12px;
  overflow:hidden;
  position:relative;
}
.statement-batch-progress span {
  animation:statementBatchProgress 1.15s ease-in-out infinite;
  background:linear-gradient(90deg, var(--teal), #2f60b8);
  border-radius:999px;
  display:block;
  height:100%;
  width:38%;
}
@keyframes statementBatchProgress {
  0% { transform:translateX(-110%); }
  100% { transform:translateX(285%); }
}
.statement-batch-result-card {
  border:1px solid #b8ddd4;
  border-radius:8px;
  background:#f2fbf8;
  color:#174d42;
  padding:12px 14px;
}
.statement-batch-result-card.working {
  border-color:#c7d6ea;
  background:#f5f8fc;
  color:#243b5a;
}
.statement-batch-result-card.warning {
  border-color:#f3c57f;
  background:#fff8ed;
  color:#7a4a05;
}
.statement-batch-result-card strong,
.statement-batch-result-card span,
.statement-batch-result-card small {
  display:block;
}
.statement-batch-result-card strong {
  font-size:13px;
  font-weight:950;
}
.statement-batch-result-card span {
  font-size:13px;
  font-weight:700;
  line-height:1.35;
  margin-top:4px;
}
.statement-batch-result-card small {
  color:var(--muted);
  font-size:12px;
  font-weight:700;
  margin-top:6px;
  word-break:break-all;
}
.statement-batch-report {
  border:1px solid var(--border);
  border-radius:8px;
  margin-top:12px;
  overflow:hidden;
}
.statement-batch-report-head {
  background:#f7fbfa;
  border-bottom:1px solid var(--border);
  padding:10px 12px;
}
.statement-batch-report-head strong,
.statement-batch-report-head span {
  display:block;
}
.statement-batch-report-head strong {
  color:var(--navy);
  font-size:13px;
  font-weight:950;
}
.statement-batch-report-head span {
  color:var(--muted);
  font-size:12px;
  margin-top:3px;
}
.statement-batch-report-table-wrap {
  max-height:260px;
  overflow:auto;
}
.statement-batch-report-table {
  border-collapse:collapse;
  font-size:12px;
  min-width:780px;
  width:100%;
}
.statement-batch-report-table th,
.statement-batch-report-table td {
  border-bottom:1px solid #e7edf3;
  padding:8px 9px;
  text-align:left;
  vertical-align:top;
}
.statement-batch-report-table th {
  background:#eef7f2;
  color:#24405c;
  font-size:11px;
  font-weight:900;
  position:sticky;
  top:0;
  z-index:1;
}
.statement-batch-report-table tr.success td:first-child {
  color:#0f766e;
  font-weight:900;
}
.statement-batch-report-table tr.failed td:first-child {
  color:#b42318;
  font-weight:900;
}
.statement-batch-report-unavailable {
  color:var(--muted);
  font-size:12px;
  font-weight:700;
  margin:10px 0 0;
}
.statement-settings-modal {
  max-width:1120px;
  width:min(1120px, 94vw);
}
.statement-settings-stack {
  display:grid;
  gap:18px;
}
.statement-settings-stack textarea {
  min-height:190px;
}
.statement-settings-section-head {
  align-items:flex-start;
  display:flex;
  gap:16px;
  justify-content:space-between;
}
.locked-source-note.important {
  background:#fff7ed;
  border:1px solid #fed7aa;
  border-radius:8px;
  color:#9a3412;
  margin:8px 0 0;
  padding:10px 12px;
}
.statement-cover-tabs {
  background:#eef7f4;
  border:1px solid #c8e4dc;
  border-radius:999px;
  display:flex;
  flex:0 0 auto;
  gap:4px;
  padding:4px;
}
.statement-cover-tabs button {
  background:transparent;
  border:0;
  border-radius:999px;
  color:#344054;
  cursor:pointer;
  font-size:12px;
  font-weight:900;
  padding:7px 12px;
}
.statement-cover-tabs button.active {
  background:#0f766e;
  color:#fff;
}
.statement-cover-token-note {
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  margin:10px 0 12px;
}
.statement-cover-template-layout {
  display:grid;
  gap:18px;
  grid-template-columns:minmax(360px, 1fr) minmax(320px, .9fr);
}
.statement-cover-format-toolbar {
  align-items:center;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:6px 0 8px;
}
.statement-cover-format-toolbar button {
  background:#fff;
  border:1px solid #cfd9e4;
  border-radius:8px;
  color:#27364a;
  cursor:pointer;
  font-size:12px;
  font-weight:900;
  min-height:32px;
  padding:6px 10px;
}
.statement-cover-format-toolbar button:hover {
  border-color:#0f766e;
  color:#0f766e;
}
.statement-cover-format-toolbar button:nth-child(2) {
  background:#fffbeb;
  border-color:#fde68a;
  color:#92400e;
}
.statement-cover-format-help {
  color:var(--muted);
  font-size:12px;
  font-weight:750;
  margin:0 0 8px;
}
.statement-cover-rich-editor {
  background:#fff;
  border:1.5px solid #cfd9e4;
  border-radius:8px;
  color:#162033;
  font-family:inherit;
  font-size:14px;
  line-height:1.55;
  min-height:280px;
  outline:none;
  overflow:auto;
  padding:12px;
}
.statement-cover-rich-editor:focus {
  border-color:#0f766e;
  box-shadow:0 0 0 3px rgba(15,118,110,.12);
}
.statement-cover-rich-editor:empty::before {
  color:#98a2b3;
  content:attr(data-placeholder);
}
.statement-cover-rich-editor p {
  margin:0 0 12px;
}
.statement-cover-rich-editor p:last-child {
  margin-bottom:0;
}
.statement-cover-rich-editor mark,
.statement-cover-letter-preview mark {
  background:#fef3c7;
  border-radius:3px;
  color:inherit;
  padding:0 2px;
}
.statement-cover-preview-card {
  background:#fbfefd;
  border:1px solid #d8e7e2;
  border-radius:8px;
  padding:14px;
}
.statement-cover-letter-preview {
  background:#fff;
  border:1px solid #e4ebe8;
  border-radius:8px;
  color:#1f2937;
  font-size:14px;
  line-height:1.65;
  min-height:236px;
  padding:16px;
}
.statement-cover-letter-preview p {
  margin:0 0 12px;
}
.statement-cover-letter-preview p:last-child {
  margin-bottom:0;
}
.zoho-reconnect-modal {
  max-width:720px;
  width:min(720px, 94vw);
}
.zoho-reconnect-steps {
  align-items:center;
  background:#f6fbfa;
  border:1px solid #cde7df;
  border-radius:8px;
  color:#475467;
  display:flex;
  gap:12px;
  margin:12px 0 16px;
  padding:12px;
}
.zoho-reconnect-steps span {
  font-size:13px;
  font-weight:750;
  line-height:1.45;
}
#zoho-reconnect-scope,
#zoho-reconnect-code {
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  min-height:68px;
}
.statement-client-panel,
.statement-inspector {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.statement-client-panel {
  min-height: 640px;
  overflow: hidden;
}
.statement-panel-head {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  padding: 13px 16px;
}
.statement-panel-head h3,
.statement-inspector h3 {
  color: var(--navy);
  font-size: 18px;
  margin: 0;
}
.statement-panel-head span {
  color: var(--muted);
  font-size: 12px;
}
.statement-client-list {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 348px);
  min-height: 540px;
  overflow: auto;
}
.statement-client-row {
  align-items: start;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 86px;
  padding: 12px 14px;
  text-align: left;
  transition: background .16s, box-shadow .16s;
  width: 100%;
}
.statement-client-row:hover {
  background: #f5faf8;
}
.statement-client-row.active {
  background: #eef8f6;
  box-shadow: inset 4px 0 0 var(--teal);
}
.statement-client-row.selected {
  background: #f8fbff;
}
.statement-select-wrap input {
  height: 18px;
  width: 18px;
}
.statement-client-main strong {
  color: #172033;
  display: block;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.25;
}
.statement-client-main small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 4px;
}
.statement-status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  grid-column: 2;
}
.statement-client-state {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1;
  margin-bottom: 6px;
  padding: 5px 7px;
  text-transform: uppercase;
}
.statement-client-state-ready {
  background: #e1f5ea;
  color: #176742;
}
.statement-client-state-issue {
  background: #fde7e5;
  color: #a23a34;
}
.statement-client-state-waiting {
  background: #edf1f4;
  color: #64748b;
}
.statement-client-profile-status {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  margin: 0 0 6px 5px;
  padding: 5px 7px;
  vertical-align: top;
}
.statement-client-profile-status-active { background:#dcfce7; color:#166534; }
.statement-client-profile-status-warning { background:#fef3c7; color:#92400e; }
.statement-client-profile-status-danger { background:#fee2e2; color:#991b1b; }
.statement-client-profile-status-muted { background:#eef2f6; color:#475467; }
.statement-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  padding: 6px 9px;
  white-space: nowrap;
}
.statement-badge-good {
  background: #dff4e8;
  color: #176742;
}
.statement-badge-info {
  background: #e7eef8;
  color: #1a4777;
}
.statement-badge-warning {
  background: #fff0cf;
  color: #8a5100;
}
.statement-badge-danger {
  background: #fde7e5;
  color: #a23a34;
}
.statement-badge-muted {
  background: #edf1f4;
  color: #64748b;
}
.statement-row-issues,
.statement-row-clear {
  font-size: 12px;
  font-weight: 800;
  grid-column: 2;
  justify-self: start;
}
.statement-row-issues {
  color: var(--danger);
}
.statement-row-clear {
  color: var(--success);
}
.statement-inspector {
  background: #f8fafc;
  max-height: calc(100vh - 112px);
  min-height: calc(100vh - 210px);
  overflow: auto;
  position: sticky;
  top: 106px;
}
.statement-preview-toolbar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 56px;
  padding: 9px 16px;
  position: sticky;
  top: 0;
  z-index: 3;
}
.statement-preview-toolbar h3 {
  color: var(--navy);
  font-size: 17px;
  line-height: 1.15;
  margin: 1px 0 0;
}
.statement-preview-toolbar p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
  margin-top: 2px;
}
.statement-preview-toolbar .statement-inspector-actions {
  gap: 8px;
  padding: 0;
}
.statement-preview-toolbar .statement-inspector-actions .btn {
  min-height: 34px;
  padding: 7px 12px;
}
.statement-lock-panel {
  align-items: start;
  background: #fff;
  border: 1px solid #d5e4ec;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 1.1fr) minmax(280px, 1.6fr) auto;
  margin: 16px 18px 0;
  padding: 15px 16px;
}
.statement-lock-panel.pending {
  background: #fbfcfd;
  border-style: dashed;
}
.statement-lock-panel.locked {
  background: #f7fbf9;
  border-color: #acd8cc;
}
.statement-lock-panel strong {
  color: var(--navy);
  display: block;
  font-size: 16px;
  line-height: 1.25;
  margin-top: 3px;
}
.statement-lock-panel p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 5px;
}
.statement-lock-panel dl {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}
.statement-lock-panel dl div:last-child {
  grid-column: 1 / -1;
}
.statement-lock-panel dt {
  color: #657489;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.statement-lock-panel dd {
  color: #172033;
  font-size: 13px;
  font-weight: 850;
  margin: 3px 0 0;
}
.statement-lock-panel .checksum {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-break: anywhere;
}
.statement-lock-actions {
  align-items: stretch;
  display: grid;
  gap: 8px;
  justify-self: end;
  min-width: 156px;
}
.statement-preview-document {
  background: #fff;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  box-shadow: 0 16px 38px rgba(24,49,79,.08);
  color: #172033;
  margin: 18px;
  min-height: 620px;
  padding: 22px;
}
.statement-data-check-panel {
  background: #fff;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  margin: 0 18px 18px;
  overflow: hidden;
}
.statement-data-check-panel > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  list-style: none;
  padding: 14px 16px;
}
.statement-data-check-panel > summary::-webkit-details-marker {
  display: none;
}
.statement-data-check-panel > summary strong {
  color: var(--navy);
}
.statement-data-check-panel > summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}
.statement-internal-document {
  border: 0;
  border-top: 1px solid #dbe5ec;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  min-height: 0;
}
.statement-preview-accordion-stack {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.statement-preview-accordion {
  background: #fff;
  border: 1px solid #d5e4ec;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(24, 49, 79, .05);
  overflow: hidden;
}
.statement-preview-accordion[open] {
  border-color: #b8d7d1;
}
.statement-preview-accordion > summary {
  align-items: center;
  background: #f8fbfc;
  cursor: pointer;
  display: flex;
  gap: 12px;
  min-height: 56px;
  padding: 14px 16px;
}
.statement-preview-accordion > summary > div {
  display: grid;
  flex: 1 1 auto;
  gap: 3px;
  min-width: 0;
}
.statement-preview-accordion > summary strong {
  color: var(--navy);
  font-size: 15px;
  font-weight: 950;
}
.statement-preview-accordion > summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}
.statement-preview-accordion[open] > summary {
  border-bottom: 1px solid #dbe8ee;
}
.statement-preview-accordion-primary > summary {
  background: #f4fbf8;
}
.statement-preview-accordion-muted > summary {
  background: #f8fbfd;
}
.statement-preview-accordion-warn > summary {
  background: #fffaf3;
}
.statement-preview-accordion-budget > summary {
  background: #f7fbf5;
}
.statement-preview-accordion-body {
  background: #fff;
  padding: 16px;
}
.statement-preview-accordion-body .statement-preview-section:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}
.statement-accordion-action-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 12px;
}
.statement-accordion-action-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
body[data-page="statements"] #content {
  max-width: calc(100vw - 28px);
}
.statement-engine-preview {
  margin: 16px 18px 18px;
}
.statement-engine-loading {
  background: #f8fbfa;
  border: 1px dashed #b7d8d2;
  border-radius: 8px;
  color: #1a4f48;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
}
.statement-engine-loading span {
  color: var(--muted);
}
.statement-engine-shell {
  background: #fff;
  border: 1px solid #cfdce6;
  border-radius: 8px;
  box-shadow: 0 16px 38px rgba(24,49,79,.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.statement-engine-shell.expanded {
  border-color: #aac8d6;
  box-shadow: 0 28px 90px rgba(15, 23, 42, .34);
  inset: 48px 16px 16px;
  position: fixed;
  z-index: 10000;
}
body.statement-preview-expanded {
  overflow: hidden;
}
body.statement-preview-expanded::before {
  background: rgba(15, 23, 42, .46);
  content: "";
  inset: 0;
  position: fixed;
  z-index: 9999;
}
.statement-engine-head {
  align-items: center;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 14px;
}
.statement-engine-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.statement-engine-head strong,
.statement-engine-head span {
  display: block;
}
.statement-engine-head strong {
  color: var(--navy);
}
.statement-engine-head span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.statement-engine-source {
  background: #e5f5f1;
  border-radius: 999px;
  color: #126a60 !important;
  font-weight: 850;
  margin: 0 !important;
  padding: 6px 9px;
  white-space: nowrap;
}
.statement-engine-zoom {
  align-items: center;
  background: #fff;
  border: 1px solid #cdd9e2;
  border-radius: 8px;
  display: inline-flex;
  gap: 2px;
  min-height: 34px;
  padding: 3px;
}
.statement-engine-zoom button,
.statement-engine-expand,
.statement-engine-collapse {
  background: #fff;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #26384f;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  min-height: 28px;
  padding: 5px 8px;
}
.statement-engine-zoom button:hover,
.statement-engine-expand:hover,
.statement-engine-collapse:hover {
  background: #eef8f6;
  border-color: #b8ded6;
  color: #0f766e;
}
.statement-engine-zoom span {
  color: var(--navy);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  min-width: 42px;
  text-align: center;
}
.statement-engine-expand {
  border-color: #cdd9e2;
}
.statement-engine-collapse {
  align-items: center;
  border-color: #cdd9e2;
  display: inline-flex;
  gap: 6px;
}
.statement-engine-collapse span {
  color: inherit;
  display: inline;
  font-size: 12px;
  margin: 0;
}
.statement-engine-collapse-arrow {
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  display: inline-block;
  height: 7px;
  transform: rotate(45deg);
  transition: transform .16s ease;
  width: 7px;
}
.statement-engine-shell.collapsed .statement-engine-collapse-arrow {
  transform: rotate(-45deg);
}
.statement-engine-window {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}
.statement-engine-window:hover {
  background: #0b5f59;
  border-color: #0b5f59;
  color: #fff;
}
.statement-engine-frame {
  background: #fff;
  border: 0;
  display: block;
  height: min(92vh, 980px);
  min-height: 720px;
  width: 100%;
}
.statement-engine-body {
  display: block;
  min-height: 0;
}
.statement-engine-shell.collapsed .statement-engine-body {
  display: none;
}
.statement-engine-shell.collapsed .statement-engine-head {
  border-bottom: 0;
}
.statement-engine-shell.collapsed .statement-engine-zoom,
.statement-engine-shell.collapsed #statement-engine-expand-btn {
  display: none;
}
.statement-engine-shell.expanded .statement-engine-body {
  display: flex;
  flex: 1;
  min-height: 0;
}
.statement-engine-shell.expanded .statement-engine-frame {
  flex: 1;
  height: auto;
  min-height: 0;
}
.statement-document-head {
  align-items: flex-start;
  border-bottom: 3px solid var(--teal);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding-bottom: 16px;
}
.statement-document-brand {
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .06em;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.statement-document-head h3 {
  color: var(--navy);
  font-size: 24px;
  line-height: 1.15;
  margin: 0;
}
.statement-document-head p {
  color: var(--muted);
  margin-top: 8px;
}
.statement-document-period {
  background: #f4faf8;
  border: 1px solid #cfe4df;
  border-radius: 8px;
  min-width: 180px;
  padding: 12px;
  text-align: right;
}
.statement-document-period span,
.statement-preview-meta span,
.statement-preview-totals span {
  color: #657489;
  display: block;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.statement-document-period strong {
  display: block;
  font-size: 17px;
  margin-top: 5px;
}
.statement-preview-meta {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
}
.statement-preview-meta div {
  border-bottom: 1px solid var(--border);
  padding: 0 0 10px;
}
.statement-preview-meta strong {
  display: block;
  margin-top: 5px;
}
.statement-preview-alert {
  border-radius: 8px;
  display: grid;
  gap: 4px;
  margin-top: 16px;
  padding: 13px 14px;
}
.statement-preview-alert.blocked {
  background: #fff6f5;
  border: 1px solid rgba(192, 57, 43, .28);
  color: #96352e;
}
.statement-preview-alert.ready {
  background: #f3fbf6;
  border: 1px solid rgba(39, 174, 96, .3);
  color: #176742;
}
.statement-preview-alert span {
  color: inherit;
  line-height: 1.45;
  opacity: .9;
}
.statement-preview-alert .statement-inline-action {
  justify-self: start;
  margin-top: 8px;
}
.statement-preview-section {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 15px;
}
.statement-section-title {
  align-items: baseline;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}
.statement-section-title-actions {
  align-items: center;
}
.statement-section-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.statement-section-title h4 {
  color: var(--navy);
  font-size: 15px;
  margin: 0;
}
.statement-section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.statement-preview-totals {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.statement-preview-totals div {
  background: #f8fbfa;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.statement-preview-totals strong {
  color: var(--navy);
  display: block;
  font-size: 18px;
  margin-top: 6px;
}
.statement-placeholder {
  background: #f8fafc;
  border: 1px dashed #cbd7e1;
  border-radius: 8px;
  color: #667085;
  line-height: 1.5;
  padding: 16px;
}
.statement-placeholder.ready {
  background: #f3fbf6;
  border-color: #b8e2cb;
  color: #176742;
}
.statement-review-intro {
  background: #f7fbfa;
  border: 1px solid #cfe4df;
  border-radius: 8px;
  margin-bottom: 10px;
  padding: 12px 14px;
}
.statement-review-intro span,
.statement-review-source {
  color: var(--teal);
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.statement-review-intro p {
  color: #53647a;
  line-height: 1.45;
  margin: 5px 0 0;
}
.statement-review-accordion {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.statement-review-accordion + .statement-review-accordion {
  margin-top: 10px;
}
.statement-review-accordion summary {
  align-items: center;
  background: #ffffff;
  cursor: pointer;
  display: flex;
  gap: 10px;
  list-style: none;
  padding: 13px 14px;
}
.statement-review-accordion summary::-webkit-details-marker {
  display: none;
}
.statement-review-accordion summary::after {
  color: #667085;
  content: "⌄";
  font-weight: 900;
  margin-left: auto;
}
.statement-review-accordion[open] summary::after {
  content: "⌃";
}
.statement-review-accordion summary span {
  align-items: center;
  background: #e6f5f1;
  border-radius: 999px;
  color: var(--teal);
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  width: 24px;
}
.statement-review-accordion summary strong {
  color: var(--navy);
  font-size: 14px;
}
.statement-review-body {
  background: #fbfcfd;
  border-top: 1px solid var(--border);
  padding: 12px;
}
.statement-review-layout-preview {
  background: #f6faf9;
  border: 1px solid #cbded9;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .07);
  overflow: hidden;
}
.statement-review-layout-preview.blocked {
  border-color: #efb4ad;
}
.statement-review-layout-head {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #d8e6e2;
  display: flex;
  justify-content: space-between;
  padding: 11px 14px;
}
.statement-review-layout-head strong {
  color: #155a49;
  display: block;
  font-size: 13px;
}
.statement-review-layout-head span {
  color: #667085;
  display: block;
  font-size: 12px;
  margin-top: 2px;
}
.statement-review-layout-frame-wrap {
  background: #eef3f7;
  height: min(70vh, 720px);
  min-height: 540px;
  position: relative;
}
.statement-review-page-preview-frame {
  background: #eef3f7;
  border: 0;
  height: 100%;
  width: 100%;
}
.statement-review-preview-placeholder {
  align-items: center;
  background: rgba(248, 251, 250, .92);
  color: #466072;
  display: flex;
  font-weight: 800;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: absolute;
  text-align: center;
}
.statement-review-preview-placeholder.is-hidden {
  display: none;
}
.statement-review-window-only {
  align-items: center;
  background: #f8fbfa;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 14px;
}
.statement-review-window-only strong {
  color: #155a49;
  display: block;
  font-size: 14px;
  margin-bottom: 3px;
}
.statement-review-window-only span {
  color: #53647a;
  display: block;
  font-size: 13px;
  line-height: 1.45;
}
.statement-review-layout-preview.window-only .statement-review-layout-head {
  border-bottom-color: #edf3f1;
}
.statement-excel-block {
  background: #fff;
  border: 1px solid #cfdcd6;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
  overflow: hidden;
}
.statement-excel-block + .statement-excel-block {
  margin-top: 18px;
}
.statement-pdf-page {
  margin-left: auto;
  margin-right: auto;
  max-width: 980px;
}
.statement-excel-title {
  align-items: center;
  background: #f4faf5;
  border-bottom: 1px solid #cfdcd6;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}
.statement-excel-title strong {
  color: var(--navy);
}
.statement-excel-title span {
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.statement-excel-scroll {
  overflow-x: auto;
  padding: 18px 20px;
}
.statement-excel-scroll h2 {
  color: var(--navy);
  font-size: 17px !important;
  line-height: 1.25;
  margin: 0 0 8px !important;
}
.statement-excel-scroll table {
  background: #fff;
  border-collapse: collapse !important;
  color: #1d2939;
  font-size: 12px !important;
  min-width: 900px;
  width: 100% !important;
}
.statement-excel-scroll th,
.statement-excel-scroll td {
  border-bottom: 1px solid #cfdcd6 !important;
  font-size: 12px !important;
  line-height: 1.25;
  padding: 7px 8px !important;
  vertical-align: top;
}
.statement-excel-scroll th {
  background: #eaf4e6 !important;
  color: #193b2d !important;
  font-weight: 900 !important;
}
.statement-excel-scroll td[align="right"],
.statement-excel-scroll td[style*="right"] {
  color: #0f4fb3;
  font-variant-numeric: tabular-nums;
}
.statement-excel-scroll tr[style*="font-weight: bold"] td,
.statement-excel-scroll tr[style*="font-weight:bold"] td {
  background: #eaf5ef !important;
  color: #0b604e;
  font-weight: 900 !important;
}
.statement-review-source {
  margin-bottom: 8px;
}
.statement-review-metrics {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.statement-review-metric {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.statement-review-metric span {
  color: #657489;
  display: block;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.statement-review-metric strong {
  color: var(--navy);
  display: block;
  font-size: 18px;
  margin-top: 6px;
}
.statement-review-metric em {
  color: #667085;
  display: block;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  margin-top: 3px;
}
.statement-government-source {
  background: #fbfcfd;
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
}
.statement-government-source.blocked {
  background: #fff7ed;
}
.statement-government-head {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 12px;
}
.statement-government-head strong {
  color: var(--navy);
  display: block;
  font-size: 14px;
}
.statement-government-head span {
  color: #657489;
  display: block;
  font-size: 12px;
  margin-top: 3px;
}
.statement-government-period {
  min-width: 112px;
  text-align: right;
}
.statement-source-chips {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}
.statement-source-chip {
  background: #fff;
  border: 1px solid #cfe1d9;
  border-radius: 8px;
  padding: 9px 10px;
}
.statement-source-chip.blocked {
  background: #fff7ed;
  border-color: #fed7aa;
}
.statement-source-chip strong {
  color: var(--navy);
  display: block;
  font-size: 12px;
}
.statement-source-chip em {
  color: #0f766e;
  display: block;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  margin-top: 2px;
}
.statement-source-chip.blocked em {
  color: #b45309;
}
.statement-government-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, .8fr);
  margin-bottom: 12px;
}
.statement-government-grid h5 {
  color: #344054;
  font-size: 12px;
  letter-spacing: .05em;
  margin: 0 0 8px;
  text-transform: uppercase;
}
.statement-government-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.statement-government-files {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 11px 12px;
}
.statement-government-files span {
  color: #344054;
  font-size: 12px;
}
.statement-government-table {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: auto;
}
.statement-government-table-head,
.statement-government-table-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 64px 170px 92px 92px 92px 78px minmax(180px, 1fr);
  min-width: 820px;
  padding: 9px 10px;
}
.statement-government-table-head {
  background: #eef6f2;
  color: #4b5d6d;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.statement-government-table-row {
  border-top: 1px solid var(--border);
  color: #253245;
  font-size: 12px;
}
.statement-government-table-row strong,
.statement-government-table-row span:nth-child(3),
.statement-government-table-row span:nth-child(4),
.statement-government-table-row span:nth-child(5) {
  color: #0f4fb3;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}
.statement-government-notes {
  color: #8a4b0f;
  font-size: 12px;
  font-weight: 750;
  margin: 8px 0 0;
  padding-left: 18px;
}
.statement-review-table {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.statement-review-head,
.statement-review-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 105px minmax(110px, .8fr) minmax(0, 1.4fr) minmax(110px, .9fr) 90px 105px;
  padding: 10px 12px;
}
.statement-review-head {
  background: #f8fafc;
  color: #667085;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.statement-review-row {
  background: #fff;
}
.statement-review-row + .statement-review-row {
  border-top: 1px solid var(--border);
}
.statement-review-row strong,
.statement-review-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.statement-review-row strong {
  color: var(--navy);
}
.statement-review-row small {
  color: #667085;
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 3px;
}
.statement-review-row em {
  display: none;
  font-style: normal;
}
.statement-review-amount {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.statement-finance-reference-section {
  background: #fffdf7;
  border: 1px solid #f1dec2;
  border-radius: 8px;
  margin-top: 18px;
  padding: 14px;
}
.statement-line-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.statement-line-row {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr auto;
  padding: 10px 12px;
}
.statement-line-row + .statement-line-row {
  border-top: 1px solid var(--border);
}
.statement-line-row span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 3px;
}
.statement-line-row > strong {
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.statement-finance-summary {
  color: #53647a;
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 8px;
}
.statement-finance-head,
.statement-finance-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 170px 115px 115px 160px minmax(0, 1fr) 105px 110px;
  padding: 10px 12px;
}
.statement-finance-head {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  color: #667085;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.statement-finance-row + .statement-finance-row {
  border-top: 1px solid var(--border);
}
.statement-finance-row strong {
  color: var(--navy);
}
.statement-finance-row span,
.statement-finance-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.statement-finance-row em {
  display: none;
  font-style: normal;
}
.statement-finance-ref {
  color: var(--navy);
  font-weight: 800;
}
.statement-finance-item small {
  color: #667085;
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
}
.statement-finance-amount {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.statement-finance-status {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  flex-direction: column;
  font-size: 11px !important;
  gap: 1px;
  font-weight: 900;
  justify-content: center;
  line-height: 1.08;
  margin-top: 0 !important;
  min-width: 74px;
  padding: 5px 9px;
  text-align: center;
  width: fit-content;
}
.statement-finance-status small {
  font-size: 10px;
  font-weight: 900;
  opacity: .92;
  white-space: nowrap;
}
.statement-finance-status.paid {
  background: #e6f7ed;
  color: #176742;
}
.statement-finance-status.unpaid {
  background: #fff3e6;
  color: #9a4d00;
}
.statement-preview-issues {
  background: #fffaf9;
  border: 1px solid rgba(192, 57, 43, .20);
  border-radius: 8px;
  margin-top: 18px;
  padding: 14px;
}
.statement-reconciliation-panel {
  background: #f8fbfa;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 14px 0;
  padding: 14px;
}
.statement-reconciliation-failed {
  background: #fff6f5;
  border-color: rgba(192, 57, 43, .25);
}
.statement-reconciliation-warning {
  background: #fffaf0;
  border-color: rgba(232, 138, 0, .30);
}
.statement-reconciliation-passed {
  background: #f3fbf6;
  border-color: rgba(39, 174, 96, .28);
}
.statement-reconciliation-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.statement-reconciliation-check {
  align-items: start;
  background: rgba(255,255,255,.76);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px;
}
.statement-reconciliation-check-fail {
  border-color: rgba(192, 57, 43, .28);
}
.statement-reconciliation-check-warning {
  border-color: rgba(232, 138, 0, .32);
}
.statement-reconciliation-check-pass {
  border-color: rgba(39, 174, 96, .25);
}
.statement-reconciliation-check strong,
.statement-reconciliation-check small {
  display: block;
}
.statement-reconciliation-check small {
  color: var(--muted);
  font-weight: 650;
  line-height: 1.45;
  margin-top: 4px;
}
.statement-reconciliation-check b {
  border-radius: 999px;
  background: #edf1f4;
  color: #475467;
  font-size: 11px;
  padding: 6px 9px;
  white-space: nowrap;
}
.statement-reconciliation-check-pass b { background: #dff4e8; color: #176742; }
.statement-reconciliation-check-fail b { background: #fde7e5; color: #a23a34; }
.statement-reconciliation-check-warning b { background: #fff0cf; color: #8a5100; }
.statement-reconciliation-values {
  display: grid;
  gap: 6px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}
.statement-reconciliation-values span {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px;
}
.statement-reconciliation-values em {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.statement-reconciliation-values strong {
  color: var(--navy);
  font-size: 13px;
  margin-top: 3px;
}
.statement-inspector-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 18px;
}
.statement-inspector-head p,
.statement-inspector-section p {
  color: var(--muted);
  line-height: 1.5;
  margin-top: 5px;
}
.statement-eyebrow {
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .7px;
  text-transform: uppercase;
}
.statement-detail-grid,
.statement-money-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 14px 18px 0;
}
.statement-detail-grid div,
.statement-money-grid div {
  background: #f8fbfa;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}
.statement-detail-grid strong,
.statement-money-grid strong {
  color: #172033;
  display: block;
  font-size: 14px;
  margin-top: 4px;
}
.statement-pipeline {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 1fr);
  padding: 14px 18px 0;
}
.statement-pipeline-step {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}
.statement-pipeline-step span {
  align-items: center;
  background: #e7eef8;
  border-radius: 999px;
  color: var(--navy);
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  height: 22px;
  justify-content: center;
  margin-bottom: 8px;
  width: 22px;
}
.statement-pipeline-step strong,
.statement-pipeline-step small {
  display: block;
}
.statement-pipeline-step small {
  color: var(--muted);
  margin-top: 3px;
}
.statement-pipeline-step.done {
  background: #f3fbf6;
  border-color: rgba(39, 174, 96, .3);
}
.statement-pipeline-step.blocked {
  background: #fff6f5;
  border-color: rgba(192, 57, 43, .28);
}
.statement-pipeline-step.waiting {
  background: #f8fbfa;
}
.statement-inspector-section {
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding: 14px 18px;
}
.statement-inspector-section h4 {
  color: var(--navy);
  font-size: 13px;
  letter-spacing: .2px;
  margin-bottom: 8px;
}
.statement-inspector-section.has-issues {
  background: #fffaf9;
}
.statement-issue-list {
  color: #96352e;
  display: grid;
  gap: 7px;
  list-style-position: inside;
}
.statement-source-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}
.statement-mini-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.statement-mini-list div {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.statement-mini-list strong,
.statement-mini-list span {
  display: block;
}
.statement-mini-list span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.statement-inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 18px 18px;
}
.statement-empty-inspector,
.statement-loading {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  min-height: 280px;
  padding: 24px;
  text-align: center;
}
.statement-loading-card {
  background: linear-gradient(180deg, #f8fbff 0%, #f2f8f7 100%);
  border: 1px dashed #b7d7d1;
  border-radius: 10px;
  margin: 14px;
  min-height: 250px;
}
.statement-loading-card strong {
  color: var(--navy);
  font-size: 18px;
}
.statement-loading-card span:not(.statement-loading-spinner) {
  color: #4b5e78;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  max-width: 420px;
}
.statement-loading-spinner {
  animation: statementLoadingSpin .85s linear infinite;
  border: 3px solid #dbe8e6;
  border-top-color: var(--teal);
  border-radius: 50%;
  display: inline-block;
  height: 34px;
  width: 34px;
}
@keyframes statementLoadingSpin {
  to { transform: rotate(360deg); }
}
.statement-empty-inspector strong {
  color: var(--navy);
  font-size: 18px;
}

@media(max-width:1440px) {
  .statement-control-band {
    align-items: stretch;
    grid-template-areas:
      "quarter month language status"
      "business business search search";
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 8px;
    padding: 8px 10px;
  }
  .statement-control-period {
    display: none;
  }
}

@media(max-width:1180px) {
  #navbar {
    padding-left: 14px;
    padding-right: 14px;
  }
  #navbar .brand {
    min-width: 190px;
  }
  #navbar .brand.brand-3a {
    min-width: 184px;
  }
  #navbar .brand.brand-3a img {
    height: 34px;
    max-width: 164px;
  }
  .calculator-layout {
    grid-template-columns: 1fr !important;
  }
	  .statement-control-band {
	    grid-template-areas:
	      "quarter month"
	      "language status"
	      "business business"
	      "search search";
	    grid-template-columns: repeat(2, minmax(0, 1fr));
	  }
	  .statement-control-period {
	    display: none;
	  }
  .statement-search-control {
    grid-column: 1 / -1;
  }
  .statement-batch-controls .form-grid {
    grid-template-columns: 1fr;
  }
  .statement-workbench {
    grid-template-columns: 1fr;
  }
  .statement-batch-layout,
  .statement-cover-template-layout {
    grid-template-columns: 1fr;
  }
  .statement-settings-section-head {
    flex-direction:column;
  }
  .statement-batch-list-head {
    align-items:flex-start;
    flex-direction:column;
  }
  .statement-inspector {
    max-height: none;
    overflow: visible;
    position: static;
  }
}

@media(max-width:980px) {
  #content {
    padding: 20px 14px 34px;
  }
  #navbar {
    min-height: 60px;
  }
  #navbar .brand {
    min-width: 180px;
  }
  #nav-user {
    display: inline-flex;
    flex: 0 0 auto;
  }
  .page-hdr {
    align-items: stretch;
  }
  .page-hdr h2 {
    font-size: 22px;
  }
  .modal-overlay {
    padding: 14px;
  }
  .client-profile-modal {
    max-width: calc(100vw - 28px) !important;
  }
  .client-profile-section-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:900px) {
  #page-clients .client-table-card .tbl-wrap,
  .budget-table-card,
  .service-items-card .tbl-wrap {
    display: none;
  }
  #clients-card-list,
  #budgets-card-list,
  #items-card-list,
  #zoho-export-card-list {
    display: flex;
  }
}

@media(max-width:760px) {
  .aws-site-ribbon {
    font-size: 10px !important;
    padding: 6px 8px !important;
  }
  .aws-site-ribbon + #login-page + #app #navbar,
  .aws-site-ribbon ~ #app #navbar {
    top: 24px;
  }
  .aws-site-ribbon ~ #app #content {
    padding-top: 30px;
  }
  #navbar {
    align-items: center;
    flex-wrap: nowrap;
    gap: 7px;
    min-height: 56px;
    overflow-x: auto;
    overflow-y: visible;
    padding: 8px 10px;
    scroll-padding-inline: 10px;
    white-space: nowrap;
  }
  body.nav-menu-open #navbar {
    overflow: visible;
  }
  .nav-menu-panel {
    border-radius: 12px;
    box-shadow: 0 20px 56px rgba(15, 23, 42, .26);
    left: 10px;
    max-height: calc(100vh - 106px);
    min-width: 0;
    overflow-y: auto;
    right: 10px;
    top: 84px;
    z-index: 12050;
  }
  .aws-site-ribbon ~ #app .nav-menu-panel {
    top: 88px;
  }
  .nav-menu-panel::before {
    display: none;
  }
  .nav-menu-panel .nav-btn {
    font-size: 14px;
    min-height: 44px;
    padding: 10px 12px;
  }
  #navbar .brand {
    flex: 0 0 auto;
    font-size: 14px;
    min-width: max-content;
    padding-right: 2px;
  }
  #navbar span[style*="v1.0"] {
    display: none;
  }
  .nav-signout {
    margin-left: 0;
  }
  .site-env-pill {
    display: none;
  }
  .nav-btn {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 8px 10px;
  }
  .help-launch-btn {
    flex: 0 0 auto;
    height: 34px;
    width: 34px;
  }
  .language-switch-label {
    display: none;
  }
  #nav-admin-btns,
  .nav-admin-area,
  .nav-menu {
    flex: 0 0 auto;
  }
  #content {
    padding: 16px 10px 30px;
  }
  .page-hdr {
    gap: 12px;
  }
  .page-hdr h2 {
    font-size: 21px;
  }
  .card {
    padding: 14px;
  }
  #page-clients .client-table-card .tbl-wrap {
    display: none;
  }
  #clients-card-list,
  #budgets-card-list,
  #items-card-list,
  #zoho-export-card-list {
    display: flex;
  }
  .record-card {
    padding: 14px;
  }
  .record-card-main {
    align-items: flex-start;
  }
  .record-card-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }
  .record-card-actions .btn {
    width: 100%;
  }
  .record-card-edit-grid {
    grid-template-columns: 1fr;
  }
  .budget-actions {
    align-items: stretch;
    display: grid !important;
    grid-template-columns: 1fr;
  }
  .export-row {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .budget-actions > .btn,
  .export-row .btn {
    width: 100%;
  }
  .modal-overlay {
    align-items: stretch;
    padding: 0;
  }
  .modal,
  .client-profile-modal,
  .provider-profile-modal {
    border-radius: 0;
    max-height: 100vh;
    max-width: 100vw !important;
  }
  .modal-body {
    padding: 16px;
  }
  .modal-footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }
  .modal-footer .btn {
    width: 100%;
  }
  .form-section .form-grid {
    padding: 14px;
  }
  .client-profile-section-grid {
    grid-template-columns:1fr;
  }
  #modal-summary .modal-body {
    padding: 12px;
  }
  #modal-summary .modal-footer {
    display: grid;
    grid-template-columns: 1fr;
  }
  #modal-summary .summary-language-actions,
  #modal-summary .summary-export-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  #modal-summary .summary-client-grid {
    grid-template-columns: 1fr;
  }
  #modal-summary .table-card,
  #modal-summary .summary-detail-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  #modal-summary .smry-tbl {
    min-width: 720px;
  }
  #modal-summary .summary-detail-tbl {
    min-width: 1080px;
  }
  .provider-picker-list {
    max-height: none;
  }
  .provider-picker-summary {
    min-height:54px;
  }
  .provider-picker-option {
    grid-template-columns: 1fr;
    min-height:0;
  }
  .provider-picker-option .btn {
    width: 100%;
  }
  .help-drawer {
    border-left: 0;
    width: 100vw;
  }
  .help-drawer-hdr {
    min-height: 66px;
    padding: 14px 16px;
  }
.help-drawer-body {
  padding: 14px 16px 24px;
}
  .help-quicklinks {
    margin: -14px -16px 14px;
    padding: 10px 16px;
  }
  .statement-primary-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .statement-primary-actions .btn {
    width: 100%;
  }
  .statement-control-band,
  .statement-metric-strip,
  .statement-preview-meta,
  .statement-preview-totals,
  .statement-detail-grid,
  .statement-money-grid,
  .statement-pipeline {
    grid-template-columns: 1fr;
  }
	  .statement-control-band {
	    grid-template-areas:
	      "quarter"
	      "month"
	      "language"
	      "business"
	      "search"
	      "status";
	  }
  .statement-client-panel,
  .statement-inspector {
    border-radius: 8px;
  }
  .statement-client-list {
    max-height: none;
    min-height: 0;
  }
  .statement-client-row {
    align-items: start;
    grid-template-columns: 26px 1fr;
  }
  .statement-status-stack,
  .statement-row-issues,
  .statement-row-clear {
    grid-column: 2;
    justify-self: start;
  }
  .statement-panel-head,
  .statement-inspector-head {
    align-items: stretch;
    flex-direction: column;
  }
  .statement-inspector-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .statement-inspector-actions .btn {
    width: 100%;
  }
  .statement-document-head,
  .statement-section-title,
  .statement-preview-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .statement-document-period {
    min-width: 0;
    text-align: left;
  }
  .statement-preview-document {
    margin: 12px;
    padding: 16px;
  }
  .statement-engine-preview {
    margin: 12px 12px 0;
  }
	  .statement-output-picker {
	    align-items:stretch;
	    flex-direction:column;
	    margin:12px 12px 0;
	  }
	  .statement-preview-accordion > summary,
	  .statement-accordion-action-row {
	    align-items:stretch;
	    flex-direction:column;
	  }
	  .statement-preview-accordion-body {
	    padding:12px;
	  }
	  .statement-preview-page-checks {
	    justify-content:flex-start;
	  }
  .statement-engine-head {
    align-items: stretch;
    flex-direction: column;
  }
  .statement-engine-tools {
    align-items: stretch;
    justify-content: flex-start;
  }
  .statement-engine-zoom {
    justify-content: space-between;
    width: 100%;
  }
  .statement-engine-expand {
    width: 100%;
  }
  .statement-engine-frame {
    height: 620px;
    min-height: 560px;
  }
  .statement-engine-shell.expanded {
    inset: 12px;
  }
}

@media(max-width:420px) {
  #navbar .brand {
    min-width: max-content;
  }
  .nav-btn {
    font-size: 11px;
  }
  .login-box {
    margin: 0 auto;
    padding: 28px 22px;
    width: calc(100vw - 24px);
  }
}

@media(max-width:720px) {
  .feature-permissions-grid {
    grid-template-columns: 1fr;
  }
}

/* ── App language switch ── */
.app-language-switch {
  align-items: center;
  background: #eef7f6;
  border: 1px solid #c8e4df;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 3px;
}
.language-switch-label {
  color: #33566f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  padding: 0 6px 0 8px;
  text-transform: uppercase;
}
.app-language-switch button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: #33566f;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  min-height: 28px;
  padding: 5px 9px;
}
.app-language-switch button.active {
  background: var(--teal);
  color: #fff;
}
.login-language-switch {
  background: #eef7f6;
  border-color: #c8e4df;
  justify-content: center;
  margin: 10px auto 18px;
  width: max-content;
}
.login-language-switch button {
  color: #33566f;
}
.login-language-switch button.active {
  background: var(--teal);
  color: #fff;
}

/* ── Mobile-first statement workbench refinements ── */
@media(max-width:820px) {
  body[data-page="statements"] #content {
    max-width: 100vw;
    padding-left: 10px;
    padding-right: 10px;
  }
  .statement-page-hdr {
    border-radius: 10px;
    margin: 0 0 10px;
    padding: 13px;
  }
  .statement-page-hdr h2 {
    font-size: 22px;
    line-height: 1.15;
  }
  .statement-page-hdr .page-subtitle {
    font-size: 13px;
  }
  .statement-primary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .statement-primary-actions .btn {
    min-height: 42px;
    padding-left: 10px;
    padding-right: 10px;
    white-space: normal;
  }
  .statement-primary-actions #stmt-fetch-live-btn,
  .statement-primary-actions #stmt-generate-btn {
    grid-column: span 1;
  }
	  .statement-control-band {
	    align-items: stretch;
	    border-radius: 10px;
	    gap: 7px;
	    grid-template-areas:
	      "quarter month"
	      "language status"
	      "business business"
	      "search search";
	    grid-template-columns: 1fr 1fr;
	    margin-bottom: 8px;
	    padding: 8px;
	  }
	  .statement-control-period {
	    display: none;
	  }
  .statement-search-control {
    grid-column: 1 / -1;
  }
	  .statement-control input,
	  .statement-control select {
	    min-height: 36px;
	    width: 100%;
	  }
	  .statement-metric-strip {
	    display: flex;
	    gap: 6px;
	    margin: 0 -10px 8px;
	    overflow-x: auto;
	    padding: 0 10px 3px;
	    scroll-snap-type: x proximity;
	  }
	  .statement-metric {
	    flex: 0 0 190px;
	    min-height: 42px;
	    scroll-snap-align: start;
	  }
  .statement-workbench {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .statement-client-panel {
    min-height: 0;
  }
  .statement-panel-head {
    gap: 10px;
    padding: 12px;
  }
  .statement-panel-head .btn {
    min-height: 38px;
    white-space: normal;
  }
  .statement-client-list {
    max-height: min(48svh, 460px);
    min-height: 0;
  }
  .statement-client-row {
    min-height: 78px;
    padding: 11px 12px;
  }
  .statement-status-stack {
    gap: 4px;
  }
  .statement-badge {
    font-size: 9px;
    padding: 5px 7px;
  }
  .statement-inspector {
    max-height: none;
    min-height: 0;
    overflow: visible;
    position: static;
  }
  .statement-preview-toolbar {
    border-radius: 10px 10px 0 0;
    gap: 8px;
    padding: 9px 10px;
  }
  .statement-preview-toolbar h3 {
    font-size: 16px;
  }
  .statement-preview-toolbar p {
    font-size: 12px;
  }
  .statement-preview-toolbar .statement-inspector-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .statement-preview-toolbar .statement-inspector-actions .btn {
    min-height: 38px;
    width: 100%;
  }
  .statement-lock-panel {
    grid-template-columns: 1fr;
    margin: 12px 12px 0;
  }
  .statement-lock-panel dl {
    grid-template-columns: 1fr;
  }
  .statement-lock-actions {
    justify-self: stretch;
    min-width: 0;
  }
  .statement-preview-document {
    border-left: 0;
    border-radius: 0 0 10px 10px;
    border-right: 0;
    box-shadow: none;
    margin: 0;
    min-height: 0;
    padding: 14px 12px 18px;
  }
  .statement-document-head,
  .statement-section-title,
  .statement-line-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }
  .statement-preview-meta,
  .statement-preview-totals {
    grid-template-columns: 1fr 1fr;
  }
  .statement-review-metrics,
  .statement-review-head,
  .statement-review-row {
    grid-template-columns: 1fr;
  }
  .statement-government-source {
    padding: 12px;
  }
  .statement-government-head,
  .statement-government-grid {
    grid-template-columns: 1fr;
  }
  .statement-government-head {
    display: grid;
  }
  .statement-government-period {
    text-align: left;
  }
  .statement-source-chips,
  .statement-government-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .statement-excel-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .statement-excel-scroll {
    margin-left: -4px;
    margin-right: -4px;
    padding: 10px;
  }
  .statement-excel-scroll table {
    font-size: 11px !important;
    min-width: 760px;
  }
  .statement-excel-scroll th,
  .statement-excel-scroll td {
    font-size: 11px !important;
    padding: 6px !important;
  }
  .statement-review-head {
    display: none;
  }
  .statement-review-row {
    align-items: start;
    gap: 7px;
    padding: 12px;
  }
  .statement-review-row em {
    color: #667085;
    display: inline;
    font-weight: 800;
  }
  .statement-review-amount {
    text-align: left;
  }
  .statement-finance-reference-section {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    margin-left: -12px;
    margin-right: -12px;
  }
  .statement-finance-head {
    display: none;
  }
  .statement-finance-row {
    align-items: start;
    gap: 6px;
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .statement-finance-row em {
    color: #667085;
    display: inline;
    font-weight: 800;
  }
  .statement-finance-amount {
    text-align: left;
  }
  .statement-finance-status {
    width: max-content;
  }
  .statement-document-period {
    min-width: 0;
    text-align: left;
  }
  .statement-engine-preview {
    margin: 10px 0 12px;
  }
  .statement-output-picker {
    border-radius:8px;
    margin:10px 0 0;
    padding:10px;
  }
  .statement-preview-page-checks .statement-page-check {
    border-radius:8px;
    width:100%;
  }
  .statement-engine-head {
    align-items: stretch;
    flex-direction: column;
  }
  .statement-engine-tools {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }
  .statement-engine-source {
    text-align: center;
  }
  .statement-engine-zoom {
    display: grid;
    grid-template-columns: 38px 1fr 38px 1fr 1fr;
    width: 100%;
  }
  .statement-engine-expand {
    min-height: 38px;
    width: 100%;
  }
  .statement-engine-frame {
    height: 72svh;
    min-height: 560px;
  }
  .statement-review-window-only {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }
  .statement-engine-shell.expanded {
    border-radius: 0;
    inset: 0;
  }
}

@media(max-width:520px) {
  #navbar {
    gap: 6px;
  }
  #navbar .brand {
    font-size: 13px;
  }
  #navbar .brand span {
    display: none;
  }
  #navbar .brand.brand-3a {
    gap: 7px;
    min-width: 146px;
  }
  #navbar .brand.brand-3a img {
    height: 28px;
    max-width: 124px;
  }
  #navbar .brand.brand-3a span {
    display: inline-flex;
    font-size: 14px;
  }
  .app-language-switch button {
    min-height: 30px;
    padding: 5px 7px;
  }
  .statement-primary-actions,
  .statement-control-band,
  .statement-preview-meta,
  .statement-preview-totals {
    grid-template-columns: 1fr;
  }
  .statement-control-band {
    grid-template-areas:
      "period"
      "quarter"
      "month"
      "language"
      "business"
      "search"
      "status";
  }
  .statement-client-list {
    max-height: min(52svh, 420px);
  }
  .statement-document-head h3 {
    font-size: 20px;
  }
  .statement-preview-document {
    font-size: 13px;
  }
  .statement-engine-frame {
    height: 70svh;
    min-height: 500px;
  }
}

@media(prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

.statement-live-progress-overlay {
  align-items: center;
  background: rgba(15, 23, 42, .55);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 10020;
}
.statement-live-progress-card {
  background: #fff;
  border: 1px solid #d8e4ec;
  border-radius: 12px;
  box-shadow: 0 28px 84px rgba(15, 23, 42, .34);
  max-width: 520px;
  padding: 22px;
  width: min(100%, 520px);
}
.statement-live-progress-head {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.statement-live-progress-head strong {
  color: #172033;
  display: block;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
}
.statement-live-progress-head span:last-child {
  color: #667085;
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 3px;
}
.statement-live-progress-card p {
  color: #475467;
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 16px;
}
.statement-live-spinner {
  animation: statement-spin .8s linear infinite;
  border: 3px solid #cfe4df;
  border-top-color: #0f766e;
  border-radius: 50%;
  flex: 0 0 auto;
  height: 34px;
  width: 34px;
}
.statement-live-status-icon {
  align-items: center;
  background: #0f766e;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}
.statement-live-progress-overlay.warning .statement-live-status-icon {
  background: #b45309;
}
.statement-live-progress-overlay.error .statement-live-status-icon {
  background: #b42318;
}
.statement-live-progress-counts {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 16px;
}
.statement-live-progress-counts span {
  background: #f8fbfc;
  border: 1px solid #e0e9f0;
  border-radius: 8px;
  color: #172033;
  display: flex;
  flex-direction: column;
  font-size: 18px;
  font-weight: 900;
  padding: 10px 12px;
}
.statement-live-progress-counts b {
  color: #667085;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  margin-bottom: 3px;
  text-transform: uppercase;
}
.statement-live-auth-repair {
  background:#fff7ed;
  border:1px solid #fed7aa;
  border-radius:10px;
  margin:0 0 16px;
  padding:12px;
}
.statement-live-auth-repair strong {
  color:#9a3412;
  display:block;
  font-size:14px;
  font-weight:900;
  margin-bottom:4px;
}
.statement-live-auth-repair p {
  color:#7c2d12;
  font-size:13px;
  margin:0 0 10px;
}
.statement-live-auth-repair .btn {
  width:auto;
}
.statement-live-progress-card .btn {
  justify-content: center;
  width: 100%;
}
.statement-live-progress-card .statement-live-auth-repair .btn {
  width:auto;
}
@keyframes statement-spin {
  to { transform: rotate(360deg); }
}

.care-plan-page-hdr {
  align-items: center;
}
.page-subtitle {
  color: #56657a;
  font-size: 14px;
  line-height: 1.45;
  margin: 4px 0 0;
}
.care-plan-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.care-plan-layout {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  min-width: 0;
}
.care-plan-main-card {
  min-width: 0;
}
.care-plan-side {
  display: grid;
  gap: 16px;
  max-width: 100%;
  min-width: 0;
  position: sticky;
  top: 88px;
}
.care-plan-side .card {
  max-width: 100%;
  min-width: 0;
}
.care-plan-section {
  border-top: 1px solid #e0e9f0;
  margin-top: 18px;
  padding-top: 18px;
}
.care-plan-section:first-of-type {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}
.care-plan-section h3 {
  color: #172033;
  font-size: 16px;
  font-weight: 900;
  margin: 0 0 6px;
}
.locked-source-note {
  color: #667085;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  margin: 0 0 12px;
}
.locked-profile-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.locked-profile-grid div {
  background: #f8fbfc;
  border: 1px solid #dce8ef;
  border-radius: 8px;
  min-height: 58px;
  padding: 10px 12px;
}
.locked-profile-grid span {
  color: #667085;
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.locked-profile-grid strong {
  color: #172033;
  display: block;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.care-plan-budget-status {
  align-items: center;
  background: #f7fbfa;
  border: 1px solid #d7ebe7;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
  padding: 10px 12px;
}
.care-plan-budget-status strong {
  color: #172033;
  font-size: 12px;
}
.care-plan-budget-status span:last-child {
  color: #56657a;
  font-size: 12px;
  font-weight: 800;
}
.care-plan-budget-source-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}
.care-plan-budget-source-actions span {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}
.care-plan-budget-source-note {
  background: #fff8e6;
  border: 1px solid #f4d994;
  border-radius: 8px;
  color: #7a4b00;
  font-size: 12px;
  line-height: 1.45;
  margin: -4px 0 12px;
  padding: 10px 12px;
}
.care-plan-budget-source-note strong {
  color: #7a4b00;
  display: block;
  font-weight: 900;
  margin-bottom: 2px;
}
.care-plan-budget-source-note span {
  display: block;
  font-weight: 650;
}
.care-plan-service-preview {
  border: 1px solid #dce8ef;
  border-radius: 10px;
  max-width: 100%;
  max-height: 520px;
  overflow: auto;
}
.care-plan-service-table {
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
  width: 100%;
}
.care-plan-service-table th {
  background: #f4f8fb;
  border-bottom: 1px solid #dce8ef;
  color: #56657a;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  padding: 10px;
  text-align: left;
  text-transform: uppercase;
}
.care-plan-service-table td {
  border-bottom: 1px solid #edf2f6;
  color: #172033;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
  padding: 10px;
  vertical-align: top;
}
.care-plan-service-table tr:last-child td {
  border-bottom: 0;
}
.care-plan-completion .alert {
  margin: 0;
}
.care-plan-suggestion-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}
.care-plan-suggestion-actions .btn {
  justify-content: center;
  min-height: 34px;
  white-space: normal;
}
.care-plan-suggestions {
  border: 1px solid #dce8ef;
  border-radius: 10px;
  max-height: 620px;
  overflow: auto;
  padding: 12px;
}
.care-plan-suggestion-note {
  background: #eef6f2;
  border: 1px solid #cfe7dc;
  border-radius: 8px;
  color: #1f5f4a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 12px;
  padding: 10px 12px;
}
.care-plan-suggestion-group {
  border-top: 1px solid #e4edf3;
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
}
.care-plan-suggestion-group:first-of-type {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}
.care-plan-suggestion-group h4 {
  color: #172033;
  font-size: 13px;
  font-weight: 900;
  margin: 0;
}
.care-plan-suggestion-group.internal {
  background: #fffaf0;
  border: 1px solid #fde4b2;
  border-radius: 8px;
  margin-top: 12px;
  padding: 12px;
}
.care-plan-suggestion-group.internal ul {
  margin: 0;
  padding-left: 18px;
}
.care-plan-suggestion-group.internal li {
  color: #7c2d12;
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 8px;
}
.care-plan-suggestion-field {
  background: #f8fbfc;
  border: 1px solid #e0e9f0;
  border-radius: 8px;
  padding: 10px 12px;
}
.care-plan-suggestion-field span {
  color: #667085;
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  margin-bottom: 5px;
  text-transform: uppercase;
}
.care-plan-suggestion-field p {
  color: #172033;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
  margin: 0;
}
.care-plan-suggestion-service {
  background: #fff;
  border: 1px solid #e0e9f0;
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 10px 12px;
}
.care-plan-suggestion-service strong {
  color: #0f766e;
  font-size: 12px;
}
.care-plan-suggestion-service span {
  color: #475467;
  font-size: 12px;
  line-height: 1.35;
}

@media(max-width:520px) {
  .statement-live-progress-card {
    padding: 18px;
  }
  .statement-live-progress-counts {
    grid-template-columns: 1fr;
  }
}

@media(max-width:1100px) {
  .care-plan-layout {
    grid-template-columns: 1fr;
  }
  .care-plan-side {
    position: static;
  }
  .client-profile-command {
    grid-template-columns: 1fr;
  }
  .client-profile-signal-row,
  .client-profile-workflow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .client-profile-sequence {
    grid-template-columns: 1fr;
  }
  .client-profile-sequence-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .client-profile-layout {
    grid-template-columns: 1fr;
  }
  .client-profile-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .client-profile-budget-row {
    grid-template-columns: 1fr 130px;
  }
  .client-profile-budget-actions {
    justify-content: flex-start;
  }
}

@media(max-width:700px) {
  .care-plan-page-hdr {
    align-items: stretch;
  }
  .care-plan-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }
  .care-plan-actions .btn {
    justify-content: center;
    width: 100%;
  }
  .care-plan-suggestion-actions {
    grid-template-columns: 1fr;
  }
  .locked-profile-grid {
    grid-template-columns: 1fr;
  }
  .care-plan-service-preview {
    max-height: 420px;
  }
  .client-profile-hdr {
    align-items: stretch;
  }
  .client-profile-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }
  .client-profile-actions .btn {
    justify-content: center;
    width: 100%;
  }
  .client-profile-command {
    border-radius: 12px;
    padding: 22px;
  }
  .client-profile-command h3 {
    font-size: 27px;
  }
  .client-profile-signal-row {
    border-radius: 10px;
    grid-template-columns: 1fr;
    margin: 8px 0 0;
  }
  .client-profile-signal-row div {
    border-bottom: 1px solid #e5edf3;
    border-right: 0;
  }
  .client-profile-signal-row div:last-child {
    border-bottom: 0;
  }
  .client-profile-workflow-grid,
  .client-profile-info-grid,
  .client-profile-sequence-steps {
    grid-template-columns: 1fr;
  }
  .client-profile-main-card .client-profile-card-title {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
  .client-profile-sync-btn {
    justify-content: center;
    width: 100%;
  }
  .client-profile-budget-section .card-title {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
  .client-profile-budget-section .card-title .btn {
    justify-content: center;
    width: 100%;
  }
  .client-profile-budget-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }
}

/* ── Budget detail workspace beta: clearer CP review layer ── */
.budget-workbench-panel {
  margin: 16px 0;
}
.budget-workbench-card {
  background: #ffffff;
  border: 1px solid #d8e5ec;
  border-radius: 10px;
  box-shadow: 0 16px 38px rgba(16, 24, 40, .07);
  overflow: hidden;
}
.budget-workbench-hero {
  align-items: flex-start;
  background: linear-gradient(180deg, #f7fbfa 0%, #ffffff 100%);
  border-bottom: 1px solid #dfe9ef;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 20px 22px 18px;
}
.budget-workbench-eyebrow,
.budget-workbench-label {
  color: #0f766e;
  display: block;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.budget-workbench-hero h3 {
  color: #172033;
  font-size: 25px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.12;
  margin: 5px 0 6px;
}
.budget-workbench-hero p {
  color: #56657a;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  margin: 0;
  max-width: 760px;
}
.budget-workbench-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(380px, 1.3fr) minmax(330px, 1fr) minmax(240px, .75fr);
  padding: 16px 18px;
}
.budget-workbench-section {
  background: #fbfdfe;
  border: 1px solid #dfe9ef;
  border-radius: 9px;
  min-width: 0;
  padding: 14px;
}
.budget-workbench-section.success {
  background: #f0fbf5;
  border-color: #b8e4ca;
}
.budget-workbench-section.warning {
  background: #fffbeb;
  border-color: #f3d58a;
}
.budget-workbench-section.danger {
  background: #fff5f3;
  border-color: #f5b8b1;
}
.budget-workbench-metrics {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 10px;
}
.budget-workbench-metric {
  border-right: 1px solid #e5edf3;
  min-width: 0;
  padding-right: 10px;
}
.budget-workbench-metric:last-child {
  border-right: 0;
}
.budget-workbench-metric span,
.budget-workbench-signal-row span {
  color: #667085;
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.budget-workbench-metric strong {
  color: #172033;
  display: block;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.budget-workbench-signal-row {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 10px;
}
.budget-workbench-signal-row div {
  min-width: 0;
}
.budget-workbench-signal-row strong {
  color: #172033;
  display: block;
  font-size: 17px;
  font-weight: 950;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.budget-workbench-signal-row strong.ready {
  color: #087443;
}
.budget-workbench-signal-row strong.warning {
  color: #a15c00;
}
.budget-workbench-signal-row strong.draft {
  color: #475467;
}
.budget-workbench-provider-line {
  border-radius: 7px;
  font-size: 12px;
  font-weight: 850;
  margin-top: 12px;
  padding: 8px 10px;
}
.budget-workbench-provider-line.success {
  background: #dcfce7;
  color: #166534;
}
.budget-workbench-provider-line.warning {
  background: #fef3c7;
  color: #92400e;
}
.budget-workbench-provider-line.danger {
  background: #fee4e2;
  color: #991b1b;
}
.budget-workbench-next {
  color: #172033;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.45;
  margin: 12px 0 0;
}
.budget-workbench-category-panel {
  border-top: 1px solid #e3edf2;
  padding: 16px 18px 18px;
}
.budget-workbench-category-panel .budget-workbench-label {
  margin-bottom: 10px;
}
.budget-workbench-category {
  align-items: center;
  border-top: 1px solid #edf2f6;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(210px, .95fr) minmax(260px, 1.35fr) 112px 96px;
  padding: 12px 0;
}
.budget-workbench-category:first-of-type {
  border-top: 0;
}
.budget-workbench-category strong {
  color: #172033;
  display: block;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
}
.budget-workbench-category span,
.budget-workbench-category-services {
  color: #667085;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}
.budget-workbench-category-total {
  color: #172033;
  font-size: 15px;
  font-weight: 950;
  text-align: right;
}
.budget-workbench-empty {
  background: #f8fafc;
  border: 1px dashed #c7d5df;
  border-radius: 8px;
  color: #667085;
  font-weight: 700;
  padding: 18px;
}

@media(max-width:1180px) {
  .budget-workbench-grid {
    grid-template-columns: 1fr;
  }
}

@media(max-width:760px) {
  .budget-workbench-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }
  .budget-workbench-hero h3 {
    font-size: 22px;
  }
  .budget-workbench-grid,
  .budget-workbench-category-panel {
    padding: 14px;
  }
  .budget-workbench-metrics,
  .budget-workbench-signal-row,
  .budget-workbench-category {
    grid-template-columns: 1fr 1fr;
  }
  .budget-workbench-category-services {
    grid-column: 1 / -1;
  }
  .budget-workbench-category-total {
    text-align: left;
  }
}

@media(max-width:520px) {
  .budget-workbench-metrics,
  .budget-workbench-signal-row,
  .budget-workbench-category {
    grid-template-columns: 1fr;
  }
  .budget-workbench-metric {
    border-bottom: 1px solid #e5edf3;
    border-right: 0;
    padding: 0 0 9px;
  }
  .budget-workbench-metric:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }
}

/* ── Budget service planner beta: editable grouped service view ── */
.budget-service-planner {
  margin: 16px 0;
}
.budget-service-planner-card {
  background: #ffffff;
  border: 1px solid #d8e5ec;
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(16, 24, 40, .06);
  overflow: hidden;
}
.budget-service-planner-head {
  align-items: flex-start;
  background: #ffffff;
  border-bottom: 1px solid #e1eaf0;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 18px 20px;
}
.budget-service-planner-head h3 {
  color: #172033;
  font-size: 22px;
  font-weight: 950;
  line-height: 1.15;
  margin: 5px 0 5px;
}
.budget-service-planner-head p {
  color: #56657a;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  margin: 0;
  max-width: 720px;
}
.budget-service-planner-actions {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 9px;
}
.budget-service-planner-actions span {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}
.budget-service-groups {
  display: flex;
  flex-direction: column;
}
.budget-service-group {
  border-top: 1px solid #edf2f6;
}
.budget-service-group:first-child {
  border-top: 0;
}
.budget-service-group.has-issues {
  border-left: 3px solid #d92d20;
}
.budget-service-group-summary {
  align-items: center;
  background: #f8fbfc;
  cursor: pointer;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  list-style: none;
  padding: 13px 18px;
}
.budget-service-group-summary::-webkit-details-marker { display: none; }
.budget-service-group-summary::before {
  border-bottom: 2px solid #0f766e;
  border-right: 2px solid #0f766e;
  content: "";
  flex: 0 0 auto;
  height: 8px;
  transform: rotate(45deg);
  transition: transform .16s ease;
  width: 8px;
}
.budget-service-group:not([open]) .budget-service-group-summary::before {
  transform: rotate(-45deg);
}
.budget-service-group-summary > div {
  flex: 1;
  min-width: 0;
}
.budget-service-group-summary strong {
  color: #172033;
  display: block;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.25;
}
.budget-service-group-summary span:not(.badge) {
  color: #667085;
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
}
.budget-service-row-list {
  display: flex;
  flex-direction: column;
}
.budget-service-row {
  align-items: center;
  background: #ffffff;
  border-top: 1px solid #edf2f6;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(230px, 1.25fr) minmax(300px, 1.15fr) minmax(360px, 1.35fr) minmax(120px, .55fr) auto;
  padding: 14px 18px;
}
.budget-service-row.has-issue {
  background: #fff8f7;
}
.budget-service-row:hover {
  background: #f7fbfa;
}
.budget-service-title-line {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.budget-service-title-line strong {
  color: #172033;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.3;
}
.budget-service-title-line span,
.budget-service-provider-line span {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}
.budget-service-provider-line {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}
.budget-service-money,
.budget-service-meta {
  display: grid;
  gap: 8px;
}
.budget-service-money {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.budget-service-meta {
  grid-template-columns: 1fr;
}
.budget-service-mini-stat {
  min-width: 0;
}
.budget-service-mini-stat span,
.budget-service-edit label {
  color: #667085;
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.budget-service-mini-stat strong {
  color: #172033;
  display: block;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.budget-service-edit {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(120px, 1fr) 76px 76px minmax(140px, 1.2fr);
}
.budget-service-edit input,
.budget-service-edit select {
  background: #ffffff;
  border: 1px solid #cfd9e3;
  border-radius: 8px;
  color: #172033;
  font: inherit;
  min-height: 36px;
  padding: 7px 9px;
  width: 100%;
}
.budget-service-actions {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.budget-service-empty {
  background: #f8fafc;
  border: 1px dashed #c7d5df;
  border-radius: 8px;
  color: #667085;
  margin: 18px;
  padding: 24px;
  text-align: center;
}
.budget-service-empty strong {
  color: #172033;
  display: block;
  font-size: 16px;
  margin-bottom: 5px;
}

/* ── Finance workspace ── */
.finance-header-actions {
  align-items:center;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:flex-end;
}
.finance-summary-grid {
  display:grid;
  gap:12px;
  margin-bottom:16px;
}
.finance-command-center {
  display:grid;
  gap:12px;
}
.finance-command-main {
  display:grid;
  gap:12px;
  grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
}
.finance-stat {
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  box-shadow:0 1px 3px rgba(0,0,0,.04);
  padding:12px 14px;
  text-align:left;
}
.finance-stat-clickable {
  cursor:pointer;
  transition:border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.finance-stat-clickable:hover,
.finance-stat-clickable.active {
  border-color:#6ab9b1;
  box-shadow:0 10px 24px rgba(15,118,110,.12);
  transform:translateY(-1px);
}
.finance-stat-danger { border-top:3px solid #d92d20; }
.finance-stat-warning { border-top:3px solid #f59e0b; }
.finance-stat-ready { border-top:3px solid #0f766e; }
.finance-stat-paid { border-top:3px solid #16a34a; }
.finance-stat-neutral { border-top:3px solid #7c8aa5; }
.finance-stat span {
  color:var(--muted);
  display:block;
  font-size:11px;
  letter-spacing:.4px;
  margin-bottom:6px;
  text-transform:uppercase;
}
.finance-stat strong {
  color:var(--navy);
  display:block;
  font-size:19px;
}
.finance-stat em,
.finance-payment-last p {
  color:var(--muted);
  display:block;
  font-size:11px;
  font-style:normal;
  line-height:1.35;
  margin-top:5px;
}
.finance-payment-last {
  background:#f8fbfd;
  border:1px solid var(--border);
  border-radius:8px;
  padding:10px 12px;
}
.finance-payment-last span {
  color:var(--muted);
  display:block;
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.finance-payment-last strong {
  color:var(--navy);
  display:block;
  font-size:13px;
  margin-top:4px;
}
.finance-invoice-no {
  color:var(--navy);
  display:inline-block;
  font-weight:800;
  line-height:1.25;
  max-width:100%;
  overflow-wrap:anywhere;
  text-decoration:none;
}
a.finance-invoice-no {
  border-bottom:1px solid rgba(15,118,110,.42);
  color:var(--teal);
}
a.finance-invoice-no:hover {
  border-bottom-color:var(--teal2);
  color:var(--teal2);
}
.finance-invoice-no-warning,
a.finance-invoice-no-warning {
  color:#b42318;
}
a.finance-invoice-no-warning {
  border-bottom-color:rgba(180,35,24,.45);
}
.finance-file-shortcut {
  color:var(--teal);
  display:inline-block;
  font-size:12px;
  font-weight:700;
  margin-top:4px;
  text-decoration:none;
}
.finance-file-shortcut:hover {
  text-decoration:underline;
}
.finance-issue-chips {
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  margin-top:5px;
}
.finance-issue-chips span {
  border-radius:999px;
  font-size:10px;
  font-weight:800;
  line-height:1;
  padding:4px 6px;
}
.finance-issue-chips span.warning { background:#fff4d8; color:#8a5100; }
.finance-issue-chips span.danger { background:#fde8e8; color:#a23a34; }
.finance-date-warning {
  color:#b42318;
  font-size:12px;
  font-weight:700;
  margin-top:4px;
}
.form-group input.finance-warning-input {
  border-color:#f0a6a0;
  color:#b42318;
  font-weight:800;
}
.finance-layout {
  align-items:start;
  display:grid;
  gap:16px;
  grid-template-columns:1fr;
}
.finance-layout > section,
.finance-detail-card {
  min-width:0;
}
.finance-list-head {
  align-items:flex-start;
  background:#fff;
  border-bottom:1px solid var(--border);
  display:flex;
  justify-content:space-between;
  padding:13px 16px;
}
.finance-list-head strong {
  color:var(--navy);
  display:block;
  font-size:15px;
  font-weight:950;
}
.finance-list-head span {
  color:var(--muted);
  display:block;
  font-size:12px;
  font-weight:750;
  margin-top:3px;
}
.finance-pagination {
  background:#f8fbfc;
}
.finance-detail-card {
  max-height:none;
  overflow:visible;
  position:static;
  scroll-margin-top:78px;
}
.finance-detail-head {
  align-items:flex-start;
  background:#f8fbfd;
  border:1px solid var(--border);
  border-radius:8px;
  display:flex;
  gap:12px;
  justify-content:space-between;
  margin-bottom:12px;
  padding:10px 12px;
}
.finance-validation-panel {
  border:1px solid var(--border);
  border-radius:8px;
  margin-bottom:12px;
  overflow:hidden;
}
.finance-validation-panel.clean {
  background:#f2fbf6;
  border-color:#c8ead7;
}
.finance-validation-panel.has-issues {
  background:#fffaf0;
  border-color:#f5d08a;
}
.finance-validation-head {
  align-items:flex-start;
  display:flex;
  gap:12px;
  justify-content:space-between;
  padding:10px 12px;
}
.finance-validation-head strong {
  color:var(--navy);
  display:block;
  font-size:14px;
}
.finance-validation-head span {
  color:var(--muted);
  display:block;
  font-size:12px;
  line-height:1.4;
  margin-top:2px;
}
.finance-validation-metrics {
  border-top:1px solid rgba(0,0,0,.06);
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
}
.finance-validation-metrics div {
  border-right:1px solid rgba(0,0,0,.06);
  padding:9px 12px;
}
.finance-validation-metrics div:last-child {
  border-right:0;
}
.finance-validation-metrics span,
.finance-validation-list span {
  color:var(--muted);
  display:block;
  font-size:11px;
}
.finance-validation-metrics strong {
  color:var(--navy);
  display:block;
  font-size:14px;
  margin-top:3px;
}
.finance-validation-list {
  border-top:1px solid rgba(0,0,0,.06);
  display:grid;
  gap:7px;
  padding:10px 12px;
}
.finance-validation-list div {
  background:#fff;
  border:1px solid var(--border);
  border-left-width:4px;
  border-radius:7px;
  padding:8px 10px;
}
.finance-validation-list div.warning { border-left-color:#f59e0b; }
.finance-validation-list div.danger { border-left-color:#d92d20; }
.finance-validation-list strong {
  color:var(--navy);
  display:block;
  font-size:12px;
  margin-bottom:2px;
}
.finance-audit-panel {
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  margin-bottom:12px;
  overflow:hidden;
}
.finance-audit-panel summary {
  align-items:center;
  color:var(--navy);
  cursor:pointer;
  display:flex;
  font-size:12px;
  font-weight:900;
  justify-content:space-between;
  list-style:none;
  padding:9px 12px;
}
.finance-audit-panel summary::-webkit-details-marker {
  display:none;
}
.finance-audit-panel summary span {
  background:#eef6f6;
  border-radius:999px;
  color:var(--teal);
  font-size:11px;
  padding:3px 7px;
}
.finance-audit-list {
  border-top:1px solid var(--border);
  display:grid;
}
.finance-audit-list div {
  border-bottom:1px solid var(--border);
  padding:8px 12px;
}
.finance-audit-list div:last-child {
  border-bottom:0;
}
.finance-audit-list strong {
  color:var(--navy);
  display:block;
  font-size:12px;
  text-transform:capitalize;
}
.finance-audit-list span {
  color:var(--muted);
  display:block;
  font-size:11px;
  margin-top:2px;
}
.finance-payment-form,
.finance-upload,
.finance-maintenance-form {
  align-items:end;
  border:1px solid var(--border);
  border-radius:8px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:10px;
  padding:10px 12px;
}
.finance-maintenance-form {
  align-items:flex-end;
  background:#fbfdfd;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
}
.finance-maintenance-form .form-group {
  min-width:145px;
}
.finance-maintenance-title,
.finance-maintenance-notes {
  grid-column:1 / -1;
}
.finance-maintenance-title {
  color:var(--teal);
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.readonly-field {
  align-items:center;
  background:#f3f7f8;
  border:1px solid var(--border);
  border-radius:7px;
  color:var(--navy);
  display:flex;
  min-height:38px;
  padding:8px 10px;
}
.finance-maintenance-notes {
  flex:1 1 100%;
}
.finance-maintenance-notes textarea {
  min-height:58px;
  resize:vertical;
}
.finance-form-actions {
  align-items:center;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  grid-column:1 / -1;
}
.finance-create-panel {
  display:grid;
  gap:12px;
}
.finance-wizard-grid {
  display:grid;
  gap:12px;
  grid-template-columns:minmax(280px,.95fr) minmax(260px,.75fr);
}
.finance-wizard-card {
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  display:grid;
  gap:10px;
  padding:12px;
}
.finance-wizard-wide {
  grid-column:1 / -1;
}
.finance-wizard-side {
  grid-column:1 / -1;
}
.finance-wizard-step {
  align-items:center;
  display:flex;
  gap:8px;
}
.finance-wizard-step b {
  align-items:center;
  background:#0f766e;
  border-radius:999px;
  color:#fff;
  display:inline-flex;
  font-size:12px;
  height:24px;
  justify-content:center;
  width:24px;
}
.finance-wizard-step span {
  color:var(--navy);
  font-size:13px;
  font-weight:900;
}
.finance-wizard-note {
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
  margin:0;
}
.finance-create-intro {
  background:#f5faf9;
  border:1px solid #cce3df;
  border-radius:8px;
  display:grid;
  gap:3px;
  padding:12px 14px;
}
.finance-create-intro strong {
  color:var(--navy);
  font-size:15px;
}
.finance-create-intro span {
  color:var(--muted);
  font-size:13px;
  line-height:1.4;
}
.finance-create-form {
  align-items:end;
  display:grid;
  gap:10px;
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.finance-create-form .form-group {
  min-width:0;
}
.finance-client-picker,
.finance-create-full,
.finance-create-actions {
  grid-column:1 / -1;
}
.finance-selected-client {
  align-items:flex-start;
  background:#f3f7f8;
  border:1px solid var(--border);
  border-radius:7px;
  color:var(--navy);
  display:flex;
  flex-direction:column;
  gap:2px;
  min-height:39px;
  padding:8px 10px;
}
.finance-selected-client.muted {
  color:var(--muted);
}
.finance-selected-client span {
  color:var(--muted);
  font-size:12px;
}
.finance-client-results {
  display:grid;
  gap:6px;
  max-height:224px;
  overflow:auto;
}
.finance-client-result {
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  color:var(--text);
  cursor:pointer;
  display:grid;
  gap:3px;
  padding:9px 10px;
  text-align:left;
  transition:background .15s ease, border-color .15s ease, transform .15s ease;
}
.finance-client-result:hover {
  background:#eef8f6;
  border-color:#9ed2cc;
  transform:translateY(-1px);
}
.finance-client-result strong {
  color:var(--navy);
  font-size:13px;
}
.finance-client-result span,
.finance-client-hint {
  color:var(--muted);
  font-size:12px;
}
.finance-client-hint {
  background:#fafafa;
  border:1px dashed var(--border);
  border-radius:8px;
  padding:10px;
}
.finance-client-hint.error {
  border-color:#f2b6b6;
  color:#9b1c1c;
}
.finance-create-actions {
  align-items:center;
  display:flex;
  gap:8px;
  justify-content:flex-end;
  padding-top:2px;
  grid-column:1 / -1;
}
.finance-create-checklist {
  display:grid;
  gap:7px;
}
.finance-create-checklist div {
  align-items:flex-start;
  border:1px solid var(--border);
  border-radius:8px;
  display:grid;
  gap:8px;
  grid-template-columns:22px minmax(0,1fr);
  padding:8px 9px;
}
.finance-create-checklist div.ok {
  background:#f2fbf6;
  border-color:#c8ead7;
}
.finance-create-checklist div.warn {
  background:#fffaf0;
  border-color:#f2d28f;
}
.finance-create-checklist b {
  align-items:center;
  border-radius:999px;
  display:inline-flex;
  font-size:11px;
  font-weight:900;
  height:20px;
  justify-content:center;
  width:20px;
}
.finance-create-checklist .ok b {
  background:#d5f0e8;
  color:#166534;
}
.finance-create-checklist .warn b {
  background:#fdeec8;
  color:#8a5100;
}
.finance-create-checklist strong,
.finance-create-checklist em {
  display:block;
}
.finance-create-checklist strong {
  color:var(--navy);
  font-size:12px;
}
.finance-create-checklist em {
  color:var(--muted);
  font-size:11px;
  font-style:normal;
  line-height:1.35;
  margin-top:2px;
}
.finance-payment-review-card {
  background:#fff;
  border:1px solid #cbdce3;
  border-radius:8px;
  box-shadow:0 8px 24px rgba(16,44,61,.08);
  margin:0 0 14px;
  overflow:hidden;
}
.finance-payment-review-head {
  align-items:flex-start;
  display:flex;
  gap:12px;
  justify-content:space-between;
  padding:12px 14px;
}
.finance-payment-review-head strong {
  color:var(--navy);
  display:block;
  font-size:15px;
}
.finance-payment-review-head span {
  color:var(--muted);
  display:block;
  font-size:12px;
  margin-top:3px;
}
.finance-payment-review-actions {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
}
.finance-payment-review-metrics {
  border-top:1px solid var(--border);
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
}
.finance-payment-review-metrics div {
  border-right:1px solid var(--border);
  padding:9px 12px;
}
.finance-payment-review-metrics div:last-child { border-right:0; }
.finance-payment-review-metrics span {
  color:var(--muted);
  display:block;
  font-size:10px;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.finance-payment-review-metrics strong {
  color:var(--navy);
  display:block;
  font-size:16px;
  margin-top:4px;
}
.finance-payment-review-table {
  border-top:1px solid var(--border);
  max-height:360px;
  overflow:auto;
}
.finance-payment-review-table table {
  margin:0;
}
.finance-payment-review-table tr.attention td {
  background:#fffaf0;
}
.finance-audit-panel-ui {
  background:#fff;
  border:1px solid #cbdce3;
  border-radius:8px;
  box-shadow:0 8px 24px rgba(16,44,61,.08);
  margin:0 0 14px;
  overflow:hidden;
}
.finance-audit-panel-ui.missing {
  border-color:#f2d28f;
}
.finance-audit-head {
  align-items:flex-start;
  border-bottom:1px solid var(--border);
  display:flex;
  gap:12px;
  justify-content:space-between;
  padding:14px;
}
.finance-audit-head strong {
  color:var(--navy);
  display:block;
  font-size:16px;
}
.finance-audit-head span,
.finance-audit-note {
  color:var(--muted);
  display:block;
  font-size:12px;
  line-height:1.45;
  margin-top:3px;
}
.finance-audit-actions {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
}
.finance-audit-warning-list {
  background:#fffaf0;
  border-bottom:1px solid #f2d28f;
  display:grid;
  gap:6px;
  padding:10px 14px;
}
.finance-audit-warning-list div {
  border-left:3px solid #f59e0b;
  color:#5c3b00;
  font-size:12px;
  line-height:1.45;
  padding-left:8px;
}
.finance-audit-metrics {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
}
.finance-audit-metric {
  border-bottom:1px solid var(--border);
  border-right:1px solid var(--border);
  min-height:86px;
  padding:11px 12px;
}
.finance-audit-metric:nth-child(4n) {
  border-right:0;
}
.finance-audit-metric span {
  color:var(--muted);
  display:block;
  font-size:10px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.finance-audit-metric strong {
  color:var(--navy);
  display:block;
  font-size:20px;
  margin-top:6px;
}
.finance-audit-metric em {
  color:var(--muted);
  display:block;
  font-size:11px;
  font-style:normal;
  line-height:1.35;
  margin-top:4px;
}
.finance-audit-ready { border-top:3px solid #0f766e; }
.finance-audit-warning { border-top:3px solid #f59e0b; }
.finance-audit-danger { border-top:3px solid #d92d20; }
.finance-audit-neutral { border-top:3px solid #7c8aa5; }
.finance-audit-critical {
  align-items:flex-start;
  background:#eef8f6;
  border-bottom:1px solid var(--border);
  display:flex;
  gap:12px;
  padding:12px 14px;
}
.finance-audit-critical strong {
  color:#00645d;
  flex:0 0 auto;
  font-size:12px;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.finance-audit-critical span {
  color:var(--navy);
  font-size:12px;
  line-height:1.45;
}
.finance-audit-tables {
  display:grid;
  gap:10px;
  padding:12px 14px;
}
.finance-audit-table {
  border:1px solid var(--border);
  border-radius:8px;
  overflow:hidden;
}
.finance-audit-table summary {
  align-items:center;
  background:#f8fbfd;
  color:var(--navy);
  cursor:pointer;
  display:flex;
  font-size:12px;
  font-weight:900;
  justify-content:space-between;
  list-style:none;
  padding:10px 12px;
}
.finance-audit-table summary::-webkit-details-marker {
  display:none;
}
.finance-audit-table summary span {
  background:#e8f1f5;
  border-radius:999px;
  color:var(--muted);
  font-size:11px;
  padding:2px 8px;
}
.finance-audit-table p {
  color:var(--muted);
  font-size:12px;
  margin:0;
  padding:12px;
}
.finance-audit-table-scroll {
  overflow:auto;
}
.finance-audit-table table {
  border-collapse:collapse;
  min-width:960px;
  width:100%;
}
.finance-audit-table th,
.finance-audit-table td {
  border-top:1px solid var(--border);
  font-size:11px;
  padding:8px 10px;
  text-align:left;
  vertical-align:top;
}
.finance-audit-table th {
  background:#fff;
  color:var(--muted);
  font-weight:900;
  text-transform:uppercase;
}
.finance-audit-note {
  padding:0 14px 14px;
}
.finance-line-section-head {
  align-items:flex-start;
  border-top:1px solid var(--border);
  display:flex;
  gap:14px;
  justify-content:space-between;
  margin-top:14px;
  padding-top:14px;
}
.finance-line-section-head .card-title {
  margin:0 0 3px;
}
.finance-line-section-head p {
  color:var(--muted);
  font-size:12px;
  line-height:1.4;
  margin:0;
}
.finance-line-editor {
  background:#f7fbfa;
  border:1px solid #bcd7d2;
  border-radius:8px;
  box-shadow:0 12px 30px rgba(16,44,61,.08);
  display:grid;
  gap:10px;
  margin:12px 0;
  padding:12px;
  scroll-margin-top:96px;
}
.finance-line-editor-head {
  align-items:flex-start;
  display:flex;
  gap:12px;
  justify-content:space-between;
}
.finance-line-editor-head strong {
  color:var(--navy);
  display:block;
  font-size:14px;
}
.finance-line-editor-head span {
  color:var(--muted);
  display:block;
  font-size:12px;
  line-height:1.4;
  margin-top:2px;
}
.finance-line-form-section {
  background:#fff;
  border:1px solid #d8e6e3;
  border-radius:8px;
  overflow:hidden;
}
.finance-line-form-section summary {
  color:#0e6f66;
  cursor:pointer;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  list-style:none;
  padding:10px 12px;
  text-transform:uppercase;
}
.finance-line-form-section summary::-webkit-details-marker {
  display:none;
}
.finance-line-form-section[open] summary {
  border-bottom:1px solid #e2eeeb;
}
.finance-line-form-grid {
  display:grid;
  gap:10px;
  grid-template-columns:repeat(3,minmax(0,1fr));
  padding:12px;
}
.finance-line-form-wide {
  grid-column:1 / -1;
}
.finance-line-lookup {
  background:#f8fbfa;
  border:1px dashed #b8d4cf;
  border-radius:8px;
  display:grid;
  gap:8px;
  padding:10px;
}
.finance-line-lookup label {
  color:#59667d;
  display:block;
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  margin-bottom:6px;
  text-transform:uppercase;
}
.finance-line-lookup small {
  color:var(--muted);
  display:block;
  font-size:11px;
  line-height:1.35;
  margin-top:5px;
}
.finance-line-lookup-actions {
  display:grid;
  gap:8px;
  grid-template-columns:minmax(0,1fr) auto;
}
.finance-line-lookup-results {
  display:grid;
  gap:6px;
}
.finance-lookup-row {
  background:#fff;
  border:1px solid #d8e6e3;
  border-radius:7px;
  cursor:pointer;
  display:grid;
  gap:3px;
  padding:8px 9px;
  text-align:left;
  transition:background .15s ease,border-color .15s ease,transform .15s ease;
}
.finance-lookup-row:hover {
  background:#eef8f6;
  border-color:#98cbc5;
  transform:translateY(-1px);
}
.finance-lookup-row strong {
  color:var(--navy);
  font-size:12px;
  line-height:1.3;
}
.finance-lookup-row span,
.finance-lookup-empty,
.finance-lookup-applied {
  color:var(--muted);
  font-size:11px;
  line-height:1.35;
}
.finance-lookup-empty,
.finance-lookup-applied {
  background:#fff;
  border:1px solid #d8e6e3;
  border-radius:7px;
  padding:8px 9px;
}
.finance-lookup-applied {
  background:#eaf8ef;
  border-color:#bde8cc;
  color:#0f6b38;
  font-weight:800;
}
.finance-lookup-empty.error {
  border-color:#f2b6b6;
  color:#9b1c1c;
}
.finance-line-editor-actions,
.finance-line-actions {
  align-items:center;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
}
.finance-line-actions {
  border-top:1px solid var(--border);
  padding:10px 12px;
}
.finance-line-list {
  display:grid;
  gap:10px;
}
.finance-line-card {
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  overflow:hidden;
}
.finance-line-card summary {
  align-items:center;
  cursor:pointer;
  display:flex;
  gap:10px;
  justify-content:space-between;
  list-style:none;
  padding:10px 12px;
}
.finance-line-card summary::-webkit-details-marker {
  display:none;
}
.finance-line-card summary span {
  color:var(--navy);
  font-size:13px;
  font-weight:800;
  line-height:1.35;
}
.finance-line-card summary strong {
  color:var(--teal);
  font-size:13px;
  white-space:nowrap;
}
.finance-line-grid {
  border-top:1px solid var(--border);
  display:grid;
  gap:8px;
  grid-template-columns:repeat(2,minmax(0,1fr));
  padding:10px 12px;
}
.finance-line-grid div {
  background:#f8fbfa;
  border:1px solid var(--border);
  border-radius:7px;
  padding:8px;
}
.finance-line-grid span,
.finance-line-notes span {
  color:var(--muted);
  display:block;
  font-size:10px;
  font-weight:800;
  letter-spacing:.06em;
  margin-bottom:4px;
  text-transform:uppercase;
}
.finance-line-grid strong {
  color:var(--navy);
  display:block;
  font-size:12px;
  line-height:1.35;
  overflow-wrap:anywhere;
}
.finance-line-notes {
  border-top:1px solid var(--border);
  display:grid;
  gap:8px;
  padding:10px 12px;
}
.finance-line-notes p {
  color:var(--text);
  font-size:12px;
  line-height:1.45;
  margin:0;
  white-space:pre-wrap;
}
.client-profile-document-section {
  margin-top:16px;
}
.client-documents-hub {
  overflow:hidden;
  padding:0;
}
.client-documents-head {
  align-items:flex-start;
  border-bottom:1px solid #dbe7ee;
  display:flex;
  gap:16px;
  justify-content:space-between;
  padding:16px 18px;
}
.client-documents-head .card-title {
  margin-bottom:5px;
}
.client-documents-head p {
  color:#53667a;
  font-size:13px;
  line-height:1.45;
  margin:0;
}
.client-documents-loading,
.client-documents-empty,
.client-document-preview-empty {
  align-items:center;
  background:#f8fbfa;
  border:1px dashed #bfced8;
  border-radius:8px;
  color:#64748b;
  display:flex;
  flex-direction:column;
  font-size:13px;
  gap:7px;
  justify-content:center;
  min-height:130px;
  padding:22px;
  text-align:center;
}
.client-documents-empty.compact {
  margin:10px;
  min-height:100px;
}
.client-document-preview-empty strong {
  color:#172033;
}
.client-document-preview-empty span {
  font-size:12px;
  line-height:1.5;
}
.client-documents-metrics {
  border-bottom:1px solid #dbe7ee;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
}
.client-documents-metrics div {
  border-right:1px solid #e4edf3;
  min-width:0;
  padding:13px 18px;
}
.client-documents-metrics div:last-child {
  border-right:0;
}
.client-documents-metrics span {
  color:#64748b;
  display:block;
  font-size:10px;
  font-weight:900;
  letter-spacing:.07em;
  margin-bottom:5px;
  text-transform:uppercase;
}
.client-documents-metrics strong {
  color:#172033;
  display:block;
  font-size:20px;
  font-weight:950;
  line-height:1;
}
.client-documents-upload-disclosure {
  border-bottom:1px solid #dbe7ee;
}
.client-documents-upload-disclosure summary {
  align-items:center;
  background:#f8fbfc;
  cursor:pointer;
  display:grid;
  gap:14px;
  grid-template-columns:minmax(0,1fr) auto;
  padding:14px 18px;
}
.client-documents-upload-disclosure summary::-webkit-details-marker {
  display:none;
}
.client-documents-upload-disclosure summary strong,
.client-documents-upload-copy strong {
  color:#172033;
  display:block;
  font-size:14px;
  font-weight:950;
  margin-bottom:4px;
}
.client-documents-upload-disclosure summary span,
.client-documents-upload-copy span {
  color:#53667a;
  display:block;
  font-size:12px;
  line-height:1.45;
}
.client-documents-upload-disclosure summary em {
  border:1px solid #cbd8e3;
  border-radius:7px;
  color:#344256;
  font-size:12px;
  font-style:normal;
  font-weight:900;
  padding:7px 10px;
}
.client-documents-upload-disclosure[open] summary em {
  background:#0f766e;
  border-color:#0f766e;
  color:#fff;
}
.client-documents-upload-panel {
  align-items:start;
  background:#fff;
  display:grid;
  gap:14px;
  grid-template-columns:220px minmax(0,1fr);
  padding:14px 18px;
}
.client-document-file-picker {
  align-items:center;
  background:#fff;
  border:1px dashed #94b8c8;
  border-radius:8px;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  gap:6px;
  justify-content:center;
  min-height:92px;
  padding:12px;
  text-align:center;
}
.client-document-file-picker input {
  display:none;
}
.client-document-file-picker span {
  background:#0f766e;
  border-radius:6px;
  color:#fff;
  display:inline-flex;
  font-size:12px;
  font-weight:900;
  line-height:1;
  padding:7px 10px;
}
.client-document-file-picker strong {
  color:#53667a;
  display:block;
  font-size:12px;
  font-weight:800;
  max-width:180px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.client-documents-upload-grid {
  align-items:end;
  display:grid;
  gap:10px;
  grid-template-columns:repeat(3,minmax(120px,1fr)) auto;
}
.client-documents-upload-grid label {
  min-width:0;
}
.client-documents-upload-grid label.wide {
  grid-column:1 / -1;
}
.client-documents-upload-grid label span {
  color:#64748b;
  display:block;
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
  margin-bottom:6px;
  text-transform:uppercase;
}
.client-documents-upload-grid input,
.client-documents-upload-grid select {
  background:#fff;
  border:1px solid #cbd8e3;
  border-radius:7px;
  color:#172033;
  font-size:13px;
  height:36px;
  min-width:0;
  padding:0 9px;
  width:100%;
}
.client-documents-upload-grid .btn {
  min-height:36px;
}
.client-documents-workbench {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(380px,42%);
  min-height:520px;
}
.client-documents-list-pane {
  border-right:1px solid #dbe7ee;
  min-width:0;
}
.client-documents-toolbar {
  border-bottom:1px solid #e4edf3;
  display:grid;
  gap:10px;
  grid-template-columns:minmax(0,1fr) 220px;
  padding:12px 14px;
}
.client-documents-search label,
.client-documents-type-filter span {
  color:#64748b;
  display:block;
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
  margin-bottom:6px;
  text-transform:uppercase;
}
.client-documents-search input,
.client-documents-type-filter select {
  background:#fff;
  border:1px solid #cbd8e3;
  border-radius:7px;
  color:#172033;
  font-size:13px;
  height:38px;
  padding:0 10px;
  width:100%;
}
.client-documents-list {
  max-height:560px;
  overflow:auto;
}
.client-document-group {
  border-bottom:1px solid #e4edf3;
}
.client-document-group summary {
  align-items:center;
  background:#f8fbfc;
  cursor:pointer;
  display:flex;
  gap:12px;
  justify-content:space-between;
  padding:12px 14px;
}
.client-document-group summary::-webkit-details-marker {
  display:none;
}
.client-document-group summary span {
  min-width:0;
}
.client-document-group summary strong,
.client-document-group summary em {
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.client-document-group summary strong {
  color:#172033;
  font-size:13px;
  font-weight:950;
}
.client-document-group summary em {
  color:#64748b;
  font-size:11px;
  font-style:normal;
  margin-top:3px;
}
.client-document-group summary b {
  background:#e7f5f2;
  border-radius:999px;
  color:#0f766e;
  font-size:12px;
  font-weight:950;
  line-height:1;
  min-width:28px;
  padding:6px 8px;
  text-align:center;
}
.client-document-group[open] summary {
  background:#eef8f5;
}
.client-document-group-list {
  background:#fff;
}
.client-document-row {
  align-items:center;
  background:#fff;
  border:0;
  border-bottom:1px solid #e8eff4;
  cursor:pointer;
  display:grid;
  gap:12px;
  grid-template-columns:24px minmax(0,1fr) 96px;
  padding:12px 14px;
  text-align:left;
  transition:background .16s;
  width:100%;
}
.client-document-row:hover,
.client-document-row.active {
  background:#edf8f6;
}
.client-document-row-main {
  min-width:0;
}
.client-document-row-main strong,
.client-document-row-main em {
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.client-document-row-main strong {
  color:#172033;
  font-size:13px;
  font-style:normal;
  font-weight:900;
  line-height:1.25;
}
.client-document-row-main em {
  color:#667085;
  font-size:12px;
  font-style:normal;
  margin-top:2px;
}
.client-document-row-main span {
  align-items:center;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:6px;
}
.client-document-row-main b {
  background:#f6fafb;
  border:1px solid #dbe7ee;
  border-radius:999px;
  color:#486171;
  display:inline-block;
  font-size:11px;
  font-weight:800;
  line-height:1;
  max-width:150px;
  overflow:hidden;
  padding:4px 7px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.client-document-row-side {
  align-items:flex-end;
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
}
.client-document-row-side i {
  border-radius:999px;
  display:block;
  font-size:11px;
  font-style:normal;
  font-weight:900;
  line-height:1;
  padding:5px 8px;
  white-space:nowrap;
}
.client-document-row-side i.ready {
  background:#dcfce7;
  border:1px solid #bbf7d0;
  color:#166534;
}
.client-document-row-side i.missing {
  background:#fff7ed;
  border:1px solid #fed7aa;
  color:#9a3412;
}
.client-document-payment-status {
  border-radius:999px;
  align-items:center;
  display:inline-flex;
  flex-wrap:wrap;
  font-size:11px;
  font-weight:900;
  gap:4px;
  justify-content:center;
  line-height:1.05;
  margin-top:5px;
  padding:5px 8px;
  white-space:nowrap;
}
.client-document-payment-status span,
.client-document-payment-status small {
  display:block;
}
.client-document-payment-status small {
  font-size:10px;
  font-weight:900;
  opacity:.78;
}
.client-document-payment-status.paid {
  background:#e6f7ed;
  border:1px solid #bfe9cf;
  color:#176742;
}
.client-document-payment-status.unpaid {
  background:#fff3e6;
  border:1px solid #ffd9ab;
  color:#9a4d00;
}
.client-document-row-side small {
  color:#64748b;
  font-size:11px;
  font-weight:850;
}
.client-document-preview {
  background:#fbfdff;
  min-width:0;
  padding:16px;
}
.client-document-preview-head {
  align-items:center;
  display:flex;
  gap:10px;
  margin-bottom:12px;
}
.client-document-preview-head div {
  min-width:0;
}
.client-document-preview-head strong,
.client-document-preview-head span {
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.client-document-preview-head strong {
  color:#172033;
  font-size:15px;
  font-weight:950;
  line-height:1.25;
}
.client-document-preview-head span {
  color:#64748b;
  font-size:12px;
  margin-top:3px;
}
.client-document-preview-actions {
  align-items:center;
  border-bottom:1px solid #dbe7ee;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:0 -16px 12px;
  padding:0 16px 12px;
}
.client-document-preview-meta {
  display:grid;
  gap:8px;
  grid-template-columns:repeat(2,minmax(0,1fr));
  margin-bottom:12px;
}
.client-document-preview-meta div {
  background:#fff;
  border:1px solid #dbe7ee;
  border-radius:7px;
  min-width:0;
  padding:9px 10px;
}
.client-document-preview-meta span {
  color:#64748b;
  display:block;
  font-size:10px;
  font-weight:900;
  letter-spacing:.07em;
  margin-bottom:5px;
  text-transform:uppercase;
}
.client-document-preview-meta strong {
  color:#172033;
  display:block;
  font-size:13px;
  font-weight:900;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.client-document-preview-stage {
  align-items:center;
  background:#eef4f5;
  border:1px solid #dbe7ee;
  border-radius:8px;
  display:flex;
  justify-content:center;
  min-height:360px;
  overflow:hidden;
  padding:12px;
}
.client-document-preview-stage img {
  background:#fff;
  border-radius:6px;
  box-shadow:0 10px 28px rgba(16,45,61,.14);
  max-height:520px;
  max-width:100%;
  object-fit:contain;
}
.client-document-preview-frame {
  background:#fff;
  border:1px solid #dbe7ee;
  border-radius:8px;
  height:520px;
  width:100%;
}
.document-table-preview {
  background:#f8fbfb;
  border:1px solid #dbe7ee;
  border-radius:8px;
  color:#52637a;
  margin-top:10px;
  min-height:180px;
  padding:12px;
  width:100%;
}
.document-table-preview > span {
  display:block;
  font-size:13px;
  font-weight:800;
  padding:54px 8px;
  text-align:center;
}
.document-table-preview-head {
  align-items:center;
  display:flex;
  flex-wrap:wrap;
  gap:8px 12px;
  justify-content:space-between;
  margin-bottom:10px;
}
.document-table-preview-head strong {
  color:#172033;
  font-size:14px;
  font-weight:950;
}
.document-table-preview-head span,
.document-table-preview-note {
  color:#64748b;
  font-size:12px;
  font-weight:750;
}
.document-table-scroll {
  background:#fff;
  border:1px solid #dbe7ee;
  border-radius:7px;
  max-height:520px;
  overflow:auto;
}
.document-table-preview-grid {
  border-collapse:separate;
  border-spacing:0;
  font-size:12px;
  min-width:720px;
  width:100%;
}
.document-table-preview-grid th,
.document-table-preview-grid td {
  border-bottom:1px solid #e4edf3;
  border-right:1px solid #e4edf3;
  max-width:260px;
  min-width:92px;
  padding:7px 9px;
  text-align:left;
  vertical-align:top;
  white-space:nowrap;
}
.document-table-preview-grid th {
  background:#eaf5f1;
  color:#163f36;
  font-size:11px;
  font-weight:950;
  position:sticky;
  top:0;
  z-index:1;
}
.document-table-preview-grid tr:nth-child(even) td {
  background:#fbfdfd;
}
.document-table-preview-grid td {
  color:#172033;
}
.drive-preview-placeholder.compact {
  min-height:110px;
  padding:24px;
}

/* ── Document Drive ── */
.document-drive-hdr {
  align-items:flex-start;
}
.document-drive-actions {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.drive-summary-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:12px;
  margin-bottom:16px;
}
.drive-toolbar {
  align-items:end;
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  box-shadow:var(--shadow-sm);
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-bottom:16px;
  padding:14px;
}
.drive-search {
  flex:1 1 320px;
  min-width:240px;
}
.drive-shell {
  align-items:start;
  display:grid;
  gap:16px;
  grid-template-columns:250px minmax(0,1.05fr) minmax(430px,.95fr);
}
.drive-folder-rail,
.drive-main,
.drive-preview-card {
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  box-shadow:var(--shadow-sm);
}
.drive-folder-rail {
  padding:14px;
  position:sticky;
  top:68px;
}
.drive-rail-title,
.drive-preview-title {
  color:var(--navy);
  font-size:12px;
  font-weight:850;
  letter-spacing:.08em;
  margin-bottom:10px;
  text-transform:uppercase;
}
.drive-folder-btn {
  align-items:center;
  background:#fff;
  border:1px solid transparent;
  border-radius:7px;
  color:var(--text);
  cursor:pointer;
  display:grid;
  gap:8px;
  grid-template-columns:18px minmax(0,1fr) auto;
  min-height:38px;
  padding:8px 9px;
  text-align:left;
  transition:background .16s,border-color .16s,color .16s;
  width:100%;
}
.drive-folder-btn + .drive-folder-btn,
#drive-folder-list .drive-folder-btn:first-child {
  margin-top:4px;
}
.drive-folder-btn span:nth-child(2) {
  font-size:13px;
  font-weight:700;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.drive-folder-btn strong {
  color:var(--muted);
  font-size:12px;
}
.drive-folder-btn em {
  background:#fff4e2;
  border:1px solid #f7c56e;
  border-radius:999px;
  color:#a45a00;
  font-size:10px;
  font-style:normal;
  font-weight:850;
  grid-column:3;
  justify-self:end;
  line-height:1;
  margin-top:-2px;
  padding:3px 5px;
}
.drive-folder-btn:hover,
.drive-folder-btn.active {
  background:#edf8f6;
  border-color:#a7d9d4;
  color:var(--teal2);
}
.drive-folder-icon,
.drive-file-icon {
  display:inline-block;
  flex:0 0 auto;
  position:relative;
}
.drive-folder-icon {
  background:#e8f3f2;
  border:1.5px solid #75bfb8;
  border-radius:3px;
  height:13px;
  width:17px;
}
.drive-folder-icon::before {
  background:#e8f3f2;
  border:1.5px solid #75bfb8;
  border-bottom:0;
  border-radius:3px 3px 0 0;
  content:'';
  height:5px;
  left:1px;
  position:absolute;
  top:-5px;
  width:8px;
}
.drive-file-icon {
  background:#f7fbfb;
  border:1.5px solid #8fb7c6;
  border-radius:3px;
  height:24px;
  width:19px;
}
.drive-file-icon::after {
  border-left:6px solid transparent;
  border-top:6px solid #cfe2e8;
  content:'';
  position:absolute;
  right:-1px;
  top:-1px;
}
.drive-file-icon.pending {
  background:#fff9ef;
  border-color:#f2b454;
}
.drive-file-icon.pending::after {
  border-top-color:#f7d59c;
}
.drive-main {
  overflow:hidden;
}
.drive-main-head {
  align-items:center;
  border-bottom:1px solid var(--border);
  display:flex;
  justify-content:space-between;
  padding:14px 16px;
}
.drive-main-head h3 {
  color:var(--navy);
  font-size:18px;
  margin:0 0 3px;
}
.drive-main-head p {
  color:var(--muted);
  font-size:12px;
}
.drive-bulk-actions {
  align-items:center;
  background:#f8fbfc;
  border-bottom:1px solid var(--border);
  display:flex;
  gap:12px;
  justify-content:space-between;
  min-height:48px;
  padding:10px 16px;
}
.drive-bulk-copy {
  align-items:baseline;
  display:flex;
  gap:7px;
  min-width:0;
}
.drive-bulk-copy strong {
  color:var(--teal2);
  font-size:20px;
  font-weight:950;
  line-height:1;
}
.drive-bulk-copy span {
  color:#53667a;
  font-size:12px;
  font-weight:800;
}
.drive-pagination {
  align-items:center;
  background:#ffffff;
  border-bottom:1px solid var(--border);
  display:flex;
  gap:12px;
  justify-content:space-between;
  min-height:48px;
  padding:10px 16px;
}
.drive-pagination-bottom {
  border-bottom:0;
  border-top:1px solid var(--border);
}
.drive-pagination-info {
  align-items:baseline;
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  min-width:0;
}
.drive-pagination-info strong {
  color:var(--navy);
  font-size:15px;
  font-weight:950;
}
.drive-pagination-info span,
.drive-pagination-info em {
  color:#53667a;
  font-size:12px;
  font-style:normal;
  font-weight:800;
}
.drive-pagination-actions {
  align-items:center;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
}
.drive-bulk-buttons {
  align-items:center;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
}
.drive-table-wrap {
  border:0;
  border-radius:0;
  overflow-x:auto;
}
.drive-table {
  min-width:760px;
  table-layout:fixed;
  width:100%;
}
.drive-table th:nth-child(1),
.drive-table td:nth-child(1) {
  width:42px;
}
.drive-table th:nth-child(2),
.drive-table td:nth-child(2) {
  width:43%;
}
.drive-table th:nth-child(3),
.drive-table td:nth-child(3) {
  width:25%;
}
.drive-table th:nth-child(4),
.drive-table td:nth-child(4) {
  width:17%;
}
.drive-table th:nth-child(5),
.drive-table td:nth-child(5) {
  width:10%;
}
.drive-table th {
  background:#17445f;
  color:#fff;
}
.drive-table td {
  overflow:hidden;
  padding:13px 12px;
  vertical-align:middle;
}
.drive-row-active {
  background:#edf8f6 !important;
}
.drive-row-selected {
  background:#e7f5f2 !important;
}
.drive-select-cell {
  text-align:center;
}
.drive-select-check {
  accent-color:#0f766e;
  cursor:pointer;
  height:16px;
  width:16px;
}
.drive-select-check:disabled {
  cursor:not-allowed;
  opacity:.42;
}
.drive-doc-name {
  align-items:center;
  display:flex;
  gap:10px;
  min-width:0;
}
.drive-doc-name > div {
  min-width:0;
}
.drive-doc-name strong {
  color:var(--navy);
  display:block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.drive-doc-name .client-meta {
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.drive-path {
  color:#486171;
  display:block;
  font-size:12px;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.drive-client-ref {
  display:flex;
  flex-direction:column;
  gap:3px;
  min-width:0;
}
.drive-client-ref strong {
  color:var(--navy);
  font-size:13px;
  line-height:1.25;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.drive-client-ref span {
  color:#51697b;
  font-size:12px;
}
.drive-client-ref em {
  color:var(--teal2);
  display:block;
  font-size:12px;
  font-style:normal;
  font-weight:800;
  line-height:1.25;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.drive-client-ref small {
  color:#667085;
  display:block;
  font-size:11px;
  font-weight:750;
  line-height:1.25;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.drive-payment-inline {
  align-self:flex-start;
  border-radius:999px;
  display:inline-flex;
  font-size:11px;
  font-weight:950;
  line-height:1;
  margin-top:3px;
  padding:5px 8px;
  white-space:nowrap;
}
.drive-payment-inline.paid {
  background:#e6f7ed;
  border:1px solid #bfe9cf;
  color:#176742;
}
.drive-payment-inline.unpaid {
  background:#fff3e6;
  border:1px solid #ffd9ab;
  color:#9a4d00;
}
.drive-preview-card {
  max-height:calc(100vh - 88px);
  overflow:auto;
  padding:16px;
  position:sticky;
  top:68px;
}
.drive-empty,
.drive-preview-placeholder {
  align-items:center;
  background:#f8fbfa;
  border:1px dashed #bfd0d8;
  border-radius:8px;
  color:var(--muted);
  display:flex;
  flex-direction:column;
  gap:7px;
  justify-content:center;
  min-height:180px;
  padding:22px;
  text-align:center;
}
.drive-preview-placeholder strong {
  color:var(--navy);
}
.drive-preview-placeholder span {
  font-size:12px;
  line-height:1.5;
}
.drive-preview-head {
  align-items:center;
  display:flex;
  gap:10px;
  margin-bottom:12px;
}
.drive-preview-head strong {
  color:var(--navy);
  display:block;
  line-height:1.25;
}
.drive-preview-toolbar {
  align-items:center;
  border-bottom:1px solid var(--border);
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:0 -16px 12px;
  padding:0 16px 12px;
}
.drive-preview-toolbar .btn {
  text-decoration:none;
}
.drive-preview-meta {
  display:grid;
  gap:8px;
  grid-template-columns:repeat(2,minmax(0,1fr));
  margin-bottom:12px;
}
.drive-preview-meta div {
  background:#f8fbfa;
  border:1px solid var(--border);
  border-radius:7px;
  padding:8px;
}
.drive-preview-meta span {
  color:var(--muted);
  display:block;
  font-size:10px;
  font-weight:800;
  letter-spacing:.06em;
  margin-bottom:4px;
  text-transform:uppercase;
}
.drive-preview-meta strong {
  color:var(--navy);
  display:block;
  font-size:12px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.drive-preview-frame {
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  height:540px;
  margin-bottom:12px;
  width:100%;
}
.drive-preview-stage {
  align-items:center;
  background:#eef4f5;
  border:1px solid var(--border);
  border-radius:8px;
  display:flex;
  justify-content:center;
  margin-bottom:12px;
  min-height:420px;
  overflow:hidden;
  padding:12px;
}
.drive-image-preview {
  background:#fff;
  border-radius:6px;
  box-shadow:0 10px 28px rgba(16,45,61,.14);
  max-height:560px;
  max-width:100%;
  object-fit:contain;
}
.drive-edit-form {
  border-top:1px solid var(--border);
  display:grid;
  gap:10px;
  grid-template-columns:repeat(2,minmax(0,1fr));
  margin-top:12px;
  padding-top:12px;
}
.drive-edit-form .form-group {
  min-width:0;
}
.drive-edit-path,
.drive-edit-notes {
  grid-column:1 / -1;
}
.drive-edit-notes textarea {
  min-height:58px;
  resize:vertical;
}

@media(max-width:1320px) {
  .budget-service-row {
    grid-template-columns: minmax(240px, 1fr) minmax(280px, 1fr);
  }
  .budget-service-edit {
    grid-column: 1 / -1;
  }
  .budget-service-actions {
    align-items: flex-start;
    flex-direction: row;
  }
}

@media (max-width:1000px) {
  .finance-layout {
    grid-template-columns:1fr;
  }
  .finance-detail-card { max-height:none; position:static; }
  .finance-maintenance-form,
  .finance-create-form,
  .finance-wizard-grid { grid-template-columns:1fr; }
  .finance-audit-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .finance-audit-metric:nth-child(4n) { border-right:1px solid var(--border); }
  .finance-audit-metric:nth-child(2n) { border-right:0; }
  .finance-audit-head,
  .finance-audit-critical {
    flex-direction:column;
  }
  .finance-payment-review-metrics,
  .finance-validation-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .drive-shell { grid-template-columns:1fr; }
  .provider-compliance-summary,
  .provider-compliance-layout,
  .provider-compliance-upload-grid {
    grid-template-columns:1fr;
  }
  .provider-compliance-upload-grid .textarea-wide {
    grid-column:auto;
  }
  .provider-compliance-check {
    grid-template-columns:1fr;
  }
  .provider-compliance-check-controls {
    grid-template-columns:1fr;
  }
  .provider-master-upload {
    grid-template-columns:1fr;
  }
  .drive-folder-rail,
  .drive-preview-card { max-height:none; position:static; }
  .drive-folder-rail { display:block; }
  .drive-preview-frame { height:320px; }
  .drive-bulk-actions {
    align-items:flex-start;
    flex-direction:column;
  }
  .drive-pagination {
    align-items:flex-start;
    flex-direction:column;
  }
  .drive-pagination-actions {
    justify-content:flex-start;
    width:100%;
  }
  .drive-bulk-buttons {
    justify-content:flex-start;
    width:100%;
  }
  .client-documents-upload-panel {
    grid-template-columns:1fr;
  }
  .client-documents-toolbar {
    grid-template-columns:1fr;
  }
  .client-document-file-picker {
    min-height:86px;
  }
  .client-documents-upload-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .client-documents-upload-grid label.wide {
    grid-column:1 / -1;
  }
  .client-documents-upload-grid .btn {
    grid-column:1 / -1;
  }
  .client-documents-workbench { grid-template-columns:1fr; }
  .client-documents-list-pane { border-right:0; }
  .client-document-preview { border-top:1px solid #dbe7ee; }
  .client-document-preview-frame { height:360px; }
	  .statement-section-title-actions,
	  .statement-section-actions,
	  .statement-preview-accordion > summary,
	  .statement-accordion-action-row {
	    align-items: stretch;
	    flex-direction: column;
	  }
  .statement-section-actions .btn {
    width: 100%;
  }
  .statement-review-layout-frame-wrap {
    height: 620px;
    min-height: 460px;
  }
}

@media(max-width:760px) {
  .statementx-control-panel,
  .statementx-decision-panel,
  .statementx-simple-cards,
  .statementx-summary-grid,
  .statementx-layout,
  .statementx-proda-grid,
  .statementx-upload-main,
  .statementx-source-rules,
  .statementx-upload-result-grid,
  .statementx-readiness-grid,
  .statementx-readiness-explain,
  .statementx-readiness-client,
  .statementx-readiness-client-numbers,
  .statementx-ledger-metrics,
  .statementx-ledger-grid,
  .statementx-continuity-note,
  .statementx-resolution-metrics,
  .statementx-trace-metrics,
  .statementx-freeze-banner {
    grid-template-columns:1fr;
  }
  .statementx-section-head,
  .statementx-trace-head,
  .statementx-file-row {
    align-items:flex-start;
    flex-direction:column;
  }
  .statementx-trace-details summary {
    align-items:flex-start;
    flex-wrap:wrap;
  }
  .statementx-decision-main h3 {
    font-size:22px;
  }
  .statementx-plain-note {
    align-items:flex-start;
    flex-direction:column;
  }
  .statementx-disclosure-card > summary {
    align-items:flex-start;
    flex-wrap:wrap;
  }
  .statementx-disclosure-card > summary em {
    margin-left:28px;
  }
  .statementx-readiness-lead,
  .statementx-readiness-note {
    align-items:flex-start;
    flex-direction:column;
  }
  .statementx-readiness-bucket summary,
  .statementx-readiness-issues summary {
    align-items:flex-start;
    flex-wrap:wrap;
  }
  .statementx-readiness-bucket summary em,
  .statementx-readiness-issues summary small {
    margin-left:24px;
    width:100%;
  }
  .statementx-trace-details summary small {
    margin-left:24px;
    width:100%;
  }
  .statementx-source-rules div,
  .statementx-upload-result-grid div {
    border-right:0;
    border-bottom:1px solid var(--border);
  }
  .statementx-source-rules div:last-child,
  .statementx-upload-result-grid div:last-child {
    border-bottom:0;
  }
  .statementx-hdr .page-actions .btn {
    width:100%;
  }
  .finance-header-actions,
  .document-drive-hdr,
  .document-drive-actions,
  .drive-toolbar {
    align-items:flex-start;
    flex-direction:column;
  }
  .finance-header-actions .btn,
  .finance-header-actions input,
  .finance-filter-panel,
  .drive-search,
  .drive-toolbar .statement-control,
  .drive-toolbar .btn {
    width:100%;
  }
  .finance-filter-panel {
    grid-template-columns:1fr !important;
  }
  .drive-preview-meta,
  .drive-edit-form,
  .finance-line-grid,
  .finance-line-form-grid,
  .finance-payment-review-metrics,
  .finance-validation-metrics,
  .client-documents-metrics,
  .client-document-preview-meta {
    grid-template-columns:1fr;
  }
  .finance-line-section-head,
  .finance-line-editor-head {
    align-items:stretch;
    flex-direction:column;
  }
  .finance-line-section-head .btn,
  .finance-line-editor-head .btn {
    width:100%;
  }
  .finance-line-lookup-actions {
    grid-template-columns:1fr;
  }
  .client-documents-head {
    align-items:flex-start;
    flex-direction:column;
  }
  .client-documents-head .btn {
    width:100%;
  }
  .client-documents-metrics div {
    border-right:0;
    border-bottom:1px solid #e4edf3;
  }
  .client-documents-metrics div:last-child {
    border-bottom:0;
  }
  .client-document-row {
    grid-template-columns:24px minmax(0,1fr);
  }
  .client-documents-upload-grid {
    grid-template-columns:1fr;
  }
  .client-documents-upload-grid label.wide {
    grid-column:auto;
  }
  .client-document-row-side {
    align-items:flex-start;
    flex-direction:row;
    grid-column:2;
  }
  .drive-doc-name strong,
  .drive-path {
    max-width:180px;
  }
  .drive-bulk-buttons .btn {
    flex:1 1 100%;
  }
  .email-template-hero,
  .email-template-actions {
    align-items:flex-start;
    flex-direction:column;
  }
  .email-template-hero img {
    height:auto;
    max-width:220px;
    width:72vw;
  }
  .email-template-layout,
  .email-template-editor-grid,
  .email-send-grid {
    grid-template-columns:1fr;
  }
  .email-send-preview-panel {
    position:static;
  }
  .email-template-row {
    align-items:flex-start;
    flex-direction:column;
  }
  .email-template-row-meta {
    align-items:flex-start;
    flex-direction:row;
    flex-wrap:wrap;
  }
  .email-preview-brand {
    align-items:flex-start;
    flex-direction:column;
  }
  .email-preview-paper {
    padding:18px;
  }
  .budget-service-planner-head {
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }
  .budget-service-planner-actions {
    align-items: stretch;
  }
  .budget-service-row {
    grid-template-columns: 1fr;
    padding: 14px;
  }
  .budget-service-money {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .budget-service-edit {
    grid-template-columns: 1fr 1fr;
  }
  .budget-service-edit label:last-child {
    grid-column: 1 / -1;
  }
  .budget-service-actions {
    flex-direction: column;
  }
  .budget-service-actions .btn {
    width: 100%;
  }
}

@media(max-width:520px) {
  .budget-service-money,
  .budget-service-edit {
    grid-template-columns: 1fr;
  }
  .budget-service-edit label:last-child {
    grid-column: auto;
  }
}

/* ── Global collapsible affordance ─────────────────────────────────────── */
details > summary {
  list-style: none;
}
details > summary::-webkit-details-marker {
  display: none;
}
details > summary::marker {
  content: "";
}
details:not(.form-section):not(.client-profile-info-section):not(.statementx-disclosure-card):not(.statementx-readiness-bucket):not(.statementx-readiness-issues):not(.statementx-trace-details) > summary::before {
  border: solid var(--teal);
  border-width: 0 2px 2px 0;
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  height: 8px;
  margin-right: 2px;
  transform: rotate(-45deg);
  transition: transform .16s ease, border-color .16s ease;
  width: 8px;
}
details:not(.form-section):not(.client-profile-info-section):not(.statementx-disclosure-card):not(.statementx-readiness-bucket):not(.statementx-readiness-issues):not(.statementx-trace-details)[open] > summary::before {
  transform: rotate(45deg);
}
details:not(.form-section):not(.client-profile-info-section):not(.statementx-disclosure-card):not(.statementx-readiness-bucket):not(.statementx-readiness-issues):not(.statementx-trace-details) > summary:hover::before {
  border-color: var(--teal2);
}
.statementx-disclosure-card > summary::before,
.statementx-readiness-bucket > summary::before,
.statementx-readiness-issues > summary::before,
.statementx-trace-details > summary::before {
  content:none;
  display:none;
}
.form-section summary,
.zoho-preview summary {
  align-items: center;
  display: flex;
  gap: 10px;
}
.statement-review-accordion summary::after {
  content: none !important;
}
.statement-data-check-panel > summary strong,
.client-document-group summary span {
  flex: 1 1 auto;
  min-width: 0;
}
.client-documents-upload-disclosure summary {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.statement-engine-head::before {
  border: solid var(--teal);
  border-width: 0 2px 2px 0;
  content: "";
  flex: 0 0 auto;
  height: 9px;
  transform: rotate(45deg);
  transition: transform .16s ease, border-color .16s ease;
  width: 9px;
}
.statement-engine-shell.collapsed .statement-engine-head::before {
  transform: rotate(-45deg);
}

/* ── Statement per-month notes ─────────────────────────────────────────── */
.statement-notes-panel {
  background: #fffaf0;
  border: 1px solid #f0d492;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
}
.statement-notes-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.statement-notes-head strong,
.statement-note-new label {
  color: #5f4111;
  display: block;
  font-weight: 700;
}
.statement-notes-head span,
.statement-note-help,
.statement-note-empty,
.statement-note-row-head span {
  color: #816431;
  font-size: 12px;
}
.statement-note-row,
.statement-note-new {
  background: #fff;
  border: 1px solid #ead8ad;
  border-radius: 6px;
  display: grid;
  gap: 8px;
  padding: 10px;
}
.statement-note-row-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
.statement-note-row textarea,
.statement-note-new textarea {
  border: 1px solid #d8c9a5;
  border-radius: 6px;
  font: inherit;
  min-height: 54px;
  padding: 8px;
  resize: vertical;
  width: 100%;
}
.statement-note-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.statement-note-actions select {
  border: 1px solid #d8c9a5;
  border-radius: 6px;
  padding: 6px 8px;
}
.statement-note-actions .danger {
  color: #b42318;
}

/* Provider public registration and compliance link */
.app-hidden { display:none !important; }
.provider-public-mode { background:#eef4f7; }
.provider-public-page { padding:72px 18px 42px; min-height:100vh; }
.provider-public-shell { width:min(1120px, 100%); margin:0 auto; }
.provider-public-hero,
.provider-public-card {
  background:#fff;
  border:1px solid #cfe0eb;
  border-radius:10px;
  box-shadow:0 18px 40px rgba(16,36,58,.08);
}
.provider-public-hero { align-items:center; display:flex; gap:22px; margin-bottom:18px; padding:24px; }
.provider-public-hero img { max-width:34vw; object-fit:contain; width:190px; }
.provider-public-hero span,
.provider-public-card h2 { color:#00796b; font-weight:900; letter-spacing:.12em; text-transform:uppercase; }
.provider-public-hero h1 { font-size:30px; margin:4px 0 8px; }
.provider-public-hero p,
.provider-public-card p,
.provider-public-callout { color:#50617a; }
.provider-public-form { display:grid; gap:16px; }
.provider-public-card { padding:22px; }
.provider-public-card.error,
.provider-public-card.success { margin:80px auto; max-width:720px; }
.provider-public-card-head { align-items:flex-start; display:flex; gap:16px; justify-content:space-between; margin-bottom:14px; }
.provider-public-grid { display:grid; gap:14px; grid-template-columns:repeat(2, minmax(0, 1fr)); }
.provider-public-grid label {
  color:#61708a;
  display:grid;
  font-size:12px;
  font-weight:900;
  gap:6px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.provider-public-grid label.wide { grid-column:1/-1; }
.provider-public-grid input,
.provider-public-grid select,
.provider-public-grid textarea {
  border:1px solid #c8d8e6;
  border-radius:8px;
  color:#16243a;
  font-size:14px;
  font-weight:600;
  letter-spacing:0;
  padding:12px;
  text-transform:none;
  width:100%;
}
.provider-public-grid select {
  background:#fff;
  min-height:44px;
}
.provider-public-requirements { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 16px; }
.provider-public-requirements span {
  background:#effaf4;
  border:1px solid #b9ebcc;
  border-radius:999px;
  color:#096b3f;
  font-size:12px;
  font-weight:800;
  padding:7px 10px;
}
.provider-public-callout {
  background:#f7fbfc;
  border:1px dashed #b6ccdb;
  border-radius:8px;
  font-size:13px;
  font-weight:700;
  margin-top:14px;
  padding:12px;
}
.provider-public-callout-strong {
  background:#eefaf7;
  border-color:#a8e2d8;
  color:#125f56;
  font-size:14px;
}
.provider-public-service-list {
  display:grid;
  gap:8px;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  margin-top:14px;
}
.provider-public-check-option {
  align-items:flex-start;
  background:#f7fbfc;
  border:1px solid #d8e6ef;
  border-radius:8px;
  cursor:pointer;
  display:flex;
  gap:9px;
  min-height:48px;
  padding:10px;
}
.provider-public-check-option:hover {
  background:#eefaf7;
  border-color:#9edbd1;
}
.provider-public-check-option input,
.provider-public-terms input,
.provider-public-radio-options input {
  flex:0 0 auto;
  margin-top:3px;
}
.provider-public-check-option span {
  color:#17253a;
  font-size:13px;
  font-weight:700;
  line-height:1.35;
}
.provider-public-check-option strong {
  background:#e6f3f1;
  border-radius:999px;
  color:#006f65;
  display:inline-block;
  font-size:11px;
  margin-right:7px;
  padding:2px 7px;
}
.provider-public-file-grid {
  display:grid;
  gap:12px;
  grid-template-columns:repeat(2, minmax(0, 1fr));
}
.provider-public-file-field {
  background:#f7fbfc;
  border:1px solid #d8e6ef;
  border-radius:8px;
  display:grid;
  gap:6px;
  padding:12px;
}
.provider-public-file-field span,
.provider-public-radio-group legend {
  color:#61708a;
  font-size:12px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.provider-public-file-field small,
.provider-public-radio-group p {
  color:#61708a;
  font-size:12px;
  font-weight:700;
  letter-spacing:0;
  line-height:1.35;
  margin:0;
  text-transform:none;
}
.provider-public-radio-group {
  border:1px solid #d8e6ef;
  border-radius:8px;
  margin:0;
  padding:12px;
}
.provider-public-radio-options {
  display:flex;
  flex-wrap:wrap;
  gap:8px 14px;
  margin-top:8px;
}
.provider-public-radio-options label {
  align-items:center;
  color:#16243a;
  display:flex;
  font-size:13px;
  font-weight:800;
  gap:6px;
  letter-spacing:0;
  text-transform:none;
}
.provider-public-terms {
  align-items:flex-start;
  background:#f7fbfc;
  border:1px solid #d8e6ef;
  border-radius:8px;
  color:#16243a;
  display:flex;
  font-size:14px;
  font-weight:700;
  gap:10px;
  line-height:1.45;
  margin-top:12px;
  padding:13px;
}
.provider-signature-grid { display:grid; gap:14px; grid-template-columns:repeat(2, minmax(0, 1fr)); margin-top:14px; }
.provider-signature-block { border:1px solid #cfe0eb; border-radius:10px; padding:12px; }
.provider-signature-head { align-items:center; display:flex; gap:12px; justify-content:space-between; margin-bottom:10px; }
.provider-signature-block canvas {
  background:#fff;
  border:1px solid #c8d8e6;
  border-radius:8px;
  height:170px;
  touch-action:none;
  width:100%;
}
.provider-public-actions { display:flex; justify-content:flex-end; padding-bottom:22px; }
.provider-registration-panel { display:grid; gap:10px; }
.provider-registration-actions { display:flex; flex-wrap:wrap; gap:8px; }
.provider-registration-url {
  border:1px solid #c8d8e6;
  border-radius:8px;
  color:#0f766e;
  font-weight:800;
  padding:10px 12px;
  width:100%;
}
.provider-registration-empty {
  background:#f7fbfc;
  border:1px dashed #c8d8e6;
  border-radius:8px;
  color:#50617a;
  font-size:13px;
  font-weight:700;
  padding:10px 12px;
}
.provider-registration-link-row,
.provider-registration-submission {
  align-items:center;
  background:#f7fbfc;
  border:1px solid #d9e7f0;
  border-radius:8px;
  display:flex;
  gap:10px;
  justify-content:space-between;
  padding:10px;
}
.provider-registration-link-row span,
.provider-registration-submission span { color:#61708a; display:block; font-size:12px; font-weight:700; }

/* Provider UI polish - 2026-05-20
   Provider profile and compliance are daily work surfaces, so the UI should read
   like a clean operating table rather than a dark admin grid. */
.provider-profile-modal,
.provider-compliance-modal {
  width:min(96vw, 1360px);
}
.provider-profile-modal .modal-body,
.provider-compliance-modal .modal-body {
  background:#f6f9fb;
  padding:18px;
}
.provider-profile-modal .modal-footer,
.provider-compliance-modal .modal-footer {
  background:#fff;
  border-top:1px solid #d8e4ec;
}
.provider-profile-head {
  align-items:flex-end;
  background:#fff;
  border:1px solid #d8e5ec;
  border-radius:10px;
  display:grid;
  gap:14px;
  grid-template-columns:minmax(320px,1fr) minmax(180px,220px) auto;
  margin-bottom:12px;
  padding:14px;
}
.provider-profile-head .form-group,
.provider-profile-head .provider-profile-actions {
  min-width:0;
}
.provider-profile-head input,
.provider-profile-section input,
.provider-profile-section select,
.provider-profile-section textarea {
  background:#fff;
}
.provider-profile-hint {
  background:#edf8f5;
  border-color:#c4e4dc;
  color:#155e54;
  font-weight:750;
}
.provider-profile-section {
  background:#fff;
  border:1px solid #d8e5ec;
  border-radius:10px;
}
.provider-profile-section summary {
  background:#f7fbfc;
  border-bottom:1px solid transparent;
  color:#14253a;
  min-height:44px;
}
.provider-profile-section[open] summary {
  border-bottom-color:#e4edf3;
}
.provider-profile-section .form-grid {
  gap:12px;
}
.provider-service-editor-head {
  align-items:flex-end;
  background:#fff;
  border:1px solid #d8e5ec;
  border-bottom:0;
  border-radius:10px 10px 0 0;
  display:flex;
  gap:16px;
  justify-content:space-between;
  margin-top:14px;
  padding:14px 16px;
}
.provider-service-editor-head h4 {
  color:#14253a;
  font-size:16px;
  font-weight:900;
  margin:0 0 4px;
}
.provider-service-editor-head p {
  color:#52627a;
  font-size:13px;
  font-weight:650;
  line-height:1.4;
  margin:0;
}
.provider-service-editor-head span {
  background:#e9f5f3;
  border:1px solid #c5dfda;
  border-radius:999px;
  color:#087267;
  flex:0 0 auto;
  font-size:12px;
  font-weight:850;
  padding:7px 10px;
}
.provider-service-editor-wrap {
  background:#fff;
  border:1px solid #d8e5ec;
  border-radius:0 0 10px 10px;
  max-height:60vh;
  overflow:auto;
}
.provider-service-editor {
  border-collapse:separate;
  border-spacing:0;
  min-width:1240px;
  table-layout:fixed;
  width:100%;
}
.provider-service-editor thead tr {
  background:#eaf5f3;
}
.provider-service-editor thead th {
  background:#eaf5f3;
  border-bottom:1px solid #c7ddd8;
  color:#24413f;
  font-size:11px;
  font-weight:900;
  letter-spacing:.07em;
  padding:10px 10px;
  text-align:left;
  text-transform:uppercase;
  white-space:nowrap;
}
.provider-service-editor thead th:nth-child(1) { width:230px; }
.provider-service-editor thead th:nth-child(2) { width:70px; }
.provider-service-editor thead th:nth-child(3) { width:78px; }
.provider-service-editor thead th:nth-child(4) { width:118px; }
.provider-service-editor thead th:nth-child(5) { width:100px; }
.provider-service-editor thead th:nth-child(6) { width:72px; }
.provider-service-editor thead th:nth-child(7),
.provider-service-editor thead th:nth-child(8) { width:108px; }
.provider-service-editor thead th:nth-child(9) { width:118px; }
.provider-service-editor thead th:nth-child(10) { width:100px; }
.provider-service-editor thead th:nth-child(11) { width:140px; }
.provider-service-editor thead th:nth-child(12) { width:104px; }
.provider-service-editor tbody tr {
  background:#fff;
}
.provider-service-editor tbody tr:nth-child(even) {
  background:#fbfdfe;
}
.provider-service-editor tbody tr:hover {
  background:#f2faf8;
}
.provider-service-editor td {
  border-bottom:1px solid #e2ebf1;
  color:#17263b;
  padding:10px;
  vertical-align:top;
}
.provider-service-editor input,
.provider-service-editor select,
.provider-service-editor textarea {
  background:#fff;
  border:1px solid #cbdbe6;
  border-radius:7px;
  color:#132236;
  font:inherit;
  min-height:36px;
  padding:8px 9px;
  width:100%;
}
.provider-service-editor input:focus,
.provider-service-editor select:focus,
.provider-service-editor textarea:focus,
.provider-compliance-card input:focus,
.provider-compliance-card select:focus {
  border-color:#0d8b7e;
  box-shadow:0 0 0 3px rgba(13,139,126,.12);
  outline:0;
}
.provider-service-editor textarea {
  line-height:1.35;
  min-height:36px;
  resize:vertical;
}
.provider-service-editor .service-id-input {
  min-width:0;
}
.provider-service-editor .provider-service-id {
  color:#52627a;
  font-size:12px;
  font-weight:650;
  line-height:1.35;
  margin-top:6px;
}
.provider-service-editor .loaded-rate {
  background:#edf4f8;
  border-color:#c9dae5;
  color:#132236;
  font-weight:900;
}
.provider-row-actions {
  text-align:right;
}
.provider-row-actions .btn {
  min-height:36px;
  white-space:nowrap;
}
.provider-compliance-modal {
  width:min(96vw, 1360px);
}
.provider-compliance-modal .modal-body {
  max-height:calc(92vh - 126px);
}
.provider-compliance-summary {
  gap:12px;
  grid-template-columns:repeat(4,minmax(160px,1fr));
  margin-bottom:14px;
}
.provider-compliance-summary div {
  background:#fff;
  border:1px solid #d8e5ec;
  border-radius:10px;
  padding:14px;
}
.provider-compliance-summary div.warn {
  background:#fff8f4;
  border-color:#f0b6a9;
}
.provider-compliance-summary span,
.provider-compliance-summary em {
  color:#607088;
  letter-spacing:.07em;
}
.provider-compliance-layout {
  align-items:start;
  display:grid;
  gap:16px;
  grid-template-columns:minmax(0,1fr) minmax(380px,420px);
}
.provider-compliance-card {
  background:#fff;
  border:1px solid #d8e5ec;
  border-radius:10px;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
  overflow:hidden;
  padding:16px;
}
.provider-compliance-card .section-title-row {
  align-items:flex-start;
  border-bottom:1px solid #e5eef4;
  margin:-16px -16px 14px;
  padding:16px;
}
.provider-compliance-card h4 {
  color:#14253a;
  font-size:17px;
  font-weight:900;
  line-height:1.35;
}
.provider-compliance-card h5 {
  background:#eaf5f3;
  border-color:#c7ddd8;
  color:#0b6f64;
  font-weight:900;
}
.provider-compliance-check {
  background:#fff;
  border:1px solid #d8e5ec;
  border-radius:10px;
  display:grid;
  gap:12px;
  grid-template-columns:1fr;
  margin-bottom:10px;
  padding:12px;
}
.provider-compliance-check-main strong {
  color:#14253a;
  font-size:14px;
  line-height:1.35;
}
.provider-compliance-check-main span {
  color:#607088;
  font-size:12px;
}
.provider-compliance-check-controls {
  align-items:center;
  display:grid;
  gap:8px;
  grid-template-columns:96px 132px 138px minmax(150px,1fr) 72px;
}
.provider-compliance-check-controls input,
.provider-compliance-check-controls select,
.provider-compliance-upload-grid input,
.provider-compliance-upload-grid select {
  background:#fff;
  border:1px solid #cbdbe6;
  border-radius:7px;
  color:#132236;
  font:inherit;
  min-height:36px;
  min-width:0;
  padding:8px 9px;
}
.provider-compliance-status {
  align-items:center;
  min-height:30px;
}
.provider-compliance-upload-grid {
  gap:12px;
}
.provider-compliance-upload-grid .textarea-wide {
  grid-column:1/-1;
}
.provider-compliance-upload-actions {
  align-items:flex-start;
  flex-direction:column;
}
.provider-compliance-upload-actions .btn {
  width:100%;
}
.provider-registration-panel {
  background:#f8fbfc;
  border:1px solid #d8e5ec;
  border-radius:10px;
  gap:10px;
  margin-bottom:14px;
  padding:12px;
}
.provider-registration-actions .btn {
  min-height:34px;
}
.provider-registration-url {
  background:#fff;
  color:#086a60;
  font-size:12px;
}
.provider-registration-empty {
  background:#fff;
  color:#52627a;
  line-height:1.45;
}
.provider-registration-link-row,
.provider-registration-submission,
.provider-compliance-doc {
  background:#fff;
  border-color:#d8e5ec;
}
.provider-compliance-doc {
  align-items:flex-start;
}
.provider-compliance-doc .btn {
  flex:0 0 auto;
}

@media(max-width:1180px) {
  .provider-profile-head {
    grid-template-columns:1fr;
  }
  .provider-profile-actions .btn {
    width:100%;
  }
  .provider-compliance-layout {
    grid-template-columns:1fr;
  }
  .provider-compliance-action-card {
    order:-1;
  }
}
@media(max-width:760px) {
  .provider-profile-modal,
  .provider-compliance-modal {
    width:calc(100vw - 16px);
  }
  .provider-profile-modal .modal-body,
  .provider-compliance-modal .modal-body {
    padding:12px;
  }
  .provider-service-editor-head {
    align-items:flex-start;
    flex-direction:column;
  }
  .provider-service-editor-wrap {
    border-radius:0 0 10px 10px;
    max-height:none;
    overflow:visible;
  }
  .provider-service-editor,
  .provider-service-editor tbody,
  .provider-service-editor tr,
  .provider-service-editor td {
    display:block;
    min-width:0;
    width:100%;
  }
  .provider-service-editor thead { display:none; }
  .provider-service-editor tr {
    border:1px solid #d8e5ec;
    border-radius:10px;
    box-shadow:0 1px 2px rgba(15,23,42,.04);
    margin:0 0 12px;
    overflow:hidden;
  }
  .provider-service-editor td {
    border-bottom:0;
    padding:8px 12px;
  }
  .provider-service-editor td::before {
    color:#607088;
    content:attr(data-label);
    display:block;
    font-size:11px;
    font-weight:900;
    letter-spacing:.07em;
    margin-bottom:5px;
    text-transform:uppercase;
  }
  .provider-service-editor .provider-service-cell::before,
  .provider-service-editor .provider-row-actions::before {
    display:none;
  }
  .provider-row-actions .btn {
    width:100%;
  }
  .provider-compliance-summary {
    grid-template-columns:1fr 1fr;
  }
  .provider-compliance-check-controls {
    grid-template-columns:1fr;
  }
}
@media(max-width:520px) {
  .provider-compliance-summary {
    grid-template-columns:1fr;
  }
}
@media (max-width: 760px) {
  .provider-public-page { padding:64px 10px 28px; }
  .provider-public-hero { align-items:flex-start; flex-direction:column; padding:18px; }
  .provider-public-hero img { max-width:220px; width:70%; }
  .provider-public-hero h1 { font-size:24px; }
  .provider-public-card { padding:16px; }
  .provider-public-card-head { flex-direction:column; }
  .provider-public-grid,
  .provider-public-service-list,
  .provider-public-file-grid,
  .provider-signature-grid { grid-template-columns:1fr; }
  .provider-public-actions .btn { justify-content:center; width:100%; }
}

.portal-preview-link {
  display:block;
  margin-top:14px;
  padding:11px 14px;
  border:1px solid rgba(0,92,63,.18);
  border-radius:12px;
  background:#f3faf7;
  color:#005c3f;
  font-size:13px;
  font-weight:800;
  text-align:center;
  text-decoration:none;
}

.portal-preview-link:hover {
  background:#e4f3ed;
}
