/* ── Reset & Variables ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary:   #0f1117;
  --bg-secondary: #1a1d27;
  --bg-panel:     #1e2130;
  --bg-hover:     #252840;
  --border:       #2d3148;
  --border-light: #3d4168;

  --text-primary:   #e8eaf6;
  --text-secondary: #9096b4;
  --text-muted:     #5a5f7a;

  --accent-blue:   #7c3aed;
  --accent-green:  #37b24d;
  --accent-yellow: #f59f00;
  --accent-red:    #f03e3e;
  --accent-purple: #9775fa;

  --severity-high:   #f03e3e;
  --severity-medium: #f59f00;
  --severity-low:    #37b24d;

  --step-pending:    #5a5f7a;
  --step-active:     #7c3aed;
  --step-completed:  #37b24d;

  --radius: 8px;
  --radius-sm: 4px;
  --font: 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

/* ── App Body (sidebar + content) ──────────────────────────────────────── */
.app-body {
  display: flex;
  height: calc(100vh - 56px);
  overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  width: 160px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
  margin-bottom: 8px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  padding: 6px 8px 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  user-select: none;
}

.sidebar-item:hover:not(.disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent-blue);
  font-weight: 600;
}

.sidebar-item.active .sidebar-icon {
  filter: none;
}

.sidebar-item.disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.sidebar-icon {
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1;
}

.sidebar-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 0 8px;
}

/* ── Header ────────────────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  height: 56px;
  flex-shrink: 0;
}

.header-left { display: flex; align-items: center; gap: 14px; }
.header-right { display: flex; align-items: center; gap: 10px; }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-blue);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.logo-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.logo-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

.status-badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all 0.3s;
}
.status-badge.connected { color: var(--accent-green); border-color: var(--accent-green); }
.status-badge.error     { color: var(--accent-red); border-color: var(--accent-red); }

.join-form { display: flex; gap: 8px; align-items: center; }

.input-field {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 13px;
  width: 140px;
  outline: none;
  transition: border-color 0.2s;
}
.input-field:focus { border-color: var(--accent-blue); }
.input-field::placeholder { color: var(--text-muted); }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  padding: 7px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent-blue); color: #fff; }
.btn-primary:hover { background: #6d28d9; }
.btn-danger  { background: var(--accent-red); color: #fff; }
.btn-danger:hover { background: #c92a2a; }
.btn-success { background: #2f9e44; color: #fff; }
.btn-success:hover { background: #237032; }
.btn-small {
  padding: 3px 10px;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.btn-small:hover { background: var(--bg-hover); }

/* ── Main Grid ─────────────────────────────────────────────────────────── */
.main-grid {
  display: grid;
  grid-template-columns: 40% 60%;
  flex: 1;
  height: 100%;
  gap: 0;
  overflow: hidden;
  min-width: 0;
}

.right-column {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-left: 1px solid var(--border);
}

/* ── Panels ────────────────────────────────────────────────────────────── */
.panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.panel-header h2 { font-size: 13px; font-weight: 600; color: var(--text-primary); }

.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Transcript panel */
.panel-transcript { height: 100%; border-right: 1px solid var(--border); }

.transcript-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  scroll-behavior: smooth;
}

.placeholder-text {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  margin-top: 40px;
  font-size: 13px;
}

.transcript-utterance {
  margin-bottom: 10px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border-light);
  font-size: 13px;
  line-height: 1.6;
}

.transcript-interim {
  margin-bottom: 10px;
  padding: 8px 12px;
  background: rgba(124, 58, 237, 0.05);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-blue);
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
}

.transcript-timestamp {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 3px;
  font-family: var(--font-mono);
}

/* 7 Steps panel */
.panel-steps {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  padding: 10px 12px;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  gap: 4px;
  border-right: 1px solid var(--border);
  cursor: default;
  transition: background 0.2s;
}
.step-item:last-child { border-right: none; }
.step-item:hover { background: var(--bg-hover); border-radius: var(--radius-sm); }

.step-icon { font-size: 16px; line-height: 1; }
.step-label { font-size: 9px; color: var(--text-secondary); text-align: center; line-height: 1.3; }

.step-score-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.step-score-fill {
  height: 100%;
  background: var(--step-pending);
  transition: width 0.5s ease, background 0.3s;
}

.step-score-text { font-size: 9px; color: var(--text-muted); font-family: var(--font-mono); }

/* Step states */
.step-item[data-status="in_progress"] .step-score-fill  { background: var(--accent-blue); }
.step-item[data-status="completed"]  .step-score-fill  { background: var(--accent-green); }
.step-item[data-status="skipped"]    .step-score-fill  { background: var(--text-muted); }
.step-item[data-status="in_progress"] .step-label { color: var(--accent-blue); font-weight: 600; }
.step-item[data-status="completed"]   .step-label { color: var(--accent-green); }

.next-action-bar {
  padding: 6px 16px;
  background: rgba(124, 58, 237, 0.08);
  border-top: 1px solid var(--border);
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.next-action-label { color: var(--accent-blue); font-weight: 600; white-space: nowrap; }
#next-action-text  { color: var(--text-primary); }

/* Insights panel */
.panel-insights {
  flex: 1;
  border-bottom: 1px solid var(--border);
  min-height: 0;
  transition: box-shadow 0.3s;
}

.panel-insights.alert-flash {
  box-shadow: 0 0 0 2px var(--severity-high), 0 0 20px rgba(240, 62, 62, 0.3);
  animation: flash-border 0.8s ease-in-out 3;
}

@keyframes flash-border {
  0%   { box-shadow: 0 0 0 2px var(--severity-high), 0 0 20px rgba(240, 62, 62, 0.4); }
  50%  { box-shadow: 0 0 0 3px var(--severity-high), 0 0 35px rgba(240, 62, 62, 0.7); }
  100% { box-shadow: 0 0 0 2px var(--severity-high), 0 0 20px rgba(240, 62, 62, 0.4); }
}

.insights-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Insight cards */
.insight-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 10px 12px;
  border-left: 4px solid var(--border);
  animation: slide-in 0.3s ease;
}
.insight-card.severity-high   { border-left-color: var(--severity-high); }
.insight-card.severity-medium { border-left-color: var(--severity-medium); }
.insight-card.severity-low    { border-left-color: var(--severity-low); }

@keyframes slide-in {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.insight-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.insight-type-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.type-objection  { background: rgba(240,62,62,0.15);  color: var(--severity-high); }
.type-testimonial{ background: rgba(55,178,77,0.15);  color: var(--severity-low); }
.type-pitch      { background: rgba(245,159,0,0.15);  color: var(--severity-medium); }
.type-proactive  { background: rgba(124,58,237,0.15); color: var(--accent-blue); }
.type-step_alert { background: rgba(151,117,250,0.15);color: var(--accent-purple); }

.insight-phrase {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 5px;
  padding-left: 8px;
  border-left: 2px solid var(--border-light);
}
.insight-suggestion {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.5;
}
.insight-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 5px;
  font-family: var(--font-mono);
}

/* Query panel */
.panel-query { flex-shrink: 0; max-height: 240px; }

.query-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.query-history {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.query-item { font-size: 12px; }
.query-question { color: var(--accent-blue); font-weight: 600; margin-bottom: 3px; }
.query-question::before { content: "▶ "; }
.query-answer { color: var(--text-primary); padding-left: 12px; line-height: 1.5; }
.query-spinner { color: var(--text-muted); font-style: italic; padding-left: 12px; }

.query-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.query-textarea {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 12px;
  padding: 7px 10px;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}
.query-textarea:focus { border-color: var(--accent-blue); }
.query-textarea::placeholder { color: var(--text-muted); }

/* ── Final Report Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  width: min(90vw, 720px);
  max-height: 85vh;
  overflow-y: auto;
  animation: slide-up 0.3s ease;
}

@keyframes slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-panel);
}
.modal-header h2 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 20px; }

.report-grade-hero {
  text-align: center;
  padding: 24px;
  margin-bottom: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}
.report-score-number {
  font-size: 88px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 6px;
}
.report-score-number.score-high   { color: var(--accent-green); }
.report-score-number.score-medium { color: var(--accent-yellow); }
.report-score-number.score-low    { color: var(--severity-high); }

.report-total { font-size: 18px; color: var(--text-secondary); }

.report-steps-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 13px;
}
.report-steps-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.report-steps-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.step-score-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
  min-width: 36px;
  text-align: center;
}
.score-high   { background: rgba(55,178,77,0.2);  color: var(--accent-green); }
.score-medium { background: rgba(245,159,0,0.2);  color: var(--accent-yellow); }
.score-low    { background: rgba(240,62,62,0.2);  color: var(--severity-high); }

.step-suggestions { margin-top: 5px; padding-left: 12px; }
.step-suggestions li { font-size: 12px; color: var(--text-secondary); margin-bottom: 3px; }

.report-feedback-section {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}
.report-feedback-section h3 { font-size: 13px; margin-bottom: 8px; color: var(--text-secondary); }
.report-feedback-section p  { font-size: 13px; line-height: 1.6; }

.loading-spinner {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-style: italic;
}

/* ── Settings View ──────────────────────────────────────────────────────── */
.settings-view {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-primary);
  min-width: 0;
  flex-direction: column;
}

.settings-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  width: 100%;
}

.settings-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 40px;
}

.settings-page-header {
  margin-bottom: 32px;
}

.settings-page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.settings-page-header p {
  font-size: 13px;
  color: var(--text-secondary);
}

.settings-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.settings-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.settings-card-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.settings-card-header h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.settings-card-header p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.settings-fields {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.settings-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.field-badge.optional {
  background: rgba(90, 95, 122, 0.2);
  color: var(--text-muted);
}

.field-status-row {
  margin-bottom: 2px;
}

.field-status {
  font-size: 11px;
  font-weight: 500;
}

.status-set {
  color: var(--accent-green);
}

.status-unset {
  color: var(--accent-yellow);
}

.field-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.settings-input {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color 0.2s;
}

.settings-input:focus {
  border-color: var(--accent-blue);
}

.settings-input::placeholder {
  color: var(--text-muted);
  font-family: var(--font);
}

.btn-eye {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
  line-height: 1.4;
}

.btn-eye:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

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

/* ── Provider selector (OpenAI vs Claude) ─────────────────────────────────── */
.field-provider-selector {
  display: flex;
  gap: 12px;
  margin: 6px 0 4px;
  flex-wrap: wrap;
}

.provider-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: border-color .15s, background .15s;
  user-select: none;
}

.provider-option:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.provider-option input[type="radio"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}

.provider-option:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text-primary);
  font-weight: 600;
}

.settings-save-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 8px 0 32px;
}

.btn-save-settings {
  padding: 10px 28px;
  font-size: 14px;
}

.save-msg {
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
}

.save-msg-success {
  color: var(--accent-green);
  background: rgba(55, 178, 77, 0.1);
  border: 1px solid rgba(55, 178, 77, 0.3);
}

.save-msg-error {
  color: var(--accent-red);
  background: rgba(240, 62, 62, 0.1);
  border: 1px solid rgba(240, 62, 62, 0.3);
}

/* ── Scrollbars ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── SDR WhatsApp View ──────────────────────────────────────────────────── */
.sdr-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100%;
  overflow: hidden;
}

.sdr-left-col {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.sdr-right-col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
}

/* Sections */
.sdr-section {
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
}

.sdr-section-slots {
  flex: 1;
  overflow-y: auto;
}

.sdr-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

/* WA Status */
.wa-status-dot { font-size: 14px; line-height: 1; }
.wa-status-area { font-size: 12px; }
.wa-connected { display: flex; align-items: center; justify-content: space-between; }
.wa-phone { color: var(--accent-green); font-weight: 600; font-size: 12px; }
.wa-qr-wrap { text-align: center; padding: 4px 0; }
.wa-qr-img { width: 220px; height: 220px; border-radius: var(--radius-sm); border: 2px solid var(--border-light); }
.wa-qr-tip { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.wa-offline { color: var(--accent-red) !important; }

/* Import */
.sdr-import-area { display: flex; gap: 6px; align-items: center; }
.sdr-upload-btn {
  display: inline-block;
  padding: 5px 10px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.sdr-upload-btn:hover { background: var(--border); }
.sdr-manual-btn { font-size: 11px !important; }

.import-feedback {
  margin-top: 8px;
  font-size: 11px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.import-feedback.success { color: var(--accent-green); background: rgba(55,178,77,0.1); }
.import-feedback.error   { color: var(--accent-red);   background: rgba(240,62,62,0.1); }

/* Form */
.sdr-form { display: flex; flex-direction: column; gap: 6px; }
.sdr-input {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}
.sdr-input:focus { border-color: var(--accent-blue); }
.sdr-input::placeholder { color: var(--text-muted); }
.sdr-label { font-size: 11px; color: var(--text-secondary); }
.sdr-check-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); cursor: pointer; }
.sdr-form-actions { display: flex; gap: 6px; }
.sdr-bulk-textarea { resize: vertical; min-height: 100px; font-family: monospace; font-size: 12px; line-height: 1.6; }
.sdr-bulk-hint { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; line-height: 1.5; }
.sdr-bulk-hint code { background: var(--bg-tertiary); padding: 1px 5px; border-radius: 3px; font-size: 11px; }

/* Campaign selector */
.campaign-selector { display: flex; flex-direction: column; gap: 4px; }
.campaign-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; border: 1px solid var(--border-color); transition: background 0.15s; }
.campaign-opt:hover { background: var(--bg-tertiary); }
.campaign-opt input[type="radio"] { accent-color: var(--accent-blue); cursor: pointer; }
.campaign-opt input[type="radio"]:checked + span { color: var(--accent-blue); }
.campaign-opt span strong { font-weight: 600; }

/* Slots */
.slot-period-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.slot-period-field { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.slot-period-sep {
  color: var(--text-secondary);
  font-size: 16px;
  padding-bottom: 8px;
}
.slot-preview {
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  min-height: 32px;
  line-height: 1.5;
}
.slot-preview strong { color: var(--accent-blue); }

.slots-list { display: flex; flex-direction: column; gap: 4px; }
.slot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: var(--bg-panel);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 11px;
}
.slot-item.taken { opacity: 0.5; }
.slot-time { display: flex; flex-direction: column; gap: 2px; color: var(--text-secondary); }
.slot-booked-by { color: var(--accent-green); font-size: 10px; }
.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Tabs */
.sdr-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.sdr-tab {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.sdr-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.sdr-tab.active { color: var(--accent-blue); border-bottom-color: var(--accent-blue); font-weight: 700; }

/* Conversas count badge */
.conv-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 9px;
  background: var(--accent-blue);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
  line-height: 1;
}
.sdr-tab.active .conv-count { background: var(--accent-blue); }
.sdr-tab:not(.active) .conv-count { background: var(--text-muted); }

/* Stats bar inside lead list */
.conv-stats-bar {
  display: flex;
  gap: 12px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.conv-stat {
  font-size: 11px;
  font-weight: 600;
}
.conv-stat-responsive { color: var(--accent-yellow); }
.conv-stat-contacted  { color: var(--accent-green); }

.sdr-tab-content { flex: 1; overflow-y: auto; min-height: 0; }

/* ── Objection Tree ─────────────────────────────────────────────────── */
.obj-tree-container { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.obj-tree-header {
  display: flex; align-items: baseline; gap: 10px;
  padding: 4px 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.obj-tree-title   { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.obj-tree-subtitle{ font-size: 11px; color: var(--text-muted); }

.obj-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  overflow: hidden;
}
.obj-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; cursor: pointer; user-select: none;
  transition: background 0.12s;
}
.obj-card-header:hover { background: var(--bg-hover); }

.obj-card-left  { display: flex; align-items: center; gap: 8px; }
.obj-card-right { display: flex; align-items: center; gap: 8px; }

.obj-rank  { font-size: 10px; font-weight: 700; color: var(--text-muted); min-width: 20px; }
.obj-label { font-size: 12px; font-weight: 600; color: var(--text-primary); }

.obj-count      { font-size: 11px; font-weight: 700; color: var(--accent-blue); min-width: 32px; text-align: right; }
.obj-count-zero { font-size: 10px; color: var(--text-muted); font-style: italic; }

.obj-bar-wrap { width: 60px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.obj-bar      { height: 100%; background: var(--accent-blue); border-radius: 2px; transition: width 0.3s; }

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

/* Approaches */
.obj-approaches { padding: 0 12px 12px; border-top: 1px solid var(--border); }

.ap-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.ap-row:last-child { border-bottom: none; }

.ap-top  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.ap-label{ font-size: 11px; font-weight: 700; color: var(--text-primary); }
.ap-stats{ display: flex; align-items: center; gap: 8px; }
.ap-uses { font-size: 10px; color: var(--text-muted); }

.ap-rate      { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; }
.rate-good    { background: rgba(34,197,94,.18); color: #22c55e; }
.rate-mid     { background: rgba(234,179,8,.18);  color: #eab308; }
.rate-bad     { background: rgba(239,68,68,.18);  color: #ef4444; }
.rate-none    { color: var(--text-muted); font-weight: 400; font-style: italic; }

.ap-message {
  font-size: 11px; color: var(--text-secondary); line-height: 1.5;
  background: var(--bg-secondary); padding: 6px 8px; border-radius: 6px;
  border-left: 3px solid var(--accent-blue);
}

/* Queue */
.sdr-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.queue-actions { display: flex; gap: 6px; }
.sdr-queue-list { display: flex; flex-direction: column; }
.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.queue-item:hover { background: var(--bg-hover); }
.queue-priority-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.queue-lead-info { flex: 1; min-width: 0; }
.queue-lead-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.queue-lead-meta { font-size: 11px; color: var(--text-muted); }
.queue-action-col { text-align: right; }
.queue-next-action { font-size: 11px; color: var(--text-secondary); }
.queue-score { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }

/* Conversations */
.sdr-conv-layout { display: grid; grid-template-columns: 220px 1fr; height: 100%; overflow: hidden; }
.sdr-lead-list { border-right: 1px solid var(--border); overflow-y: auto; background: var(--bg-secondary); }
.lead-list-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.lead-list-item:hover { background: var(--bg-hover); }
.lead-list-item.selected { background: rgba(124,58,237,0.12); border-left: 3px solid var(--accent-blue); }
.lead-list-top-row { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.lead-list-name { font-size: 13px; font-weight: 600; color: var(--text-primary); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-list-time { font-size: 10px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.lead-list-phone { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.lead-list-preview { font-size: 11px; color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-list-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Status color tags */
.lead-status-contacted  { color: var(--accent-green) !important; }
.lead-status-responsive { color: var(--accent-yellow) !important; }
.lead-status-new        { color: var(--text-muted); }
.lead-status-scheduled  { color: var(--accent-blue) !important; }

/* Chat area */
.sdr-chat-area { display: flex; flex-direction: column; overflow: hidden; }
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.chat-lead-info { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.chat-lead-phone { font-size: 11px; color: var(--text-muted); }
.chat-lead-status {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--bg-hover);
  color: var(--text-muted);
}
.chat-zoom-link { font-size: 11px; color: var(--accent-blue); text-decoration: none; }
.chat-actions { display: flex; gap: 6px; }

/* Manual override countdown banner — shown below the chat header */
.override-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #fff3cd;
  color: #856404;
  border-bottom: 1px solid #ffc107;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}
.override-banner strong {
  font-weight: 700;
  color: #664d03;
}

.chat-thread {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}
.bubble-wrap { display: flex; flex-direction: column; max-width: 75%; }
.bubble-wrap.out { align-items: flex-end; margin-left: auto; }
.bubble-wrap.in  { align-items: flex-start; margin-right: auto; }

/* ── Reply row (bubble + reply button side by side) ──────────────────────── */
.bubble-row { display: flex; align-items: flex-end; gap: 4px; }
.bubble-row.out { flex-direction: row-reverse; }
.bubble-row.in  { flex-direction: row; }

.bubble-reply-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  flex-shrink: 0;
  align-self: center;
  transition: background .12s, color .12s;
}
.bubble-wrap:hover .bubble-reply-btn { display: flex; }
.bubble-reply-btn:hover { background: var(--border-light); color: var(--text-primary); }

/* ── Quoted message preview inside bubble ────────────────────────────────── */
.bubble-quoted {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin-bottom: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,.18);
  overflow: hidden;
}
.bubble-out .bubble-quoted { background: rgba(255,255,255,.15); }
.bubble-quoted-bar { width: 3px; border-radius: 2px; background: rgba(255,255,255,.5); flex-shrink: 0; }
.bubble-out .bubble-quoted-bar { background: rgba(255,255,255,.7); }
.bubble-in  .bubble-quoted-bar { background: var(--accent-blue); }
.bubble-quoted-text {
  font-size: 11px;
  opacity: .8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

/* ── Reply preview bar (above textarea) ──────────────────────────────────── */
.reply-preview-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: var(--bg-panel);
  border-top: 1px solid var(--accent-blue);
  border-left: 3px solid var(--accent-blue);
  gap: 8px;
  flex-shrink: 0;
}
.reply-preview-content { display: flex; align-items: center; gap: 6px; overflow: hidden; }
.reply-preview-icon { color: var(--accent-blue); font-size: 14px; flex-shrink: 0; }
.reply-preview-text {
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reply-cancel-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 0 2px;
  line-height: 1;
}
.reply-cancel-btn:hover { color: var(--text-primary); }
.bubble {
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

/* ── Link / YouTube preview inside bubble ─────────────────────────────────── */
.bubble-link-preview {
  margin-top: 6px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.15);
  max-width: 280px;
  cursor: pointer;
  text-decoration: none;
  display: block;
}
.bubble-in .bubble-link-preview { border-color: var(--border); }
.bubble-link-preview-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
.bubble-link-preview-info {
  padding: 6px 8px;
  background: rgba(0,0,0,.25);
}
.bubble-out .bubble-link-preview-info { background: rgba(0,0,0,.2); }
.bubble-in  .bubble-link-preview-info { background: var(--bg-hover); }
.bubble-link-preview-title {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 2px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.bubble-link-preview-domain {
  font-size: 10px;
  opacity: .6;
  text-transform: uppercase;
}
.bubble a { color: inherit; text-decoration: underline; text-decoration-color: rgba(255,255,255,.4); }
.bubble-in a { text-decoration-color: rgba(0,0,0,.3); }

/* ── Input link preview card (above textarea) ─────────────────────────────── */
.input-link-preview {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: #1d2b35;
  border-top: 1px solid var(--border);
}
.input-link-preview.visible { display: flex; }
.input-link-preview img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.input-link-preview-text { flex: 1; min-width: 0; }
.input-link-preview-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.input-link-preview-domain { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.input-link-preview-close {
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; font-size: 16px; flex-shrink: 0; padding: 0;
}
.bubble-out { background: var(--accent-blue); color: #fff; border-bottom-right-radius: 2px; }
.bubble-in  { background: var(--bg-panel); color: var(--text-primary); border-bottom-left-radius: 2px; border: 1px solid var(--border); }
.bubble-audio { display: flex; align-items: center; gap: 4px; font-style: italic; }
.bubble-time { font-size: 10px; color: var(--text-muted); margin-top: 2px; font-family: var(--font-mono); }

/* ── Audio message player ─────────────────────────────────────────────────── */
.bubble-audio-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 200px;
  max-width: 280px;
}
.bubble-audio-player {
  width: 100%;
  height: 32px;
  border-radius: 20px;
  outline: none;
  accent-color: var(--accent-blue);
  display: block;
}
.bubble-out .bubble-audio-player { accent-color: #fff; }
.bubble-audio-icon { font-size: 18px; opacity: .7; }
.bubble-audio-transcript {
  font-size: 11px;
  opacity: .75;
  font-style: italic;
  line-height: 1.4;
  white-space: pre-wrap;
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #111b21;
  flex-shrink: 0;
}

.chat-side-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #8696a0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s;
  padding: 0;
}
.chat-side-btn:hover { color: var(--text-primary); }

.chat-textarea {
  flex: 1;
  background: #2a3942;
  border: none;
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 15px;
  padding: 10px 14px;
  resize: none;
  outline: none;
  min-height: 42px;
  max-height: 120px;
  line-height: 1.5;
  overflow-y: auto;
}
.chat-textarea::placeholder { color: #8696a0; }
.chat-textarea:focus { outline: none; }

.chat-action-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: #00a884;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s;
}
.chat-action-btn:hover { background: #017560; }
.chat-action-btn:disabled { opacity: .5; cursor: not-allowed; }
.chat-send-hidden { display: none !important; }

/* ── File preview bar ───────────────────────────────────────────────────── */
.file-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #1f2c34;
  border-top: 1px solid #2a3942;
  gap: 10px;
  flex-shrink: 0;
}
.file-preview-content {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.file-preview-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.file-preview-icon {
  font-size: 32px;
  flex-shrink: 0;
}
.file-preview-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.file-preview-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-preview-size {
  font-size: 11px;
  color: var(--text-muted);
}
.file-preview-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.file-preview-cancel {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #374045;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.file-preview-cancel:hover { background: #4a5568; }
.file-preview-send {
  padding: 7px 18px;
  border-radius: 20px;
  border: none;
  background: #00a884;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.file-preview-send:hover { background: #017560; }
.file-preview-send:disabled { opacity: .6; cursor: not-allowed; }

/* keep old selectors working */
.btn-mic { background: #00a884; }
#btn-chat-send { background: #00a884; }

/* ── Recording Bar (WhatsApp-style) ─────────────────────────────────────── */
.recording-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
  height: 58px;
}
.recording-bar.active { display: flex; }

.rec-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s;
}
.rec-btn:hover { color: var(--text-primary); background: var(--bg-hover); }

.rec-delete       { color: var(--accent-red); }
.rec-delete:hover { background: rgba(240,62,62,.12); color: var(--accent-red); }

.rec-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-red);
  animation: rec-blink 1.2s ease-in-out infinite;
}
.rec-dot.paused { animation: none; opacity: .35; }
@keyframes rec-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .25; }
}

.rec-timer {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 34px;
  letter-spacing: .5px;
}

.rec-waveform {
  flex: 1;
  height: 36px;
  min-width: 0;
  border-radius: 4px;
  display: block;
}

.rec-send-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent-green);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .1s;
}
.rec-send-btn:hover   { background: #2f9e44; transform: scale(1.06); }
.rec-send-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* Agendado Tab */
.calls-group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: 4px 2px 2px;
}
.calls-today-list { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.call-today-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.call-today-time {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-blue);
  font-family: var(--font-mono);
  min-width: 60px;
  width: max-content;
}
.call-today-info { flex: 1; }
.call-today-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.call-today-phone { font-size: 11px; color: var(--text-muted); }
.call-today-actions { display: flex; gap: 6px; align-items: center; }

/* SDR Modals */
.sdr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sdr-modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  width: min(90vw, 420px);
  max-height: 80vh;
  overflow-y: auto;
}
.sdr-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.sdr-modal-header h3 { font-size: 14px; font-weight: 700; }
.sdr-modal-body { padding: 14px 16px; }
.slot-pick-btn {
  width: 100%;
  text-align: left;
  margin-bottom: 6px;
  padding: 10px 12px !important;
  font-size: 13px !important;
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
}
.slot-pick-btn:hover { background: var(--bg-hover) !important; }

/* Placeholder */
.sdr-placeholder { color: var(--text-muted); font-style: italic; font-size: 12px; }

/* ── Transcrições View ──────────────────────────────────────────────────── */
.transcricoes-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.transcricoes-content {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.transcricoes-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius);
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent-blue);
  background: rgba(124, 58, 237, 0.06);
}

/* Full-view drag overlay */
.tx-drag-active {
  outline: 3px dashed var(--accent-blue);
  outline-offset: -8px;
  background: rgba(124, 58, 237, 0.04);
}

.drop-zone-icon { font-size: 36px; line-height: 1; }
.drop-zone-text { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.drop-zone-hint { font-size: 12px; color: var(--text-muted); }

.drop-zone-btn {
  margin-top: 8px;
  font-size: 13px !important;
  padding: 8px 20px !important;
}

/* Divider */
.transcricoes-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 16px 0;
}
.transcricoes-divider::before,
.transcricoes-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* YouTube URL row */
.transcricoes-yt-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.transcricoes-yt-row .settings-input {
  flex: 1;
}

/* Progress bar */
.transcricoes-progress-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  min-height: 18px;
}

.transcricoes-progress-track {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.transcricoes-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  border-radius: 4px;
  transition: width 0.6s ease;
  position: relative;
  overflow: hidden;
}

/* Shimmer animation while processing */
.transcricoes-progress-fill::after {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
  0%   { left: -60%; }
  100% { left: 160%; }
}

.transcricoes-progress-pct {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

/* Result */
.transcricoes-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.transcricoes-result-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.transcricoes-result-text {
  width: 100%;
  min-height: 280px;
  max-height: 450px;
  resize: vertical;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  padding: 14px;
  outline: none;
}

.transcricoes-result-text:focus {
  border-color: var(--accent-blue);
}

/* Cookies panel */
.transcricoes-cookies-card { border-color: var(--border-light); }

.transcricoes-cookies-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.transcricoes-cookies-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.transcricoes-cookies-subtitle { font-size: 12px; color: var(--text-muted); }

.transcricoes-cookies-link { color: var(--accent-blue); text-decoration: none; }
.transcricoes-cookies-link:hover { text-decoration: underline; }

.transcricoes-cookies-status {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text-muted);
}

.transcricoes-cookies-input {
  width: 100%;
  min-height: 100px;
  max-height: 180px;
  resize: vertical;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  padding: 10px 12px;
  outline: none;
}
.transcricoes-cookies-input:focus { border-color: var(--accent-blue); }
.transcricoes-cookies-input::placeholder { color: var(--text-muted); font-size: 10px; }

/* ── Dashboard ──────────────────────────────────────────────────────────── */
.dash-loading { padding: 60px; text-align: center; color: var(--text-muted); font-size: 14px; }
.dash-error   { padding: 40px; text-align: center; color: #ef4444; font-size: 13px; }

/* Hero cards */
.dash-hero {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.dash-hero-card {
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-card-blue   { background: linear-gradient(135deg, #1e3a5f, #1d4ed8); }
.dash-card-cyan   { background: linear-gradient(135deg, #0e4458, #0891b2); }
.dash-card-indigo { background: linear-gradient(135deg, #2e1065, #7c3aed); }
.dash-card-green  { background: linear-gradient(135deg, #052e16, #16a34a); }
.dash-hero-num    { font-size: 36px; font-weight: 800; color: #fff; line-height: 1; }
.dash-hero-label  { font-size: 13px; color: rgba(255,255,255,0.75); font-weight: 500; }
.dash-hero-sub    { font-size: 12px; color: rgba(255,255,255,0.55); margin-top: 2px; }

/* Section */
.dash-section       { margin-bottom: 32px; }
.dash-section-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 14px; }

/* Taxas de conversão em destaque */
.dash-rates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}
.dash-rate-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.dash-rate-green { background: linear-gradient(135deg, #052e16 0%, #0d3321 100%); border-color: #15803d44; }
.dash-rate-blue  { background: linear-gradient(135deg, #0c1a3a 0%, #0f2557 100%); border-color: #1d4ed844; }
.dash-rate-num   { font-size: 40px; font-weight: 800; line-height: 1; color: #fff; }
.dash-rate-green .dash-rate-num { color: #4ade80; }
.dash-rate-blue  .dash-rate-num { color: #60a5fa; }
.dash-rate-label { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.8); margin-top: 4px; }
.dash-rate-sub   { font-size: 12px; color: rgba(255,255,255,0.45); }

/* Funnel table */
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}
.dash-table th {
  padding: 10px 14px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.dash-th-left  { text-align: left;  width: 110px; }
.dash-th-right { text-align: right; }
.dash-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-primary);
}
.dash-table tr:hover td { background: rgba(255,255,255,0.02); }
.dash-row-total td { font-weight: 700; border-top: 1px solid var(--border); background: rgba(255,255,255,0.03); }
.dash-period     { color: var(--text-secondary); font-weight: 500; }
.dash-num        { text-align: right; font-variant-numeric: tabular-nums; }
.dash-pct        { text-align: right; font-variant-numeric: tabular-nums; }
.dash-pct-total  { text-align: right; font-variant-numeric: tabular-nums; color: #60a5fa; }
.dash-responsive { color: #06b6d4; }
.dash-converted  { color: #22c55e; }
.dash-highlight  { color: #22c55e; font-weight: 600; }
.dash-footnote   { font-size: 11px; color: var(--text-muted); margin-top: 8px; }

/* Status distribution */
.dash-status-grid { display: flex; flex-direction: column; gap: 10px; }
.dash-status-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.dash-status-bar  { height: 6px; border-radius: 3px; min-width: 4px; flex-shrink: 0; transition: width .4s; }
.dash-status-info { display: flex; align-items: center; gap: 12px; flex: 1; }
.dash-status-label { flex: 1; font-size: 13px; color: var(--text-secondary); }
.dash-status-count { font-size: 18px; font-weight: 700; min-width: 36px; text-align: right; }
.dash-status-pct   { font-size: 12px; color: var(--text-muted); min-width: 36px; text-align: right; }

@media (max-width: 900px) {
  .dash-hero { grid-template-columns: repeat(2, 1fr); }
}

/* ── Auth / User styles ─────────────────────────────────────────────────── */
.btn-sm {
  padding: .3rem .75rem;
  font-size: .78rem;
  border-radius: 6px;
  border: 1px solid #3a3a3a;
  background: #222;
  color: #ccc;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-sm:hover { background: #2d2d2d; color: #fff; }

.btn-danger-soft {
  border-color: #5c2020;
  color: #f87171;
}
.btn-danger-soft:hover { background: #2a1010; color: #f87171; }

/* ── Users Admin Modal ──────────────────────────────────────────────────── */
.users-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.users-modal-overlay.open { display: flex; }

.users-modal {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  width: 560px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
}
.users-modal h2 { font-size: 1.1rem; margin-bottom: 1.25rem; color: #fff; }

.users-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.users-table th, .users-table td {
  padding: .6rem .75rem;
  text-align: left;
  border-bottom: 1px solid #2a2a2a;
}
.users-table th { color: #888; font-weight: 500; }
.users-table tr:last-child td { border-bottom: none; }

.badge-admin  { background: #1e3a5f; color: #60a5fa; padding: .15rem .5rem; border-radius: 4px; font-size: .75rem; }
.badge-user   { background: #1a2a1a; color: #86efac; padding: .15rem .5rem; border-radius: 4px; font-size: .75rem; }
.badge-inactive { opacity: .45; }

.user-add-form {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #2a2a2a;
}
.user-add-form h3 { font-size: .9rem; color: #ccc; margin-bottom: .9rem; }
.user-add-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.user-add-grid input, .user-add-grid select {
  padding: .55rem .75rem;
  background: #111;
  border: 1px solid #333;
  border-radius: 6px;
  color: #e5e5e5;
  font-size: .85rem;
  outline: none;
}
.user-add-grid input:focus, .user-add-grid select:focus { border-color: #4f8ef7; }
.user-add-grid .full { grid-column: 1 / -1; }

.btn-add-user {
  margin-top: .75rem;
  padding: .55rem 1.2rem;
  background: #4f8ef7;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-add-user:hover { background: #3a7ae0; }

/* ── Pausar / Reativar IA button ─────────────────────────────────────────── */
.btn-ai-pause {
  background: transparent;
  border: 1px solid #f59e0b;
  color: #f59e0b;
}
.btn-ai-pause:hover { background: rgba(245,158,11,0.12); }

.btn-ai-active {
  background: rgba(245,158,11,0.18);
  border: 1px solid #f59e0b;
  color: #f59e0b;
  font-weight: 600;
}
.btn-ai-active:hover { background: rgba(245,158,11,0.28); }
