/* HookAILoop Tenant Portal v2.0 — Modern SaaS Design */
/* Dark mode default, HookAILoop Foundations palette */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ====== Design Tokens ====== */
:root {
  --p500: #2563EB;
  --p600: #1D4ED8;
  --p400: #3B82F6;
  --p300: #60A5FA;
  --p200: #93C5FD;
  --accent: #818CF8;
  --accent2: #C084FC;

  --bg-page: #0B1120;
  --bg-card: #151D2E;
  --bg-card-hover: #1A2540;
  --bg-input: #1E293B;
  --bg-input-focus: #253347;
  --bg-header: rgba(11, 17, 32, 0.85);
  --bg-sidebar: #0F172A;
  --bg-sidebar-hover: rgba(37, 99, 235, 0.08);
  --bg-sidebar-active: rgba(37, 99, 235, 0.15);

  --text-primary: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-muted: #64748B;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);

  --success: #4ADE80;
  --success-bg: rgba(74, 222, 128, 0.12);
  --warning: #FACC15;
  --warning-bg: rgba(250, 204, 21, 0.12);
  --error: #EF4444;
  --error-bg: rgba(239, 68, 68, 0.12);
  --info: #60A5FA;

  --gradient-primary: linear-gradient(135deg, #2563EB, #818CF8);
  --gradient-accent: linear-gradient(135deg, #818CF8, #C084FC);
  --gradient-card: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(129, 140, 248, 0.04));

  --header-h: 56px;
  --sidebar-w: 240px;
  --sidebar-collapsed: 64px;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.4);
  --shadow-glow: 0 0 24px rgba(37, 99, 235, 0.15);
  --shadow-card: 0 1px 3px rgba(0,0,0,.2), 0 0 0 1px var(--border);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Space Grotesk', var(--font-body);
  --font-mono: 'JetBrains Mono', monospace;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light theme */
[data-theme="light"] {
  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F1F5F9;
  --bg-input: #F1F5F9;
  --bg-input-focus: #E2E8F0;
  --bg-header: rgba(248, 250, 252, 0.9);
  --bg-sidebar: #FFFFFF;
  --bg-sidebar-hover: rgba(37, 99, 235, 0.06);
  --bg-sidebar-active: rgba(37, 99, 235, 0.1);
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --border: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.08);
  --shadow-card: 0 1px 3px rgba(0,0,0,.06), 0 0 0 1px var(--border);
  --shadow-glow: 0 0 24px rgba(37, 99, 235, 0.08);
}

/* ====== Reset ====== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: var(--font-body); background: var(--bg-page); color: var(--text-primary); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--p400); text-decoration: none; }
a:hover { color: var(--p300); }

/* ====== Scrollbar ====== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; opacity: 0.5; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ====== Login ====== */
.login-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--bg-page); z-index: 1000;
}
.login-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(37, 99, 235, 0.15) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(129, 140, 248, 0.1) 0%, transparent 50%);
}
.login-card {
  position: relative; width: 100%; max-width: 400px; padding: 40px 36px;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  animation: fadeUp 0.4s ease;
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo-icon { display: inline-block; margin-bottom: 12px; }
.login-logo h1 {
  font-family: var(--font-heading); font-size: 26px; font-weight: 700;
  background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-subtitle { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.login-tabs {
  display: flex; gap: 0; margin-bottom: 20px; border-bottom: 1px solid var(--border-strong);
}
.login-tab {
  flex: 1; padding: 10px; border: none; background: none;
  font-family: var(--font-heading); font-weight: 600; font-size: 13px;
  color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: var(--transition);
}
.login-tab.active { color: var(--p400); border-bottom-color: var(--p500); }
.login-tab:hover { color: var(--text-primary); }
.login-form label {
  display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 6px; margin-top: 14px; text-transform: uppercase; letter-spacing: 0.5px;
}
.login-form label:first-child { margin-top: 0; }
.login-form input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); background: var(--bg-input); color: var(--text-primary);
  font-size: 14px; font-family: var(--font-body); outline: none; transition: var(--transition);
}
.login-form input:focus {
  border-color: var(--p500); background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.login-error { color: var(--error); font-size: 12px; margin-top: 8px; }

/* ====== Buttons ====== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border: none; border-radius: var(--r-sm);
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.btn-primary {
  background: var(--gradient-primary); color: #fff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }
.btn-secondary { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-strong); }
.btn-secondary:hover { background: var(--bg-card-hover); }
.btn-danger { background: var(--error-bg); color: var(--error); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; margin-top: 20px; padding: 11px; font-size: 14px; }
.btn-icon { padding: 6px; background: none; border: none; color: var(--text-muted); cursor: pointer; border-radius: var(--r-sm); }
.btn-icon:hover { color: var(--text-primary); background: var(--bg-sidebar-hover); }

/* ====== Top Bar ====== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
  background: var(--bg-header); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; z-index: 100;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-center { display: flex; align-items: center; gap: 8px; }
.topbar-brand { font-family: var(--font-heading); font-weight: 700; font-size: 16px; color: var(--text-primary); }
.topbar-account { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.topbar-plan-badge {
  padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 600;
  background: var(--gradient-accent); color: #fff; text-transform: uppercase; letter-spacing: 0.5px;
}
.topbar-icon-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border: none; background: none; color: var(--text-muted); cursor: pointer;
  border-radius: var(--r-sm); transition: var(--transition);
}
.topbar-icon-btn:hover { color: var(--text-primary); background: var(--bg-sidebar-hover); }
.topbar-avatar {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--bg-input); color: var(--text-muted);
  cursor: pointer; transition: var(--transition); border: none;
}
.topbar-avatar:hover { color: var(--error); background: var(--error-bg); }
.sidebar-toggle { display: none; background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; }

/* ====== Shell Layout ====== */
.shell { display: flex; min-height: calc(100vh - var(--header-h)); padding-top: var(--header-h); }

/* ====== Sidebar ====== */
.sidebar {
  position: fixed; top: var(--header-h); left: 0; bottom: 0;
  width: var(--sidebar-w); background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow-y: auto;
  z-index: 50; transition: transform 0.3s ease;
}
.sidebar-nav { flex: 1; padding: 8px; }
.sidebar-section-label {
  padding: 16px 14px 6px; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted); opacity: 0.7;
}
.sidebar-section-label:first-child { padding-top: 8px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 14px; border: none; background: none;
  color: var(--text-muted); font-size: 13px; font-family: var(--font-body); font-weight: 500;
  cursor: pointer; border-radius: var(--r-sm); transition: var(--transition);
  text-align: left;
}
.nav-item:hover { background: var(--bg-sidebar-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--bg-sidebar-active); color: var(--p400); font-weight: 600;
}
.nav-item.active svg { stroke: var(--p400); }
.nav-item svg { flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }
.sidebar-footer {
  padding: 12px 14px; border-top: 1px solid var(--border);
}
.sidebar-version { font-size: 11px; color: var(--text-muted); opacity: 0.5; text-align: center; }

/* ====== Main Content ====== */
.main-content {
  margin-left: var(--sidebar-w); flex: 1; padding: 28px 32px;
  min-height: calc(100vh - var(--header-h)); transition: margin-left 0.3s ease;
}
.section { display: none; animation: fadeIn 0.25s ease; }
.section.active { display: block; }
.section-header { margin-bottom: 24px; }
.section-header h2 {
  font-family: var(--font-heading); font-size: 22px; font-weight: 700;
  color: var(--text-primary); margin-bottom: 4px;
}
.section-header p { color: var(--text-muted); font-size: 13px; }

/* ====== Cards ====== */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 20px;
  box-shadow: var(--shadow-card); transition: var(--transition);
}
.card:hover { border-color: var(--border-strong); }
.card-glass {
  background: var(--gradient-card); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--r-md); padding: 20px;
}

/* Stat Cards */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 20px;
  position: relative; overflow: hidden; transition: var(--transition);
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--gradient-primary); opacity: 0;
  transition: opacity 0.3s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md), var(--shadow-glow); }
.stat-card:hover::before { opacity: 1; }
.stat-card .label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted); margin-bottom: 8px;
}
.stat-card .value {
  font-family: var(--font-heading); font-size: 28px; font-weight: 700;
  color: var(--text-primary); line-height: 1.1;
}
.stat-card .sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.stat-card .trend { font-size: 11px; font-weight: 600; margin-top: 6px; }
.stat-card .trend.up { color: var(--success); }
.stat-card .trend.down { color: var(--error); }

/* ====== Tables ====== */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted);
  border-bottom: 1px solid var(--border-strong); background: var(--bg-card);
}
tbody td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
tbody tr { transition: var(--transition); }
tbody tr:hover { background: var(--bg-card-hover); }
.table-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }

/* ====== Badges ====== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600;
}
.badge-blue { background: rgba(37, 99, 235, 0.12); color: var(--p300); }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-orange { background: var(--warning-bg); color: var(--warning); }
.badge-red { background: var(--error-bg); color: var(--error); }
.badge-purple { background: rgba(192, 132, 252, 0.12); color: var(--accent2); }

/* ====== Forms ====== */
input, select, textarea {
  font-family: var(--font-body); font-size: 13px;
  padding: 8px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); background: var(--bg-input);
  color: var(--text-primary); outline: none; transition: var(--transition);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--p500); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
select { cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }

/* ====== Filter Bar ====== */
.filter-bar {
  display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap;
}
.filter-bar select, .filter-bar input { font-size: 12px; padding: 6px 10px; }

/* ====== Tabs (within sections) ====== */
.tabs { display: flex; gap: 2px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tab-btn {
  padding: 10px 18px; border: none; background: none;
  font-family: var(--font-heading); font-size: 13px; font-weight: 500;
  color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: var(--transition);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--p400); border-bottom-color: var(--p500); font-weight: 600; }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.2s ease; }

/* ====== Modal ====== */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.modal-content {
  position: relative; width: 90%; max-width: 640px; max-height: 85vh;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg);
  animation: fadeUp 0.2s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-family: var(--font-heading); font-size: 16px; font-weight: 600; }
.modal-close {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border: none; background: none; color: var(--text-muted); font-size: 20px;
  cursor: pointer; border-radius: var(--r-sm); transition: var(--transition);
}
.modal-close:hover { background: var(--error-bg); color: var(--error); }
#modal-body { padding: 20px; overflow-y: auto; max-height: calc(85vh - 60px); }

/* ====== Toast ====== */
#toast-container { position: fixed; top: 72px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 10px 16px; border-radius: var(--r-sm); font-size: 13px; font-weight: 500;
  color: #fff; animation: slideIn 0.3s ease; min-width: 240px;
  box-shadow: var(--shadow-md);
}
.toast.success { background: #059669; }
.toast.error { background: #DC2626; }
.toast.info { background: var(--p500); }

/* ====== Empty state ====== */
.empty-state {
  text-align: center; padding: 48px 20px; color: var(--text-muted);
}
.empty-state svg { margin-bottom: 12px; opacity: 0.3; }
.empty-state p { font-size: 14px; }

/* ====== Skeleton loading ====== */
.skeleton { background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card-hover) 50%, var(--bg-input) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--r-sm); }
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-card { height: 100px; border-radius: var(--r-md); }

/* ====== Code ====== */
code, pre { font-family: var(--font-mono); font-size: 12px; }
code { padding: 2px 6px; background: var(--bg-input); border-radius: 4px; color: var(--p300); }
pre {
  padding: 16px; background: var(--bg-input); border-radius: var(--r-sm);
  overflow-x: auto; border: 1px solid var(--border); line-height: 1.6;
  color: var(--text-secondary);
}

/* ====== Specific component styles ====== */
/* Agent cards */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.agent-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 20px; transition: var(--transition);
  cursor: pointer;
}
.agent-card:hover { border-color: var(--p500); box-shadow: var(--shadow-glow); transform: translateY(-2px); }
.agent-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.agent-card-avatar {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--gradient-primary); display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff;
}
.agent-card-name { font-weight: 600; font-size: 15px; }
.agent-card-meta { font-size: 12px; color: var(--text-muted); }
.agent-card-stats { display: flex; gap: 16px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.agent-card-stat { font-size: 12px; color: var(--text-muted); }
.agent-card-stat strong { color: var(--text-primary); font-weight: 600; }

/* Conversation list */
.conv-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); cursor: pointer; transition: var(--transition);
}
.conv-item:hover { background: var(--bg-card-hover); }
.conv-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-input); display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text-muted);
}

/* Widget Builder preview */
.widget-preview-wrap {
  background: var(--bg-input); border-radius: var(--r-md); padding: 24px;
  border: 1px solid var(--border); min-height: 400px;
  display: flex; align-items: flex-end; justify-content: flex-end;
}

/* ====== Utility ====== */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.font-mono { font-family: var(--font-mono); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Daily bar charts (reuse from admin) */
.daily-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.daily-label { min-width: 70px; font-size: 12px; color: var(--text-muted); text-align: right; }
.daily-bar { height: 18px; border-radius: 3px; background: var(--p500); transition: width 0.3s ease; min-width: 2px; }
.daily-val { min-width: 40px; font-size: 12px; color: var(--text-muted); }

/* Phase bars */
.phase-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.phase-bar-label { min-width: 80px; font-size: 12px; color: var(--text-muted); text-align: right; }
.phase-bar { height: 18px; border-radius: 3px; background: var(--p500); min-width: 2px; transition: width 0.3s ease; }
.phase-bar-val { font-size: 12px; color: var(--text-muted); min-width: 45px; }

/* Funnel */
.funnel-container { display: flex; flex-direction: column; gap: 16px; }
.funnel-agent { margin-bottom: 8px; }
.funnel-stages { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.funnel-stage { padding: 4px 8px; font-size: 12px; border-radius: 3px; text-align: center; transition: width 0.3s ease; }
.funnel-labels { display: flex; justify-content: space-between; margin-top: 4px; }
.funnel-labels span { font-size: 10px; color: var(--text-muted); }

/* Heatmap */
.heatmap-grid { display: grid; grid-template-columns: auto repeat(24, 1fr); gap: 2px; }
.heatmap-label { font-size: 11px; color: var(--text-muted); text-align: right; padding-right: 6px; line-height: 18px; }
.heatmap-hour { font-size: 9px; color: var(--text-muted); text-align: center; }
.heatmap-cell { width: 100%; height: 18px; border-radius: 2px; }
.hm-0 { background: rgba(37, 99, 235, 0.08); }
.hm-1 { background: rgba(37, 99, 235, 0.2); }
.hm-2 { background: rgba(37, 99, 235, 0.4); }
.hm-3 { background: rgba(37, 99, 235, 0.6); color: #fff; }
.hm-4 { background: rgba(37, 99, 235, 0.85); color: #fff; }

/* Cohort */
.cohort-table td, .cohort-table th { padding: 6px 10px; font-size: 12px; text-align: center; }
.cohort-good { background: rgba(74, 222, 128, 0.12); }
.cohort-ok { background: rgba(250, 204, 21, 0.08); }
.cohort-bad { background: rgba(239, 68, 68, 0.08); }

/* Compare */
.compare-table td, .compare-table th { padding: 8px 12px; font-size: 12px; }
.compare-best { background: rgba(74, 222, 128, 0.1); }
.compare-worst { background: rgba(239, 68, 68, 0.06); }

/* Dropoff */
.dropoff-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.dropoff-label { min-width: 160px; font-size: 12px; color: var(--text-muted); text-align: right; }
.dropoff-bar { height: 18px; border-radius: 3px; min-width: 2px; }
.do-bounce { background: var(--error); }
.do-early { background: #ff9800; }
.do-lowq { background: var(--warning); }
.do-mid { background: var(--info); }
.do-complete { background: var(--success); }

/* Journey section */
.journey-section { margin-bottom: 20px; }
.journey-section h4 { font-family: var(--font-heading); font-size: 14px; margin-bottom: 10px; color: var(--text-primary); }

/* Latency colors */
.latency-fast { color: var(--success); }
.latency-ok { color: var(--warning); }
.latency-slow { color: var(--error); }

/* ====== Animations ====== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ====== Responsive ====== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 20px 16px; }
  .sidebar-toggle { display: block; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .agent-grid { grid-template-columns: 1fr; }
  .topbar-center { display: none; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .login-card { margin: 16px; padding: 24px 20px; }
}
