/* === Admin Dashboard Styles === */
:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface2: #f3f1ee;
  --accent: #e07b39;
  --accent-dim: rgba(224, 123, 57, 0.12);
  --fg: #1a1a2e;
  --fg-muted: #6b6b80;
  --fg-subtle: #a0a0b0;
  --border: #e8e4de;
  --radius: 14px;
  --font: 'Outfit', sans-serif;
  --teal: #2dd4a8;
  --teal-dim: rgba(45, 212, 168, 0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { background: var(--surface2); font-family: var(--font); color: var(--fg); line-height: 1.6; -webkit-font-smoothing: antialiased; }

.admin-layout { display: flex; min-height: calc(100vh - 56px); }

/* === SIDEBAR === */
.admin-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--fg); padding: 24px 16px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: sticky; top: 56px; height: calc(100vh - 56px);
}
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-link {
  padding: 10px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.55);
  text-decoration: none; transition: all 0.2s; display: flex; align-items: center; gap: 8px;
}
.sidebar-link:hover, .sidebar-link.active { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-link.active { background: rgba(45,212,168,0.15); color: var(--teal); }
.sidebar-back { font-size: 12px; color: rgba(255,255,255,0.3); text-decoration: none; }
.sidebar-back:hover { color: rgba(255,255,255,0.6); }

/* === MAIN === */
.admin-main { flex: 1; padding: 32px; overflow-x: hidden; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-header { margin-bottom: 28px; }
.panel-header h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.panel-subtitle { font-size: 14px; color: var(--fg-muted); }
.section-title-sm { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: var(--fg); }
.panel-section { margin-top: 32px; }

/* === FEATURE STATUS === */
.feature-status-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 32px;
}
.feature-status-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; display: flex; align-items: center; gap: 14px;
  transition: all 0.2s;
}
.feature-status-card.live { border-color: rgba(45,212,168,0.3); background: linear-gradient(135deg, rgba(45,212,168,0.04) 0%, var(--surface) 100%); }
.fs-icon { font-size: 28px; flex-shrink: 0; }
.fs-body { flex: 1; }
.fs-name { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.fs-detail { font-size: 12px; color: var(--fg-muted); }
.fs-badge {
  font-size: 10px; font-weight: 700; padding: 3px 10px;
  border-radius: 100px; flex-shrink: 0;
  background: rgba(45,212,168,0.15); color: #16a34a;
}

/* === STATS GRID === */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 32px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; text-align: center;
}
.stat-num { font-size: 32px; font-weight: 800; color: var(--fg); margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--fg-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }

/* === DATA TABLES === */
.data-table { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.data-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead { background: var(--surface2); }
.data-table th { padding: 12px 16px; text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--fg-muted); }
.data-table td { padding: 12px 16px; border-top: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: rgba(224,123,57,0.03); }
.data-table .badge {
  display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 600;
}
.data-table .badge-new { background: rgba(59,130,246,0.12); color: #2563eb; }
.data-table .badge-contacted { background: rgba(168,85,247,0.12); color: #9333ea; }
.data-table .badge-booked { background: rgba(45,212,168,0.12); color: #16a34a; }
.data-table .badge-converted { background: rgba(224,123,57,0.12); color: var(--accent); }
.data-table .badge-no_show { background: rgba(239,68,68,0.12); color: #dc2626; }
.data-table .badge-scheduled { background: rgba(59,130,246,0.12); color: #2563eb; }
.data-table .badge-completed { background: rgba(45,212,168,0.12); color: #16a34a; }
.data-table .badge-cancelled { background: rgba(239,68,68,0.12); color: #dc2626; }

/* === TAB TOOLBAR === */
.tab-toolbar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab-btn {
  padding: 8px 18px; border: 1.5px solid var(--border); border-radius: 100px;
  background: var(--surface); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; color: var(--fg-muted);
}
.tab-btn:hover { border-color: var(--accent); color: var(--accent); }
.tab-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* === AUTOMATIONS LIST === */
.automations-list { display: flex; flex-direction: column; gap: 16px; }
.automation-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px;
}
.automation-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.automation-card p { font-size: 13px; color: var(--fg-muted); margin-bottom: 16px; }
.automation-steps { display: flex; gap: 10px; flex-wrap: wrap; }
.automation-step {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; font-size: 12px;
}
.automation-step.done { border-color: rgba(45,212,168,0.3); background: rgba(45,212,168,0.06); }
.step-type-tag { font-weight: 600; }

/* === LIVE DEMO CARDS === */
.demo-cards { display: flex; flex-direction: column; gap: 20px; }
.demo-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px;
}
.demo-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.demo-emoji { font-size: 28px; }
.demo-card-header h3 { font-size: 17px; font-weight: 700; flex: 1; }
.demo-badge {
  font-size: 10px; font-weight: 700; padding: 4px 12px; border-radius: 100px;
}
.demo-badge.live { background: rgba(45,212,168,0.15); color: #16a34a; }
.demo-badge.armed { background: rgba(245,158,11,0.12); color: #b45309; }
.demo-badge.active { background: rgba(224,123,57,0.12); color: var(--accent); }
.demo-badge.running { background: rgba(59,130,246,0.12); color: #2563eb; }
.demo-card p { font-size: 14px; color: var(--fg-muted); margin-bottom: 16px; line-height: 1.6; }
.demo-link { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }
.demo-link:hover { text-decoration: underline; }
.demo-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; background: var(--fg); color: #fff;
  border: none; border-radius: 100px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; margin-top: 12px;
}
.demo-trigger:hover { background: var(--accent); transform: translateY(-1px); }
.demo-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.flow-step { display: flex; align-items: center; gap: 6px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 12px; font-weight: 500; }
.flow-icon { font-size: 16px; }
.flow-arrow { color: var(--fg-subtle); font-size: 16px; }
.demo-output { margin-top: 12px; font-size: 13px; color: var(--fg-muted); font-family: 'Courier New', monospace; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; min-height: 48px; }

/* === SEQUENCE TIMELINE === */
.sequence-timeline { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.seq-step {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; min-width: 80px;
}
.seq-step.done { border-color: rgba(45,212,168,0.3); background: rgba(45,212,168,0.06); }
.seq-day { font-size: 10px; font-weight: 700; color: var(--fg-muted); text-transform: uppercase; }
.seq-type { font-size: 14px; }
.seq-status { font-size: 10px; color: var(--fg-subtle); }

/* === EMPTY STATE === */
.empty-state { text-align: center; padding: 48px 24px; color: var(--fg-muted); }
.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; position: static; height: auto; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}