/* Nomen — Quiet Authority. Shared identity; workflow layouts are retained. */
:root {
  --bg:#f4f0e7; --surface:#fffdf9; --surface-soft:#f0f2eb;
  --ink:#202724; --ink-muted:#626b62; --line:#dedfd4; --line-strong:#b6c6ad;
  --brand-blue:#183c32; --brand-navy:#183c32; --accent:#183c32;
  --muted:#626b62; --canvas:#f4f0e7; --blue:#183c32; --nav:#183c32;
  --nomen-serif:Georgia,"Times New Roman",serif;
}
body,body.landing-shell { background:var(--bg); color:var(--ink); }
.brand-name,.auth-portal-brand-name,.recovery-brand,.console-brand>span {
  font-family:var(--nomen-serif); font-weight:400; letter-spacing:-.8px; color:var(--brand-navy);
}
.brand-name { font-size:27px; }
.auth-portal-brand-name { font-size:44px; }
.brand-logo,.auth-portal-brand-mark { object-fit:contain; }
.auth-portal-brand-mark { width:62px; height:62px; }
.brand-app,.auth-portal-brand-app { letter-spacing:2px; }
.public-shell h1,.recovery-page h1 { font-family:var(--nomen-serif); font-weight:400; letter-spacing:-1px; }
.auth-portal-title { font-size:36px; }
.auth-portal-card { background:var(--surface); border-color:var(--line); }
.sidebar-link.is-active,.sidebar-link:hover { background:#e3e9dc; }
.sidebar-link.is-active .ui-icon { filter:none; }
.btn,.auth-portal-submit { background:#183c32; border-color:#183c32; color:#fffdf9; }
.btn:hover,.auth-portal-submit:hover { background:#245345; border-color:#245345; color:#fffdf9; }
.btn-secondary { background:var(--surface); color:var(--brand-blue); border-color:var(--line-strong); }
.btn-secondary:hover { background:var(--surface-soft); color:var(--brand-blue); border-color:var(--brand-blue); }
input:focus,select:focus,textarea:focus { border-color:var(--brand-blue); outline-color:#b6c6ad; }
/* Keep browser-filled text and the editing caret visible in every theme. */
input:autofill { color:var(--ink); caret-color:var(--ink); }
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color:var(--ink);
  caret-color:var(--ink);
  box-shadow:0 0 0 1000px var(--surface) inset;
}
.password-fields { min-width:0; }
.password-requirements { margin:8px 0 18px; padding:12px 14px; border:1px solid var(--line); border-radius:8px; background:var(--surface-soft); }
.password-requirements .field-help { margin:0 0 6px; color:var(--ink); }
.password-requirements ul { display:grid; gap:5px; list-style:none; padding:0; margin:0; }
.password-requirements li,.password-match { display:flex; align-items:baseline; gap:8px; color:var(--ink-muted); font-size:13px; line-height:1.5; }
.password-rule-icon { flex:none; width:1em; text-align:center; font-weight:700; }
.password-match { margin:8px 0 16px; }
.password-requirements .is-met,.password-match.is-met { color:var(--brand-blue); }
.password-match.is-mismatch { color:var(--danger,#a1392a); }
.password-fields input[aria-invalid="true"] { border-color:var(--danger,#a1392a); }
.badge-ok { color:#183c32; background:#e3e9dc; }
.stat-value,.metric-value,.stat-card strong,.kpi-value { color:var(--ink); }
.stat-card .big-number { color:var(--ink); }
.app-shell thead th,.app-shell tfoot td,.app-shell tfoot th { background:var(--surface-soft); }
.app-shell thead .todo-head-filters th { background:var(--surface); }
#overdue-partners-table thead tr:first-child th,#overdue-partners-table tfoot th,#overdue-partners-table tfoot td { background:var(--surface-soft); }
.aging-col-track,.share-track,.forecast-alt-week-track,.import-status-track { background:var(--surface-soft); }
.master-item[aria-selected=true],.master-item:hover,.billing-help { background:var(--surface-soft); }
.invoice-detail-alt-tag,.invoice-detail-alt-emphasis-pill { background:var(--surface-soft); color:var(--brand-blue); }
html[data-theme="dark"] .badge-ok { background:#334b3b; color:#d1ddc9; }
.btn-danger,.btn-danger:hover { background:#fff3ef; border-color:#d8b2a8; color:#a1392a; }
html[data-theme="dark"] .btn-danger,html[data-theme="dark"] .btn-danger:hover { background:#482b32; border-color:#815057; color:#ffb8b2; }
.console-sidebar { background:#183c32; }
.console-sidebar .console-brand>span { color:#f4f0e7; }
.console-sidebar .console-brand img { background:#f4f0e7; border-radius:4px; }
html[data-theme="dark"] {
  --bg:#14251f; --surface:#1e322a; --surface-soft:#263c30; --ink:#f4f0e7;
  --ink-muted:#c0cbb9; --line:#435448; --line-strong:#76896c;
  --brand-blue:#b6c6ad; --brand-navy:#f4f0e7; --canvas:#14251f;
}
html[data-theme="dark"] .sidebar-link:hover,html[data-theme="dark"] .sidebar-link.is-active { background:#334b3b; }
html[data-theme="dark"] .sidebar-link .ui-icon { filter:brightness(0) invert(.9); }
html[data-theme="dark"] .btn { background:#b6c6ad; border-color:#b6c6ad; color:#14251f; }
html[data-theme="dark"] .btn:hover { background:#d1ddc9; border-color:#d1ddc9; }
html[data-theme="dark"] .btn-secondary { background:var(--surface); color:var(--ink); border-color:var(--line-strong); }
html[data-theme="dark"] .brand-logo,html[data-theme="dark"] .auth-portal-brand-mark { background:#f4f0e7; border-radius:4px; }
.billing-upgrade-banner { display:flex; align-items:center; justify-content:space-between; gap:28px; padding:32px; background:var(--surface-soft); border:2px solid var(--brand-blue); }
.billing-upgrade-banner h2 { margin:8px 0 12px; font-size:clamp(23px,2.5vw,32px); }
.billing-upgrade-banner p { max-width:640px; margin:0; }
.upgrade-plan-button { min-height:56px; padding:16px 28px; font-size:17px; font-weight:800; white-space:normal; text-align:center; }
.upgrade-plan-card { display:flex; flex-direction:column; gap:18px; }
.upgrade-plan-card form { margin-top:auto; }
.upgrade-plan-card .upgrade-plan-button { width:100%; }
.upgrade-confirmation { max-width:780px; margin-top:24px; }
.upgrade-confirmation form { margin:24px 0; }
.upgrade-price { font-size:36px; font-weight:800; }
.upgrade-price small { font-size:16px; font-weight:500; }
@media(max-width:720px) { .billing-upgrade-banner { flex-direction:column; align-items:stretch; padding:24px; } }

html[data-theme="ocean"] {
  --bg:#edf4fa; --surface:#fcfdff; --surface-soft:#e4eef7; --ink:#203347;
  --ink-muted:#53687b; --line:#cddce9; --line-strong:#a5bdd1;
  --brand-blue:#234f73; --brand-navy:#203f5b; --accent:#234f73;
}
html[data-theme="lavender"] {
  --bg:#f3eff8; --surface:#fefcff; --surface-soft:#ece5f3; --ink:#34273f;
  --ink-muted:#6d5c79; --line:#ded2e7; --line-strong:#bca8ce;
  --brand-blue:#654a82; --brand-navy:#483158; --accent:#654a82;
}
html[data-theme="sand"] {
  --bg:#faf1e4; --surface:#fffcf6; --surface-soft:#f2e6d6; --ink:#403226;
  --ink-muted:#78644f; --line:#e4d4bf; --line-strong:#c8ae8d;
  --brand-blue:#805335; --brand-navy:#61412c; --accent:#805335;
}
html:is([data-theme="ocean"],[data-theme="lavender"],[data-theme="sand"]) .btn { background:var(--brand-blue); border-color:var(--brand-blue); }
html:is([data-theme="ocean"],[data-theme="lavender"],[data-theme="sand"]) .btn-secondary { background:var(--surface); color:var(--brand-blue); border-color:var(--line-strong); }
html:is([data-theme="ocean"],[data-theme="lavender"],[data-theme="sand"]) .btn-danger { background:#fff3ef; color:#a1392a; border-color:#d8b2a8; }
html:is([data-theme="ocean"],[data-theme="lavender"],[data-theme="sand"]) .sidebar-link:is(:hover,.is-active) { background:var(--surface-soft); }
.theme-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(90px,1fr)); gap:10px; padding:0; margin:16px 0 20px; border:0; }
.theme-options legend { margin-bottom:10px; font-size:13px; font-weight:700; }
.theme-options .theme-option { display:flex; flex-direction:column; align-items:center; gap:8px; position:relative; margin:0; padding:12px 8px; border:1px solid var(--line); border-radius:8px; cursor:pointer; font-size:12px; }
.theme-option:has(input:checked) { border-color:var(--brand-blue); box-shadow:0 0 0 1px var(--brand-blue); background:var(--surface-soft); }
.theme-option:has(input:focus-visible) { outline:2px solid var(--brand-blue); outline-offset:3px; }
.theme-options input { position:absolute; opacity:0; width:1px; height:1px; margin:0; min-height:0; }
.theme-swatch { width:48px; height:34px; background:linear-gradient(90deg,var(--swatch-accent) 30%,var(--swatch-bg) 30%); border-radius:5px; border:1px solid #8886; }
.queue-view-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:16px 0 10px; }
.queue-view-toolbar label { margin:0; font-size:12px; }
.queue-view-toolbar select { width:auto; max-width:230px; min-height:34px; margin:0; font-size:12px; padding:6px 30px 6px 10px; }
.queue-view-toolbar .btn { margin:0; }
#queue-view-status { margin-left:auto; color:var(--ink-muted); font-size:11px; }
.queue-reset { border:0; padding:6px; background:none; color:var(--brand-blue); font:inherit; font-size:12px; cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
.dashboard-work-queue .todo-scroll { scrollbar-width:thin; scrollbar-color:var(--line-strong) var(--surface-soft); scrollbar-gutter:stable; border:1px solid var(--line); border-radius:8px; }
.todo-scroll::-webkit-scrollbar { width:9px; height:9px; }
.todo-scroll::-webkit-scrollbar-track { background:var(--surface-soft); border-radius:8px; }
.todo-scroll::-webkit-scrollbar-thumb { background:var(--line-strong); border:2px solid var(--surface-soft); border-radius:8px; }
.todo-scroll::-webkit-scrollbar-thumb:hover { background:var(--ink-muted); }
.todo-scroll::-webkit-scrollbar-corner { background:var(--surface-soft); }
#todo-table .todo-head-main th { background:var(--surface-soft); padding:12px 10px; }
.queue-filter-toggle { display:inline-grid; place-items:center; width:24px; height:26px; margin-left:4px; padding:0; border:1px solid transparent; border-radius:4px; background:none; color:var(--ink-muted); cursor:pointer; vertical-align:middle; }
.queue-filter-toggle:is(:hover,:focus-visible,.is-filtered,[aria-expanded="true"]) { background:var(--surface); color:var(--brand-blue); border-color:var(--line-strong); }
.queue-filter-toggle.is-filtered { box-shadow:inset 0 -3px var(--brand-blue); }
.queue-filter-panel { position:fixed; z-index:180; display:grid; gap:8px; width:min(300px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); padding:16px; border:1px solid var(--line-strong); border-radius:10px; background:var(--surface); color:var(--ink); box-shadow:0 12px 40px #14251f26; }
.queue-filter-panel>strong { font-size:13px; }
.queue-filter-panel>.queue-reset { justify-self:start; padding-left:0; }
.queue-filter-panel { overflow-y:auto; }
.queue-filter-panel label { font-size:12px; font-weight:600; margin:0; }
.queue-filter-panel input,.queue-filter-panel select { width:100%; min-height:38px; margin:0; padding:8px 10px; font:inherit; font-size:13px; border:1px solid var(--line-strong); border-radius:5px; background:var(--surface); color:var(--ink); color-scheme:light; }
html[data-theme="dark"] .queue-filter-panel input,html[data-theme="dark"] .queue-filter-panel select { color-scheme:dark; }
.queue-filter-panel input[aria-invalid="true"] { border-color:var(--danger); }
.queue-filter-fields { display:grid; gap:8px; }
.queue-filter-fields:empty { display:none; }
.queue-filter-hint { font-size:11px; color:var(--ink-muted); line-height:1.5; margin:2px 0; }
.queue-filter-panel>.queue-reset { grid-column:1; }
.dashboard-work-queue .table-columns-footer { display:flex; flex-wrap:wrap; gap:8px; }
.dashboard-work-queue .table-columns-panel { position:fixed; right:auto; display:flex; flex-direction:column; overflow:hidden; z-index:180; background:var(--surface); border-color:var(--line-strong); }
.dashboard-work-queue .table-columns-title { flex:none; color:var(--ink); }
.dashboard-work-queue .table-columns-list { min-height:0; overflow-y:auto; }
.dashboard-work-queue .table-columns-option { color:var(--ink); }
.dashboard-work-queue .table-columns-footer { flex:none; border-color:var(--line); }
.queue-filter-panel>.btn { margin:8px 0 0; justify-self:end; }
.queue-save-dialog { width:min(440px,calc(100vw - 32px)); padding:28px; border:1px solid var(--line); border-radius:12px; color:var(--ink); background:var(--surface); }
.queue-save-dialog::backdrop { background:#14251f70; }
.queue-save-dialog p { color:var(--ink-muted); font-size:13px; }
.queue-note-cell { min-width:240px; max-width:300px; white-space:normal; }
.queue-note-preview { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; white-space:normal; font-size:12px; line-height:1.5; }
.queue-note-cell small { display:block; color:var(--ink-muted); font-size:10px; margin-top:4px; }
.note-generation-status { color:var(--ink-muted); font-size:12px; margin-top:10px; }
.dashboard-analysis { align-items:stretch; }
.dashboard-analysis .dashboard-paired-card { height:100%; margin-bottom:0; }
.dashboard-analysis .aging-details { margin-top:auto; padding-top:12px; }
.dashboard-analysis .partners-table-scroll { margin-top:auto; }
@media(max-width:720px) { #queue-view-status { width:100%; margin-left:0; } .queue-view-toolbar { gap:8px; } }

/* Collections policy and approval workflow. */
.collections-status { color:var(--ink); background:var(--surface-soft, #eef1e8); }
.collections-tabs { flex-wrap:wrap; gap:4px 18px; margin-bottom:20px; }
.collections-tabs a { white-space:nowrap; }
.policy-check { display:flex; align-items:flex-start; gap:10px; line-height:1.5; margin:18px 0; font-weight:500; }
.policy-check input[type="checkbox"] { flex:0 0 auto; width:17px; height:17px; margin-top:3px; }
.policy-rules { padding-left:20px; line-height:1.7; color:var(--ink-muted); }
.policy-rules li { margin-bottom:12px; }
.outreach-approval { border:1px solid var(--line); border-radius:10px; padding:20px; background:var(--surface); }
.auto-empty { padding:22px 0; max-width:600px; }
.auto-skip-reasons { margin:16px 0 0; }
.auto-skip-reasons>div { display:flex; justify-content:space-between; gap:20px; padding:12px 0; border-top:1px solid var(--line); }
.auto-skip-reasons dd { margin:0; font-weight:700; }
.auto-run-overview .workspace-strip { margin:20px 0; }
#auto-batch-name { max-width:420px; margin-bottom:20px; }
@media(max-width:720px) { .collections-tabs { gap:4px 14px; } .collections-tabs a { font-size:12px; } .outreach-approval { padding:16px; } }
/* Collection policies and approval previews */
.policy-editor {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;width:100%;max-width:none;align-items:start}
.policy-editor .workspace-panel,.policy-selector {padding:24px}
.policy-editor>.workspace-panel {margin:0;min-width:0}
.policy-editor>.selection-actions {grid-column:1/-1;margin:0;justify-content:flex-end}
.policy-selector {display:grid;gap:20px;min-width:0}
.policy-select-form {display:flex;align-items:flex-end;gap:12px;min-width:0;flex-wrap:wrap}
.policy-select-form>div {flex:1 1 280px;min-width:0}
.policy-select-form input,.policy-select-form select {width:100%;min-width:0;max-width:100%;margin:0}
.policy-select-form .btn {flex:none;margin:0}
.policy-assignment-controls {margin:20px 0}
.policy-selector>details {min-width:0;border-top:1px solid var(--line);padding-top:16px}
.policy-selector summary {cursor:pointer;color:var(--brand-blue);font-weight:600}
.policy-selector details[open] .policy-select-form {margin-top:16px}
.policy-picker-field>span {display:block;margin-bottom:6px;font-size:13px;font-weight:600}
.policy-picker {position:relative;min-width:0}
.policy-selector .policy-picker>summary {display:flex;align-items:center;justify-content:space-between;gap:12px;list-style:none;padding:10px 12px;border:1px solid var(--line-strong);border-radius:5px;background:var(--surface);color:var(--ink);font-weight:400;overflow-wrap:anywhere}
.policy-picker>summary::-webkit-details-marker {display:none}
.policy-picker>summary:focus-visible {outline:2px solid var(--brand-blue);outline-offset:3px}
.policy-picker-menu {position:absolute;inset:calc(100% + 4px) 0 auto;z-index:20;display:grid;max-height:300px;overflow-y:auto;padding:6px;background:var(--surface);border:1px solid var(--line-strong);border-radius:6px;box-shadow:0 8px 24px #14251f20}
.policy-picker-menu a {display:block;padding:10px 12px;border-radius:4px;white-space:normal;overflow-wrap:anywhere;color:var(--ink);text-decoration:none}
.policy-picker-menu a:is(:hover,:focus-visible,[aria-current]) {background:var(--surface-soft);color:var(--brand-blue)}
.policy-editor label:not(.policy-check),.policy-selector label {display:block;margin-top:16px}
.policy-selector .policy-select-form label {margin-top:0}
.policy-editor input:not([type=checkbox]),.policy-editor select,.policy-editor textarea {width:100%;min-width:0;max-width:100%}
.policy-two-fields>div {flex:1 1 140px;min-width:0}
.policy-check {display:flex;gap:10px;align-items:flex-start;margin:14px 0}
.policy-check input {flex-shrink:0;margin-top:4px}
.policy-day-options,.approval-steps,.policy-two-fields {display:flex;gap:16px;flex-wrap:wrap}
.policy-day-options label {display:inline-flex!important;gap:6px;align-items:center}
.policy-editor fieldset {border:1px solid var(--border,#dce2e8);border-radius:8px;padding:16px;margin-top:20px}
.approval-steps {margin:24px 0}.approval-steps span {border-bottom:3px solid var(--border,#dce2e8);padding:10px 0}.approval-steps .active {border-color:var(--accent,#24665c);font-weight:700}
.approval-envelope {display:grid;grid-template-columns:70px minmax(0,1fr);gap:8px 16px}.approval-envelope dd {margin:0;overflow-wrap:anywhere}
.approval-draft {padding:24px}.approval-draft .draft-preview {white-space:pre-wrap;overflow-wrap:anywhere;max-height:420px;overflow:auto}
.approval-select {display:flex;align-items:center;gap:12px;flex-wrap:wrap}
@media(max-width:1050px){.policy-editor{grid-template-columns:minmax(0,1fr)}}
@media(max-width:640px){.policy-editor .workspace-panel,.policy-selector,.approval-draft{padding:16px}.approval-steps{gap:8px;font-size:.86rem}.approval-envelope{grid-template-columns:1fr;gap:3px}.approval-envelope dd{margin-bottom:10px}}

/* Customer-grouped outreach queue. */
.queue-policy-picker { margin-bottom: 1.25rem; }
.queue-policy-picker select { flex: 1; min-width: 0; width: auto; }
.queue-select-all { margin-top: 1rem; padding-block: .5rem; }
.queue-customer { border-top: 1px solid var(--border-color, #dce3e8); padding-top: 1rem; }
.queue-customer-heading { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.queue-customer-heading h3 { margin: 0; }
.queue-customer-heading input[type="checkbox"] { flex: none; }
.queue-review { margin-block: .75rem; }
.collections-tabs[aria-label="Outreach views"] { flex-wrap: nowrap; gap: 0; }
.collections-tabs[aria-label="Outreach views"] > a { flex: 1 1 0; padding-inline: 8px; white-space: normal; }
