:root {
  --bg-app: #0a0e14;
  --bg-sidebar: #0d1219;
  --bg-panel: #121820;
  --bg-panel-hover: #161e28;
  --bg-input: #0a0e14;
  --bg-muted: #0f141c;
  --text: #f0f4f8;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.1);
  --accent: #2dd4bf;
  --accent-dim: rgba(45, 212, 191, 0.12);
  --accent-glow: rgba(45, 212, 191, 0.25);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #38bdf8;
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-w: 220px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-app);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  transition: width 0.18s ease;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 0 16px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.sidebar-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-toggle-icon {
  width: 16px;
  height: 16px;
}

.sidebar-toggle-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html.sidebar-collapsed .sidebar {
  --sidebar-w: 72px;
}

html.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 0 12px 16px;
}

html.sidebar-collapsed .sidebar-brand-text,
html.sidebar-collapsed .sidebar-org,
html.sidebar-collapsed .nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html.sidebar-collapsed .sidebar-toggle-icon {
  transform: rotate(180deg);
}

html.sidebar-collapsed .sidebar-nav {
  padding: 0 10px;
}

html.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}

html.sidebar-collapsed .sidebar-footer {
  display: flex;
  justify-content: center;
  padding: 16px 10px 0;
}

.sidebar-eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.sidebar-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active .nav-icon {
  opacity: 1;
}

.sidebar-footer {
  padding: 16px 20px 0;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.sidebar-org {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Main area ── */
.main-area {
  flex: 1;
  min-width: 0;
  padding: 32px 36px 64px;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 100vh;
}

#leadsView:not([hidden]):not(.hidden) {
  display: flex !important;
  flex-direction: column;
  gap: 16px;
}

.page-header {
  margin-bottom: 28px;
}

.page-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.page-title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 60ch;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.campaign-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-muted);
  width: fit-content;
}

.campaign-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.campaign-tab:hover {
  color: var(--text);
}

.campaign-tab.active {
  background: var(--bg-panel);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

.campaign-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wizard-steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wizard-step-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-panel);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.wizard-step-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.wizard-step-btn.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.wizard-step-btn.done {
  color: var(--text);
}

.wizard-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  font-size: 10px;
  font-weight: 700;
}

.wizard-step-btn.active .wizard-step-num {
  background: var(--accent);
  color: #0a0e14;
}

.campaign-step {
  min-height: 0;
}

.wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
}

.wizard-progress {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.launch-review {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.review-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-muted);
}

.review-item-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.review-item-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

#campaignMonitorView .panel {
  margin-bottom: 0;
}

#campaignMonitorView #liveCampaignsSection.hidden {
  display: block !important;
}


/* ── Metric cards (top row) ── */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.dashboard-metrics {
  grid-template-columns: repeat(5, 1fr);
}

.metric-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}

.metric-card.highlight .metric-value {
  color: var(--accent);
}

.metric-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.metric-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.metric-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Panels ── */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}

.panel-wide {
  width: 100%;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.tag {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.two-col.one-col {
  grid-template-columns: 1fr;
}

.hint {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Forms ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field > span:first-child {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.field input,
.field select,
.field textarea {
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-input);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.field-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.ivr-tools {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
}

.ivr-tools .panel-header {
  margin-bottom: 12px;
}

.ivr-tools textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.45;
}

.ivr-preview {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ivr-preview audio {
  width: 100%;
}

.fb-routes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  max-height: 220px;
  overflow: auto;
}

.fb-route-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.fb-route-item strong {
  display: block;
  margin-bottom: 2px;
}

.fb-route-item small {
  color: var(--text-muted);
  font-size: 12px;
}

.fb-route-item .fb-route-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.fb-leads-table-wrap {
  max-height: 560px;
  overflow: auto;
}

.fb-leads-table th,
.fb-leads-table td {
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

.fb-leads-table td.mcd-status,
.fb-leads-table td.mcd-actions {
  max-width: none;
  overflow: visible;
  white-space: normal;
}

.mcd-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.fb-status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.inline-field {
  margin-bottom: 0;
  min-width: 150px;
}

/* ── Buttons ── */
.btn {
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #0a0e14;
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: #26c4ad;
  border-color: #26c4ad;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-small {
  padding: 6px 10px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* ── File drop ── */
.file-drop {
  display: block;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-muted);
  transition: border-color 0.15s, background 0.15s;
}

.file-drop:hover,
.file-drop.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.file-drop.compact {
  padding: 16px;
  margin-bottom: 12px;
}

.file-drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.file-icon {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.file-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Stats ── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.stat-row.compact {
  margin-bottom: 10px;
}

.stat {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.preview-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.preview-emails {
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-all;
}

.preview-label {
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 6px;
}

/* ── Mode options ── */
.mode-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mode-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.mode-option:hover {
  border-color: var(--border-strong);
  background: var(--bg-panel-hover);
}

.mode-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.mode-option input {
  margin-top: 2px;
  accent-color: var(--accent);
}

.mode-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mode-label strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.mode-label small {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Campaign progress ── */
.campaign-meta {
  margin: 0 0 16px;
  padding: 10px 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.phase-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.phase-section:last-of-type {
  border-bottom: none;
}

.phase-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-muted);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.call-bar .progress-fill,
.call-fill {
  background: var(--info);
}

.sms-bar .progress-fill,
.sms-fill {
  background: #2f9e8f;
}

.sms-did-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
  max-height: 220px;
  overflow: auto;
}

.sms-did-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.sms-did-item:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.sms-did-item input {
  margin-top: 0.2rem;
}

.sms-did-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.sms-did-meta strong {
  font-size: 0.9rem;
}

.sms-did-meta small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.sms-did-badge {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
  background: rgba(122, 134, 153, 0.2);
  color: var(--text-secondary);
}

.sms-did-badge.ready {
  background: rgba(46, 160, 120, 0.2);
  color: #6dcaa8;
}

.progress-text {
  font-size: 12px;
  font-weight: 700;
  min-width: 36px;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

/* ── Badges ── */
.badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.badge.running,
.badge.calling,
.badge.emailing {
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.25);
}

.badge.completed {
  background: rgba(56, 189, 248, 0.12);
  color: var(--info);
  border-color: rgba(56, 189, 248, 0.25);
}

.badge.paused {
  background: rgba(251, 191, 36, 0.12);
  color: var(--warning);
  border-color: rgba(251, 191, 36, 0.25);
}

.badge.error {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.25);
}

.badge.call {
  background: rgba(56, 189, 248, 0.12);
  color: var(--info);
}

.badge.email {
  background: rgba(45, 212, 191, 0.12);
  color: var(--accent);
}

/* ── Live campaigns ── */
.live-campaigns-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-campaign-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-muted);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.live-campaign-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-panel-hover);
}

.live-campaign-item.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.live-campaign-main {
  flex: 1;
  min-width: 0;
}

.live-campaign-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.live-campaign-stats {
  font-size: 11px;
  color: var(--text-muted);
}

.live-campaign-progress {
  width: 100px;
  flex-shrink: 0;
}

.live-campaign-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 3px;
}

.live-campaign-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s;
}

.live-campaign-progress-fill.call-fill {
  background: var(--info);
}

.live-campaign-progress-fill.sms-fill {
  background: #2f9e8f;
}

.live-campaign-progress-text {
  font-size: 10px;
  color: var(--text-muted);
  text-align: right;
}

/* ── Launch bar ── */
.launch-bar {
  background: linear-gradient(180deg, var(--bg-panel) 0%, rgba(45, 212, 191, 0.04) 100%);
  border-color: rgba(45, 212, 191, 0.15);
}

.launch-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.launch-label {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.launch-copy {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── SignalWire / Aircall panels ── */
.signalwire-dids,
.aircall-panel {
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
}

.aircall-panel {
  border-color: rgba(56, 189, 248, 0.15);
  background: rgba(56, 189, 248, 0.04);
}

.dids-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.did-list-field {
  margin-top: 10px;
}

.did-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
}

.dids-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}


.toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.toggle input {
  margin-top: 2px;
  accent-color: var(--accent);
}

.compact-toggle {
  margin-bottom: 10px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 4px 14px;
}

.template-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.subsection-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.template-toolbar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 10px;
}

.template-select-field {
  flex: 1;
  margin-bottom: 0;
}

.template-toolbar-actions {
  display: flex;
  gap: 6px;
}

.template-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#emailTemplateHtml {
  width: 100%;
  min-height: 220px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
  background: var(--bg-input);
  color: var(--text);
}

#emailTemplateHtml:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.error-inline {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
}

.error-log {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius);
  background: rgba(248, 113, 113, 0.06);
}

.error-log h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--danger);
}

.error-log ul {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.error-log li {
  margin-bottom: 4px;
}

.disabled-panel {
  opacity: 0.4;
  pointer-events: none;
}

.section-hidden {
  display: none !important;
}

.hidden {
  display: none !important;
}

/* ── Analytics ── */
.analytics-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-meta {
  margin-left: auto;
}

.fb-redial-toolbar {
  align-items: center;
  margin-top: -4px;
  margin-bottom: 8px;
}

.fb-redial-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.fb-redial-speed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fb-redial-speed-value {
  min-width: 72px;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.fb-redial-speed .btn {
  min-width: 34px;
  padding-left: 0;
  padding-right: 0;
}

.fb-daily-queue {
  margin: 0;
}

.fb-daily-queue .hint {
  margin-top: 0;
}

.fb-daily-queue .stat-row {
  margin: 4px 0 12px;
}

.fb-daily-queue-table select {
  min-width: 160px;
  max-width: 240px;
}

.fb-daily-queue-table td {
  vertical-align: middle;
}

.fb-redial-batches {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 2px 0 4px;
}

.fb-redial-batch-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.fb-redial-batch-title {
  min-width: 148px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text);
}

.fb-redial-batch-hint {
  margin: 0 0 8px;
}

.fb-redial-avg {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.fb-paused-banner {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--warning, #d4a017);
  border-radius: 8px;
  background: color-mix(in srgb, var(--warning, #d4a017) 12%, transparent);
  color: var(--text);
  font-size: 13px;
}

.fb-redial-range .inline-field {
  min-width: 148px;
}

.fb-redial-range input[type="date"] {
  min-width: 148px;
}

.fb-dial-filters .inline-field {
  min-width: 110px;
}

.fb-dial-filters select {
  min-width: 168px;
}

.fb-dial-filters input[type="number"] {
  min-width: 88px;
}

.fb-did-batch-toolbar {
  align-items: flex-start;
}

.fb-did-batch-field select {
  min-width: 280px;
  min-height: 92px;
}

.fb-did-batch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 18px;
}

.funnel-list {
  display: flex;
  flex-direction: column;
}

.funnel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.funnel-row:last-child {
  border-bottom: none;
}

.funnel-label {
  color: var(--text-secondary);
}

.funnel-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.funnel-divider {
  height: 1px;
  background: var(--border-strong);
  margin: 6px 0;
}

.live-agents-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-color-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.status-color-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-muted);
}

.status-color-item label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.status-color-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-color-item input[type='color'] {
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.status-color-count {
  font-size: 10px;
  color: var(--text-muted);
}

.agent-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.agent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.agent-table th,
.agent-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.agent-table th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-muted);
}

.agent-table tbody tr:last-child td {
  border-bottom: none;
}

.agent-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.agent-name-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.agent-name {
  font-weight: 600;
  color: var(--text);
}

.agent-email {
  font-size: 11px;
  color: var(--text-muted);
}

.agent-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.agent-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.agent-duration {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
}

.agent-duration-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

.dashboard-campaigns-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-campaign-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-muted);
}

.dashboard-campaign-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-campaign-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  max-width: 360px;
}

.toast.success {
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--success);
}

.toast.error {
  border-color: rgba(248, 113, 113, 0.3);
  color: var(--danger);
}

.coaching-layout {
  display: block;
}

.coaching-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.coaching-layout.coaching-layout-signed-in {
  grid-template-columns: 1fr;
}

.coaching-workspace-panel {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 0;
}

.coaching-workspace-panel.hidden {
  display: none;
}

.workspace-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.workspace-http-warning {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}

.workspace-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
}

.aircall-workspace-mount {
  min-height: 680px;
  border-radius: var(--radius);
  overflow: auto;
  background: #111827;
}

.aircall-workspace-mount iframe {
  border: 0;
  width: 100% !important;
  height: 100% !important;
}

.coaching-setup {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}

.coaching-setup-steps {
  margin: 8px 0 0;
  padding-left: 18px;
}

.coaching-setup-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

#transcriptionStatusTag[data-tone='success'] {
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.35);
}

#transcriptionStatusTag[data-tone='info'] {
  color: var(--accent);
  border-color: rgba(59, 130, 246, 0.35);
}

.coaching-status[data-tone='success'] {
  color: var(--success);
}

.coaching-status[data-tone='error'] {
  color: var(--danger);
}

.coaching-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.agent-table tr.is-selected {
  background: rgba(59, 130, 246, 0.08);
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-align: left;
}

.coaching-transcript-panel {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.coaching-transcript {
  max-height: 220px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.transcript-line {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px;
  font-size: 12px;
}

.transcript-speaker {
  color: var(--text-muted);
  text-transform: capitalize;
}

.compact-header {
  margin-bottom: 8px;
}

/* ── Lead dashboard ── */
.la-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.la-insight {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.la-insight p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.la-note {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.la-kpis,
.la-channels {
  display: grid;
  gap: 12px;
}

.la-kpis {
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}

.la-kpi.is-sold {
  border-top: 3px solid var(--success);
}

.deal-board-view {
  min-height: calc(100vh - 168px);
}

.board {
  --bg-panel: #161d21;
  --bg-input: #101618;
  --text: #f4f4f4;
  --text-secondary: #c8c8c8;
  --text-muted: #9a9a9a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent: #0097b2;
  --success: #0097b2;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: inherit;
  color: #f4f4f4;
  color-scheme: dark;
  background:
    radial-gradient(ellipse at top, rgba(0, 151, 178, 0.16), transparent 42%),
    #0c1214;
  border-radius: 24px;
  border-top: 6px solid #0097b2;
}

.board .btn-ghost:hover:not(:disabled) {
  background: rgba(0, 151, 178, 0.08);
  color: #0097b2;
}

.board-top {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(160px, 1fr);
  gap: 16px;
  align-items: end;
}

.board-logo {
  display: block;
  height: 68px;
  width: auto;
}

.board-heading {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #0097b2;
}

.board-controls {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.board-live {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px 10px;
}

.board-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0097b2;
  box-shadow: 0 0 0 0 rgba(0, 151, 178, 0.7);
  animation: board-pulse 1.8s ease-out infinite;
}

.board-clock {
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.board-updated {
  flex-basis: 100%;
  text-align: right;
  color: var(--text-muted);
  font-size: 13px;
}

.board-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.board-stage {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.7fr);
  gap: 22px;
  min-height: 280px;
}

.board-score {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: 32px 36px 28px;
  border-radius: 28px;
  background: #161d21;
  border: 1px solid rgba(0, 151, 178, 0.28);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.board-score-deals,
.board-score-enrolled {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  width: 100%;
}

.board-score-rule {
  width: 72px;
  height: 4px;
  margin: 18px 0 16px;
  border-radius: 999px;
  background: #0097b2;
}

.board-score-label,
.board-section-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.board-score-num {
  margin: 6px 0 0;
  font-size: clamp(128px, 13vw, 220px);
  line-height: 0.85;
  letter-spacing: -0.06em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #f4f4f4;
  text-align: center;
}

.board-score-debt {
  margin-top: 6px;
  font-size: clamp(56px, 5.6vw, 88px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0097b2;
  text-align: center;
}

.board-score-debt-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.board-score-date {
  margin-top: 18px;
  color: var(--text-secondary);
  font-size: 18px;
  text-align: center;
}

.board-ranks {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-height: 0;
  overflow: auto;
}

.board-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  border-radius: 24px;
  border: 1px dashed var(--border-strong);
  color: var(--text-secondary);
  font-size: 28px;
  font-weight: 600;
}

.board-lane {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 12px 18px;
  align-items: center;
  min-height: 104px;
  padding: 16px 24px;
  border-radius: 22px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  overflow: hidden;
}

.board-lane-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--share, 0%);
  background: rgba(0, 151, 178, 0.1);
}

.board-lane.is-1 {
  border-color: rgba(0, 151, 178, 0.45);
  min-height: 124px;
}

.board-lane.is-1 .board-lane-bar {
  background: rgba(0, 151, 178, 0.16);
}

.board-lane.is-1 .board-lane-rank { color: #0097b2; }
.board-lane.is-2 .board-lane-rank { color: #d0d0d0; }
.board-lane.is-3 .board-lane-rank { color: #7a7a7a; }

.board-lane-rank,
.board-lane-name,
.board-lane-meta {
  position: relative;
}

.board-lane-rank {
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-muted);
}

.board-lane-name {
  font-size: clamp(28px, 3.2vw, 46px);
  font-weight: 700;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  line-height: 0.95;
}

.board-lane-meta {
  text-align: right;
}

.board-lane-deals {
  display: block;
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.board-lane-debt {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.board-cases {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 1fr);
  gap: 12px;
  overflow-x: auto;
}

.board-case {
  min-width: 0;
  padding: 14px 16px 16px;
  border-radius: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
}

.board-case-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.board-case-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.board-case-debt {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.board-case-meta {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 15px;
}

.board-case a {
  color: var(--accent);
  text-decoration: none;
}

@keyframes board-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 151, 178, 0.45); }
  100% { box-shadow: 0 0 0 12px rgba(0, 151, 178, 0); }
}

html.floor-board .sidebar,
html.floor-board .page-header {
  display: none;
}

html.floor-board .app-shell {
  display: block;
  background: #0c1214;
}

html.floor-board .main-area {
  max-height: none;
  height: 100vh;
  padding: 0;
  background: #0c1214;
}

html.floor-board .deal-board-view {
  min-height: 100vh;
  height: 100vh;
}

html.floor-board .board {
  height: 100vh;
  padding: 28px 40px 24px;
  border-radius: 0;
}

html.floor-board .board-logo,
html.board-flipped .board-logo {
  height: 96px;
}

html.floor-board .board-heading {
  font-size: 16px;
}

html.floor-board .board-score-num {
  font-size: clamp(168px, 16vw, 260px);
}

html.floor-board .board-score-debt {
  font-size: clamp(72px, 6.4vw, 104px);
}

html.board-flipped,
html.board-flipped body {
  overflow: hidden;
  background: #0c1214;
}

html.board-flipped .sidebar,
html.board-flipped .page-header {
  display: none;
}

html.board-flipped .board {
  position: fixed;
  z-index: 30;
  top: 50%;
  left: 50%;
  width: 100vh;
  height: 100vw;
  margin: 0;
  padding: 28px 36px 24px;
  box-sizing: border-box;
  overflow: auto;
  border-radius: 0;
  transform: translate(-50%, -50%) rotate(90deg);
}

html.board-flipped.board-flip-ccw .board {
  transform: translate(-50%, -50%) rotate(-90deg);
}

html.board-flipped .board-top {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand live"
    "controls controls";
  align-items: center;
  gap: 8px 16px;
}

html.board-flipped .board-brand { grid-area: brand; }
html.board-flipped .board-live {
  grid-area: live;
  justify-content: flex-end;
}
html.board-flipped .board-controls {
  grid-area: controls;
  justify-content: flex-start;
  flex-wrap: wrap;
}
html.board-flipped .board-heading {
  font-size: 14px;
}
html.board-flipped .board-clock {
  font-size: 28px;
}
html.board-flipped .board-updated {
  font-size: 12px;
}

html.board-flipped .board-stage {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 0 0 auto;
}

html.board-flipped .board-score {
  align-self: center;
  width: min(100%, 920px);
  margin: 4px auto 0;
  padding: 36px 28px 28px;
}

html.board-flipped .board-score-label,
html.board-flipped .board-score-debt-label {
  font-size: 20px;
}

html.board-flipped .board-score-num {
  font-size: clamp(188px, 26vh, 300px);
}

html.board-flipped .board-score-rule {
  width: 96px;
  margin: 22px 0 18px;
}

html.board-flipped .board-score-debt {
  font-size: clamp(84px, 12vh, 132px);
}

html.board-flipped .board-score-date {
  margin-top: 20px;
  font-size: 22px;
}

html.board-flipped .board-ranks {
  gap: 10px;
}

html.board-flipped .board-lane {
  min-height: 92px;
  padding: 14px 20px;
}

html.board-flipped .board-lane-debt {
  font-size: 22px;
  color: #0097b2;
  font-weight: 700;
}

html.board-flipped .board-cases {
  grid-auto-flow: row;
  grid-template-columns: 1fr;
  grid-auto-columns: auto;
  overflow: visible;
}

.la-channels {
  grid-template-columns: repeat(4, 1fr);
}

.la-kpi,
.la-channel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  min-width: 0;
}

.la-kpi-label,
.la-channel-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.la-kpi-value,
.la-channel-value {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.la-kpi-sub,
.la-channel-sub,
.la-channel-meta {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.la-delta {
  color: var(--text-muted);
}

.la-delta.is-up {
  color: var(--success);
}

.la-delta.is-down {
  color: var(--danger);
}

.la-channel {
  appearance: none;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-top: 3px solid var(--border-strong);
}

.la-channel:hover {
  background: var(--bg-panel-hover);
}

.la-channel.is-active {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.la-channel-tiktok { border-top-color: #2dd4bf; }
.la-channel-facebook { border-top-color: #38bdf8; }
.la-channel-instagram { border-top-color: #f472b6; }
.la-channel-other { border-top-color: #94a3b8; }

.la-channel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.la-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 999px;
  padding: 2px 7px;
  white-space: nowrap;
}

.la-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.la-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.la-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 6px;
}

.la-swatch-tiktok { background: #2dd4bf; }
.la-swatch-facebook { background: #38bdf8; }
.la-swatch-instagram { background: #f472b6; }
.la-swatch-other { background: #94a3b8; }

.la-chart-scroll {
  overflow-x: auto;
}

.la-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-height: 168px;
  min-width: 520px;
}

.la-col {
  flex: 1 1 0;
  min-width: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.la-stack {
  width: 100%;
  max-width: 28px;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.la-seg { display: block; min-height: 0; }
.la-seg-tiktok { background: #2dd4bf; }
.la-seg-facebook { background: #38bdf8; }
.la-seg-instagram { background: #f472b6; }
.la-seg-other { background: #64748b; }

.la-col-label {
  margin-top: 6px;
  height: 14px;
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.la-meter {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.la-meter-row {
  display: grid;
  grid-template-columns: 132px 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.la-meter-label {
  color: var(--text-secondary);
}

.la-meter-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.la-meter-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.la-meter-fill.is-debt {
  background: var(--info);
}

.la-meter-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.la-meter-hint {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.la-table td:first-child,
.la-table th:first-child {
  max-width: 240px;
}

.la-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}

.la-name.is-id {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--text-secondary);
}

.la-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.la-quality {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 12px;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .dashboard-metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .la-kpis {
    grid-template-columns: repeat(3, 1fr);
  }

  .la-channels {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
  }

  .sidebar-brand {
    padding: 0;
    border: none;
    margin: 0;
    align-items: center;
  }

  html.sidebar-collapsed .sidebar {
    width: 100%;
    --sidebar-w: 100%;
  }

  html.sidebar-collapsed .sidebar-nav {
    display: none;
  }

  .sidebar-nav {
    flex-direction: row;
    padding: 0;
    flex: none;
  }

  .sidebar-footer {
    display: none;
  }

  .main-area {
    padding: 20px 16px 48px;
  }

  .metrics-row,
  .dashboard-metrics,
  .two-col,
  .coaching-layout,
  .mode-options,
  .la-kpis,
  .la-channels {
    grid-template-columns: 1fr;
  }

  .la-meter-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .board-top,
  .board-stage {
    grid-template-columns: 1fr;
  }

  .board-live,
  .board-controls {
    align-items: flex-start;
  }

  .board-lane {
    grid-template-columns: 48px minmax(0, 1fr);
    min-height: 88px;
  }

  .board-lane-meta {
    grid-column: 2;
    text-align: left;
  }

  .launch-bar-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-campaign-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-campaign-meta {
    align-items: flex-start;
  }
}

.instance-removed,
#didsView,
#leadsView,
#missedCallsView,
#leadAnalyticsView,
#dealReportView,
#dashboardView,
#aircallPanel,
#press1AircallPanel,
#aircallCoachingSection,
[data-step-panel="sms"],
[data-step-panel="rvm"] {
  display: none !important;
}
