/* ============================================================
   Automations UI — Settings > Automação (Sprint 9)
   ============================================================ */

/* ── Layout da página ─────────────────────────────────────── */
.am-page { max-width: 1200px; }

.am-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.am-header-left { flex: 1; min-width: 0; }

.am-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 4px;
}

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

/* ── Loading ──────────────────────────────────────────────── */
.am-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 48px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.am-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: am-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes am-spin { to { transform: rotate(360deg); } }

/* ── Empty state ──────────────────────────────────────────── */
.am-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 64px 24px;
  text-align: center;
  background: var(--card);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-xl);
}

.am-empty-icon {
  width: 64px;
  height: 64px;
  background: #FFF7ED;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
}

.am-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.am-empty-sub {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 420px;
  line-height: 1.5;
}

/* ── Lista de regras ──────────────────────────────────────── */
.am-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Card de regra ────────────────────────────────────────── */
.am-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.am-card:hover {
  border-color: #D1D5DB;
  box-shadow: var(--shadow-sm);
}

.am-card-active { border-left: 3px solid var(--accent-gold); }

.am-card-left { flex-shrink: 0; padding-top: 2px; }
.am-card-body { flex: 1; min-width: 0; }

.am-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.am-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.am-event-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.am-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 2px 0 8px;
  line-height: 1.4;
}

.am-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.am-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.am-meta-muted { color: var(--text-muted); }
.am-meta-sep   { color: var(--text-muted); }

.am-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding-top: 1px;
}

/* ── Toggle switch ────────────────────────────────────────── */
.am-toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  cursor: pointer;
  flex-shrink: 0;
}

.am-toggle-sm { width: 32px; height: 18px; }

.am-toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.am-toggle-track {
  position: absolute;
  inset: 0;
  background: #D1D5DB;
  border-radius: var(--radius-full);
  transition: background var(--transition);
}

.am-toggle-track::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.am-toggle-sm .am-toggle-track::before {
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
}

.am-toggle-input:checked + .am-toggle-track { background: var(--accent-gold); }
.am-toggle-input:checked + .am-toggle-track::before { transform: translateX(16px); }
.am-toggle-sm .am-toggle-input:checked + .am-toggle-track::before { transform: translateX(14px); }

/* ── Icon buttons ─────────────────────────────────────────── */
.am-icon-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.am-icon-btn:hover { background: #F3F4F6; color: var(--text-primary); border-color: #D1D5DB; }
.am-icon-btn-danger:hover { background: #FEF2F2; color: var(--danger); border-color: #FECACA; }

/* ── Delete confirm inline ────────────────────────────────── */
.am-delete-confirm {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.am-btn-danger-sm {
  padding: 3px 10px;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.am-btn-danger-sm:hover { background: #DC2626; }

.am-btn-ghost-sm {
  padding: 3px 10px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: background var(--transition);
}
.am-btn-ghost-sm:hover { background: #F3F4F6; }

/* ── Botões primários / ghost ─────────────────────────────── */
.am-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--accent-gold);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.am-btn-primary:hover { background: var(--accent-gold-dark); }
.am-btn-primary:disabled, .am-btn-loading { opacity: 0.7; cursor: not-allowed; }

.am-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.am-btn-ghost:hover { background: #F3F4F6; border-color: #D1D5DB; }

/* ── Modal overlay ────────────────────────────────────────── */
.am-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,14,20,0.55);
  z-index: 1200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px 24px;
  overflow-y: auto;
  backdrop-filter: blur(3px);
  animation: am-overlay-in 0.15s ease;
}

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

.am-modal {
  background: var(--card);
  border-radius: var(--radius-xl);
  width: 720px;
  max-width: 100%;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: am-modal-in 0.18s cubic-bezier(0.34,1.3,0.64,1);
}

@keyframes am-modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.am-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.am-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.am-modal-close {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.am-modal-close:hover { background: #F3F4F6; color: var(--text-primary); }

.am-modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  max-height: 70vh;
}

.am-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: #FAFAFA;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  flex-shrink: 0;
}

/* ── Form fields ──────────────────────────────────────────── */
.am-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.am-field-grow { flex: 1; }
.am-field-80   { flex: 0 0 80px; }

.am-field-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.am-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.am-required { color: var(--danger); }

.am-input,
.am-select {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  background: #fff;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
  box-sizing: border-box;
}

.am-input:focus,
.am-select:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(201,169,110,0.15);
}

.am-input-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.12) !important;
}

.am-field-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.am-label-inline {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

/* ── Seções de condição/ação ──────────────────────────────── */
.am-section {
  background: #FAFAFA;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.am-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.am-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.am-section-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Linhas do builder ────────────────────────────────────── */
.am-builder-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.am-builder-row-action {
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.am-row-num {
  width: 20px;
  height: 20px;
  background: var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.am-row-field    { flex: 0 0 180px; min-width: 140px; }
.am-row-op       { flex: 0 0 140px; min-width: 100px; }
.am-row-type     { flex: 0 0 160px; min-width: 130px; }
.am-row-val      { flex: 1; min-width: 100px; }
.am-row-val-wide { flex: 2; min-width: 160px; }
.am-row-val-sm   { flex: 0 0 120px; min-width: 90px; }
.am-row-val-xs   { flex: 0 0 70px; min-width: 60px; }

.am-row-remove {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.am-row-remove:hover { background: #FEE2E2; color: var(--danger); }

.am-row-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 0;
  font-style: italic;
}

.am-row-empty-warn {
  color: #D97706;
  font-style: normal;
  font-weight: 600;
}

.am-add-row-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: transparent;
  color: var(--accent-gold);
  border: 1.5px dashed var(--accent-gold);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  align-self: flex-start;
}
.am-add-row-btn:hover { background: rgba(201,169,110,0.08); }

/* ── Spinner pequeno ──────────────────────────────────────── */
.am-spin-sm {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: am-spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ── Toast ────────────────────────────────────────────────── */
.am-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  pointer-events: none;
}

.am-toast-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.am-toast-success { background: #065F46; color: #fff; }
.am-toast-error   { background: #7F1D1D; color: #fff; }

/* ── Tabs ────────────────────────────────────────────────── */
.am-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.am-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}

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

.am-tab-active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-gold);
}

.am-tab-content { min-height: 200px; }

/* ── WhatsApp & Lara Section ────────────────────────────── */
.am-wa-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 1100px) {
  .am-wa-sections { grid-template-columns: 1fr; }
}

.am-wa-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
}

.am-wa-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.am-wa-section-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.am-wa-section-info { flex: 1; min-width: 0; }

.am-wa-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 2px;
}

.am-wa-section-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

.am-wa-count-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.am-wa-rules { padding: 4px 0; }

.am-wa-rule {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 20px;
  transition: background 0.1s;
}

.am-wa-rule:hover { background: var(--bg-hover, #f9fafb); }

.am-wa-rule-status {
  flex-shrink: 0;
  padding-top: 2px;
}

.am-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

.am-status-active {
  background: #05966918;
  color: #059669;
}

.am-status-pending {
  background: #D9770618;
  color: #D97706;
}

.am-wa-rule-type {
  flex-shrink: 0;
  color: var(--text-secondary);
  padding-top: 2px;
}

.am-wa-rule-info { flex: 1; min-width: 0; }

.am-wa-rule-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1px;
}

.am-wa-rule-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.am-wa-rule-pending .am-wa-rule-name {
  color: var(--text-secondary);
}

.am-wa-rule-pending .am-wa-rule-desc {
  color: var(--text-muted, #9ca3af);
}

.am-wa-legend {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.am-wa-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Flows Tab ───────────────────────────────────────────── */
.am-flows-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 1100px) {
  .am-flows-grid { grid-template-columns: 1fr; }
}

.am-flow-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.am-flow-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.am-flow-title {
  font-size: 13px;
  font-weight: 700;
}

.am-flow-steps {
  padding: 12px 16px;
}

.am-flow-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.am-flow-step-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.am-flow-step-info {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.am-flow-step-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.am-flow-step-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.am-flow-arrow {
  text-align: center;
  font-size: 14px;
  line-height: 1;
  padding: 2px 0;
  opacity: 0.5;
}

/* ── Broadcast Tab v2 — Stats + Center + Slide Panel ─────── */

/* Main layout */
.bc-v2 { display: flex; gap: 0; }

/* Stats sidebar */
.bc-stats { width: 220px; border-right: 1px solid var(--border); padding: 20px 16px; overflow-y: auto; flex-shrink: 0; background: var(--card); position: relative; z-index: 2; }
.bc-stats-title { font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 12px; }
.bc-stat-card { margin-bottom: 16px; }
.bc-stat-big { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.bc-stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.bc-stat-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 12px; }
.bc-stat-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.bc-stat-label { color: var(--text-secondary); }
.bc-stat-num { font-weight: 700; color: var(--text-primary); }
.bc-stat-divider { height: 1px; background: var(--border); margin: 14px 0; }

/* New dispatch button in stats */
.bc-new-dispatch { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; background: var(--accent-gold); color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; margin-bottom: 16px; transition: opacity 0.15s; }
.bc-new-dispatch:hover { opacity: 0.85; }
.bc-new-dispatch-sm { display: flex; align-items: center; gap: 4px; padding: 5px 12px; background: var(--accent-gold); color: #fff; border: none; border-radius: 6px; font-size: 12px; font-weight: 700; cursor: pointer; transition: opacity 0.15s; white-space: nowrap; }
.bc-new-dispatch-sm:hover { opacity: 0.85; }

/* Center area — offset to avoid slide panel overlap */
.bc-center { flex: 1; display: flex; align-items: flex-start; justify-content: flex-start; overflow-y: auto; padding: 24px; padding-right: 180px; background: var(--card); }
.bc-center-detail { width: 100%; max-width: 600px; padding-top: 8px; }

/* Empty state in center */
.bc-center-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--text-muted); }
.bc-center-empty h3 { font-size: 16px; color: var(--text-secondary); margin: 0; }
.bc-center-empty p { font-size: 13px; margin: 0 0 12px; }

/* Phone preview in center (when creating) */
.bc-center .bc-phone { width: 240px; max-height: 320px; overflow: hidden; }

/* Slide panel (right) — below system header */
.bc-slide-panel { position: fixed; top: 56px; right: 0; width: 400px; max-width: 100vw; height: calc(100vh - 56px); background: var(--card); z-index: 1101; display: flex; flex-direction: column; box-shadow: -8px 0 40px rgba(0,0,0,0.16); transform: translateX(100%); transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1); }
.bc-slide-panel.open { transform: translateX(0); }
.bc-slide-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 1100; opacity: 0; pointer-events: none; transition: opacity 200ms; }
.bc-slide-overlay.open { opacity: 1; pointer-events: auto; }

.bc-slide-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.bc-slide-title { font-size: 15px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.bc-slide-close { width: 30px; height: 30px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.bc-slide-close:hover { background: #F3F4F6; color: var(--text-primary); }

/* Tabs inside panel */
.bc-slide-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.bc-slide-tab { flex: 1; padding: 10px; text-align: center; font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; background: none; border-top: none; border-left: none; border-right: none; }
.bc-slide-tab:hover { color: var(--text-secondary); }
.bc-slide-tab.active { color: var(--accent-gold); border-bottom-color: var(--accent-gold); }
/* History action buttons (clone + delete) */
.bc-hist-actions { display: flex; gap: 2px; flex-shrink: 0; }
.bc-hist-clone-btn { width: 26px; height: 26px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; border-radius: 5px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.15s, background 0.1s; }
.bc-hist-item:hover .bc-hist-clone-btn { opacity: 1; }
.bc-hist-clone-btn:hover { background: rgba(201,169,110,0.12); color: var(--accent-gold); }

/* Confirm send panel */
.bc-confirm-send { background: #FFFBEB; border: 1.5px solid #F59E0B; border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.bc-confirm-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #92400E; margin-bottom: 10px; }
.bc-confirm-checks { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.bc-confirm-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #78350F; }
.bc-confirm-item svg { flex-shrink: 0; color: #D97706; }
.bc-confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }

.bc-tab-badge-top { position: absolute; top: -6px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; background: var(--accent-gold); color: #fff; border-radius: 8px; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.bc-slide-body { flex: 1; overflow-y: auto; padding: 20px 20px; }
.bc-slide-body .am-field { margin-bottom: 6px; }
.bc-slide-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); flex-shrink: 0; }

/* Historico list in panel */
.bc-hist-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 6px; margin: 0 -8px; transition: background 0.1s; }
.bc-hist-item:last-child { border-bottom: none; }
.bc-hist-item:hover { background: rgba(0,0,0,0.02); }
.bc-hist-active { background: rgba(201,169,110,0.06); }
.bc-hist-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.bc-hist-info { flex: 1; min-width: 0; }
.bc-hist-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bc-hist-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.bc-hist-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.bc-hist-del-btn { width: 26px; height: 26px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; border-radius: 5px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; opacity: 0; transition: opacity 0.15s, background 0.1s; margin-top: 1px; }
.bc-hist-item:hover .bc-hist-del-btn { opacity: 1; }
.bc-hist-del-btn:hover { background: #FEF2F2; color: var(--danger); }
.bc-hist-delete-confirm { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 11px; color: var(--danger); font-weight: 600; }
.bc-hist-del-yes { padding: 2px 10px; background: var(--danger); color: #fff; border: none; border-radius: 4px; font-size: 11px; font-weight: 600; cursor: pointer; }
.bc-hist-del-no { padding: 2px 10px; background: transparent; color: var(--text-muted); border: 1px solid var(--border); border-radius: 4px; font-size: 11px; cursor: pointer; }

/* Detail panel (rendered in center) */
.bc-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.bc-panel-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bc-panel-body { padding: 0; }
.bc-panel-empty { text-align: center; padding: 40px; color: var(--text-muted); font-size: 13px; }
.bc-panel-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

/* ── Detail sections ──────────────────────────────────────── */
.bc-detail-section {
  margin-bottom: 16px;
}
.bc-detail-msg {
  background: rgba(0,0,0,0.02);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
}
.bc-detail-media img {
  max-width: 200px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.bc-detail-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #2563EB;
  font-size: 13px;
  text-decoration: none;
  word-break: break-all;
  transition: background 0.12s;
}
.bc-detail-link a:hover { background: rgba(37,99,235,0.06); }

.bc-detail-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.bc-stat {
  flex: 1;
  background: rgba(0,0,0,0.02);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
.bc-stat-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}
.bc-stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.bc-detail-dates {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.bc-detail-dates span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ── Shared elements ──────────────────────────────────────── */
.bc-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.bc-card-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bc-filter-tag {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(212,175,55,0.1);
  color: var(--accent-gold-dark);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}

.bc-progress {
  position: relative;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-bottom: 12px;
  overflow: hidden;
}
.bc-progress-bar {
  height: 100%;
  background: var(--accent-gold);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.bc-progress-text {
  position: absolute;
  right: 0;
  top: -16px;
  font-size: 11px;
  color: var(--text-muted);
}

.am-btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.am-btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.bc-filters-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 10px;
}
.bc-filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.am-label-sm {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.am-hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Lead selection section ───────────────────────────────── */
.bc-leads-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 10px;
}
.bc-leads-search-wrap {
  position: relative;
  margin-top: 8px;
}
.bc-leads-search {
  padding-right: 32px;
}
.bc-leads-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.bc-lead-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.1s;
}
.bc-lead-option:hover { background: #F9FAFB; }
.bc-lead-empty {
  color: var(--text-muted);
  font-style: italic;
  cursor: default;
  justify-content: center;
}
.bc-lead-empty:hover { background: transparent; }
.bc-lead-opt-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.bc-lead-opt-phone {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Consolas', monospace;
}
.bc-leads-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.bc-lead-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 10px;
  background: rgba(7,94,84,0.08);
  color: #075E54;
  border: 1px solid rgba(7,94,84,0.2);
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
}
.bc-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  background: rgba(7,94,84,0.15);
  color: #075E54;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s;
}
.bc-chip-remove:hover { background: rgba(7,94,84,0.3); }

/* ── Throttle section ─────────────────────────────────────── */
.bc-throttle-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 10px;
}
.bc-throttle-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 8px;
}
.bc-schedule-section { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 10px; }
.bc-schedule-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.bc-schedule-input { max-width: 200px; font-size: 12px; padding: 7px 10px; }
.bc-schedule-input:disabled { opacity: 0.4; cursor: not-allowed; }

.bc-throttle-separator {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  padding-bottom: 11px;
  white-space: nowrap;
}

/* ── Secondary button ─────────────────────────────────────── */
.am-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.am-btn-secondary:hover { background: #F3F4F6; border-color: #D1D5DB; }

/* ── Tag insert bar ─────────��────────────────────────────── */
.bc-tags-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.bc-tag-hint {
  font-size: 11px;
  color: var(--text-muted);
}
.bc-tag-btn {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: rgba(7,94,84,0.08);
  color: #075E54;
  border: 1px solid rgba(7,94,84,0.2);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'SF Mono', 'Consolas', monospace;
  cursor: pointer;
  transition: background 0.12s;
}
.bc-tag-btn:hover { background: rgba(7,94,84,0.16); }
.bc-fmt-sep { width: 1px; height: 16px; background: var(--border); margin: 0 2px; }
.bc-fmt-btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 24px; background: rgba(0,0,0,0.03); border: 1px solid var(--border); border-radius: 4px; font-size: 12px; color: var(--text-secondary); cursor: pointer; transition: all 0.12s; padding: 0; }
.bc-fmt-btn:hover { background: rgba(0,0,0,0.06); color: var(--text-primary); border-color: #D1D5DB; }
.bc-fmt-mono { font-family: 'SF Mono','Consolas',monospace; font-size: 10px; letter-spacing: -0.5px; }
.bc-emoji-wrap { position: relative; }
.bc-emoji-toggle { font-size: 14px !important; line-height: 1; }
.bc-emoji-picker { display: none; position: absolute; bottom: 32px; right: 0; width: 240px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 8px; z-index: 60; }
.bc-emoji-picker.open { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; }
.bc-emoji-btn { width: 34px; height: 34px; border: none; background: transparent; border-radius: 6px; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.1s; }
.bc-emoji-btn:hover { background: rgba(0,0,0,0.05); }

/* ── Phone Mockup WhatsApp Preview ────────────────────────── */
.bc-phone {
  width: 260px;
  min-height: 460px;
  background: #fff;
  border-radius: 32px;
  box-shadow: 0 0 0 2px #1a1a1a, 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
}

/* Notch */
.bc-phone-notch {
  height: 28px;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.bc-phone-notch::after {
  content: '';
  width: 60px;
  height: 6px;
  background: #333;
  border-radius: 3px;
}
.bc-phone-notch-time {
  position: absolute;
  left: 16px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
}

/* WhatsApp header */
.bc-wa-header {
  background: #075E54;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.bc-wa-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25D366, #128C7E);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bc-wa-avatar svg { color: #fff; }
.bc-wa-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}
.bc-wa-status {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  font-weight: 400;
}

/* Chat area */
.bc-wa-chat {
  flex: 1;
  background: #ECE5DD url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" opacity="0.04"><path d="M20 20h20v20H20zM60 20h20v20H60zM100 20h20v20h-20zM40 40h20v20H40zM80 40h20v20H80z" fill="%23000"/></svg>');
  padding: 12px 10px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
}

/* Message bubble */
.bc-wa-bubble {
  max-width: 88%;
  background: #DCF8C6;
  padding: 7px 10px 4px;
  border-radius: 8px 8px 0 8px;
  font-size: 12.5px;
  line-height: 1.55;
  color: #111;
  word-break: break-word;
  white-space: pre-wrap;
  align-self: flex-end;
  position: relative;
  box-shadow: 0 1px 1px rgba(0,0,0,0.06);
}
.bc-wa-bubble code { background: rgba(0,0,0,0.06); padding: 1px 4px; border-radius: 3px; font-family: 'SF Mono','Consolas',monospace; font-size: 11px; }
.bc-wa-bubble::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: -6px;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-left-color: #DCF8C6;
  border-bottom-color: #DCF8C6;
}
.bc-wa-bubble-time {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  margin-top: 3px;
  font-size: 10px;
  color: rgba(0,0,0,0.4);
}
.bc-wa-bubble-time svg { color: #53BDEB; }

/* Image in bubble */
.bc-wa-img-bubble { padding: 3px 3px 4px; }
.bc-wa-preview-img { width: 100%; border-radius: 6px; display: block; max-height: 140px; object-fit: cover; }
.bc-wa-img-bubble .bc-wa-bubble-time { padding: 0 4px; }

/* Tag highlight inside bubble */
.bc-wa-tag {
  display: inline;
  background: rgba(7,94,84,0.12);
  color: #075E54;
  font-weight: 600;
  border-radius: 3px;
  padding: 0 2px;
}

/* Empty preview */
.bc-wa-empty {
  text-align: center;
  color: rgba(0,0,0,0.3);
  font-size: 12px;
  font-style: italic;
  padding: 40px 16px;
}

/* Bottom input mockup */
.bc-wa-bottom {
  background: #F0F0F0;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bc-wa-input-mock {
  flex: 1;
  background: #fff;
  border-radius: 18px;
  padding: 7px 12px;
  font-size: 11px;
  color: #999;
}
.bc-wa-send-mock {
  width: 30px;
  height: 30px;
  background: #075E54;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bc-wa-send-mock svg { color: #fff; }

/* Phone home bar */
.bc-phone-home {
  height: 18px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bc-phone-home::after {
  content: '';
  width: 100px;
  height: 4px;
  background: #1a1a1a;
  border-radius: 2px;
}

/* ── Media upload in editor ───────────────────────────────── */
.bc-media-options { display: flex; align-items: center; gap: 8px; }
.bc-media-upload-btn { display: flex; align-items: center; gap: 5px; padding: 8px 14px; background: rgba(0,0,0,0.03); border: 1.5px dashed var(--border); border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: all 0.12s; white-space: nowrap; }
.bc-media-upload-btn:hover { background: rgba(0,0,0,0.05); border-color: var(--accent-gold); color: var(--accent-gold); }
.bc-media-preview { position: relative; display: inline-block; margin-top: 8px; }
.bc-media-preview img { max-width: 120px; max-height: 80px; border-radius: 8px; border: 1px solid var(--border); }
.bc-media-remove { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; background: var(--danger); color: #fff; border: 2px solid #fff; border-radius: 50%; font-size: 11px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.bc-media-pos { display: flex; gap: 16px; margin-top: 8px; }
.bc-pos-label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-secondary); cursor: pointer; }
.bc-pos-label input[type="radio"] { accent-color: var(--accent-gold); }

/* ── Broadcast analytics in detail view ──────────────────── */
/* Detail topbar */
.bc-detail-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.bc-detail-topbar-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bc-detail-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 0; }
.bc-detail-topbar-right { display: flex; gap: 6px; flex-shrink: 0; }
.bc-detail-topbar-right .am-btn-primary { padding: 6px 14px; font-size: 12px; }
.bc-detail-topbar-right .am-btn-danger { padding: 5px 12px; font-size: 11px; }

/* Info strip: dates left + metric bars right */
.bc-info-strip { display: flex; align-items: stretch; justify-content: space-between; gap: 20px; padding: 14px 16px; background: rgba(0,0,0,0.015); border-radius: 10px; margin-bottom: 16px; }
.bc-info-dates { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--text-muted); flex-shrink: 0; align-items: flex-start; justify-content: center; }
.bc-info-dates span { display: inline-flex; align-items: center; gap: 4px; }
.bc-info-bars { flex: 1; max-width: 240px; display: flex; flex-direction: column; gap: 6px; justify-content: center; }

/* Split layout: segments left, leads right */
.bc-detail-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bc-detail-left { display: flex; flex-direction: column; gap: 14px; }
.bc-detail-right { display: flex; flex-direction: column; }

/* Compact stats row */
.bc-detail-stats-compact { display: flex; gap: 12px; }
.bc-stat-mini { display: flex; flex-direction: column; align-items: center; background: rgba(0,0,0,0.02); border-radius: 8px; padding: 10px 14px; flex: 1; }
.bc-stat-mini-val { font-size: 20px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.bc-stat-mini-lbl { font-size: 10px; color: var(--text-muted); margin-top: 3px; }

/* Horizontal metric bars */
.bc-metrics-col { display: flex; flex-direction: column; gap: 8px; }
.bc-metric-row { display: flex; align-items: center; gap: 8px; }
.bc-metric-bar-h { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.bc-metric-bar-h div { height: 100%; border-radius: 3px; transition: width 0.4s; }
.bc-metric-pct { font-size: 12px; font-weight: 700; color: var(--text-primary); min-width: 32px; text-align: right; }
.bc-metric-lbl { font-size: 11px; color: var(--text-muted); min-width: 50px; }

/* Lead segmentation cards */
.bc-leads-seg { display: flex; flex-direction: column; gap: 6px; }
.bc-seg-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: rgba(0,0,0,0.015); border-radius: 8px; cursor: default; transition: background 0.1s; }
.bc-seg-item:hover { background: rgba(0,0,0,0.04); }
.bc-seg-active { background: rgba(201,169,110,0.08) !important; border-left: 3px solid var(--accent-gold); }
.bc-seg-icon { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bc-seg-num { font-size: 16px; font-weight: 800; color: var(--text-primary); min-width: 28px; }
.bc-seg-lbl { font-size: 12px; color: var(--text-secondary); }

/* Segment leads list (right side) */
.bc-seg-leads-list { max-height: 300px; overflow-y: auto; }
.bc-seg-lead { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-primary); }
.bc-seg-lead:last-child { border-bottom: none; }
.bc-seg-lead svg { color: var(--text-muted); flex-shrink: 0; }
.bc-seg-lead span { flex: 1; font-weight: 500; }
.bc-seg-lead small { font-size: 11px; color: var(--text-muted); font-family: 'SF Mono','Consolas',monospace; }
.bc-seg-leads-empty { padding: 24px; text-align: center; font-size: 12px; color: var(--text-muted); font-style: italic; }

/* ── Rules documentation tab ─────────────────────────────── */
.bc-rules-section { margin-bottom: 16px; }
.bc-rules-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
.bc-rules-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bc-rules-title { font-size: 13px; }
.bc-rules-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.bc-rules-list li { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: var(--text-secondary); line-height: 1.5; padding-left: 4px; }
.bc-rules-list li svg { flex-shrink: 0; color: #10B981; margin-top: 2px; }

/* ── Broadcast Dashboard ───────────────────────────────────── */
.bc-dashboard { padding: 0; overflow-y: auto; height: 100%; width: 100%; }
.bc-dash-top-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.bc-dash-filters { display: flex; gap: 4px; }
.bc-dash-filter { padding: 6px 14px; border: 1px solid var(--border); background: transparent; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all 0.12s; }
.bc-dash-filter:hover { border-color: #D1D5DB; color: var(--text-secondary); }
.bc-dash-filter.active { background: var(--accent-gold); color: #fff; border-color: var(--accent-gold); }
.bc-dash-new-btn { font-size: 12px; padding: 6px 14px; }
.bc-dash-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 20px; }
.bc-dash-kpi { background: rgba(0,0,0,0.02); border: 1px solid var(--border); border-radius: 10px; padding: 16px; text-align: center; }
.bc-dash-kpi-val { display: block; font-size: 26px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.bc-dash-kpi-lbl { display: block; font-size: 11px; color: var(--text-muted); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.03em; }
.bc-dash-chart { background: rgba(0,0,0,0.02); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 20px; }
.bc-dash-chart svg { width: 100%; height: auto; }
.bc-chart-dot { cursor: pointer; }
.bc-chart-guide { opacity: 0; transition: opacity 0.2s; }
.bc-chart-tooltip { opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.bc-chart-circle { transition: r 0.2s, stroke-width 0.2s; }
.bc-chart-val { transition: font-size 0.2s, opacity 0.15s; }
.bc-chart-dot:hover .bc-chart-guide { opacity: 0.3; }
.bc-chart-dot:hover .bc-chart-tooltip { opacity: 1; }
.bc-chart-dot:hover .bc-chart-circle { r: 7; stroke-width: 3; }
.bc-chart-dot:hover .bc-chart-val { opacity: 0; }
.bc-dash-metric-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.bc-dash-metric-tab { padding: 5px 12px; border: 1.5px solid var(--border); background: transparent; border-radius: 6px; font-size: 11px; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all 0.12s; }
.bc-dash-metric-tab:hover { border-color: #D1D5DB; color: var(--text-secondary); }
.bc-dash-metric-tab.active { background: #fff; font-weight: 700; }
.bc-dash-bottom-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.bc-dash-compare { background: rgba(0,0,0,0.02); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.bc-dash-compare-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bc-dash-section-title { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.bc-dash-sort { padding: 4px 10px; border: 1px solid var(--border); border-radius: 5px; font-size: 11px; background: #fff; color: var(--text-secondary); cursor: pointer; }
.bc-dash-bar-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.bc-dash-bar-name { font-size: 12px; font-weight: 600; color: var(--text-primary); min-width: 100px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-dash-bar-track { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.bc-dash-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.bc-dash-bar-val { font-size: 11px; color: var(--text-muted); min-width: 80px; text-align: right; white-space: nowrap; }
.bc-dash-table-wrap { background: rgba(0,0,0,0.02); border: 1px solid var(--border); border-radius: 10px; padding: 4px 0; overflow-x: auto; flex: 1; }
.bc-dash-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.bc-dash-table th { text-align: left; padding: 8px 12px; font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); }
.bc-dash-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.bc-dash-table tr:last-child td { border-bottom: none; }
.bc-dash-table tr:hover td { background: rgba(0,0,0,0.01); }

@media (max-width: 768px) {
  .bc-v2 { flex-direction: column; height: auto; }
  .bc-stats { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: 200px; }
  .bc-center { min-height: 300px; }
  .bc-slide-panel { width: 100vw; }
  .bc-filters-grid { grid-template-columns: 1fr; }
  .bc-detail-stats { flex-direction: column; }
  .bc-analytics-grid { grid-template-columns: 1fr; }
  .bc-dash-kpis { grid-template-columns: repeat(2, 1fr); }
  .bc-dash-filters { flex-wrap: wrap; }
}
