/* Admin-only workspace. Uses the public site's navy / blue color roles. */
.crm-container{max-width:1180px;color:#32445a}.crm-page-heading{display:flex;justify-content:space-between;gap:24px;align-items:flex-start;margin:0 0 28px}.crm-page-heading h1{font-size:30px;line-height:1.4;color:#132b4f}.crm-page-heading p{font-size:13px;color:#52647a;margin-top:10px}.crm-page-heading>a{white-space:nowrap;padding:10px 0}.crm-section-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:15px}.crm-section-heading h2,.crm-list-section>h2{font-size:19px;color:#132b4f}.crm-summary{padding:24px;background:white;border:1px solid #d8e1ee;border-radius:12px}.crm-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.crm-metrics>div{border:1px solid #d8e1ee;background:#f5f7fb;padding:17px 18px;border-radius:8px}.crm-metrics span{display:block;font-size:12px;color:#52647a}.crm-metrics strong{font-size:26px;color:#132b4f;display:block;margin-top:7px;overflow-wrap:anywhere}.crm-help,.crm-limit-note{font-size:12px;line-height:1.8;color:#52647a;margin-top:12px}.crm-summary-rate{font-size:13px;padding:13px 0;color:#32445a}.crm-summary-rate strong{margin:0 10px;color:#132b4f}.crm-summary-rate span{font-size:12px;color:#52647a}.crm-stage-counts{display:flex;gap:8px;flex-wrap:wrap}.crm-stage-counts>span{padding:6px 9px;background:#edf2fa;font-size:12px;color:#32445a;border-radius:5px}.crm-stage-counts b{margin-left:7px;color:#132b4f}.crm-attribution{margin-top:16px;border-top:1px solid #d8e1ee;padding-top:14px}.crm-attribution summary{font-size:12px;color:#1b46a6;cursor:pointer;min-height:34px}.crm-list-section{margin-top:32px}.crm-filters{display:grid;grid-template-columns:minmax(220px,1.5fr) minmax(130px,1fr) minmax(120px,.8fr) auto auto;gap:10px;align-items:end;margin-top:16px}.crm-filters label,.crm-edit-grid label{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:600;color:#32445a}.crm-container input,.crm-container select,.crm-container textarea,.crm-dialog input,.crm-dialog select,.crm-dialog textarea{font:inherit;min-height:44px;min-width:0;width:100%;border:1px solid #8190a5;color:#182b45;background:white;border-radius:7px;padding:10px 12px}.crm-container input::placeholder,.crm-dialog input::placeholder,.crm-dialog textarea::placeholder{color:#5f7085;opacity:1}.crm-button,.crm-icon-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 16px;border:1px solid #245edb;border-radius:7px;background:#245edb;color:white;font-size:12px;font-weight:650;cursor:pointer;text-align:center;text-decoration:none;line-height:1.6}.crm-button:hover{background:#1b46a6;border-color:#1b46a6;color:white}.crm-button.secondary{background:white;color:#245edb;border-color:#9fb8e9}.crm-button.secondary:hover{background:#eaf1ff;border-color:#245edb;color:#1b46a6}.crm-button.danger{color:#b42318;border-color:#c97b73;background:white;margin-left:auto}.crm-button.danger:hover{background:#fff1ef;border-color:#b42318}.crm-button:disabled,.crm-button:disabled:hover{background:#e3e8f0;border-color:#cad4e2;color:#52647a;opacity:1;cursor:not-allowed}.crm-container :focus-visible,.crm-dialog :focus-visible{outline:3px solid #245edb;outline-offset:3px}.crm-container [hidden],.crm-dialog [hidden]{display:none!important}#crm-list-status{font-size:12px;color:#52647a;min-height:24px;margin:17px 0 10px}.crm-record{display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,230px) auto;align-items:center;gap:22px;background:white;border:1px solid #d8e1ee;border-radius:9px;padding:18px 20px;margin:9px 0}.crm-record h3{font-size:16px;color:#132b4f;overflow-wrap:anywhere}.crm-record h3 span{font-size:12px;font-weight:500;color:#52647a;margin-left:12px;white-space:nowrap}.crm-record p{font-size:12px;color:#32445a;line-height:1.7;margin-top:5px;overflow-wrap:anywhere}.crm-record small{font-size:11px;color:#52647a;line-height:1.8}.crm-record-status{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.crm-record-status>small{flex:1 0 100%;overflow-wrap:anywhere}.crm-badge,.crm-qualification{font-size:11px;padding:3px 7px;border-radius:4px;border:1px solid #c7d7f5;background:#eaf1ff;color:#1b46a6}.crm-qualification{color:#52647a;border-color:#d8e1ee;background:#f5f7fb}.crm-qualification[data-quality="qualified"]{color:#16613c;border-color:#a7d6bb;background:#edf8f0}.crm-qualification[data-quality="unqualified"]{color:#7c5100;border-color:#e4c88f;background:#fff6de}.crm-pagination{display:flex;justify-content:center;align-items:center;gap:18px;margin-top:20px;font-size:12px;color:#52647a}.crm-empty{padding:26px;background:white;border:1px solid #d8e1ee;border-radius:10px}.crm-empty h2,.crm-empty h3{color:#132b4f;font-size:18px;line-height:1.5}.crm-empty p{font-size:13px;color:#52647a;margin:9px 0 16px}.crm-limit-note{border-top:1px solid #d8e1ee;padding-top:18px;margin-top:25px}.crm-error{color:#b42318;font-size:13px;line-height:1.8;margin:15px 0}.crm-dialog{width:min(760px,calc(100% - 32px));max-height:calc(100dvh - 32px);border:1px solid #d8e1ee;border-radius:14px;padding:24px;color:#32445a;background:white;overflow:auto;box-shadow:0 20px 80px #132b4f33}.crm-dialog::backdrop{background:#132b4f88}.crm-dialog:not([open]){display:none}.crm-dialog-header{display:flex;justify-content:space-between;align-items:center;gap:16px}.crm-dialog-header h2{font-size:24px;color:#132b4f}.crm-icon-button{width:44px;min-width:44px;padding:0;background:#f5f7fb;border-color:#d8e1ee;color:#132b4f;font-size:24px}.crm-detail-caption{font-size:11px;color:#52647a;margin:8px 0 20px;overflow-wrap:anywhere}.crm-contact{margin:0 0 24px;background:#f5f7fb;border:1px solid #d8e1ee;border-radius:8px;padding:8px 16px;font-size:12px;line-height:1.8}.crm-contact>div{display:grid;grid-template-columns:92px minmax(0,1fr);gap:14px;padding:8px 0;border-bottom:1px solid #d8e1ee}.crm-contact>div:last-child{border-bottom:0}.crm-contact dt{color:#52647a}.crm-contact dd{margin:0;color:#182b45;white-space:pre-wrap;overflow-wrap:anywhere}.crm-edit-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.crm-edit-grid .crm-wide{grid-column:1/-1}.crm-edit-grid small{font-size:11px;color:#52647a;font-weight:400;line-height:1.8}.crm-evidence{margin-top:20px;border:1px solid #d8e1ee;border-radius:8px;padding:16px}.crm-evidence>summary{cursor:pointer;color:#132b4f;font-size:13px;font-weight:600;min-height:28px}.crm-evidence .crm-edit-grid{margin-top:16px}.crm-detail-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}.crm-history{margin-top:24px;border-top:1px solid #d8e1ee;padding-top:20px}.crm-history h3{font-size:16px;color:#132b4f}.crm-history ol{padding-left:20px;font-size:12px;line-height:1.8}.crm-history li{padding:8px 0}.crm-history strong{display:block;color:#32445a;overflow-wrap:anywhere}.crm-history small{display:block;color:#52647a;overflow-wrap:anywhere}#crm-detail-feedback{font-size:13px;color:#1b46a6;line-height:1.8;margin-top:16px;white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:900px){.crm-filters{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto auto}.crm-filters>label:first-child{grid-column:1/-1}.crm-page-heading{flex-direction:column;gap:10px}.crm-record{grid-template-columns:minmax(0,1fr) auto;gap:14px}.crm-record-status{grid-column:1}.crm-record>.crm-button{grid-column:2;grid-row:1/3}}
@media(max-width:600px){.crm-container{padding:25px 16px 40px}.crm-page-heading h1{font-size:25px}.crm-page-heading p{font-size:12px}.crm-summary{padding:18px 14px}.crm-section-heading{align-items:flex-start}.crm-section-heading h2{font-size:18px}.crm-metrics{grid-template-columns:1fr 1fr;gap:8px}.crm-metrics>div{padding:13px 10px}.crm-metrics span{font-size:11px}.crm-metrics strong{font-size:22px}.crm-summary-rate span{display:block;margin-top:5px}.crm-filters{grid-template-columns:1fr 1fr;gap:10px}.crm-filters>label:first-child{grid-column:1/-1}.crm-record{padding:15px 13px;gap:10px}.crm-record h3 span{display:block;margin:5px 0 0}.crm-record>.crm-button{padding:9px 11px}.crm-stage-counts{gap:6px}.crm-stage-counts>span{font-size:11px}.crm-help,.crm-limit-note{font-size:11px}.crm-dialog{width:calc(100% - 20px);padding:18px 14px;max-height:calc(100dvh - 20px)}.crm-dialog-header h2{font-size:21px}.crm-contact{padding:8px 11px}.crm-contact>div{grid-template-columns:70px minmax(0,1fr);gap:9px}.crm-edit-grid{gap:12px;grid-template-columns:1fr}.crm-edit-grid .crm-wide{grid-column:auto}.crm-evidence{padding:13px}.crm-detail-actions{display:grid;grid-template-columns:1fr}.crm-button.danger{margin:3px 0 0}.crm-dialog input,.crm-dialog select,.crm-dialog textarea{font-size:16px}.crm-filters input,.crm-filters select{font-size:16px}}
@media(prefers-reduced-motion:reduce){.crm-container *,.crm-dialog *{transition:none!important;scroll-behavior:auto!important}}

/* One stage palette is shared by the filters and the customer list. */
.crm-type-summary { display:flex; flex-wrap:wrap; gap:8px 16px; margin:0 0 15px; color:#52647a; font-size:12px; }
.crm-type-summary b { margin-left:5px; color:#132b4f; }
.crm-filters { grid-template-columns:minmax(190px,1.5fr) minmax(120px,1fr) minmax(120px,1fr) minmax(100px,.8fr) auto auto; }
.crm-report-tags { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-bottom:8px; }
.crm-report-type,.crm-consultation-choice,.crm-delivery-status { display:inline-flex; align-items:center; border:1px solid #d8e1ee; border-radius:4px; padding:3px 7px; color:#52647a; background:#f5f7fb; font-size:10px; line-height:1.65; }
.crm-report-type { color:#6d28d9; background:#f5f3ff; border-color:#d6c6f5; font-weight:650; }
.crm-consultation-choice[data-requested="true"] { color:#166534; background:#f0fdf4; border-color:#b1dfc0; }
.crm-delivery-status[data-delivery="submitted"] { color:#1d4ed8; background:#eff6ff; border-color:#bfdbfe; }
.crm-delivery-status[data-delivery="failed"] { color:#b42318; background:#fff1ef; border-color:#e5b5af; }
.crm-delivery-status[data-delivery="unknown"] { color:#92400e; background:#fffbeb; border-color:#f5d58a; }
.crm-delivery-setup { margin-top:18px; border:1px solid #d8e1ee; border-radius:9px; background:white; padding:16px 20px; }
.crm-delivery-setup summary { min-height:32px; color:#132b4f; font-size:13px; font-weight:650; cursor:pointer; }
.crm-delivery-setup summary span { margin-left:10px; color:#92400e; font-size:11px; font-weight:500; }
.crm-delivery-setup summary span[data-ready="true"] { color:#166534; }
.crm-delivery-setup p,.crm-delivery-setup ul { margin-top:12px; font-size:12px; line-height:1.8; color:#52647a; }
.crm-delivery-setup ul { padding-left:20px; }
.crm-delivery-setup code { overflow-wrap:anywhere; }
.crm-report-delivery { border:1px solid #d8e1ee; border-radius:9px; padding:16px; margin-bottom:24px; }
.crm-report-delivery-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }
.crm-report-delivery-heading h3 { color:#132b4f; font-size:16px; }
.crm-report-delivery .crm-contact { margin-bottom:12px; }
.crm-report-delivery>.crm-button { margin-top:12px; }
#crm-report-feedback { font-size:12px; line-height:1.8; color:#1b46a6; margin-top:12px; }
@media(max-width:1000px) { .crm-filters { grid-template-columns:repeat(3,minmax(0,1fr)) auto auto; }.crm-filters>label:first-child { grid-column:1/-1; } }
@media(max-width:600px) { .crm-filters { grid-template-columns:1fr 1fr; }.crm-filters>label:first-child { grid-column:1/-1; }.crm-filters>label:nth-child(2) { grid-column:1/-1; }.crm-delivery-setup { padding:14px; }.crm-report-delivery { padding:13px; }.crm-report-delivery-heading { align-items:flex-start; flex-wrap:wrap; } }
.crm-container [data-stage] { --stage-ink:#334155; --stage-bg:#f1f5f9; --stage-line:#cbd5e1; }
.crm-container [data-stage="received"] { --stage-ink:#1d4ed8; --stage-bg:#eff6ff; --stage-line:#bfdbfe; }
.crm-container [data-stage="contact_attempted"] { --stage-ink:#92400e; --stage-bg:#fffbeb; --stage-line:#f5d58a; }
.crm-container [data-stage="contacted"] { --stage-ink:#0e7490; --stage-bg:#ecfeff; --stage-line:#a5e1ec; }
.crm-container [data-stage="consulted"] { --stage-ink:#166534; --stage-bg:#f0fdf4; --stage-line:#b1dfc0; }
.crm-container [data-stage="connected"] { --stage-ink:#6d28d9; --stage-bg:#f5f3ff; --stage-line:#d6c6f5; }
.crm-container [data-stage="contracted"] { --stage-ink:#132b4f; --stage-bg:#eaf1ff; --stage-line:#b9cbea; }
.crm-container [data-stage="on_hold"] { --stage-ink:#9a3412; --stage-bg:#fff7ed; --stage-line:#f5c7a4; }
.crm-container [data-stage="closed"] { --stage-ink:#475569; --stage-bg:#f1f5f9; --stage-line:#cbd5e1; }
.crm-stage-filters { display:flex; flex-wrap:wrap; gap:8px; }
.crm-stage-tab { display:inline-flex; align-items:center; justify-content:space-between; gap:12px; min-height:44px; padding:9px 12px; border:1px solid var(--stage-line); border-radius:7px; background:var(--stage-bg); color:var(--stage-ink); font:inherit; font-size:12px; font-weight:600; cursor:pointer; }
.crm-stage-tab b { display:inline-grid; place-items:center; min-width:22px; height:22px; padding:0 5px; border-radius:4px; background:#ffffffaa; color:inherit; font-size:12px; font-variant-numeric:tabular-nums; }
.crm-stage-tab:hover { border-color:var(--stage-ink); box-shadow:inset 0 0 0 1px var(--stage-ink); }
.crm-stage-tab[aria-pressed="true"] { background:var(--stage-ink); border-color:var(--stage-ink); color:#fff; }
.crm-stage-tab[aria-pressed="true"] b { background:transparent; }
.crm-stage-hint { margin-top:10px; color:#52647a; font-size:11px; line-height:1.8; }
.crm-badge[data-stage] { display:inline-flex; align-items:center; gap:6px; padding:5px 9px; border-color:var(--stage-line); background:var(--stage-bg); color:var(--stage-ink); font-weight:650; }
.crm-badge[data-stage]:before { content:""; flex:none; width:6px; height:6px; border-radius:50%; background:var(--stage-ink); }
.crm-list-heading { display:flex; align-items:baseline; justify-content:space-between; gap:12px; }
.crm-list-heading h2 { font-size:19px; color:#132b4f; }
.crm-list-heading>span { color:#52647a; font-size:11px; }
.crm-record { grid-template-columns:minmax(0,1fr) 146px minmax(150px,210px) auto; }
.crm-record-date { display:flex; flex-direction:column; align-items:flex-start; gap:6px; }
.crm-record-date>span { font-size:11px; color:#52647a; }
.crm-record-date time { display:flex; flex-wrap:wrap; align-items:baseline; gap:7px; color:#132b4f; font-size:13px; font-variant-numeric:tabular-nums; }
.crm-record-date time b { font-weight:650; }
.crm-record-date time span { color:#52647a; font-size:12px; }
#crm-items[aria-busy="true"] { opacity:.5; pointer-events:none; }
@media(max-width:900px) {
 .crm-record { grid-template-columns:minmax(0,1fr) auto; }
 .crm-record-date { grid-column:1; grid-row:2; flex-direction:row; align-items:baseline; gap:10px; }
 .crm-record-status { grid-column:1; grid-row:3; }
 .crm-record>.crm-button { grid-column:2; grid-row:1/4; }
}
@media(max-width:600px) {
 .crm-stage-filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
 .crm-stage-tab { padding:9px 10px; gap:6px; font-size:11px; }
 .crm-stage-tab[data-stage="all"] { grid-column:1/-1; }
 .crm-stage-hint { font-size:10px; }
 .crm-list-heading { align-items:flex-start; flex-direction:column; gap:6px; }
 .crm-record-date { flex-wrap:wrap; gap:4px 8px; }
 .crm-record-date time { gap:6px; font-size:12px; }
 .crm-record-date time span { font-size:11px; }
 .crm-record-status { grid-column:1/-1; }
 .crm-record>.crm-button { grid-row:1/3; }
}
/* Manual dispatch deliberately separates copying from the operator's sent record. */
.crm-delivery-status[data-delivery="awaiting_manual"] { color:#92400e; background:#fffbeb; border-color:#f5d58a; }
.crm-delivery-status[data-delivery="manual_sent"] { color:#166534; background:#f0fdf4; border-color:#b1dfc0; }
.crm-manual-message { margin-top:16px; padding:14px; border:1px solid #d8e1ee; border-radius:8px; background:#f5f7fb; }
.crm-manual-message>label,.crm-manual-confirm>label { display:flex; flex-direction:column; gap:7px; font-size:12px; font-weight:600; color:#32445a; }
.crm-manual-message textarea { margin-top:8px; font-size:12px; line-height:1.8; min-height:160px; overflow-wrap:anywhere; resize:vertical; }
.crm-manual-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.crm-manual-confirm { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:12px; border-top:1px solid #d8e1ee; margin-top:18px; padding-top:16px; }
@media(max-width:600px) { .crm-manual-confirm { grid-template-columns:1fr; }.crm-manual-actions { display:grid; grid-template-columns:1fr; }.crm-manual-message { padding:11px; }.crm-manual-message textarea { font-size:16px; } }
