﻿/* ============================================================
   TCPA Admin â€” LeadFlow design system
   Blue-grey paper, white cards, navy accent, maroon alerts.
   Loaded after bootstrap + uicomponents so it overrides them.
   ============================================================ */

/* ---- 1. Tokens ---- */
:root {
  /* Surfaces */
  --paper:        #E9EDF4;
  --surface:      #FFFFFF;
  --ash:          #E7EBF2;
  --bone:         #DCE3EE;
  --ink:          #16224B;
  --ink-2:        #2A3760;
  --muted:        #67718D;
  --muted-2:      #B0B7CB;
  --hair:         #DFE4EE;
  --hair-2:       #EBEEF5;
  --hair-strong:  #C9D2E3;

  /* Primary â€” the single accent (navy) */
  --blue:         #24345E;
  --blue-hover:   #1B2848;
  --blue-soft:    #E9EDF6;
  --blue-tint:    #F3F5FA;

  /* Secondary accent (sparingly) */
  --orange:       #DC6B2A;
  --orange-soft:  #FBEADC;

  /* Alert (maroon) â€” unassigned inbound, hard warnings */
  --alert:        #8E3B3B;
  --alert-bg:     #F6E3E1;

  /* Deadline / attention states */
  --ontrack:      #2E7D51;
  --overdue:      #C0392B;

  /* Status (text / bg pairs) */
  --st-available:   #2E8B57;  --st-available-bg:   #E2F1E9;
  --st-booked:      #6C4BA6;  --st-booked-bg:      #EEE8F7;
  --st-reserved:    #C8651C;  --st-reserved-bg:    #FBEADC;
  --st-sold:        #24345E;  --st-sold-bg:        #E9EDF6;
  --st-bankable:    #1E7F8C;  --st-bankable-bg:    #E1F1F4;
  --st-transferred: #16224B;  --st-transferred-bg: #DDE6F1;
  --st-unreleased:  #98A2B3;  --st-unreleased-bg:  #EEF1F5;
  --st-cancelled:   #76808E;  --st-cancelled-bg:   #EAEDF1;
  --st-danger:      #C0392B;  --st-danger-bg:      #F8E3DF;

  /* Type â€” headings are sans in this design; --serif kept as an alias */
  --serif: 'Inter', system-ui, -apple-system, sans-serif;
  --sans:  'Inter', system-ui, -apple-system, sans-serif;
  /* Mono retired by request — numeric/code cells use the standard UI font
     (tabular figures via "tnum" keep number columns aligned). */
  --mono:  'Inter', system-ui, -apple-system, sans-serif;

  /* Shape & elevation */
  --r-card:  10px;
  --r-ctrl:  8px;
  --r-badge: 999px;
  --shadow-card: 0 1px 3px rgba(22,34,75,.07), 0 4px 14px rgba(22,34,75,.06);
  --ring: 0 0 0 3px rgba(36,52,94,.16);
}

/* ---- 2. Base ---- */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px; line-height: 1.45;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }

.display { font-family: var(--sans); font-weight: 700; letter-spacing: -.01em; line-height: 1.05; }
.eyebrow { font-family: var(--sans); font-size: 11px; font-weight: 500;
           text-transform: uppercase; letter-spacing: .13em; color: var(--muted); }
.mono { font-family: var(--mono); font-feature-settings: "tnum"; }
.num, .price { font-feature-settings: "tnum"; }

/* Standard card / section title text â€” use on every card & section heading */
.card-title-text {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.005em;
  color: var(--ink);
}

/* Shared status / verified pill recipe */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex-shrink: 0;
  line-height: 1.2;
}

.status-badge--success {
  background: var(--st-available-bg, #e8f5e9);
  color: var(--st-available, #2e7d32);
}

.status-badge--info {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-badge--warn {
  background: rgba(180, 83, 9, 0.12);
  color: #b45309;
}

.status-badge--muted {
  background: var(--surface-2, #eef0ef);
  color: var(--muted);
}

/* ---- 4. Page header ---- */
.page-head { margin-bottom: 22px; }
.page-head .eyebrow { margin-bottom: 8px; }
.page-title { font-family: var(--sans); font-weight: 700; font-size: 26px;
              letter-spacing: -.01em; color: var(--ink); margin: 0; }
.page-subhead { display: flex; align-items: center; gap: 8px; margin-top: 10px;
                font-size: 13.5px; color: var(--muted); }
.page-subhead .dot { color: var(--hair-strong); }

/* ---- Form labels ---- */
.form-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 5px;
}

.form-label:has(~ :is(.form-control, .form-select, textarea):required)::after,
.form-label:has(~ .form-check-input:required)::after {
  content: " *";
  color: var(--st-danger);
}

/* ---- 5. Cards, toolbar, controls ---- */
.card,
.data-table-wrapper,
.filter-bar {
  background: var(--surface); border: 1px solid var(--hair);
  border-radius: var(--r-card); box-shadow: var(--shadow-card);
}

/* DataTable's Filters slot becomes the toolbar card */
.filter-bar { padding: 16px; margin-bottom: 20px; }
.toolbar-inner { display: flex; align-items: center; gap: 14px; }
.toolbar-inner .search { position: relative; flex: 1; max-width: 460px; }
.toolbar-inner .search svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted); pointer-events: none;
}
.toolbar-inner .search .input { height: 42px; padding-left: 40px; }

/* Inputs / selects (incl. bootstrap form-control/form-select overrides) */
.input, .select,
input[type="text"], input[type="search"], input[type="number"],
input[type="date"], input[type="email"], input[type="tel"],
input[type="url"], input[type="password"],
select,
.form-control, .form-select {
  width: 100%; height: 38px; padding: 0 12px;
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--hair-strong);
  border-radius: var(--r-ctrl); transition: border-color .12s, box-shadow .12s;
}
textarea.form-control { height: auto; padding: 10px 12px; }
.input::placeholder, .form-control::placeholder { color: var(--muted-2); }
.input:disabled, input:disabled, select:disabled,
.form-control:disabled, .form-select:disabled {
  background: var(--ash); color: var(--muted); cursor: default;
}
.input:focus, .select:focus,
input:focus, select:focus,
.form-control:focus, .form-select:focus {
  outline: none; border-color: var(--blue); box-shadow: var(--ring);
}

/* Native date picker indicator â€” keep it subtle so date fields match the family */
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }

/* Small control tier â€” matched height for inputs + buttons (see .btn-sm below) */
.input-sm,
.form-control-sm, .form-select-sm {
  height: 32px; padding: 0 10px; font-size: 13px; border-radius: var(--r-ctrl);
}
textarea.form-control-sm { height: auto; padding: 7px 10px; }
.form-select-sm { padding-right: 32px; }

/* Dropdown caret â€” the shared background reset above strips Bootstrap's SVG, so restore it */
.select, select, .form-select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 9px;
}

/* Buttons (design classes + bootstrap overrides) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; font-family: var(--sans); font-size: 13px; font-weight: 500;
  border-radius: var(--r-ctrl); border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn-primary,
.btn.btn-primary {
  background: var(--blue); color: #F4F8FC; border-color: var(--blue);
  box-shadow: 0 1px 2px rgba(20,33,46,.12);
}
.btn-primary:hover,
.btn.btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #F4F8FC; }
.btn-ghost,
.btn.btn-outline-primary, .btn.btn-outline-secondary, .btn.btn-secondary {
  background: var(--surface); color: var(--ink); border-color: var(--hair-strong);
}
.btn-ghost:hover,
.btn.btn-outline-primary:hover, .btn.btn-outline-secondary:hover, .btn.btn-secondary:hover {
  background: var(--ash); border-color: var(--muted-2); color: var(--ink);
}
.btn-sm, .btn.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-lg, .btn.btn-lg { height: 44px; padding: 0 22px; }
.btn-danger,
.btn.btn-danger, .btn.btn-outline-danger {
  background: var(--surface); color: var(--st-danger); border-color: var(--st-danger-bg);
}
.btn-danger:hover,
.btn.btn-danger:hover, .btn.btn-outline-danger:hover { background: var(--st-danger-bg); color: var(--st-danger); }
.toolbar-inner .btn-primary { height: 42px; }

/* ---- 6. Table (overrides uicomponents.css) ---- */
.data-table-wrapper { padding: 0; overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--surface); }

.data-table thead th {
  text-align: left;
  font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: #8CA3C9; background: var(--surface);
  padding: 12px 16px; border-bottom: 1px solid var(--hair-strong);
  white-space: nowrap; user-select: none;
}
.data-table thead th[role="button"]:hover { background: var(--surface); color: var(--blue); }
.data-table th.num, .data-table td.num,
.data-table th.actions, .data-table td.actions,
.data-table th.col-num, .data-table td.col-num { text-align: right; }

.data-table tbody td {
  padding: 14px 16px; vertical-align: middle;
  border-bottom: 1px solid var(--hair-2); color: var(--ink-2);
}
.data-table tbody tr { border-bottom: 0; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: transparent; }
.data-table tbody tr:hover td { background: #F7F7F8; }

/* NAME cell â€” bold ink link */
.row-name { font-family: var(--sans); font-weight: 600; font-size: 14px; color: var(--ink); cursor: pointer; }
.row-name:hover { text-decoration: underline; }

.cell-empty { color: var(--muted-2); }
.data-table td.num, .data-table td.col-num { font-feature-settings: "tnum"; color: var(--ink-2); }

/* Badges */
.badge-list { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 10px; border-radius: var(--r-badge);
  font-size: 11px; font-weight: 500; letter-spacing: .04em;
}
.badge-sold        { color: var(--st-sold);        background: var(--st-sold-bg); }
.badge-available   { color: var(--st-available);   background: var(--st-available-bg); }
.badge-booked      { color: var(--st-booked);      background: var(--st-booked-bg); }
.badge-reserved    { color: var(--st-reserved);    background: var(--st-reserved-bg); }
.badge-bankable    { color: var(--st-bankable);    background: var(--st-bankable-bg); }
.badge-transferred { color: var(--st-transferred); background: var(--st-transferred-bg); }
.badge-unreleased  { color: var(--st-cancelled);   background: var(--st-cancelled-bg); }
.badge-cancelled   { color: var(--st-cancelled);   background: var(--st-cancelled-bg); }
.badge-danger      { color: var(--st-danger);      background: var(--st-danger-bg); }
.badge-more { font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* ---- 7. Pager (overrides uicomponents + bootstrap) ---- */
.data-table-pager {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 18px; font-size: 12.5px; color: var(--muted);
}
.data-table-pager-summary {
  display: flex; align-items: baseline; gap: 6px;
  font-feature-settings: "tnum"; color: var(--ink-2);
}
.data-table-pager-total { font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1; }
.data-table-pager-label { font-size: 13px; font-weight: 600; }
.data-table-pager-page { font-size: 12px; color: var(--muted); }
.data-table-pager-page::before { content: "\00b7"; margin-right: 6px; }

/* Row total above a list; the figure itself carries the emphasis. */
.list-count {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  white-space: nowrap; margin-right: 4px;
}
.list-count strong {
  font-size: 19px; font-weight: 700; color: var(--ink);
  font-feature-settings: "tnum"; line-height: 1;
}
.list-count .list-count-sub { font-size: 12px; font-weight: 400; color: var(--muted); }
.list-count .list-count-sub::before { content: "\00b7"; margin-right: 6px; }
.data-table-pager-controls { display: flex; align-items: center; gap: 8px; }
.data-table-pager-pagesize { width: auto; height: 32px; font-size: 12px; }
.data-table-pager-pageinput { display: flex; align-items: center; gap: 6px; }
.data-table-pager-pageinput input {
  width: 56px; height: 32px; text-align: center;
  font-family: var(--mono); font-feature-settings: "tnum";
}
.data-table-pager .btn-group { display: inline-flex; gap: 2px; }
.data-table-pager .btn-group .btn {
  width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--hair-strong); border-radius: var(--r-ctrl);
  background: var(--surface); color: var(--muted-2);
}
.data-table-pager .btn-group .btn:hover:not(:disabled) { background: var(--ash); color: var(--ink-2); }
.data-table-pager .btn-group .btn:disabled { opacity: .55; cursor: default; }

/* ---- 8. Empty / skeleton tints ---- */
.empty-state { color: var(--muted); }
.empty-state-title { color: var(--ink); font-weight: 600; }
.empty-state-icon { color: var(--muted-2); opacity: .5; }

/* ---- 9. Modal (bootstrap overrides â€” scrim, serif title, tinted footer) ---- */
.modal-backdrop.show { background: rgba(14,39,72,.42); opacity: 1; }
.modal-content {
  border: 1px solid var(--hair); border-radius: var(--r-card);
  box-shadow: 0 24px 70px rgba(14,39,72,.22); background: var(--surface);
}
.modal-header { border-bottom: 1px solid var(--hair); padding: 18px 22px; }
.modal-title { font-family: var(--sans); font-weight: 600; font-size: 18px; color: var(--ink); }
.modal-subtitle { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.modal-body { padding: 22px; }
.modal-footer {
  border-top: 1px solid var(--hair); padding: 14px 22px;
  background: var(--blue-tint); display: flex; justify-content: flex-end; gap: 10px;
}

/* Form section labels (carry-over from old admin form helpers) */
.ut-section-label {
  color: var(--muted); border-bottom: 1px solid var(--hair);
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding-bottom: 7px; margin: 0 0 14px;
}
.ut-required { color: var(--st-danger); font-weight: 600; }
.ut-optional { color: var(--muted-2); font-weight: 400; letter-spacing: 0; text-transform: none; }
.ut-form-actions { border-top: 1px solid var(--hair); }


/* ---- 10. Stage tabs (SaleWizard, StepsManager) ---- */
.sw-stages {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--hair);
  overflow: hidden;
  margin-bottom: 1.75rem;
  position: relative;
  z-index: 10;
}

.sw-stage {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 0;
  border-right: 1px solid var(--hair);
  background: var(--surface);
  text-align: left;
  cursor: default;
  user-select: none;
}

.sw-stage:last-child {
  border-right: 0;
}

button.sw-stage {
  cursor: pointer;
  transition: background 0.12s;
}

button.sw-stage:hover {
  background: var(--blue-tint);
}

button.sw-stage:not(.active):hover::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--blue);
  opacity: 0.35;
}

.sw-stage.locked {
  cursor: not-allowed;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(
    45deg,
    transparent 0,
    transparent 6px,
    rgba(14, 39, 72, 0.05) 6px,
    rgba(14, 39, 72, 0.05) 7px
  );
}

.sw-stage.locked .sw-stage-name,
.sw-stage.locked .sw-stage-status {
  color: var(--muted-2);
}

.sw-stage.locked .sw-stage-num {
  color: var(--muted-2);
}

.sw-stage.active {
  background: var(--blue-tint);
}

.sw-stage.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--blue);
}

button.sw-stage.unsaved {
  background: var(--st-reserved-bg);
}

button.sw-stage.unsaved .sw-stage-name {
  color: var(--st-reserved);
}

button.sw-stage.unsaved .sw-stage-status {
  color: var(--st-reserved);
  font-weight: 600;
}

button.sw-stage.active.unsaved {
  background: var(--orange-soft);
}

.sw-stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sw-stage-num {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.sw-stage.active .sw-stage-num {
  color: var(--ink);
}

.sw-stage-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--hair-strong);
  background: var(--surface);
  flex-shrink: 0;
}

.sw-stage-dot.in-progress {
  border-color: var(--blue);
}

button.sw-stage.unsaved .sw-stage-dot.in-progress {
  border-color: var(--st-reserved);
}

.sw-stage-dot.saved {
  border-color: var(--st-sold);
  background: var(--st-sold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 8px;
}

.sw-stage-dot--na {
  border-style: dashed;
  border-color: var(--muted);
  background: transparent;
}

.sw-stage--na .sw-stage-name,
.sw-stage--na .sw-stage-status {
  color: var(--muted);
  opacity: 0.6;
}

.sw-stage-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 16px;
  color: var(--muted);
}

button.sw-stage:not(.active) .sw-stage-name {
  color: var(--ink-2);
}

.sw-stage.active .sw-stage-name {
  font-weight: 500;
  color: var(--ink);
}

button.sw-stage.active.unsaved .sw-stage-name {
  color: var(--st-reserved);
}

.sw-stage-status {
  font-size: 10px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* Shared derived-value tag (SaleForm, SaleAgentsList) */
.sf-derived-tag { font-size: 0.65rem; background: var(--bone); color: var(--muted); padding: 0.05rem 0.35rem; border-radius: 3px; font-weight: 500; margin-left: 0.25rem; text-transform: none; letter-spacing: 0; }


/* ============================================================
   11. CRM lead components (LeadFlow layout)
   ============================================================ */

/* ---- Greeting header ---- */
.greeting { margin-bottom: 16px; }
.greeting h1 { margin: 0; font-size: 22px; font-weight: 700; color: var(--ink); }
.greeting-date { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---- Unassigned alert banner ---- */
.alert-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 10px 16px; margin-bottom: 18px;
  background: var(--alert-bg); border: 1px solid #EAC8C4; border-radius: var(--r-card);
  color: var(--overdue); font-size: 13px; font-weight: 600; cursor: pointer; text-align: left;
}
.alert-banner:hover { border-color: var(--overdue); }
.alert-banner .alert-banner-text { display: inline-flex; align-items: center; gap: 8px; }
.alert-banner .alert-banner-count {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--overdue); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700;
}

/* ---- Stat strip: MINE / OVERALL groups of outlined chips ---- */
.stat-strip { display: flex; flex-wrap: wrap; gap: 28px; margin-bottom: 20px; }
.stat-group { min-width: 0; }
.stat-group-label {
  font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.stat-group-cards { display: flex; gap: 10px; flex-wrap: wrap; }

.stat-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  background: var(--surface); border: 1px solid var(--hair-strong);
  border-radius: var(--r-card); box-shadow: var(--shadow-card);
  cursor: pointer; font-family: var(--sans); white-space: nowrap;
  transition: border-color .12s, box-shadow .12s;
}
.stat-chip .stat-icon { display: inline-flex; font-size: 13px; color: #4E71E8; }
.stat-chip .stat-value { font-size: 15px; font-weight: 700; color: var(--ink); font-feature-settings: "tnum"; }
.stat-chip .stat-label { font-size: 13px; color: var(--ink-2); }
.stat-chip:hover { border-color: #9DB4F0; }
.stat-chip.active { border-color: #4E71E8; box-shadow: 0 0 0 3px rgba(78,113,232,.15); }
.stat-chip:disabled { cursor: default; }

/* Outline variants (match reference: blue = mine w/ content, orange = unassigned, red = inbound) */
.stat-chip--primary { border-color: #9DB4F0; }
.stat-chip--warn  { border-color: var(--orange); }
.stat-chip--warn .stat-icon { color: var(--orange); }
.stat-chip--alert { border-color: var(--st-danger); }
.stat-chip--alert .stat-icon { color: var(--st-danger); }

/* ---- Toolbar: showing count, pill dropdown filters, all chip, sort, view toggle ---- */
.leads-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.leads-toolbar .showing { font-size: 12.5px; color: var(--muted); white-space: nowrap; margin-right: 4px; }
.leads-toolbar .spacer { flex: 1; }

.filter-select {
  height: 32px; width: auto; padding: 0 28px 0 14px;
  border: 1px solid var(--hair-strong); border-radius: 999px;
  background-color: var(--surface); font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  cursor: pointer;
}
.filter-select:disabled { opacity: .55; cursor: default; }

.all-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px;
  background: var(--blue); border: 1px solid var(--blue); border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: #F3F5FA; cursor: pointer; white-space: nowrap;
}
.all-chip:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.all-chip .all-count { font-feature-settings: "tnum"; }

.sort-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--hair-strong);
  border-radius: var(--r-ctrl); font-size: 12px; font-weight: 500; color: var(--ink-2);
  cursor: pointer; white-space: nowrap;
}
.sort-toggle:hover { background: var(--blue-tint); }

.view-toggle { display: inline-flex; border: 1px solid var(--hair-strong); border-radius: var(--r-ctrl); overflow: hidden; }
.view-toggle button {
  border: 0; background: var(--surface); width: 34px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 14px; cursor: pointer;
}
.view-toggle button + button { border-left: 1px solid var(--hair-strong); }
.view-toggle button.active { background: var(--blue); color: #fff; }
.view-toggle button.active:hover { color: #fff; }
.view-toggle button:disabled { cursor: default; opacity: .55; }

/* Emails page Inbound/Sent tabs reuse .view-toggle but carry text labels,
   so let them size to content instead of the icon-only 34px width. */
.emails-tabs .view-toggle button {
  width: auto; padding: 0 14px; gap: 6px;
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.emails-tabs .view-toggle button i { font-size: 13px; }

.icon-btn {
  width: 32px; height: 32px; border: 1px solid var(--hair-strong); border-radius: var(--r-ctrl);
  background: var(--surface); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer;
}
.icon-btn:hover { color: var(--overdue); }
.icon-btn:disabled { opacity: .55; cursor: default; }

/* Leads page: toolbar sits flat on the page background, not in a card */
.leads-page .filter-bar { background: transparent; border: 0; box-shadow: none; padding: 0; margin-bottom: 0; }

/* ---- Lead grid rows ---- */
.lead-name { font-weight: 700; font-size: 14.5px; color: var(--ink); }
.lead-type { font-size: 12px; color: var(--muted-2); margin-left: 6px; }
.lead-new-chip {
  display: inline-flex; align-items: center; gap: 3px;
  height: 18px; padding: 0 7px; margin-left: 7px; border-radius: 4px;
  background: var(--orange-soft); color: var(--orange);
  font-size: 10px; font-weight: 700; letter-spacing: .03em;
}
.cell-mono { font-family: var(--mono); font-size: 12.5px; font-feature-settings: "tnum"; color: var(--muted); }
.overdue-text { color: var(--overdue); font-weight: 600; font-size: 12.5px; }
.ontrack-text { color: var(--ontrack); font-size: 12.5px; }

/* Next-action chip: solid red when overdue, neutral otherwise; click to edit */
.chip-next {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 12px; border: 0; border-radius: 7px;
  font-family: var(--mono); font-size: 12px; font-weight: 600; font-feature-settings: "tnum";
  background: var(--ash); color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.chip-next:hover { filter: brightness(.97); }
.chip-next--overdue { background: var(--overdue); color: #fff; }
.chip-next--empty { background: var(--surface); border: 1px solid var(--hair-strong); color: var(--muted); }
/* Deadline chip opens the custom calendar popover; nothing is saved until the
   user presses Confirm inside it. */
.deadline-cell { position: relative; display: inline-flex; }
.deadline-popover {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40;
  background: var(--surface); border: 1px solid var(--hair-strong);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(16, 24, 40, .18);
}

/* ---- Custom date-time picker (DateTimePicker.razor) ---- */
.dtp { display: flex; flex-direction: column; gap: 10px; padding: 14px; width: 272px; }
.dtp-head { display: flex; align-items: center; justify-content: space-between; }
.dtp-title { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.dtp-nav { display: inline-flex; gap: 2px; }
.dtp-nav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border: 0; border-radius: 7px;
  background: none; color: var(--ink-2); font-size: 13px; cursor: pointer;
}
.dtp-nav-btn:hover { background: var(--ash); color: var(--ink); }
.dtp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dtp-dow {
  text-align: center; font-size: 11px; font-weight: 600; color: var(--muted);
  padding-bottom: 2px; letter-spacing: .02em;
}
.dtp-day {
  height: 30px; border: 0; border-radius: 8px; background: none;
  font-family: var(--mono); font-size: 12.5px; font-feature-settings: "tnum";
  color: var(--ink); cursor: pointer;
}
.dtp-day:hover { background: var(--ash); }
.dtp-day--muted { color: var(--muted); opacity: .6; }
.dtp-day--today { box-shadow: inset 0 0 0 1px var(--hair-strong); font-weight: 700; }
.dtp-day--selected,
.dtp-day--selected:hover { background: var(--blue); color: #fff; font-weight: 700; }
.dtp-time {
  display: flex; align-items: center; gap: 6px;
  border-top: 1px solid var(--hair); padding-top: 10px;
  color: var(--ink-2); font-size: 13px;
}
.dtp-time-select { width: 64px; font-family: var(--mono); font-feature-settings: "tnum"; }
.dtp-time-sep { font-weight: 700; color: var(--muted); }
.dtp-today {
  margin-left: auto; border: 0; background: none; padding: 4px 6px;
  font-size: 12.5px; font-weight: 600; color: var(--blue); cursor: pointer; border-radius: 6px;
}
.dtp-today:hover { background: var(--blue-tint); }
.dtp-foot { display: flex; gap: 8px; justify-content: flex-end; }

/* Compact selects used inline in table rows */
.table-select { height: 32px; width: auto; min-width: 120px; font-size: 12.5px; padding: 0 30px 0 10px; }

/* Expandable row shell */
.data-table tbody tr.lead-row { cursor: pointer; }
.data-table tbody tr.lead-row:hover td { background: var(--blue-tint); }
.data-table tbody tr.lead-row:hover td:first-child { box-shadow: inset 3px 0 0 var(--orange); }

/* Expanded parent row keeps a divider below it so it stays visually
   separated from the workspace that opens underneath, plus a persistent
   orange marker on its left edge. */
.data-table tbody tr.lead-row.expanded td {
  background: var(--blue-tint);
  border-bottom: 1px solid var(--hair-strong);
}
.data-table tbody tr.lead-row.expanded td:first-child { box-shadow: inset 3px 0 0 var(--orange); }

/* Workspace row: indented from the left with a navy accent bar,
   so it clearly reads as a child of the row above, not a list item. */
.data-table tbody tr.lead-expand-row > td {
  padding: 14px 20px 22px 44px; background: var(--blue-tint);
  border-bottom: 2px solid var(--hair-strong); cursor: default;
}

/* ---- Lead workspace (expanded row): white card lifted off the tinted row ---- */
.lead-workspace {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

.lw-headline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
/* Vendor email: plain text; only the pencil (shown on hover) starts the edit. */
.lw-headline .lw-email {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--ink-2);
}
.lw-headline .lw-email-edit {
  border: 0; background: transparent; padding: 0; line-height: 1;
  cursor: pointer; opacity: 0; transition: opacity .12s;
}
.lw-headline .lw-email:hover .lw-email-edit { opacity: 1; }
.lw-headline .lw-email-edit .bi { font-size: 11px; color: var(--muted-2); }
.lw-headline .lw-email-edit:hover .bi { color: var(--blue); }
.lw-headline .lw-email-edit:disabled { cursor: default; opacity: .6; }
.lw-email-input {
  border: 1px solid var(--blue); border-radius: 6px; padding: 1px 8px;
  font-size: 12.5px; color: var(--ink); width: 230px; outline: none;
}
.lw-icon-btn {
  border: 0; background: transparent; padding: 2px; color: var(--muted);
  display: inline-flex; align-items: center; font-size: 13px; cursor: pointer;
}
.lw-icon-btn:hover { color: var(--blue); }
.lw-icon-btn:disabled { opacity: .5; cursor: default; }
.lw-head-actions { margin-left: auto; display: inline-flex; gap: 8px; }
.lw-introducer {
  height: 24px; width: auto; max-width: 240px;
  font-size: 11px; font-weight: 600;
  border: 1px solid var(--hair); border-radius: 6px;
  background-color: var(--surface); color: var(--ink-2);
  padding: 0 26px 0 8px; background-position: right 8px center;
}

/* Pricing inline at top-left of the workspace (£-prefixed input groups) */
.lw-price-group { width: 150px; flex-wrap: nowrap; }
.lw-price-group .input-group-text {
  height: 30px; padding: 0 9px; font-size: 12px;
  background: var(--ash); border-color: var(--hair-strong); color: var(--muted);
  border-radius: var(--r-ctrl) 0 0 var(--r-ctrl);
}
.lw-price-group input {
  height: 30px; font-size: 12.5px; font-family: var(--mono); font-feature-settings: "tnum";
  border-radius: 0 var(--r-ctrl) var(--r-ctrl) 0;
}

.lw-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 8px 0 4px; }
.lw-title h3 { margin: 0; font-size: 19px; font-weight: 700; color: var(--ink); }
.lw-title .lw-type { font-size: 12.5px; color: var(--muted); }
.lw-title .lw-edit { font-size: 12.5px; color: var(--blue); font-weight: 500; cursor: pointer; }
.lw-title .lw-edit:hover { text-decoration: underline; }

.lw-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--hair-strong); margin: 12px 0 0; }
.lw-tab {
  border: 0; background: transparent; padding: 8px 14px;
  font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.lw-tab:hover { color: var(--ink); }
.lw-tab.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--blue); }
.lw-panel { padding: 14px 0 0; }

.lw-activity { width: 100%; border-collapse: collapse; font-size: 13px; }
/* Scoped with .lead-workspace so these beat the outer .data-table thead/td rules,
   which otherwise bleed into this nested table (padding, sticky header, hover tint). */
.lead-workspace .lw-activity thead { position: static; }
.lead-workspace .lw-activity thead th {
  text-align: left; font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); background: transparent; padding: 6px 12px 6px 0; border-bottom: 1px solid var(--hair);
}
.lead-workspace .lw-activity tbody td {
  padding: 9px 12px 9px 0; border-bottom: 1px solid var(--hair-2);
  vertical-align: top; color: var(--ink-2); background: transparent;
}
.lead-workspace .lw-activity tbody tr:hover td { background: transparent; }
.lw-activity .lw-date { font-family: var(--mono); font-size: 12px; white-space: nowrap; color: var(--blue); }
.lw-activity .lw-type { font-weight: 600; white-space: nowrap; }
.lw-activity .lw-type i { margin-right: 4px; }
.lw-activity .lw-type--comment { color: var(--st-bankable); }
.lw-activity .lw-type--update { color: var(--st-reserved); }
.lw-activity .lw-type--created { color: var(--st-available); }
.lw-activity .lw-type--email-in { color: var(--st-transferred); }
.lw-activity .lw-type--email-out { color: var(--st-booked); }
.lw-activity .lw-by { color: var(--muted); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Expandable email rows in the activity timeline */
.lw-activity .lw-row-email { cursor: pointer; }
.lead-workspace .lw-activity tbody tr.lw-row-email:hover td { background: var(--surface-2, #f6f8fb); }
.lw-activity .lw-expand-chevron { margin-left: 6px; font-size: 11px; color: var(--muted-2); }
.lead-workspace .lw-activity tbody tr.lw-row-email-detail td {
  padding: 0 8px 12px 8px; background: transparent;
}
.lw-email-detail {
  border: 1px solid var(--hair-strong); border-radius: 8px;
  background: var(--surface); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px; text-align: left;
}
.lw-email-detail-meta {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-size: 12px; color: var(--ink-2);
}
.lw-email-detail-label { font-weight: 600; color: var(--muted); margin-right: 4px; }
.lw-email-detail-body {
  font-size: 13px; color: var(--ink); line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
  max-height: 320px; overflow-y: auto;
}
.lw-email-detail-body--html { white-space: normal; }
.lw-email-detail-body--html p { margin: 0 0 10px 0; }
.lw-email-detail-actions { display: flex; justify-content: flex-start; }

/* Inline reply composer inside the expanded email row */
.lw-reply {
  display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid var(--hair); padding-top: 10px;
}
.lw-reply-meta { font-size: 12px; color: var(--muted); }
.lw-reply-text { font-size: 13px; resize: vertical; }
.lw-reply-actions { display: flex; gap: 8px; }

.lw-composer { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.lw-composer input { flex: 1; }
.lw-send {
  width: 38px; height: 34px; flex: none;
  border: 1px solid #C7D6F2; border-radius: 8px;
  background: #EAF0FE; color: #4E71E8;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; cursor: pointer;
}
.lw-send:hover { border-color: #4E71E8; }
.lw-send:disabled { opacity: .5; cursor: default; }

/* Inbound lead detail: email left, AI-mapped fields right. Capped to a readable
   width and forced to respect it (min-width: 0) - without that, a long unbroken
   string in the email body (e.g. a tracking URL with no spaces) forces its grid
   track to its min-content width, squeezing the AI-mapped column to almost nothing. */
.inbound-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start;
  max-width: 1140px;
}
@media (max-width: 900px) {
  .inbound-detail-grid { grid-template-columns: 1fr; }
}
.inbound-detail-email, .inbound-detail-extract { min-width: 0; }
.inbound-detail-email .email-view-body { max-height: 420px; overflow-y: auto; }
.inbound-extract-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.inbound-extract-title {
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
}

/* Inbound lead extracted-data table (screenshot-style key/value rows) */
.extract-table {
  width: 100%; border-collapse: collapse; margin-bottom: 14px;
  border: 1px solid var(--hair-2); border-radius: 8px; overflow: hidden;
}
.extract-table tr:nth-child(odd) { background: var(--ash); }
.extract-table th {
  width: 170px; padding: 8px 14px; text-align: left; vertical-align: top;
  color: #9f2237; font-size: 12.5px; font-weight: 600;
}
.extract-table td {
  padding: 8px 14px; font-size: 13px; color: var(--ink); word-break: break-word;
}

/* Footer: tracking chips, shown on the vendor info tab only */
.lw-footer {
  display: flex; align-items: center;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hair-2);
}
.lw-chip-muted {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px;
  border-radius: 999px; background: var(--ash); color: var(--muted);
  font-size: 11.5px; font-weight: 500;
  max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
a.lw-chip-muted { text-decoration: none; }
a.lw-chip-muted:hover { color: var(--ink); }
.lw-tracking { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lw-portal-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.lw-portal-meta .lw-chip-muted { gap: 5px; }

/* Right action panel: WhatsApp fills the space, CALL NOW sits at the bottom. */
.lw-side { display: flex; flex-direction: column; gap: 10px; }
.lw-side-call {
  margin-top: auto; display: flex; flex-direction: column; gap: 6px;
  padding-top: 10px; border-top: 1px solid var(--hair);
}
.btn-callnow,
.btn.btn-callnow {
  width: 100%; height: 44px; font-size: 14px; font-weight: 700;
  background: #3D5896; color: #fff; border: 1px solid #3D5896;
  border-radius: var(--r-card);
}
.btn-callnow:disabled { cursor: default; }
.lw-muted-note { font-size: 11.5px; color: var(--muted); text-align: center; }

/* ============ Emails page ============ */

.emails-tabs { margin-bottom: 14px; }

/* ---- Email template editor (two-pane modal: form left, sample preview right) ---- */
.template-editor-grid {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px;
  align-items: start;
}
@media (max-width: 900px) { .template-editor-grid { grid-template-columns: 1fr; } }

.token-toolbar { display: flex; flex-wrap: wrap; gap: 6px; }
.token-chip {
  height: 24px; padding: 0 10px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--hair-strong); border-radius: var(--r-badge);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
  display: inline-flex; align-items: center;
}
.token-chip:hover { border-color: var(--blue); color: var(--blue); }
.token-chip:disabled { opacity: .55; cursor: default; }

.template-editor-preview { position: sticky; top: 0; }
.template-preview-title { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.template-preview-card {
  border: 1px solid var(--hair); border-radius: var(--r-card);
  background: var(--ash); padding: 14px 16px;
}
.template-preview-subject {
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--hair-strong);
}
.template-preview-body { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.template-preview-body p { margin: 0 0 .6em; }
.template-preview-body p:last-child { margin-bottom: 0; }
.template-preview-body ul, .template-preview-body ol { margin: 0 0 .6em; padding-left: 1.4em; }

/* ---- CodeMirror HTML editor themed to the design system ---- */
.code-editor .CodeMirror {
  height: 300px; border: 1px solid var(--hair-strong); border-radius: 8px;
  font-size: 12.5px; line-height: 1.5;
}
.code-editor .CodeMirror-focused { border-color: var(--blue); }
.code-editor .CodeMirror-gutters { background: var(--surface); border-right: 1px solid var(--hair); }
.code-editor .CodeMirror-linenumber { color: var(--muted); }
.code-editor-compose .CodeMirror { height: 230px; }

.check-filter {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.check-filter input { accent-color: var(--primary); }

.email-dot-col { width: 26px; }
.email-unread-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
}
/* Gmail convention: unread stands out in bold, read rows sit back at normal weight */
tr.email-unread .email-from-name,
tr.email-unread .email-subject { font-weight: 700; }
tr.email-dismissed td { opacity: .55; }

.email-from-name { font-weight: 400; color: var(--ink); }
.email-from-addr { font-size: 12px; color: var(--muted); }

.email-subject {
  border: 0; padding: 0; background: none; cursor: pointer;
  color: var(--ink); font-size: inherit; font-weight: 400; text-align: left;
}
.email-preview {
  font-size: 12px; color: var(--muted); margin-top: 2px;
  max-width: 480px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.email-view-meta {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; color: var(--ink-2);
  padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--hair-2);
}
.email-view-label {
  display: inline-block; min-width: 70px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted);
}
/* overflow-wrap lets long unbroken runs (tracking URLs with no spaces) wrap instead of
   forcing their container - and its CSS Grid track, in the inbound-detail-grid case -
   wider than intended. */
.email-view-body { font-size: 13.5px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.email-view-body--html { white-space: normal; max-height: 420px; overflow-y: auto; }
.email-view-body--html img { max-width: 100%; height: auto; }

/* ---- Expandable email rows (same interaction pattern as the leads table) ---- */
.data-table tbody tr.email-row { cursor: pointer; }
.data-table tbody tr.email-row:hover td { background: var(--blue-tint); }
.data-table tbody tr.email-row:hover td:first-child { box-shadow: inset 3px 0 0 var(--orange); }
.data-table tbody tr.email-row.expanded td {
  background: var(--blue-tint);
  border-bottom: 1px solid var(--hair-strong);
}
.data-table tbody tr.email-row.expanded td:first-child { box-shadow: inset 3px 0 0 var(--orange); }
.data-table tbody tr.email-expand-row > td {
  padding: 14px 20px 22px 44px; background: var(--blue-tint);
  border-bottom: 2px solid var(--hair-strong); cursor: default;
}

/* Reader card lifted off the tinted expand row */
.email-detail {
  background: var(--surface); border: 1px solid var(--hair-strong);
  border-radius: var(--r-card, 10px); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}
.email-detail .email-view-meta { margin-bottom: 0; }
.email-detail .email-view-attachments { margin-top: 0; }
.email-detail .lw-reply { margin-top: 0; }
.email-detail-actions { display: flex; gap: 8px; border-top: 1px solid var(--hair); padding-top: 12px; }

/* Archived rows slide out to the right before the list refresh removes them */
.data-table tbody tr.email-row td { transition: opacity .28s ease, transform .28s ease; }
.data-table tbody tr.email-row--leaving td { opacity: 0; transform: translateX(32px); }

/* Row action icon buttons */
.email-row-actions { display: inline-flex; gap: 4px; }
.email-action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid transparent; background: none; color: var(--ink-2);
  font-size: 14px; cursor: pointer; padding: 0;
}
.email-action-btn:hover {
  background: var(--surface); border-color: var(--hair-strong); color: var(--blue);
}
.email-action-btn:disabled { opacity: .5; cursor: default; }

/* Inline reply composer inside the email reader */
.email-view-body + .lw-reply,
.email-view-body--html + .lw-reply,
.email-view-attachments + .lw-reply { margin-top: 14px; }

/* ---- Introducer form: sectioned layout with matching-priority chips ---- */
.intro-form-section { border-top: 1px solid var(--hair); padding-top: 14px; margin-top: 14px; }
.intro-form-section--first { border-top: 0; padding-top: 0; margin-top: 0; }
.intro-form-section-title {
  font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.intro-section-explain { font-size: 12.5px; color: var(--ink-2); margin: -4px 0 12px; }
.intro-priority {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; margin-right: 4px; border-radius: 50%;
  background: var(--blue); color: #fff;
  font-size: 11px; font-weight: 700; vertical-align: text-bottom;
}
.intro-field-hint { font-size: 12px; color: var(--muted); margin: -2px 0 6px; }

/* Master agreement template panel on the Solicitors page (the rest of the seller
   agreement dialog's styles live in AgreementDialog.razor.css) */
.agr-template-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--bg-2, #f7f7f8); border: 1px solid var(--hair);
  border-radius: 10px; padding: 12px 16px; margin-bottom: 14px;
}
.agr-template-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.agr-template-title { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.agr-template-file { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; }
.agr-template-meta { color: var(--muted); }
.agr-template-actions { display: flex; align-items: center; gap: 10px; }
.agr-template-error { color: var(--danger, #c02626); font-size: 12.5px; }

/* "My Emails" inline view on the leads page */
.my-emails-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 0 10px;
}
.my-emails-title {
  font-size: 16px; font-weight: 700; margin: 0;
  display: flex; align-items: center; gap: 8px;
}

.email-link-context { font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.email-link-search { position: relative; margin-bottom: 12px; }
.email-link-search svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted); pointer-events: none;
}
.email-link-search .input { height: 40px; padding-left: 38px; width: 100%; }
.email-link-empty { font-size: 13px; color: var(--muted); }
.email-link-results {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 300px; overflow-y: auto;
}
.email-link-result {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 12px; border: 1px solid var(--hair-strong); border-radius: var(--r-ctrl);
  background: var(--surface); cursor: pointer; text-align: left;
}
.email-link-result:hover { border-color: var(--primary); }
.email-link-result:disabled { opacity: .55; cursor: default; }
.email-link-name { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.email-link-addr { font-size: 12px; color: var(--muted); }

/* Inbound email attachments */
.email-attach-hint {
  display: inline-flex; align-items: center; gap: 2px; margin-left: 6px;
  font-size: 11.5px; color: var(--muted);
}
.email-view-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* Renders a lead badge as a clickable link without adding button chrome — used on the
   Sent Emails, Received WhatsApps and Inbound Leads list pages. */
.lead-link-btn {
  border: 0;
  padding: 0.15rem 0.55rem;
  cursor: pointer;
  font-family: inherit;
}
.lead-link-btn:hover {
  filter: brightness(0.95);
}
.email-attachment {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border: 1px solid var(--hair-strong); border-radius: 999px;
  background: var(--surface); font-size: 12.5px; color: var(--ink); text-decoration: none;
  cursor: pointer; font-family: inherit;
}
.email-attachment:hover { border-color: var(--blue); color: var(--blue); }
.email-attachment .bi { color: var(--muted); font-size: 12px; }
.email-attachment-size { color: var(--muted); font-size: 11.5px; }
/* Save-attachment-as-document strip (expanded email row) */
.lw-save-doc {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ink-2);
}
.lw-save-doc-type { width: auto; min-width: 160px; font-size: 12.5px; }
.lw-save-doc-note {
  font-size: 12.5px; color: var(--st-available);
  display: inline-flex; align-items: center; gap: 5px;
}

/* Documents tab manager */
.lw-doc-name {
  border: 0; background: transparent; padding: 0; cursor: pointer;
  font-size: 13px; color: var(--ink); text-align: left;
}
.lw-doc-name:hover { color: var(--blue); text-decoration: underline; }
.lw-doc-type-select { width: auto; min-width: 150px; font-size: 12.5px; }
.lw-doc-source { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.lw-doc-confirm { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }

/* File preview modal */
.lw-preview-image { max-width: 100%; max-height: 65vh; display: block; margin: 0 auto; border-radius: 6px; }
.lw-preview-frame { width: 100%; height: 65vh; border: 1px solid var(--hair-strong); border-radius: 6px; }
.lw-preview-actions { display: flex; justify-content: flex-end; margin-top: 12px; }

/* ============================================================
   Seller portal (public, anonymous — /portal)
   Themed to the TCPA website: crimson #BA0E42 primary, green
   #8FC373 secondary, dark-grey header with the white logo, Roboto.
   ============================================================ */
.portal-shell {
  /* Website palette, scoped so the admin design system is untouched. */
  --tc-red:        #BA0E42;
  --tc-red-dark:   #950A34;
  --tc-red-soft:   #F8E7ED;
  --tc-green:      #8FC373;
  --tc-green-soft: #D8EDC8;
  --tc-green-dark: #3F5C10;
  --tc-dark:       #3A3939;
  --tc-grey:       #6E6E6E;
  --tc-hair:       #E6E6E6;

  min-height: 100vh; display: flex; flex-direction: column; background: #F5F5F5;
  font-family: 'Roboto', system-ui, -apple-system, sans-serif; color: var(--tc-dark);
}
.portal-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 28px; background: var(--tc-dark);
}
.portal-logo { height: 30px; width: auto; }
.portal-topbar-tag {
  margin-left: auto; font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, .75);
  text-transform: uppercase; letter-spacing: .08em;
}
.portal-main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 28px 20px 48px; }
.portal-footer { padding: 18px; text-align: center; font-size: 12px; color: var(--tc-grey); }

/* Website-style controls: crimson pill buttons */
.portal-shell .btn { border-radius: 999px; font-weight: 500; }
.portal-shell .btn-primary {
  background: var(--tc-red); border-color: var(--tc-red); color: #fff;
}
.portal-shell .btn-primary:hover, .portal-shell .btn-primary:focus,
.portal-shell .btn-primary:active {
  background: var(--tc-red-dark); border-color: var(--tc-red-dark); color: #fff;
}
.portal-shell .btn-primary:disabled { background: var(--tc-red); border-color: var(--tc-red); opacity: .45; }
.portal-shell .btn-outline-secondary {
  border-color: var(--tc-grey); color: var(--tc-dark); background: #fff;
}
.portal-shell .btn-outline-secondary:hover { background: var(--tc-hair); border-color: var(--tc-grey); color: var(--tc-dark); }
.portal-shell a { color: var(--tc-red); }

.portal-login { max-width: 480px; margin: 48px auto 0; }
.portal-card {
  background: #fff; border: 1px solid var(--tc-hair); border-radius: 12px;
  padding: 24px; box-shadow: 0 1px 3px rgba(58, 57, 57, .07);
}
.portal-card + .portal-card { margin-top: 16px; }
.portal-card-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700; color: var(--tc-dark); margin: 0 0 6px;
}
.portal-card-title .bi { color: var(--tc-red); font-size: 17px; }
.portal-card-lede { font-size: 14px; color: var(--tc-grey); margin: 0 0 18px; }

.portal-success { display: flex; gap: 12px; margin-bottom: 12px; }
.portal-success .bi { font-size: 24px; color: var(--tc-green-dark); }
.portal-success p { font-size: 13.5px; color: var(--tc-grey); margin: 4px 0 0; }

/* Lead confirmation banner ("Welcome back, John") */
.portal-lead-banner {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start;
  background: #fff; border: 1px solid var(--tc-hair); border-left: 4px solid var(--tc-red);
  border-radius: 12px; padding: 22px 24px; margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(58, 57, 57, .07);
}
@media (max-width: 900px) { .portal-lead-banner { grid-template-columns: 1fr; } }
.portal-lead-greeting h1 { font-size: 24px; font-weight: 700; color: var(--tc-dark); margin: 0 0 8px; }
.portal-lead-greeting p { font-size: 14px; color: var(--tc-grey); margin: 0; max-width: 52ch; }
.portal-lead-greeting strong { color: var(--tc-dark); }
.portal-lead-details {
  background: #F5F5F5; border-radius: 10px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.portal-lead-detail { display: flex; gap: 10px; font-size: 13px; }
.portal-lead-label { width: 52px; flex: none; color: var(--tc-grey); }
.portal-lead-value { font-weight: 500; color: var(--tc-dark); overflow-wrap: anywhere; }
.portal-lead-note { font-size: 12px; color: var(--tc-grey); margin-top: 6px; }

/* Step indicator */
.portal-steps { display: flex; align-items: center; gap: 10px; margin: 0 2px 18px; }
.portal-step {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--tc-grey);
}
.portal-step-dot {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 2px solid #C6C6C6; color: var(--tc-grey);
  font-size: 12px; font-weight: 700;
}
.portal-step.active { color: var(--tc-dark); font-weight: 700; }
.portal-step.active .portal-step-dot { background: var(--tc-red); border-color: var(--tc-red); color: #fff; }
.portal-step.done { color: var(--tc-green-dark); }
.portal-step.done .portal-step-dot { background: var(--tc-green); border-color: var(--tc-green); color: #fff; }
.portal-step-line { flex: 1; height: 2px; background: #C6C6C6; border-radius: 2px; max-width: 90px; }

/* Two-column: wizard + marketing sidebar */
.portal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .portal-grid { grid-template-columns: 1fr; } }

/* Call-time option grid */
.portal-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px; }
@media (max-width: 700px) { .portal-options { grid-template-columns: 1fr; } }
.portal-option {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; border: 1px solid #C6C6C6; border-radius: 999px;
  background: #fff; font-size: 13px; color: var(--tc-dark);
  cursor: pointer; user-select: none; margin: 0;
}
.portal-option:hover { border-color: var(--tc-red); }
.portal-option.selected { background: var(--tc-red-soft); border-color: var(--tc-red); font-weight: 700; }
.portal-option input { accent-color: var(--tc-red); margin: 0; }

/* Document upload cards */
.portal-doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }
@media (max-width: 700px) { .portal-doc-grid { grid-template-columns: 1fr; } }
.portal-doc-card { border: 1px solid var(--tc-hair); border-radius: 10px; padding: 16px; }
.portal-doc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.portal-doc-name { font-weight: 700; font-size: 14px; color: var(--tc-dark); }
.portal-doc-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--tc-grey);
  border: 1px solid #C6C6C6; border-radius: 999px; padding: 2px 9px;
}
.portal-doc-badge.uploaded { color: var(--tc-green-dark); border-color: var(--tc-green); background: var(--tc-green-soft); }
.portal-doc-hint { font-size: 12.5px; color: var(--tc-grey); margin: 0 0 14px; min-height: 38px; }
.portal-upload-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 9px 12px; border: 1px solid var(--tc-red); border-radius: 999px;
  background: #fff; font-size: 13px; font-weight: 600; color: var(--tc-red);
  cursor: pointer; margin: 0; transition: .15s ease-in-out;
}
.portal-upload-btn:hover { background: var(--tc-red); color: #fff; }
.portal-upload-btn.disabled { opacity: .6; pointer-events: none; }
.portal-upload-btn input[type="file"] { display: none; }

/* Wizard footer nav */
.portal-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portal-btn-continue { min-width: 150px; }

/* Completion */
.portal-complete {
  border: 1px solid var(--tc-green); border-radius: 10px;
  background: var(--tc-green-soft); padding: 16px 18px; margin-bottom: 16px;
}
.portal-complete-head { display: flex; gap: 10px; margin-bottom: 10px; }
.portal-complete-head .bi { font-size: 22px; color: var(--tc-green-dark); }
.portal-complete-head strong { color: var(--tc-green-dark); display: block; }
.portal-complete-head div div { font-size: 13px; color: var(--tc-dark); }
.portal-complete p { font-size: 13.5px; color: var(--tc-dark); margin: 0; }
.portal-next-steps {
  border: 1px solid var(--tc-hair); border-radius: 10px; padding: 16px 18px; margin-bottom: 20px;
}
.portal-next-steps strong { display: block; margin-bottom: 8px; color: var(--tc-dark); font-size: 14px; }
.portal-next-steps ul { list-style: none; margin: 0; padding: 0; }
.portal-next-steps li {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 13px; color: var(--tc-green-dark); padding: 3px 0;
}
.portal-help { display: flex; align-items: center; gap: 12px; padding: 16px 20px; font-size: 14px; }
.portal-help-icon {
  width: 34px; height: 34px; border-radius: 50%; background: var(--tc-red); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px; flex: none;
}
.portal-help a { font-weight: 700; text-decoration: none; }

/* Marketing sidebar */
.portal-sidebar { display: flex; flex-direction: column; gap: 16px; }
.portal-sidebar .portal-card + .portal-card { margin-top: 0; }
.portal-side-title { font-size: 15px; font-weight: 700; color: var(--tc-dark); margin: 0 0 14px; }
.portal-benefit { display: flex; gap: 10px; margin-bottom: 14px; }
.portal-benefit:last-child { margin-bottom: 0; }
.portal-benefit .bi { color: var(--tc-red); font-size: 16px; margin-top: 1px; }
.portal-benefit strong { display: block; font-size: 13px; color: var(--tc-dark); }
.portal-benefit p { font-size: 12px; color: var(--tc-grey); margin: 2px 0 0; }
.portal-track-record { background: #FBF3F6; text-align: center; }
.portal-track-record .portal-side-title { text-align: left; }
.portal-stat { padding: 6px 0; }
.portal-stat-value { display: block; font-size: 26px; font-weight: 700; color: var(--tc-red); }
.portal-stat-label { font-size: 11.5px; color: var(--tc-grey); }
.portal-stars { color: #E5A62E; font-size: 14px; letter-spacing: 2px; margin-bottom: 8px; }
.portal-testimonial p { font-size: 12.5px; color: var(--tc-dark); font-style: italic; margin: 0 0 8px; }
.portal-testimonial span { font-size: 12px; color: var(--tc-grey); }
.portal-questions { background: var(--tc-red); color: #fff; text-align: center; }
.portal-questions strong { display: block; margin-bottom: 6px; }
.portal-questions p { font-size: 12.5px; color: rgba(255, 255, 255, .88); margin: 0 0 12px; }
.portal-questions .btn-light { color: var(--tc-red); font-weight: 700; }

/* ---- Voice calls (Twilio) ---- */

/* In-progress call panel under the lead headline */
.lw-call-panel {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 14px; margin-bottom: 10px;
  background: var(--panel); border: 1px solid var(--hair); border-radius: var(--r-card);
  font-size: 13px;
}
.lw-call-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-2); }
.lw-call-status--live { color: var(--ok, #2E7D32); }
.lw-call-status--live i { animation: lw-call-pulse 1.4s ease-in-out infinite; }
@keyframes lw-call-pulse { 50% { opacity: 0.35; } }

/* Expanded call row in the activity timeline */
.lw-call-audio { display: block; width: 100%; max-width: 460px; height: 36px; }
.lw-call-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 20px; }
.lw-call-fact { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.lw-call-transcript summary {
  cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.lw-call-transcript pre {
  margin: 8px 0 0; padding: 10px 12px; max-height: 320px; overflow: auto;
  background: var(--panel); border: 1px solid var(--hair); border-radius: 6px;
  font-family: inherit; font-size: 12.5px; white-space: pre-wrap;
}

/* Missed-calls banner on the leads board */
.missed-calls {
  margin-bottom: 18px; padding: 10px 16px;
  background: var(--alert-bg); border: 1px solid #EAC8C4; border-radius: var(--r-card);
}
.missed-calls-head {
  display: flex; align-items: center; gap: 8px;
  color: var(--overdue); font-size: 13px; font-weight: 700; margin-bottom: 6px;
}
.missed-call-row {
  display: flex; align-items: center; gap: 14px;
  padding: 5px 0; border-top: 1px solid #EAC8C4; font-size: 12.5px;
}
.missed-call-when { color: var(--ink-3); white-space: nowrap; }
.missed-call-who { flex: 1; display: inline-flex; align-items: center; gap: 8px; }
.missed-call-lead {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--brand); font-weight: 600; text-decoration: underline;
}
.missed-call-agent { color: var(--ink-3); }
.missed-call-dismiss {
  border: 0; background: none; padding: 2px 6px; cursor: pointer; color: var(--ink-3);
}
.missed-call-dismiss:hover { color: var(--overdue); }

/* ---- WhatsApp chat ---- */

.wa-chat { display: flex; flex-direction: column; gap: 10px; text-align: left; }

.wa-messages {
    display: flex; flex-direction: column; gap: 6px;
    max-height: 420px; overflow-y: auto; padding: 12px;
    background: #f0ede6; border-radius: 10px;
}

.wa-row { display: flex; }
.wa-row-out { justify-content: flex-end; }
.wa-row-in { justify-content: flex-start; }

.wa-bubble {
    max-width: 75%; padding: 8px 12px; border-radius: 12px;
    font-size: .9rem; line-height: 1.35; box-shadow: 0 1px 1px rgba(0,0,0,.08);
}
.wa-bubble-out { background: #d9fdd3; border-bottom-right-radius: 4px; }
.wa-bubble-in { background: #fff; border-bottom-left-radius: 4px; }
.wa-bubble-failed { background: #fdecea; border: 1px solid #f5c6cb; }

.wa-body { white-space: pre-wrap; word-break: break-word; }

.wa-meta {
    display: flex; gap: 6px; justify-content: flex-end; align-items: center;
    margin-top: 3px; font-size: .72rem; color: #667781;
}
.wa-ticks { letter-spacing: -2px; }
.wa-ticks-read { color: #53bdeb; }

.wa-error { margin-top: 4px; font-size: .78rem; color: #b02a37; }

.wa-media { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.wa-media audio { max-width: 260px; height: 36px; }
.wa-media video { max-width: 260px; border-radius: 8px; }
.wa-media img { max-width: 200px; max-height: 200px; border-radius: 8px; cursor: pointer; }
.wa-media-file { font-size: .85rem; }
.wa-media-save {
    border: none; background: none; color: #667781; cursor: pointer;
    padding: 2px 4px; border-radius: 4px; font-size: .85rem;
}
.wa-media-save:hover { background: rgba(0,0,0,.06); color: #1f2c33; }

.wa-composer { display: flex; gap: 8px; align-items: flex-end; }
.wa-composer textarea, .wa-composer .form-select { flex: 1; }
.btn-wa-send {
    background: #25d366; color: #fff; border: none;
    width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-wa-send:hover:not(:disabled) { background: #1faa52; color: #fff; }
.btn-wa-send:disabled { opacity: .5; }

.wa-window-note { font-size: .78rem; color: #667781; }
.wa-template-preview {
    padding: 8px 12px; background: #f8f9fa; border: 1px dashed #ced4da;
    border-radius: 8px; font-size: .85rem; color: #495057; white-space: pre-wrap;
}
.wa-thread-actions { display: flex; justify-content: flex-end; }

/* ---- WhatsApp inbound banner (Leads page) ---- */

.wa-banner {
  margin-bottom: 18px; padding: 10px 16px;
  background: #e9f9ef; border: 1px solid #bfe8cd; border-radius: var(--r-card);
}
.wa-banner-head {
  display: flex; align-items: center; gap: 8px;
  color: #1a7f4b; font-size: 13px; font-weight: 700; margin-bottom: 6px;
}
.wa-banner-row {
  display: flex; align-items: center; gap: 14px;
  padding: 5px 0; border-top: 1px solid #bfe8cd; font-size: 12.5px;
}
.wa-banner-when { color: var(--ink-3); white-space: nowrap; }
.wa-banner-who { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.wa-banner-name { font-weight: 600; }
.wa-banner-lead {
  border: none; background: none; padding: 0; cursor: pointer;
  color: #1a7f4b; font-weight: 600; text-decoration: underline;
}
.wa-banner-preview {
  flex: 1; color: var(--ink-2); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.wa-banner-dismiss {
  border: none; background: none; color: var(--ink-3); cursor: pointer;
  padding: 2px 6px; border-radius: 4px;
}
.wa-banner-dismiss:hover { background: rgba(0,0,0,.06); color: var(--ink-1); }

/* ---- Linking an unassigned conversation to a lead (chat dialog) ---- */

.wa-link-lead {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line, #e5e1d8);
}
.wa-assign-result {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  border: 1px solid var(--line, #e5e1d8); background: #fff;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.wa-assign-result:hover { background: #f4f2ec; }
.wa-assign-name { font-weight: 600; font-size: 13px; }
.wa-assign-detail { color: var(--ink-3); font-size: 12px; }

/* ---- WhatsApp side panel (lead workspace right pane) ---- */

.wa-chat-side { flex: 1; min-height: 0; }
.wa-chat-side .wa-messages {
  max-height: 46vh; padding: 10px; background: #f0ede6;
}
.wa-chat-side .wa-bubble { max-width: 90%; font-size: .85rem; }
.wa-chat-side .wa-media audio,
.wa-chat-side .wa-media video,
.wa-chat-side .wa-media img { max-width: 250px; }
.wa-chat-side .wa-composer textarea { font-size: .85rem; }

.wa-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 28px 8px; color: var(--muted); font-size: 12.5px;
  flex: 1;
}

.wa-side-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }

/* ---- Call outcome dialog ---- */

/* Context line: address/email left, lead status right */
.cod-context {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.cod-context-info {
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  color: var(--ink-2); font-size: 13px; min-width: 0;
}
.cod-context-info .bi { margin-right: 5px; color: var(--ink-3); }

/* Call bar: phone, pricing and Dial in one strip; green while a call is live */
.cod-callbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: #f6f4ee; border: 1px solid var(--hair); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 14px;
}
.cod-callbar--live { background: #e9f9ef; border-color: #bfe8cd; }
.cod-phone { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.cod-phone .bi-telephone { color: var(--ink-3); }
.cod-phone-input { max-width: 190px; }
.cod-pricing { display: inline-flex; align-items: center; gap: 6px; }
.cod-pricing label { font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 0; }
.cod-pricing .lw-price-group { width: 132px; }
.cod-dial { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.cod-dial-btn { font-weight: 600; }

/* Workflow sections: outcome + comment, then follow-up channels */
.cod-section { margin-bottom: 14px; }
.cod-section-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px;
}

.cod-outcomes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.cod-streak-hint {
  display: flex; align-items: center; gap: 6px;
  color: #b02a37; font-size: 12.5px; margin-bottom: 8px;
}
.cod-outcome {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--hair-strong); background: var(--surface);
  color: var(--ink-2); font-size: 13px; font-weight: 500;
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
}
.cod-outcome:hover { background: #f4f2ec; }
.cod-outcome.active { background: #3D5896; border-color: #3D5896; color: #fff; }

/* Channel chips: a card with the template picker appears only for active channels */
.cod-channels { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.cod-channel {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--hair-strong); background: var(--surface);
  color: var(--ink-2); font-size: 13px; font-weight: 500;
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
}
.cod-channel:hover { background: #f4f2ec; }
.cod-channel.active { background: #3D5896; border-color: #3D5896; color: #fff; }

.cod-channel-card {
  display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--hair); border-radius: 10px; background: var(--surface);
  padding: 10px 12px; margin-bottom: 8px;
}
.cod-channel-card-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.cod-channel-card-row { display: flex; align-items: center; gap: 8px; }
.cod-channel-card-row .form-select { flex: 1; }
.cod-template-preview { font-size: .78rem; padding: 6px 10px; width: 100%; }

.cod-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; width: 100%; flex-wrap: wrap;
}
/* Inline discard confirmation: replaces the footer instead of a native confirm() */
.cod-discard-confirm {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; width: 100%; flex-wrap: wrap;
  background: #fdecea; border: 1px solid #f5c6cb; border-radius: 8px;
  padding: 8px 12px;
}
.cod-discard-confirm-text {
  display: inline-flex; align-items: center; gap: 8px;
  color: #842029; font-size: 13px; font-weight: 500;
}
.cod-discard-confirm-actions { display: inline-flex; gap: 8px; }

.cod-footer-group { display: inline-flex; align-items: flex-start; gap: 8px; }
.cod-footer-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-3); white-space: nowrap;
}
.cod-footer-labels { display: inline-flex; flex-direction: column; gap: 2px; padding-top: 6px; }
.cod-footer-hint { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.cod-next-call-wrap { display: inline-flex; flex-direction: column; gap: 3px; }
.cod-next-presets { display: inline-flex; gap: 8px; flex-wrap: wrap; max-width: 240px; }
.cod-next-preset {
  border: none; background: none; padding: 0; cursor: pointer;
  font-size: 11px; color: #3D5896; text-decoration: underline; white-space: nowrap;
}
.cod-next-preset:hover { color: #2c4170; }
.cod-next-preset:disabled { opacity: .5; cursor: default; }
.cod-status { width: 170px; }
.cod-footer-actions { display: inline-flex; gap: 8px; margin-left: auto; }

.wa-banner-dismiss-all {
  margin-left: auto; border: none; background: none; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: inherit;
  opacity: .75; text-decoration: underline;
}
.wa-banner-dismiss-all:hover { opacity: 1; }

.wa-banner-count {
  display: inline-flex; align-items: center; gap: 4px;
  border: none; border-radius: 999px;
  background: rgba(255,255,255,.22); color: inherit;
  font-size: 11.5px; font-weight: 700; padding: 2px 10px;
  white-space: nowrap;
}

/* Grouped rows expand on a click anywhere, so the whole row is the hit target. */
.wa-banner-row--clickable { cursor: pointer; }
.wa-banner-row--clickable:hover { background: rgba(255,255,255,.28); }
.wa-banner-row--clickable:hover .wa-banner-count { background: rgba(255,255,255,.4); }

.wa-banner-row--nested {
  margin-left: 26px; opacity: .92; font-size: 12.5px;
}

/* ---- Shared file preview modal ---- */
.lw-preview-audio { width: 100%; margin-bottom: 8px; }
.lw-preview-video { width: 100%; max-height: 420px; border-radius: 8px; margin-bottom: 8px; }
.lw-preview-save { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.lw-preview-save .lw-save-doc-type { width: auto; }

/* wa-media-file is now a button (opens the preview modal) rather than a download link */
button.wa-media-file {
  border: none; background: none; padding: 0; cursor: pointer;
  color: #0b5ed7; text-decoration: underline; text-align: left;
}

.lw-preview-save-name { max-width: 220px; }

/* Save-as-document bar in the file preview modal */
.lw-preview-savebar {
  margin-top: 12px; padding: 10px 12px;
  border: 1px solid var(--hair-strong); border-radius: 8px;
  background: #faf9f6;
}
.lw-preview-savebar-title {
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px;
}
.lw-preview-savebar-row {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
}
.lw-preview-savebar-label {
  display: flex; flex-direction: column; gap: 3px; margin: 0;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
}
.lw-preview-savebar-label:first-child { flex: 1; min-width: 220px; }
.lw-preview-savebar-label .lw-preview-save-name { width: 100%; min-width: 220px; max-width: none; }
.lw-preview-savebar-label .lw-save-doc-type { width: 160px; }
.lw-preview-savebar-btn { white-space: nowrap; }
