/* ==========================================================================
   Welcome Call Center — design system
   Tokens → base → components → page patterns. Light theme.
   ========================================================================== */

* { box-sizing: border-box; }

:root {
  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Palette */
  --navy: #14263b;
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-tint: #f7fafc;
  --text: #1b2b3d;
  --muted: #5c6f82;
  --faint: #8aa0b4;

  --primary: var(--brand, #2563eb);
  --primary-strong: #1d4ed8;
  --primary-soft: #e9f0fd;
  --primary-border: #c4d6f7;

  --accent: #f59e0b;          /* solar amber */
  --accent-soft: #fdf3df;

  --success: #16803c;
  --success-soft: #e8f6ed;
  --success-border: #bfe3cc;

  --warn: #b45309;
  --warn-soft: #fdf1e0;
  --warn-border: #f3d9ae;

  --danger: #c22a2a;
  --danger-soft: #fdecec;
  --danger-border: #f2c4c4;

  --border: #dfe7ef;
  --border-strong: #c9d6e3;

  /* Shape & depth */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(20, 38, 59, 0.06);
  --shadow-md: 0 4px 16px rgba(20, 38, 59, 0.08);
  --shadow-lg: 0 12px 40px rgba(20, 38, 59, 0.16);
  --trans: 180ms ease;
}

/* ==== Base ================================================================ */

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 6px; }
h2 { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 10px; }
h3 { font-size: 1rem; font-weight: 650; margin: 20px 0 8px; }
a { color: var(--primary); }
code { background: #e9eef5; padding: 2px 6px; border-radius: 6px; font-size: 0.85em; font-family: var(--font-mono); }

.muted { color: var(--muted); }
.lead { font-size: 1.02rem; color: var(--muted); }
.hidden { display: none !important; }
.center-text { text-align: center; }
.req { color: var(--danger); }
.fineprint { font-size: 0.8rem; color: var(--faint); margin-top: 14px; }
.mono { font-family: var(--font-mono); font-size: 0.85em; }
.icon { flex-shrink: 0; vertical-align: -2px; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ==== Layout ============================================================== */

.narrow { max-width: 660px; margin: 0 auto; padding: 28px 18px 64px; }
.wide { max-width: 1440px; margin: 0 auto; padding: 28px 24px 64px; }
.center-page { padding-top: 48px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

/* Page header pattern */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 20px; }
.page-head p { margin: 2px 0 0; color: var(--muted); max-width: 640px; }
.page-head .page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ==== App header / navigation ============================================ */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.topbar-inner {
  max-width: 1440px; margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); font-weight: 700; font-size: 1.02rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand .muted { font-weight: 500; }
.role-badge {
  font-size: 0.7rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--primary-soft); color: var(--primary-strong);
  border: 1px solid var(--primary-border); border-radius: 6px; padding: 2px 7px; margin-left: 2px;
}

.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-links a {
  text-decoration: none; color: var(--muted); font-weight: 550; font-size: 0.92rem;
  padding: 7px 12px; border-radius: var(--radius-sm); transition: background var(--trans), color var(--trans);
  display: inline-flex; align-items: center; gap: 7px;
}
.nav-links a:hover { background: var(--surface-tint); color: var(--text); }
.nav-links a.active { background: var(--primary-soft); color: var(--primary-strong); }
.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; color: var(--text); cursor: pointer; }

@media (max-width: 900px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .nav-links {
    display: none; flex-direction: column; align-items: stretch; flex-basis: 100%; padding: 6px 0 4px; border-top: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 10px; }
  .nav-right { margin-left: 0; }
}

/* Public top bar (homeowner pages) */
.topbar.public-bar { position: static; }

/* ==== Buttons ============================================================= */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 0.92rem; cursor: pointer; text-decoration: none; text-align: center;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  transition: background var(--trans), border-color var(--trans), color var(--trans), transform 120ms ease, box-shadow var(--trans);
  min-height: 38px;
}
.btn:hover { border-color: var(--primary); color: var(--primary-strong); background: var(--primary-soft); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #a52222; border-color: #a52222; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-tint); border-color: transparent; }
.btn-ghost.danger { color: var(--danger); }
.btn-ghost.danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-lg { padding: 14px 26px; font-size: 1.02rem; width: 100%; min-height: 50px; border-radius: 12px; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; min-height: 32px; border-radius: var(--radius-sm); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; }

/* ==== Forms =============================================================== */

.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.88rem; color: var(--text); }
input, textarea, select {
  font: inherit; font-weight: 400; padding: 10px 12px; min-height: 42px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  transition: border-color var(--trans), box-shadow var(--trans);
}
textarea { min-height: 0; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }
.grid-span { grid-column: 1 / -1; }
.code-area { font-family: var(--font-mono); font-size: 0.84rem; line-height: 1.55; }
@media (max-width: 640px) { .grid-form { grid-template-columns: 1fr; } }

.search-field { position: relative; flex: 1; min-width: 230px; }
.search-field .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search-field input { width: 100%; padding-left: 36px; }

/* ==== Alerts & badges ===================================================== */

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 0.92rem; border: 1px solid; }
.alert .icon { margin-top: 2px; }
.alert-error { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }
.alert-success { background: var(--success-soft); border-color: var(--success-border); color: var(--success); }
.alert-warn { background: var(--warn-soft); border-color: var(--warn-border); color: var(--warn); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 7px; font-size: 0.76rem; font-weight: 650; white-space: nowrap; border: 1px solid transparent;
}
.badge .icon { width: 12px; height: 12px; }
.badge-neutral { background: #eef2f7; color: var(--muted); border-color: var(--border); }
.badge-info { background: var(--primary-soft); color: var(--primary-strong); border-color: var(--primary-border); }
.badge-success { background: var(--success-soft); color: var(--success); border-color: var(--success-border); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.badge-plain { background: transparent; color: var(--faint); border: none; padding: 3px 2px; font-weight: 600; }

/* Legacy pill mapping (kept for compatibility) */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 7px; font-size: 0.76rem; font-weight: 650; white-space: nowrap; border: 1px solid transparent; }
.pill-soft { background: #eef2f7; color: var(--muted); border-color: var(--border); }
.pill-pending { background: #eef2f7; color: var(--muted); border-color: var(--border); }
.pill-in_progress { background: var(--primary-soft); color: var(--primary-strong); border-color: var(--primary-border); }
.pill-completed { background: var(--success-soft); color: var(--success); border-color: var(--success-border); }
.pill-flagged { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }

/* ==== Metric cards ======================================================== */

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden;
}
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--border-strong); }
.stat.stat-info::before { background: var(--primary); }
.stat.stat-success::before { background: var(--success); }
.stat.stat-warn::before { background: var(--accent); }
.stat-label { color: var(--muted); font-size: 0.8rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.stat-num { font-size: 1.85rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.stat-num.ok { color: var(--success); }
.stat-num.warn { color: var(--warn); }

/* ==== Toolbar (search + filters) ========================================= */

.filter-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface-tint); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 14px;
}
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn { background: transparent; border-color: transparent; color: var(--muted); font-weight: 600; }
.filter-btn:hover { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.filter-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.filter-btn.active:hover { background: var(--navy); color: #fff; }

/* ==== Call list =========================================================== */

.call-acc {
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px;
  background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden;
  border-left: 3px solid transparent;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.call-acc.row-completed { border-left-color: var(--success); }
.call-acc.row-flagged { border-left-color: var(--accent); }
.call-acc.row-pending { border-left-color: var(--border-strong); }
.call-acc[open] { border-color: var(--primary-border); box-shadow: var(--shadow-md); }

.call-acc summary {
  display: grid; grid-template-columns: auto minmax(160px, 1.4fr) auto 1fr auto; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer; list-style: none; min-height: 54px;
}
.call-acc summary::-webkit-details-marker { display: none; }
.call-acc summary:hover { background: var(--surface-tint); }
.acc-chevron { color: var(--faint); transition: transform 180ms ease; display: inline-flex; }
.call-acc[open] .acc-chevron { transform: rotate(180deg); }
.acc-name { min-width: 0; }
.acc-name strong { display: block; font-size: 0.95rem; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-name .sub { color: var(--faint); font-size: 0.82rem; font-family: var(--font-mono); }
.acc-pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-start; }
.acc-date { font-size: 0.78rem; color: var(--faint); white-space: nowrap; text-align: right; font-family: var(--font-mono); }
.acc-body { padding: 16px 18px 18px; border-top: 1px solid var(--border); background: var(--surface-tint); }
.acc-section { margin-bottom: 14px; }
.acc-section > h4 { margin: 0 0 8px; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }

@media (max-width: 820px) {
  .call-acc summary { grid-template-columns: auto 1fr auto; }
  .acc-pills { grid-column: 2 / -1; }
  .acc-date { display: none; }
}

/* ==== Tables ============================================================== */

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; color: var(--faint); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:hover { background: var(--surface-tint); }
.cell-wrap { max-width: 280px; }

/* ==== Detail grids ======================================================== */

.detail-header { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 18px; margin-top: 12px; }
.detail-grid > div { font-size: 0.92rem; }
.detail-grid .muted { font-size: 0.76rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.check-grid > div { display: flex; align-items: center; gap: 8px; background: var(--surface-tint); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 0.9rem; }

.flag-card { border-color: var(--warn-border); background: #fffdf7; }
.flag-list { margin: 8px 0 0; padding-left: 4px; list-style: none; }
.flag-list li { display: flex; gap: 9px; align-items: flex-start; padding: 7px 0; border-bottom: 1px dashed var(--warn-border); font-size: 0.92rem; }
.flag-list li:last-child { border-bottom: none; }
.flag-list .icon { color: var(--warn); margin-top: 3px; }

.pre-box {
  background: var(--surface-tint); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; white-space: pre-wrap; word-break: break-word; font-size: 0.88rem; font-family: inherit;
}
.transcript { max-height: 460px; overflow-y: auto; }

/* ==== Share / copy ======================================================== */

.share-row { display: flex; gap: 8px; margin-top: 8px; }
.share-input { flex: 1; font-size: 0.85rem; color: var(--muted); font-family: var(--font-mono); background: var(--surface-tint); }

/* ==== Modal (native dialog) ============================================== */

dialog.modal {
  border: none; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 0; width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 64px);
}
dialog.modal::backdrop { background: rgba(20, 38, 59, 0.45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px 0; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 14px 24px 24px; }

/* ==== Empty state ========================================================= */

.empty-state { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty-state .icon { color: var(--faint); margin-bottom: 8px; }
.empty-state p { margin: 4px 0 14px; }

/* ==== Homeowner (public) pages =========================================== */

body.public { background: linear-gradient(180deg, #f4f8fc 0%, var(--bg) 100%); }
.hero { max-width: 720px; margin: 0 auto; padding: 46px 18px 6px; text-align: center; }
.hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.35rem); }
.hero-points { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 26px; text-align: left; }
.point {
  display: flex; gap: 12px; align-items: flex-start; flex: 1 1 200px; max-width: 240px; font-size: 0.88rem; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm);
}
.point strong { color: var(--text); }
.point-icon {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-strong); border: 1px solid var(--primary-border);
}
.point-icon .icon { width: 17px; height: 17px; }

.info-box {
  background: var(--primary-soft); border: 1px solid var(--primary-border); border-radius: var(--radius-sm);
  padding: 14px 16px; margin: 18px 0; display: grid; gap: 7px; font-size: 0.93rem;
}
.info-box .muted { font-size: 0.75rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary-strong); opacity: 0.75; display: block; }

.consent { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 0.9rem; margin-bottom: 18px; color: var(--muted); cursor: pointer; }
.consent input { margin-top: 3px; min-height: 0; width: 17px; height: 17px; accent-color: var(--primary); }

/* Pre-call countdown */
.countdown { text-align: center; padding: 22px 0 10px; }
.countdown-num {
  font-size: 4.2rem; font-weight: 700; line-height: 1; color: var(--primary-strong);
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.countdown-num.tick { animation: countdown-pop 900ms ease-out; }
@keyframes countdown-pop {
  0% { transform: scale(1.35); opacity: 0.35; }
  40% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.countdown-text { color: var(--muted); margin: 10px 0 0; font-size: 0.95rem; }

.call-status { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 12px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.volume-bar { height: 6px; background: #e4eaf1; border-radius: 999px; overflow: hidden; margin-bottom: 18px; }
#volume-fill { height: 100%; width: 0; background: var(--primary); border-radius: 999px; transition: width 0.12s; }

.big-check {
  width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 12px;
  background: var(--success-soft); border: 1.5px solid var(--success-border); color: var(--success);
  display: flex; align-items: center; justify-content: center;
  animation: pop-in 320ms ease;
}
@keyframes pop-in { 0% { transform: scale(0.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.steps { display: flex; justify-content: center; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; color: var(--faint); }
.steps li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.steps li.done { color: var(--success); }
.steps li.done::before { background: var(--success); }
.steps li.current { color: var(--primary-strong); }
.steps li.current::before { background: var(--primary); }

.footer { text-align: center; color: var(--faint); font-size: 0.8rem; padding: 34px 16px 40px; }
.footer a { color: var(--faint); }

/* ==== Manual script page ================================================= */

.script-text { white-space: pre-wrap; font-size: 0.96rem; line-height: 1.75; }
.script-text .not-on-file { background: var(--warn-soft); border: 1px solid var(--warn-border); padding: 0 4px; border-radius: 4px; font-weight: 700; }
.script-text .your-name { background: var(--primary-soft); border: 1px solid var(--primary-border); padding: 0 4px; border-radius: 4px; font-weight: 700; }

@media print {
  .topbar, .no-print { display: none !important; }
  body { background: #fff; }
  .card { border: none; box-shadow: none; padding: 0; }
}

/* ==== Small screens ======================================================= */

@media (max-width: 640px) {
  .wide, .narrow { padding-left: 14px; padding-right: 14px; }
  .card { padding: 20px 16px; }
  h1 { font-size: 1.5rem; }
  .page-head .page-actions { width: 100%; }
  .page-head .page-actions .btn { flex: 1; }
}

/* ==========================================================================
   Refinement pass — cohesive data list, status hierarchy, KPI & toolbar polish
   ========================================================================== */

/* Ambient top-of-page treatment: cool blue into warm white, content stays flat */
body {
  background:
    radial-gradient(1100px 320px at 18% -60px, rgba(37, 99, 235, 0.08), transparent 60%),
    radial-gradient(900px 280px at 85% -100px, rgba(245, 158, 11, 0.07), transparent 62%),
    var(--bg);
}

/* Header: tighter grouping, clearer active tab, quieter logout */
.topbar-inner { gap: 14px; }
.nav-links { margin-left: 4px; }
.nav-links a { position: relative; }
.nav-links a.active {
  background: var(--primary-soft); color: var(--primary-strong); font-weight: 700;
}
/* Unmistakable current-page marker: solid underline anchored to the tab */
.nav-links a.active::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px;
  background: var(--primary); border-radius: 3px 3px 0 0;
}
.nav-right .btn { color: var(--faint); }
.nav-right .btn:hover { color: var(--text); background: var(--surface-tint); }

@media (max-width: 900px) {
  /* On the stacked mobile menu an underline reads poorly — use a left bar instead */
  .nav-links a.active::after { left: 0; right: auto; top: 6px; bottom: 6px; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
}

/* KPI cards: tinted icon container, dominant number, subtle status wash */
.stat { flex-direction: row; align-items: center; gap: 13px; padding: 14px 16px; }
.stat::before { display: none; }
.stat > div { display: flex; flex-direction: column; gap: 0; }
.stat-icon {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: #eef2f7; color: var(--muted);
}
.stat-info .stat-icon { background: var(--primary-soft); color: var(--primary-strong); }
.stat-success .stat-icon { background: var(--success-soft); color: var(--success); }
.stat-warn .stat-icon { background: var(--accent-soft); color: var(--warn); }
.stat-info { background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), #fff 55%); }
.stat-success { background: linear-gradient(135deg, rgba(22, 128, 60, 0.05), #fff 55%); }
.stat-warn { background: linear-gradient(135deg, rgba(245, 158, 11, 0.07), #fff 55%); }
.stat-label { font-size: 0.75rem; }
.stat-num { font-size: 2.05rem; line-height: 1.12; }

/* Toolbar: compact, filters clearly interactive, active state confident */
.filter-row { padding: 8px 10px; gap: 8px; }
.filter-row .search-field input { min-height: 37px; }
.filter-btn { background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.filter-btn:hover { border-color: var(--border-strong); background: var(--surface-tint); color: var(--text); }
.filter-btn .muted { color: inherit; opacity: 0.6; font-weight: 500; }
.filter-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.filter-btn.active .muted { opacity: 0.75; }

/* Cohesive call list: one elevated container, column headers, hairline rows */
.list-card { --cols: 26px minmax(190px, 1.6fr) 54px 148px minmax(150px, 1fr) 176px; padding: 0; overflow: hidden; }
.list-head {
  display: grid; grid-template-columns: var(--cols); gap: 12px; align-items: center;
  padding: 9px 18px; border-bottom: 1px solid var(--border); background: var(--surface-tint);
  font-size: 0.69rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--faint);
}
.list-head .th-right { text-align: right; }
.list-card .call-acc {
  border: none; border-left: 2px solid transparent; border-radius: 0; margin: 0;
  box-shadow: none; background: transparent; border-bottom: 1px solid var(--border);
}
.list-card .call-acc:last-of-type { border-bottom: none; }
.list-card .call-acc.row-completed { border-left-color: var(--success); }
.list-card .call-acc.row-flagged { border-left-color: var(--accent); }
.list-card .call-acc.row-pending { border-left-color: transparent; }
.list-card .call-acc summary {
  grid-template-columns: var(--cols); padding: 8px 18px; min-height: 46px;
  transition: background var(--trans);
}
.list-card .call-acc summary:hover { background: #f6f9fd; }
.list-card .call-acc summary:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.list-card .call-acc[open] { background: #f5f9ff; border-left-color: var(--primary); }
.list-card .call-acc[open] summary { background: transparent; }
.list-card .acc-body { background: transparent; border-top: 1px dashed var(--border-strong); animation: acc-in 190ms ease; }
@keyframes acc-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* Status hierarchy: issues loudest, review status secondary, change order restrained */
.cell-source { font-size: 0.73rem; font-weight: 700; color: var(--faint); letter-spacing: 0.05em; }
.cell-status .badge { font-size: 0.74rem; }
.cell-issues { display: flex; flex-wrap: wrap; gap: 5px 10px; align-items: center; }
.chip-issues {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--danger); color: #fff; font-size: 0.75rem; font-weight: 700;
  border-radius: 7px; padding: 3px 9px;
}
.mini-flag { display: inline-flex; align-items: center; gap: 5px; color: var(--warn); font-size: 0.77rem; font-weight: 650; }
.cell-empty { color: var(--border-strong); }
.list-card .acc-date { color: var(--muted); font-family: var(--font-sans); font-size: 0.8rem; }

@media (max-width: 900px) {
  .list-head { display: none; }
  .list-card { --cols: none; }
  .list-card .call-acc summary { grid-template-columns: 22px 1fr auto; row-gap: 6px; }
  .list-card .cell-source, .list-card .acc-date { display: none; }
  .list-card .cell-issues, .list-card .cell-status { grid-column: 2 / -1; }
}

/* Skeleton loading (matches final row anatomy) */
.skeleton-row { display: grid; grid-template-columns: var(--cols, 1fr); gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.skeleton { position: relative; overflow: hidden; background: #e8edf4; border-radius: 6px; min-height: 12px; }
.skeleton::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
