/* ============ Call Command Center — Light/Clean Theme ============ */
:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-2: #f1f4f7;
  --border: #e3e8ee;
  --border-strong: #cbd5e1;
  --text: #1a2332;
  --text-2: #5a6b7f;
  --text-3: #8a97a8;
  --primary: #2563eb;
  --primary-soft: #eff4ff;
  --primary-border: #bfd3f8;
  --green: #16a34a;
  --green-soft: #ecfdf3;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --purple: #7c3aed;
  --purple-soft: #f5f3ff;
  --gray-soft: #f1f5f9;
  --shadow: 0 1px 3px rgba(16,24,40,.07), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.14);
  --radius: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; overflow: hidden; }
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); }

/* ============ App Layout ============ */
#app { display: flex; flex-direction: column; height: 100vh; }
.main-area { display: flex; flex: 1; min-height: 0; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ============ Top Bar ============ */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; background: var(--surface);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px;
}
.nav-tabs { display: flex; gap: 4px; margin-left: 12px; }
.nav-tab {
  border: none; background: transparent; padding: 7px 14px; border-radius: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--text-2); transition: all .15s;
}
.nav-tab:hover { background: var(--surface-2); color: var(--text); }
.nav-tab.active { background: var(--primary-soft); color: var(--primary); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border-strong); background: var(--surface);
  padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--text); transition: all .15s;
}
.btn:hover { border-color: var(--text-3); background: var(--surface-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

/* ============ Stats Bar ============ */
.stats-bar {
  display: flex; gap: 12px; padding: 12px 20px; background: var(--surface);
  border-bottom: 1px solid var(--border); flex-shrink: 0; overflow-x: auto;
}
.stat-card {
  display: flex; flex-direction: column; gap: 2px; padding: 8px 16px;
  background: var(--surface-2); border-radius: var(--radius); min-width: 108px;
  border: 1px solid var(--border);
}
.stat-val { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.stat-label { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.stat-card.accent-blue .stat-val { color: var(--primary); }
.stat-card.accent-green .stat-val { color: var(--green); }
.stat-card.accent-purple .stat-val { color: var(--purple); }
.stat-card.accent-amber .stat-val { color: var(--amber); }

/* ============ Toolbar (filters) ============ */
.toolbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px;
  background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; flex-wrap: wrap;
}
.search-box {
  display: flex; align-items: center; gap: 8px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; width: 250px;
}
.search-box input { border: none; background: transparent; outline: none; font-size: 13px; width: 100%; color: var(--text); }
.filter-select {
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: 8px;
  padding: 7px 10px; font-size: 13px; font-weight: 500; color: var(--text); outline: none; cursor: pointer;
}
.toolbar .count-label { font-size: 12.5px; color: var(--text-3); font-weight: 500; margin-left: auto; }

/* ============ Call Sheet Table ============ */
.sheet-wrap { flex: 1; overflow: auto; }
table.sheet { width: 100%; border-collapse: collapse; }
table.sheet thead th {
  position: sticky; top: 0; z-index: 5; background: var(--surface);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); text-align: left; padding: 10px 12px;
  border-bottom: 2px solid var(--border); white-space: nowrap; cursor: pointer; user-select: none;
}
table.sheet thead th:hover { color: var(--primary); }
table.sheet tbody tr {
  background: var(--surface); border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .12s;
}
table.sheet tbody tr:hover { background: var(--primary-soft); }
table.sheet td { padding: 10px 12px; vertical-align: middle; }
tr.row-hot { box-shadow: inset 3px 0 0 var(--green); }
tr.row-progress { box-shadow: inset 3px 0 0 var(--primary); }
tr.row-callback { box-shadow: inset 3px 0 0 var(--amber); background: var(--amber-soft); }
tr.row-dead { opacity: .5; }
tr.row-booked { box-shadow: inset 3px 0 0 var(--green); background: var(--green-soft); }

.lead-cell { max-width: 220px; }
.lead-company { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-contact { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-url { font-size: 11.5px; color: var(--primary); font-weight: 500; text-decoration: none; display: block; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.lead-url:hover { text-decoration: underline; }
.lead-contact-cell { font-size: 13px; vertical-align: middle; max-width: 160px; }
.lead-contact-name { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-contact-title { font-size: 11.5px; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone-link { color: var(--primary); font-weight: 600; text-decoration: none; white-space: nowrap; font-size: 13px; }
.phone-link:hover { text-decoration: underline; }
.loc-cell { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }

.score-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; padding: 3px 8px; border-radius: 999px; font-weight: 800; font-size: 12.5px;
}
.score-hi { background: var(--green-soft); color: var(--green); }
.score-mid { background: var(--amber-soft); color: var(--amber); }
.score-lo { background: var(--gray-soft); color: var(--text-3); }

.status-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.st-fresh { background: var(--gray-soft); color: var(--text-2); }
.st-progress { background: var(--primary-soft); color: var(--primary); }
.st-hot { background: var(--green-soft); color: var(--green); }
.st-callback { background: var(--amber-soft); color: var(--amber); }
.st-booked { background: var(--green); color: #fff; }
.st-dead { background: var(--gray-soft); color: var(--text-3); text-decoration: line-through; }

/* Attempt dots */
.attempts { display: flex; gap: 5px; align-items: center; }
.att-dot {
  width: 26px; height: 26px; border-radius: 50%; border: 1.5px dashed var(--border-strong);
  background: var(--surface); display: flex; align-items: center; justify-content: center;
  font-size: 12px; transition: all .15s; position: relative;
}
.att-dot:hover { border-color: var(--primary); background: var(--primary-soft); transform: scale(1.1); }
.att-dot.filled { border-style: solid; }
.att-noanswer { background: var(--gray-soft); border-color: var(--border-strong); }
.att-voicemail { background: var(--purple-soft); border-color: #d8ccf5; }
.att-gatekeeper { background: var(--amber-soft); border-color: #f3d9a4; }
.att-callback { background: var(--amber-soft); border-color: var(--amber); }
.att-conversation { background: var(--primary-soft); border-color: var(--primary-border); }
.att-booked { background: var(--green-soft); border-color: var(--green); }
.att-notinterested { background: var(--red-soft); border-color: #f4c1c1; }
.att-badnumber { background: var(--red-soft); border-color: var(--red); }
.att-custom { background: #e0f2fe; border-color: #7dd3fc; }

/* ============ Outcome Popover ============ */
.popover-backdrop { position: fixed; inset: 0; z-index: 60; }
.outcome-pop {
  position: fixed; z-index: 61; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px; width: 250px;
}
.outcome-pop h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 6px 8px 8px; }
.outcome-opt {
  display: flex; align-items: center; gap: 9px; width: 100%; border: none; background: transparent;
  padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text); text-align: left;
}
.outcome-opt:hover { background: var(--surface-2); }
.outcome-custom-row { display: flex; gap: 6px; padding: 6px 8px 4px; border-top: 1px solid var(--border); margin-top: 4px; }
.outcome-custom-row input {
  flex: 1; border: 1px solid var(--border-strong); border-radius: 7px; padding: 6px 9px; font-size: 12.5px; outline: none;
}
.outcome-custom-row input:focus { border-color: var(--primary); }
.pop-clear { width: 100%; margin-top: 4px; border: none; background: transparent; color: var(--red); font-size: 12px; font-weight: 600; padding: 7px; border-radius: 7px; }
.pop-clear:hover { background: var(--red-soft); }

/* ============ Lead Detail Slide-out ============ */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(16,24,40,.35); z-index: 40;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
/* When the coach is open, keep the backdrop non-blocking so the table + coach
   stay clickable and both panels can be operated together. */
body.coach-open .drawer-backdrop.open { opacity: 0; pointer-events: none; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 520px; max-width: 94vw;
  background: var(--surface); z-index: 41; box-shadow: var(--shadow-lg);
  transform: translateX(105%);
  transition: transform .25s cubic-bezier(.4,0,.2,1), right .25s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; border-left: 1px solid var(--border);
}
.drawer.open { transform: translateX(0); }
/* When the coach is open, dock the drawer to the LEFT of the coach panel
   (coach width = 360px) instead of overlapping it, so both are visible and usable. */
body.coach-open .drawer { right: 360px; }
@media (max-width: 1400px) {
  body.coach-open .drawer { width: 460px; }
}
/* On narrow screens the coach becomes a full-height fixed overlay (z-index 50),
   so revert the drawer to the right edge and let the coach sit above it. */
@media (max-width: 1100px) {
  body.coach-open .drawer { right: 0; }
}
.drawer-head { padding: 20px 24px 14px; border-bottom: 1px solid var(--border); }
.drawer-close { position: absolute; top: 14px; right: 16px; border: none; background: var(--surface-2); width: 30px; height: 30px; border-radius: 8px; font-size: 15px; color: var(--text-2); }
.drawer-close:hover { background: var(--border); }
.drawer-company { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 2px; padding-right: 36px; }
.drawer-sub { font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.action-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 8px;
  font-size: 13px; font-weight: 700; text-decoration: none; border: 1px solid transparent;
}
.chip-call { background: var(--green); color: #fff; }
.chip-call:hover { background: #15803d; }
.chip-web { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); }
.chip-web:hover { background: #e0eaff; }
.chip-neutral { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.chip-neutral:hover { background: var(--border); }
.chip-coach { background: linear-gradient(135deg, #7c3aed22, #2563eb22); color: #6d28d9; border: 1px solid #c4b5fd; cursor: pointer; }
.chip-coach:hover { background: linear-gradient(135deg, #7c3aed33, #2563eb33); border-color: #a78bfa; }

.drawer-body { flex: 1; overflow-y: auto; padding: 18px 24px 30px; }
.d-section { margin-bottom: 22px; }
.d-section-title {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-3); margin-bottom: 9px; display: flex; align-items: center; gap: 6px;
}
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.info-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; }
.info-item.full { grid-column: 1 / -1; }
.info-k { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-bottom: 2px; }
.info-v { font-size: 13px; font-weight: 500; line-height: 1.45; word-break: break-word; }
.pitch-box {
  background: var(--amber-soft); border: 1px solid #f3e0b0; border-radius: 10px;
  padding: 12px 14px; font-size: 13px; line-height: 1.55;
}
.pitch-box strong { color: var(--amber); }

.status-select-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.status-btn { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.status-btn:hover { border-color: var(--primary); color: var(--primary); }
.status-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }

.callback-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.callback-row input { border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 10px; font-size: 13px; outline: none; }

.notes-area {
  width: 100%; min-height: 110px; border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 11px 13px; font-size: 13.5px; line-height: 1.55; resize: vertical; outline: none;
}
.notes-area:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.note-save-hint { font-size: 11px; color: var(--text-3); margin-top: 5px; }
.note-log { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.note-entry { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; font-size: 12.5px; line-height: 1.5; }
.note-entry .ts { font-size: 10.5px; color: var(--text-3); font-weight: 700; margin-bottom: 2px; }

.timeline { display: flex; flex-direction: column; gap: 8px; }
.tl-item { display: flex; gap: 10px; align-items: flex-start; }
.tl-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; border: 1px solid var(--border); }
.tl-body { font-size: 13px; font-weight: 600; }
.tl-ts { font-size: 11px; color: var(--text-3); font-weight: 500; }
.tl-empty { font-size: 12.5px; color: var(--text-3); font-style: italic; }

/* Mini calculator in drawer */
.mini-calc { background: var(--purple-soft); border: 1px solid #e4dcf7; border-radius: 12px; padding: 14px; }
.mini-calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.mc-field label { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin-bottom: 3px; }
.mc-field input { width: 100%; border: 1px solid var(--border-strong); border-radius: 7px; padding: 7px 9px; font-size: 13px; outline: none; background: #fff; }
.mc-field input:focus { border-color: var(--purple); }
.mini-result { background: #fff; border-radius: 9px; padding: 10px 12px; text-align: center; border: 1px solid #e4dcf7; }
.mini-result .big { font-size: 21px; font-weight: 800; color: var(--purple); letter-spacing: -.02em; }
.mini-result .small { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.mc-save { margin-top: 8px; width: 100%; }

/* ============ AI Coach Panel ============ */
.coach-panel {
  width: 360px; flex-shrink: 0; background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; transition: margin-right .25s ease;
}
.coach-panel.collapsed { margin-right: -360px; }
.coach-head {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.coach-avatar {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px;
}
.coach-title { font-weight: 800; font-size: 14px; }
.coach-status { font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.coach-context {
  padding: 8px 16px; background: var(--primary-soft); border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--primary); font-weight: 600; display: flex; align-items: center; gap: 6px;
}
.coach-settings {
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg-2);
}
.settings-label { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; display: block; margin-bottom: 5px; }
.settings-select {
  width: 100%; padding: 6px 10px; border: 1px solid var(--border); border-radius: 7px;
  font-size: 13px; background: #fff; color: var(--text-1); cursor: pointer;
}
.settings-select:focus { border-color: var(--primary); outline: none; }
.settings-hint { font-size: 11px; color: var(--text-3); margin-top: 8px; line-height: 1.4; }
.coach-status .dot-live.live { background: #22c55e; }
.coach-status .dot-live.preview { background: var(--amber); }
.coach-status .dot-live.error { background: #ef4444; }
.coach-msgs { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 13px; line-height: 1.55; }
.msg-ai { background: var(--surface-2); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-user { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-ai strong { color: var(--primary); }
.quick-prompts { padding: 8px 12px; display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--border); }
.qp-chip {
  border: 1px solid var(--primary-border); background: var(--primary-soft); color: var(--primary);
  font-size: 11.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px;
}
.qp-chip:hover { background: #dbe7ff; }
.coach-input-row { display: flex; gap: 8px; padding: 10px 12px 12px; }
.coach-input {
  flex: 1; border: 1px solid var(--border-strong); border-radius: 10px; padding: 9px 12px;
  font-size: 13px; outline: none; resize: none;
}
.coach-input:focus { border-color: var(--primary); }
.coach-send {
  border: none; background: var(--primary); color: #fff; border-radius: 10px;
  width: 38px; font-size: 15px;
}
.coach-send:hover { background: #1d4ed8; }
.typing { display: inline-flex; gap: 3px; padding: 4px 0; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3 } 40% { opacity: 1 } }

/* ============ Calculator Page ============ */
.calc-page { flex: 1; overflow-y: auto; padding: 28px; }
.calc-layout { display: grid; grid-template-columns: 400px 1fr; gap: 22px; max-width: 1100px; margin: 0 auto; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); padding: 22px;
}
.card h3 { font-size: 15px; font-weight: 800; margin-bottom: 4px; letter-spacing: -.01em; }
.card .sub { font-size: 12.5px; color: var(--text-2); margin-bottom: 18px; }
.calc-field { margin-bottom: 14px; }
.calc-field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 5px; }
.calc-field input {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 9px;
  padding: 10px 12px; font-size: 14px; outline: none; font-weight: 600;
}
.calc-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.calc-field .hint { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row input[type=range] { flex: 1; accent-color: var(--primary); }
.slider-val { font-size: 17px; font-weight: 800; color: var(--primary); min-width: 52px; text-align: right; }

.result-hero {
  background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; border-radius: 14px;
  padding: 24px; text-align: center; margin-bottom: 16px;
}
.result-hero .label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.result-hero .big-num { font-size: 42px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.result-hero .per { font-size: 14px; font-weight: 600; opacity: .9; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.result-tile { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 14px; text-align: center; }
.result-tile .v { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.result-tile .k { font-size: 11px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.result-tile.green .v { color: var(--green); }
.result-tile.blue .v { color: var(--primary); }
.result-tile.purple .v { color: var(--purple); }
.result-tile.amber .v { color: var(--amber); }

.bars { display: flex; align-items: flex-end; gap: 28px; height: 180px; padding: 0 30px; margin-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 8px; }
.bar { width: 100%; max-width: 130px; border-radius: 9px 9px 0 0; transition: height .4s ease; min-height: 8px; }
.bar-current { background: #cbd5e1; }
.bar-projected { background: linear-gradient(180deg, #7c3aed, #2563eb); }
.bar-num { font-size: 14px; font-weight: 800; }
.bar-label { font-size: 11.5px; color: var(--text-2); font-weight: 700; }
.talk-track {
  background: var(--green-soft); border: 1px solid #c3ebd0; border-radius: 12px;
  padding: 14px 16px; font-size: 13.5px; line-height: 1.65; margin-top: 16px;
}
.talk-track .tt-title { font-weight: 800; color: var(--green); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }

/* ============ Upload Zone ============ */
.upload-overlay {
  position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 70;
  display: flex; align-items: center; justify-content: center;
}
.upload-modal { background: var(--surface); border-radius: 16px; padding: 30px; width: 480px; max-width: 92vw; box-shadow: var(--shadow-lg); }
.upload-modal h3 { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.upload-modal p { font-size: 13px; color: var(--text-2); margin-bottom: 16px; line-height: 1.5; }
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: 12px; padding: 36px 20px;
  text-align: center; transition: all .15s; cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .dz-icon { font-size: 30px; margin-bottom: 8px; }
.dropzone .dz-main { font-size: 14px; font-weight: 700; }
.dropzone .dz-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.upload-modal .modal-actions { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; }

/* ============ Toast ============ */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--text); color: #fff; padding: 11px 20px; border-radius: 10px;
  font-size: 13px; font-weight: 600; z-index: 90; transition: transform .25s ease; box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .coach-panel { position: fixed; right: 0; top: 0; bottom: 0; z-index: 50; box-shadow: var(--shadow-lg); }
  .coach-panel.collapsed { margin-right: 0; transform: translateX(100%); }
  .calc-layout { grid-template-columns: 1fr; }
}
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d3dbe4; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #b9c4d1; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ Login Screen ============ */
.login-screen {
  position: fixed; inset: 0; z-index: 100;
  background: linear-gradient(135deg, #eef2f7 0%, #dde4ef 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 40px 36px; width: 400px; max-width: 92vw; text-align: center;
}
.login-favicon { width: 56px; height: 56px; border-radius: 14px; margin: 0 auto 12px; display: block; }
.login-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; }
.login-sub { font-size: 13px; color: var(--text-2); margin-bottom: 24px; }
.login-field { text-align: left; margin-bottom: 16px; }
.login-field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 5px; }
.login-field input {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 9px;
  padding: 11px 13px; font-size: 14px; outline: none; font-weight: 500;
}
.login-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.login-error { color: var(--red); font-size: 12.5px; font-weight: 600; min-height: 18px; margin-bottom: 8px; }
.login-btn { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }
.login-hint { margin-top: 18px; font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
.login-hint strong { color: var(--text-2); }

/* ============ Sort Arrows ============ */
.sort-arrow { font-size: 10px; color: var(--primary); margin-left: 3px; }
.sort-arrow::after { content: ''; }

/* ============ Toolbar hint ============ */
.toolbar-hint { font-size: 11.5px; color: var(--text-3); font-weight: 500; }

/* ============ Settings Page ============ */
.settings-page { flex: 1; overflow-y: auto; padding: 28px; }
.settings-layout { display: grid; grid-template-columns: 420px 1fr; gap: 22px; max-width: 1000px; margin: 0 auto; }
.settings-card h3 { font-size: 15px; font-weight: 800; margin-bottom: 4px; letter-spacing: -.01em; }
.settings-card .sub { font-size: 12.5px; color: var(--text-2); margin-bottom: 18px; }
.settings-field { margin-bottom: 14px; }
.settings-field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 5px; }
.settings-field input, .settings-field textarea, .settings-select-wide {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 9px;
  padding: 10px 12px; font-size: 14px; outline: none; font-weight: 500; background: #fff;
}
.settings-field input:focus, .settings-field textarea:focus, .settings-select-wide:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.settings-field .hint { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.settings-info-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 13px; color: var(--text-2); border-bottom: 1px solid var(--border); }
.settings-info-row strong { color: var(--text); font-weight: 700; }
.settings-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.settings-actions .btn { justify-content: center; width: 100%; }
.btn-danger { border-color: #f4c1c1; background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #fde8e8; border-color: var(--red); }

/* API status box in settings */
.api-status-box {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 16px; font-size: 13px;
}
.api-status-row { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.api-status-row:last-child { margin-bottom: 0; }
.api-status-label { font-weight: 700; color: var(--text-2); font-size: 12px; }
.api-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.api-status-dot.live { background: #22c55e; }
.api-status-dot.preview { background: var(--amber); }
.api-status-dot.error { background: var(--red); }
.settings-note { font-size: 12px; color: var(--green); font-weight: 600; margin-left: 10px; }
.settings-note.error { color: var(--red); }

/* ============ Add/Edit Lead Modal ============ */
.lead-modal-wide { width: 640px; max-width: 94vw; max-height: 88vh; overflow-y: auto; }
.lead-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.lf-field { display: flex; flex-direction: column; }
.lf-field label { font-size: 11.5px; font-weight: 700; color: var(--text-2); margin-bottom: 4px; }
.lf-field input, .lf-field textarea {
  border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 11px;
  font-size: 13.5px; outline: none; font-weight: 500;
}
.lf-field input:focus, .lf-field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.08); }
.lf-full { grid-column: 1 / -1; }

/* ============ Drawer Edit Mode + Delete ============ */
.drawer-edit-btns { display: flex; gap: 8px; margin-top: 12px; }
.drawer-edit-btns .btn { flex: 1; justify-content: center; }
.drawer-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drawer-edit-grid .lf-full { grid-column: 1 / -1; }
.drawer-delete-zone { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.btn-delete-lead {
  border: 1px solid #f4c1c1; background: var(--red-soft); color: var(--red);
  padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 7px;
}
.btn-delete-lead:hover { background: #fde8e8; border-color: var(--red); }

/* Confirm dialog */
.confirm-overlay {
  position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 80;
  display: flex; align-items: center; justify-content: center;
}
.confirm-modal {
  background: var(--surface); border-radius: 14px; padding: 26px; width: 380px;
  max-width: 92vw; box-shadow: var(--shadow-lg); text-align: center;
}
.confirm-modal h3 { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.confirm-modal p { font-size: 13px; color: var(--text-2); margin-bottom: 20px; line-height: 1.5; }
.confirm-modal .modal-actions { display: flex; gap: 10px; }
.confirm-modal .modal-actions .btn { flex: 1; justify-content: center; }

@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .lead-form-grid { grid-template-columns: 1fr; }
}
