/* ═══════════════════════════════════════════════════════════════
   VOCALIX — DESIGN SYSTEM & COMPONENT STYLES
   Dark theme · Glassmorphism · Neon accents · Fluid layout
═══════════════════════════════════════════════════════════════ */

/* ── Custom Properties ── */
:root {
  --bg-base:        #080c14;
  --bg-surface:     #0d1117;
  --bg-elevated:    #111827;
  --bg-card:        rgba(17, 24, 39, 0.7);
  --bg-card-hover:  rgba(17, 24, 39, 0.9);
  --glass-border:   rgba(255, 255, 255, 0.06);
  --glass-border-h: rgba(168, 85, 247, 0.3);

  --purple:         #a855f7;
  --purple-dim:     rgba(168, 85, 247, 0.15);
  --purple-glow:    rgba(168, 85, 247, 0.25);
  --cyan:           #06b6d4;
  --cyan-dim:       rgba(6, 182, 212, 0.15);
  --green:          #22c55e;
  --orange:         #f97316;
  --red:            #ef4444;
  --pink:           #ec4899;

  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;

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

  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      14px;
  --radius-xl:      20px;

  --shadow-card:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow:    0 0 24px rgba(168,85,247,0.15);
  --shadow-glow-c:  0 0 24px rgba(6,182,212,0.15);

  --font-sans:      'Plus Jakarta Sans', system-ui, sans-serif;
  --font-display:   'Syne', system-ui, sans-serif;
  --font-mono:      'JetBrains Mono', monospace;

  --transition:     0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow:0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
canvas { display: block; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(168,85,247,0.3); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(168,85,247,0.5); }

/* ═══════════════════════════════════════════════════════════════
   AMBIENT BACKGROUND
═══════════════════════════════════════════════════════════════ */
.ambient-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.orb {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.12;
  animation: orbFloat 20s ease-in-out infinite;
}
.orb-1 { width: 600px; height: 600px; background: var(--purple); top: -200px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 500px; height: 500px; background: var(--cyan); bottom: -150px; right: -100px; animation-delay: -7s; }
.orb-3 { width: 400px; height: 400px; background: var(--pink); top: 40%; left: 40%; animation-delay: -14s; }
#particleCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ═══════════════════════════════════════════════════════════════
   APP SHELL
═══════════════════════════════════════════════════════════════ */
.app-shell {
  position: relative; z-index: 1;
  display: flex; min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 100;
  transition: width var(--transition-slow);
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-w-col); }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-count,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .logo-text,
.sidebar.collapsed .usage-card,
.sidebar.collapsed .user-info { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .nav-icon { margin: 0; }

/* Logo */
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 34px; height: 34px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(6,182,212,0.2));
  border: 1px solid rgba(168,85,247,0.3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-name {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 700;
  background: linear-gradient(135deg, #f1f5f9, #a855f7);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-tagline { font-size: 0.62rem; color: var(--text-muted); display: block; margin-top: -2px; }
.sidebar-toggle {
  width: 24px; height: 24px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border);
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--purple-dim); color: var(--purple); border-color: rgba(168,85,247,0.3); }

/* Nav */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-section-label {
  font-size: 0.58rem; font-weight: 700; letter-spacing: 0.1em;
  color: var(--text-muted); padding: 10px 8px 4px;
  white-space: nowrap; overflow: hidden;
}
.nav-list { display: flex; flex-direction: column; gap: 1px; margin-bottom: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition);
  position: relative; white-space: nowrap;
}
.nav-item:hover { background: rgba(255,255,255,0.04); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(6,182,212,0.08));
  border: 1px solid rgba(168,85,247,0.2);
}
.nav-item.active .nav-icon { color: var(--purple); }
.nav-item.active .nav-label { color: var(--text-primary); font-weight: 600; }
.nav-icon { color: var(--text-muted); flex-shrink: 0; display: flex; align-items: center; }
.nav-label { font-size: 0.8rem; color: var(--text-secondary); flex: 1; }
.nav-count {
  font-size: 0.65rem; font-weight: 700; color: var(--text-muted);
  background: rgba(255,255,255,0.06); border-radius: 10px; padding: 1px 6px;
}
.nav-badge {
  font-size: 0.55rem; font-weight: 700; border-radius: 4px; padding: 2px 5px;
}
.nav-badge.new { background: rgba(168,85,247,0.2); color: var(--purple); }
.nav-badge.live { color: var(--green); font-size: 0.7rem; }
.nav-badge .pulse { animation: pulseDot 1.5s ease-in-out infinite; }

/* Sidebar Footer */
.sidebar-footer {
  padding: 10px 10px 14px;
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.usage-card { margin-bottom: 10px; }
.usage-header { display: flex; justify-content: space-between; margin-bottom: 5px; }
.usage-label { font-size: 0.68rem; color: var(--text-muted); }
.usage-pct { font-size: 0.68rem; color: var(--purple); font-weight: 600; }
.usage-bar {
  height: 3px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden;
}
.usage-fill {
  height: 100%; background: linear-gradient(90deg, var(--purple), var(--cyan));
  border-radius: 2px; transition: width 1s cubic-bezier(0.16,1,0.3,1);
}
.usage-sub { font-size: 0.62rem; color: var(--text-muted); margin-top: 4px; }
.user-profile-mini {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border);
}
.user-name { font-size: 0.75rem; font-weight: 600; color: var(--text-primary); display: block; }
.user-role { font-size: 0.62rem; color: var(--text-muted); display: block; }
.user-menu-btn { color: var(--text-muted); padding: 2px; margin-left: auto; }

/* ═══════════════════════════════════════════════════════════════
   MAIN WRAPPER
═══════════════════════════════════════════════════════════════ */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-slow);
}
.sidebar.collapsed ~ .main-wrapper { margin-left: var(--sidebar-w-col); }

/* ═══════════════════════════════════════════════════════════════
   TOP HEADER
═══════════════════════════════════════════════════════════════ */
.top-header {
  height: var(--header-h);
  background: rgba(8,12,20,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 50;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.mobile-menu-btn {
  display: none; color: var(--text-secondary);
  padding: 6px; border-radius: var(--radius-sm);
}
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; }
.breadcrumb-root { color: var(--text-muted); }
.breadcrumb svg { color: var(--text-muted); }
.breadcrumb-current { color: var(--text-primary); font-weight: 600; }
.header-center { flex: 1; max-width: 400px; }
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border);
  border-radius: var(--radius-md); padding: 7px 12px;
  transition: var(--transition);
}
.search-bar:focus-within { border-color: rgba(168,85,247,0.4); background: rgba(168,85,247,0.05); }
.search-icon { color: var(--text-muted); flex-shrink: 0; }
.search-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 0.78rem;
}
.search-input::placeholder { color: var(--text-muted); }
.search-kbd {
  font-size: 0.6rem; color: var(--text-muted);
  background: rgba(255,255,255,0.06); border-radius: 4px; padding: 2px 5px;
  font-family: var(--font-mono);
}
.header-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.status-indicator { display: flex; align-items: center; gap: 6px; }
.status-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  animation: pulseDot 2s ease-in-out infinite;
}
.status-text { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; }
.header-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border);
  color: var(--text-secondary); display: flex; align-items: center; justify-content: center;
  transition: var(--transition); position: relative;
}
.header-btn:hover { background: var(--purple-dim); color: var(--purple); border-color: rgba(168,85,247,0.3); }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--red); color: white; font-size: 0.55rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* Notification Panel */
.notif-panel {
  position: fixed; top: calc(var(--header-h) + 8px); right: 16px;
  width: 320px; z-index: 200;
  transform: translateY(-8px) scale(0.97); opacity: 0; pointer-events: none;
  transition: var(--transition);
}
.notif-panel.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: all; }
.notif-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.notif-header h3 { font-size: 0.85rem; font-weight: 700; }
.notif-list { display: flex; flex-direction: column; gap: 2px; }
.notif-item {
  display: flex; gap: 10px; padding: 10px;
  border-radius: var(--radius-sm); transition: var(--transition);
}
.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-item.unread { background: rgba(168,85,247,0.04); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.notif-dot.green { background: var(--green); }
.notif-dot.purple { background: var(--purple); }
.notif-dot.orange { background: var(--orange); }
.notif-dot.cyan { background: var(--cyan); }
.notif-content { display: flex; flex-direction: column; gap: 3px; }
.notif-title { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.4; }
.notif-time { font-size: 0.65rem; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   CONTENT AREA & MODULES
═══════════════════════════════════════════════════════════════ */
.content-area { flex: 1; padding: 20px; overflow-y: auto; }
.module { display: none; animation: moduleIn 0.3s ease; }
.module.active { display: block; }

/* Module Header */
.module-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px; gap: 16px; flex-wrap: wrap;
}
.module-title {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 700;
  color: var(--text-primary); line-height: 1.2;
}
.module-subtitle { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; }
.module-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wave { display: inline-block; animation: waveHand 2s ease-in-out infinite; }
.live-indicator {
  font-size: 0.7rem; color: var(--green); font-weight: 700;
  animation: pulseDot 1.5s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════════
   GLASS CARD
═══════════════════════════════════════════════════════════════ */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}
.glass-card:hover { border-color: rgba(255,255,255,0.09); }

/* Card Header */
.card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 14px; gap: 12px;
}
.card-title { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); }
.card-subtitle { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.card-controls { display: flex; align-items: center; gap: 8px; }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--purple), #7c3aed);
  color: white; font-size: 0.78rem; font-weight: 600;
  padding: 8px 14px; border-radius: var(--radius-md);
  transition: var(--transition); white-space: nowrap;
  box-shadow: 0 4px 12px rgba(168,85,247,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(168,85,247,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.btn-sm { padding: 6px 12px; font-size: 0.74rem; }
.btn-primary.btn-xs { padding: 4px 8px; font-size: 0.68rem; }
.btn-primary.btn-full { width: 100%; justify-content: center; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border);
  color: var(--text-secondary); font-size: 0.78rem; font-weight: 500;
  padding: 8px 14px; border-radius: var(--radius-md);
  transition: var(--transition); white-space: nowrap;
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); border-color: rgba(255,255,255,0.12); }
.btn-ghost.btn-sm { padding: 6px 12px; font-size: 0.74rem; }
.btn-ghost.btn-xs { padding: 4px 8px; font-size: 0.68rem; }
.btn-ghost.btn-full { width: 100%; justify-content: center; }

.btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2);
  color: var(--red); font-size: 0.68rem; font-weight: 500;
  padding: 4px 8px; border-radius: var(--radius-sm);
  transition: var(--transition);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

/* ═══════════════════════════════════════════════════════════════
   FORM ELEMENTS
═══════════════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-label { font-size: 0.72rem; font-weight: 600; color: var(--text-secondary); }
.form-input, .form-select, .form-textarea {
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-size: 0.8rem; padding: 8px 12px;
  transition: var(--transition); outline: none; width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: rgba(168,85,247,0.5); background: rgba(168,85,247,0.05);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.1);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-select { cursor: pointer; }
.form-select option { background: var(--bg-elevated); }
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.form-select-sm {
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); color: var(--text-secondary);
  font-size: 0.72rem; padding: 5px 8px; outline: none; cursor: pointer;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio-group { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-option {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border);
  font-size: 0.75rem; color: var(--text-secondary); cursor: pointer;
  transition: var(--transition);
}
.radio-option.active, .radio-option:has(input:checked) {
  background: var(--purple-dim); border-color: rgba(168,85,247,0.3); color: var(--purple);
}
.radio-option input { display: none; }
.input-prefix-group { display: flex; }
.input-prefix {
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border);
  border-right: none; border-radius: var(--radius-md) 0 0 var(--radius-md);
  padding: 8px 10px; font-size: 0.75rem; color: var(--text-muted); white-space: nowrap;
}
.input-prefix + .form-input { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.input-mini {
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 0.72rem; padding: 5px 10px; outline: none; width: 160px;
}
.search-mini { display: flex; }

/* Toggle */
.toggle {
  width: 36px; height: 20px; border-radius: 10px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--glass-border);
  position: relative; cursor: pointer; transition: var(--transition); flex-shrink: 0;
}
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-muted); transition: var(--transition);
}
.toggle.active { background: linear-gradient(135deg, var(--purple), #7c3aed); border-color: transparent; }
.toggle.active::after { left: 18px; background: white; }
.toggle-row { display: flex; align-items: center; gap: 10px; font-size: 0.78rem; color: var(--text-secondary); }

/* Sliders */
.slider-item { margin-bottom: 14px; }
.slider-header { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.75rem; color: var(--text-secondary); }
.slider-val { color: var(--purple); font-weight: 600; }
.slider-labels { display: flex; justify-content: space-between; font-size: 0.62rem; color: var(--text-muted); margin-top: 4px; }
.slider-group { display: flex; flex-direction: column; }
.styled-range {
  -webkit-appearance: none; width: 100%; height: 4px;
  border-radius: 2px; outline: none; cursor: pointer;
  background: rgba(255,255,255,0.08);
}
.styled-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--purple); cursor: pointer;
  box-shadow: 0 0 8px rgba(168,85,247,0.5);
  transition: var(--transition);
}
.styled-range::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* ═══════════════════════════════════════════════════════════════
   AVATAR
═══════════════════════════════════════════════════════════════ */
.avatar-ring {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  padding: 1.5px; flex-shrink: 0;
}
.avatar-inner {
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 700; color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════
   BADGES & PILLS
═══════════════════════════════════════════════════════════════ */
.badge-green { font-size: 0.65rem; color: var(--green); font-weight: 700; }
.badge-tag {
  display: inline-flex; align-items: center;
  background: var(--purple-dim); border: 1px solid rgba(168,85,247,0.2);
  color: var(--purple); font-size: 0.68rem; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
}
.status-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.68rem; font-weight: 600; padding: 3px 8px; border-radius: 20px;
}
.status-pill.active { background: rgba(34,197,94,0.1); color: var(--green); }
.status-pill.paused { background: rgba(249,115,22,0.1); color: var(--orange); }
.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--purple-dim); color: var(--purple); font-size: 0.65rem; font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD — STATS GRID
═══════════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--bg-card); backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  padding: 14px; display: flex; align-items: flex-start; gap: 12px;
  transition: var(--transition); position: relative; overflow: hidden;
}
.stat-card:hover { border-color: rgba(168,85,247,0.2); transform: translateY(-2px); }
.stat-icon {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon.purple { background: var(--purple-dim); color: var(--purple); }
.stat-icon.green { background: rgba(34,197,94,0.15); color: var(--green); }
.stat-icon.cyan { background: var(--cyan-dim); color: var(--cyan); }
.stat-icon.orange { background: rgba(249,115,22,0.15); color: var(--orange); }
.stat-body { flex: 1; min-width: 0; }
.stat-label { font-size: 0.68rem; color: var(--text-muted); display: block; margin-bottom: 3px; }
.stat-value {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 700;
  color: var(--text-primary); display: block; line-height: 1;
}
.stat-trend { font-size: 0.65rem; display: block; margin-top: 4px; }
.stat-trend.up { color: var(--green); }
.stat-trend.down { color: var(--cyan); }
.stat-sparkline { position: absolute; bottom: 0; right: 0; opacity: 0.6; }

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD — CHARTS
═══════════════════════════════════════════════════════════════ */
.charts-row { display: grid; grid-template-columns: 1fr 280px; gap: 12px; margin-bottom: 16px; }
.chart-card { }
.chart-card.large { }
.chart-card.small { }
.chart-container { margin-bottom: 12px; }
.chart-stats { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--glass-border); }
.chart-stat { display: flex; flex-direction: column; gap: 2px; }
.cs-value { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }
.cs-value.green { color: var(--green); }
.cs-value.red { color: var(--red); }
.cs-value.cyan { color: var(--cyan); }
.cs-value.orange { color: var(--orange); }
.cs-label { font-size: 0.62rem; color: var(--text-muted); }
.donut-container { position: relative; display: flex; justify-content: center; margin-bottom: 12px; }
.donut-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center;
}
.donut-val { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--text-primary); display: block; }
.donut-lbl { font-size: 0.6rem; color: var(--text-muted); }
.legend-list { display: flex; flex-direction: column; gap: 6px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.72rem; color: var(--text-secondary); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.legend-pct { margin-left: auto; font-weight: 600; color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD — BOTTOM ROW
═══════════════════════════════════════════════════════════════ */
.bottom-row { display: grid; grid-template-columns: 1fr 1fr 240px; gap: 12px; }
.agents-list { display: flex; flex-direction: column; gap: 8px; }
.agent-row { display: flex; align-items: center; gap: 10px; }
.agent-avatar {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 700; color: white; flex-shrink: 0;
}
.agent-info { flex: 1; min-width: 0; }
.agent-name { font-size: 0.78rem; font-weight: 600; color: var(--text-primary); display: block; }
.agent-meta { font-size: 0.65rem; color: var(--text-muted); }
.agent-score { display: flex; align-items: center; gap: 8px; }
.score-bar { width: 60px; height: 3px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.score-fill { height: 100%; background: linear-gradient(90deg, var(--purple), var(--cyan)); border-radius: 2px; }
.score-val { font-size: 0.7rem; font-weight: 700; color: var(--green); min-width: 28px; text-align: right; }
.activity-feed { display: flex; flex-direction: column; gap: 8px; }
.activity-item { display: flex; gap: 10px; align-items: flex-start; }
.activity-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.activity-dot.purple { background: var(--purple); }
.activity-dot.green { background: var(--green); }
.activity-dot.cyan { background: var(--cyan); }
.activity-dot.orange { background: var(--orange); }
.activity-content { display: flex; flex-direction: column; gap: 2px; }
.activity-text { font-size: 0.72rem; color: var(--text-secondary); line-height: 1.4; }
.activity-time { font-size: 0.62rem; color: var(--text-muted); }
.steps-card { }

/* ═══════════════════════════════════════════════════════════════
   AGENTS GRID
═══════════════════════════════════════════════════════════════ */
.agents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.agent-card {
  background: var(--bg-card); backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  padding: 16px; transition: var(--transition); cursor: pointer;
}
.agent-card:hover { border-color: rgba(168,85,247,0.25); transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.agent-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.agent-avatar-lg {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 700; color: white;
}
.agent-status-badge { font-size: 0.62rem; font-weight: 700; padding: 3px 8px; border-radius: 20px; }
.agent-status-badge.active { background: rgba(34,197,94,0.1); color: var(--green); }
.agent-status-badge.paused { background: rgba(249,115,22,0.1); color: var(--orange); }
.agent-card-name { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.agent-card-role { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 10px; }
.agent-card-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.meta-tag {
  font-size: 0.6rem; font-weight: 600; padding: 2px 6px; border-radius: 4px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
  color: var(--text-muted);
}
.agent-card-stats { display: flex; gap: 12px; margin-bottom: 12px; padding: 10px; background: rgba(255,255,255,0.02); border-radius: var(--radius-sm); }
.acs-item { display: flex; flex-direction: column; gap: 2px; }
.acs-val { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }
.acs-lbl { font-size: 0.58rem; color: var(--text-muted); }
.agent-card-actions { display: flex; gap: 6px; }
.create-card {
  border: 1px dashed rgba(168,85,247,0.3); background: rgba(168,85,247,0.03);
  display: flex; align-items: center; justify-content: center;
  min-height: 200px;
}
.create-card:hover { background: rgba(168,85,247,0.08); border-color: rgba(168,85,247,0.5); }
.create-card-inner { text-align: center; }
.create-icon { margin-bottom: 10px; }
.create-title { font-size: 0.88rem; font-weight: 700; color: var(--purple); margin-bottom: 4px; }
.create-desc { font-size: 0.7rem; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   TWO-COLUMN LAYOUT
═══════════════════════════════════════════════════════════════ */
.two-col-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.col-main { display: flex; flex-direction: column; }
.col-side { display: flex; flex-direction: column; gap: 16px; }

/* ═══════════════════════════════════════════════════════════════
   MODEL SELECTOR
═══════════════════════════════════════════════════════════════ */
.model-selector { display: flex; flex-direction: column; gap: 8px; }
.model-option {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-md);
  border: 1px solid var(--glass-border); background: rgba(255,255,255,0.02);
  cursor: pointer; transition: var(--transition);
}
.model-option:hover { border-color: rgba(168,85,247,0.3); background: var(--purple-dim); }
.model-option.selected { border-color: rgba(168,85,247,0.4); background: var(--purple-dim); }
.mo-logo {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 800; flex-shrink: 0;
}
.mo-logo.openai { background: rgba(16,163,127,0.2); color: #10a37f; }
.mo-logo.claude { background: rgba(210,140,100,0.2); color: #d28c64; }
.mo-logo.gemini { background: rgba(66,133,244,0.2); color: #4285f4; }
.mo-info { flex: 1; }
.mo-name { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); display: block; }
.mo-desc { font-size: 0.65rem; color: var(--text-muted); }
.mo-check { color: var(--purple); font-weight: 700; font-size: 0.9rem; }

/* ═══════════════════════════════════════════════════════════════
   PHONE MODULE
═══════════════════════════════════════════════════════════════ */
.price-preview {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; background: rgba(168,85,247,0.08);
  border: 1px solid rgba(168,85,247,0.2); border-radius: var(--radius-md);
  margin-bottom: 12px;
}
.price-label { font-size: 0.72rem; color: var(--text-muted); }
.price-val { font-size: 1rem; font-weight: 700; color: var(--purple); }

/* ═══════════════════════════════════════════════════════════════
   WORKFLOW BUILDER
═══════════════════════════════════════════════════════════════ */
.workflow-layout { display: grid; grid-template-columns: 160px 1fr 220px; gap: 12px; height: 520px; }
.workflow-palette { overflow-y: auto; }
.palette-title { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.palette-nodes { display: flex; flex-direction: column; gap: 6px; }
.palette-node {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border); background: rgba(255,255,255,0.02);
  cursor: grab; transition: var(--transition); font-size: 0.72rem; color: var(--text-secondary);
}
.palette-node:hover { border-color: rgba(168,85,247,0.3); background: var(--purple-dim); }
.palette-node:active { cursor: grabbing; }
.pn-icon { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0; }
.workflow-canvas { position: relative; overflow: hidden; }
.canvas-toolbar {
  position: absolute; top: 10px; left: 10px; z-index: 10;
  display: flex; align-items: center; gap: 4px;
  background: rgba(8,12,20,0.8); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); padding: 4px;
}
.canvas-btn {
  width: 24px; height: 24px; border-radius: 4px;
  color: var(--text-muted); font-size: 0.8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.canvas-btn:hover, .canvas-btn.active { background: var(--purple-dim); color: var(--purple); }
.canvas-sep { width: 1px; height: 16px; background: var(--glass-border); margin: 0 2px; }
.canvas-area {
  position: absolute; inset: 0; top: 44px;
  background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}
.wf-node {
  position: absolute; display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--radius-md);
  border: 1px solid var(--glass-border); background: rgba(13,17,23,0.9);
  backdrop-filter: blur(8px); cursor: grab; user-select: none;
  transition: box-shadow var(--transition); min-width: 140px;
}
.wf-node:hover { box-shadow: 0 0 16px rgba(168,85,247,0.2); border-color: rgba(168,85,247,0.3); }
.wf-node-icon { font-size: 1rem; flex-shrink: 0; }
.wf-node-body { display: flex; flex-direction: column; gap: 1px; }
.wf-node-type { font-size: 0.55rem; font-weight: 700; letter-spacing: 0.08em; color: var(--text-muted); }
.wf-node-name { font-size: 0.75rem; font-weight: 600; color: var(--text-primary); }
.wf-node-port {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--purple); border: 2px solid var(--bg-base);
  position: absolute; cursor: crosshair;
}
.wf-node-port.in { left: -5px; top: 50%; transform: translateY(-50%); }
.wf-node-port.out { right: -5px; top: 50%; transform: translateY(-50%); }
.trigger-node { border-color: rgba(168,85,247,0.3); }
.message-node { border-color: rgba(6,182,212,0.3); }
.ai-node { border-color: rgba(34,197,94,0.3); }
.condition-node { border-color: rgba(249,115,22,0.3); }
.action-node { border-color: rgba(236,72,153,0.3); }
.end-node { border-color: rgba(239,68,68,0.3); }
.workflow-props { overflow-y: auto; }
.props-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 120px; font-size: 0.72rem; color: var(--text-muted); text-align: center; }
.node-props-form { }

/* ═══════════════════════════════════════════════════════════════
   PROMPT STUDIO
═══════════════════════════════════════════════════════════════ */
.prompt-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.prompt-editor-col { display: flex; flex-direction: column; gap: 16px; }
.prompt-test-col { display: flex; flex-direction: column; }
.code-editor {
  display: flex; gap: 0;
  background: rgba(0,0,0,0.3); border-radius: var(--radius-md);
  border: 1px solid var(--glass-border); overflow: hidden;
  font-family: var(--font-mono);
}
.editor-line-nums {
  padding: 12px 10px; background: rgba(0,0,0,0.2);
  color: var(--text-muted); font-size: 0.72rem; line-height: 1.6;
  text-align: right; user-select: none; min-width: 36px;
  border-right: 1px solid var(--glass-border);
}
.editor-textarea {
  flex: 1; background: none; border: none; outline: none;
  color: #e2e8f0; font-size: 0.78rem; line-height: 1.6;
  padding: 12px; resize: none; min-height: 280px;
  font-family: var(--font-mono);
}
.editor-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; background: rgba(0,0,0,0.2);
  border-top: 1px solid var(--glass-border);
}
.token-count { font-size: 0.65rem; color: var(--text-muted); font-family: var(--font-mono); }
.editor-actions { display: flex; gap: 6px; }
.variables-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.var-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; background: rgba(255,255,255,0.02);
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
}
.var-name { font-family: var(--font-mono); font-size: 0.65rem; color: var(--cyan); flex: 1; }
.var-type { font-size: 0.6rem; color: var(--text-muted); }
.var-source {
  font-size: 0.55rem; font-weight: 700; padding: 1px 5px; border-radius: 3px;
  background: rgba(168,85,247,0.1); color: var(--purple);
}
.prompt-test-card { flex: 1; display: flex; flex-direction: column; }
.test-chat { flex: 1; overflow-y: auto; max-height: 300px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.test-msg { display: flex; flex-direction: column; gap: 4px; }
.test-msg.ai { align-items: flex-start; }
.test-msg.user { align-items: flex-end; }
.test-sender { font-size: 0.62rem; color: var(--text-muted); }
.test-msg p {
  padding: 8px 12px; border-radius: var(--radius-md); font-size: 0.75rem; line-height: 1.5; max-width: 90%;
}
.test-msg.ai p { background: rgba(168,85,247,0.1); border: 1px solid rgba(168,85,247,0.2); color: var(--text-secondary); }
.test-msg.user p { background: rgba(6,182,212,0.1); border: 1px solid rgba(6,182,212,0.2); color: var(--text-secondary); }
.test-input-row { display: flex; gap: 8px; }
.trait-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.trait-chip, .emotion-chip {
  padding: 4px 10px; border-radius: 20px; font-size: 0.68rem; font-weight: 600;
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border);
  color: var(--text-muted); cursor: pointer; transition: var(--transition);
}
.trait-chip.active, .emotion-chip.active {
  background: var(--purple-dim); border-color: rgba(168,85,247,0.3); color: var(--purple);
}

/* ═══════════════════════════════════════════════════════════════
   VOICE CONFIG
═══════════════════════════════════════════════════════════════ */
.voice-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; }
.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.voice-card {
  padding: 12px; border-radius: var(--radius-md);
  border: 1px solid var(--glass-border); background: rgba(255,255,255,0.02);
  cursor: pointer; transition: var(--transition); display: flex; flex-direction: column; gap: 8px;
}
.voice-card:hover { border-color: rgba(168,85,247,0.3); }
.voice-card.selected { border-color: rgba(168,85,247,0.5); background: var(--purple-dim); }
.voice-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: white;
}
.voice-avatar.female { background: linear-gradient(135deg, #ec4899, #a855f7); }
.voice-avatar.male { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.voice-avatar.cloned-av { background: linear-gradient(135deg, #f97316, #eab308); }
.voice-info { display: flex; flex-direction: column; gap: 2px; }
.voice-name { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.voice-provider { font-size: 0.62rem; color: var(--text-muted); }
.voice-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.vtag {
  font-size: 0.58rem; padding: 1px 5px; border-radius: 3px;
  background: rgba(255,255,255,0.05); color: var(--text-muted);
}
.vtag.clone { background: rgba(249,115,22,0.1); color: var(--orange); }
.voice-play-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--purple-dim); border: 1px solid rgba(168,85,247,0.3);
  color: var(--purple); font-size: 0.7rem; display: flex; align-items: center; justify-content: center;
  transition: var(--transition); align-self: flex-end;
}
.voice-play-btn:hover { background: var(--purple); color: white; }
.voice-waveform { margin-bottom: 12px; }
.voice-filters { display: flex; gap: 6px; }

/* ═══════════════════════════════════════════════════════════════
   KNOWLEDGE BASE
═══════════════════════════════════════════════════════════════ */
.kb-layout { display: grid; grid-template-columns: 1fr 1fr 200px; gap: 16px; align-items: start; }
.kb-upload-zone {
  border: 2px dashed rgba(168,85,247,0.3); background: rgba(168,85,247,0.03);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 32px 16px; cursor: pointer; transition: var(--transition);
  text-align: center;
}
.kb-upload-zone:hover, .kb-upload-zone.drag-over {
  border-color: rgba(168,85,247,0.6); background: rgba(168,85,247,0.08);
}
.upload-icon { opacity: 0.7; }
.upload-title { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.upload-desc { font-size: 0.7rem; color: var(--text-muted); }
.upload-types { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.utype {
  font-size: 0.6rem; font-weight: 700; padding: 2px 6px; border-radius: 4px;
  background: rgba(255,255,255,0.05); color: var(--text-muted);
}
.kb-list { display: flex; flex-direction: column; gap: 8px; }
.kb-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); background: rgba(255,255,255,0.02); }
.kb-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.55rem; font-weight: 800; flex-shrink: 0;
}
.kb-icon.pdf { background: rgba(239,68,68,0.15); color: var(--red); }
.kb-icon.doc { background: rgba(59,130,246,0.15); color: #3b82f6; }
.kb-icon.csv { background: rgba(34,197,94,0.15); color: var(--green); }
.kb-icon.url { background: rgba(168,85,247,0.15); color: var(--purple); }
.kb-info { flex: 1; min-width: 0; }
.kb-name { font-size: 0.75rem; font-weight: 600; color: var(--text-primary); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-meta { font-size: 0.62rem; color: var(--text-muted); }
.kb-status { font-size: 0.62rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.kb-status.indexed { background: rgba(34,197,94,0.1); color: var(--green); }
.kb-status.processing { background: rgba(249,115,22,0.1); color: var(--orange); }
.kb-stats { display: flex; flex-direction: column; gap: 8px; }
.kb-stat-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--glass-border); }
.kb-stat-item:last-child { border-bottom: none; }
.kbs-label { font-size: 0.72rem; color: var(--text-muted); }
.kbs-val { font-size: 0.78rem; font-weight: 700; color: var(--text-primary); }
.kbs-val.green { color: var(--green); }

/* ═══════════════════════════════════════════════════════════════
   LIVE CALLS
═══════════════════════════════════════════════════════════════ */
.live-calls-layout { display: grid; grid-template-columns: 240px 1fr 220px; gap: 12px; height: 580px; }
.live-calls-list { overflow-y: auto; }
.call-items { display: flex; flex-direction: column; gap: 4px; }
.call-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px; border-radius: var(--radius-md);
  border: 1px solid transparent; cursor: pointer; transition: var(--transition);
}
.call-item:hover { background: rgba(255,255,255,0.03); }
.call-item.selected { background: var(--purple-dim); border-color: rgba(168,85,247,0.2); }
.call-avatar {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 700; color: white; flex-shrink: 0;
}
.call-info { flex: 1; min-width: 0; }
.call-number { font-size: 0.72rem; font-weight: 600; color: var(--text-primary); display: block; }
.call-agent { font-size: 0.62rem; color: var(--text-muted); }
.call-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.call-duration { font-family: var(--font-mono); font-size: 0.7rem; color: var(--green); font-weight: 600; }
.call-sentiment { font-size: 0.8rem; }
.call-wave { display: flex; align-items: center; gap: 2px; height: 16px; }
.wave-bar {
  width: 3px; background: var(--green); border-radius: 2px;
  animation: waveAnim 0.8s ease-in-out infinite;
}
.wave-bar:nth-child(1) { height: 6px; animation-delay: 0s; }
.wave-bar:nth-child(2) { height: 12px; animation-delay: 0.1s; }
.wave-bar:nth-child(3) { height: 16px; animation-delay: 0.2s; }
.wave-bar:nth-child(4) { height: 10px; animation-delay: 0.3s; }
.wave-bar:nth-child(5) { height: 8px; animation-delay: 0.4s; }
.live-transcript { display: flex; flex-direction: column; overflow: hidden; }
.transcript-feed { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 0; margin-bottom: 12px; }
.transcript-msg { display: flex; gap: 10px; }
.msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 700; flex-shrink: 0;
}
.ai-avatar { background: linear-gradient(135deg, var(--purple), #7c3aed); color: white; }
.user-avatar { background: rgba(255,255,255,0.08); font-size: 0.9rem; }
.msg-bubble { display: flex; flex-direction: column; gap: 3px; max-width: 85%; }
.msg-sender { font-size: 0.62rem; color: var(--text-muted); font-weight: 600; }
.msg-bubble p { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.5; }
.msg-time { font-size: 0.6rem; color: var(--text-muted); font-family: var(--font-mono); }
.transcript-footer { border-top: 1px solid var(--glass-border); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.sentiment-bar { display: flex; align-items: center; gap: 8px; }
.sb-label { font-size: 0.65rem; color: var(--text-muted); white-space: nowrap; }
.sb-track { flex: 1; height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.sb-fill { height: 100%; border-radius: 2px; }
.sb-fill.positive { background: linear-gradient(90deg, var(--green), var(--cyan)); }
.sb-fill.negative { background: linear-gradient(90deg, var(--red), var(--orange)); }
.sb-val { font-size: 0.65rem; font-weight: 700; white-space: nowrap; }
.sb-val.positive { color: var(--green); }
.call-controls { display: flex; gap: 6px; justify-content: center; }
.ctrl-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
  font-size: 0.85rem; display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.ctrl-btn:hover { background: rgba(255,255,255,0.1); }
.ctrl-btn.end { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3); }
.ctrl-btn.end:hover { background: rgba(239,68,68,0.3); }
.ai-insights { overflow-y: auto; }
.insight-item { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.insight-label { font-size: 0.68rem; color: var(--text-muted); min-width: 70px; }
.insight-val { font-size: 0.75rem; font-weight: 700; color: var(--text-primary); }
.insight-val.purple { color: var(--purple); }
.insight-val.cyan { color: var(--cyan); }
.mini-bar { flex: 1; height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.mini-fill { height: 100%; background: linear-gradient(90deg, var(--purple), var(--cyan)); border-radius: 2px; }
.insight-divider { height: 1px; background: var(--glass-border); margin: 10px 0; }
.call-metric-row { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text-muted); margin-bottom: 6px; }
.metric-val { color: var(--text-primary); font-weight: 600; }
.insight-section-title { font-size: 0.65rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.suggestion-chips { display: flex; flex-direction: column; gap: 5px; }
.suggestion-chip {
  padding: 6px 10px; border-radius: var(--radius-sm);
  background: rgba(168,85,247,0.08); border: 1px solid rgba(168,85,247,0.2);
  color: var(--text-secondary); font-size: 0.68rem; text-align: left;
  transition: var(--transition);
}
.suggestion-chip:hover { background: var(--purple-dim); color: var(--purple); }

/* ═══════════════════════════════════════════════════════════════
   CALL HISTORY
═══════════════════════════════════════════════════════════════ */
.history-layout { display: grid; grid-template-columns: 280px 1fr; gap: 12px; }
.history-list { overflow-y: auto; }
.history-filters { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.history-items { display: flex; flex-direction: column; gap: 4px; }
.history-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px; border-radius: var(--radius-md);
  border: 1px solid transparent; cursor: pointer; transition: var(--transition);
}
.history-item:hover { background: rgba(255,255,255,0.03); }
.history-item.selected { background: var(--purple-dim); border-color: rgba(168,85,247,0.2); }
.hi-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.hi-status.completed { background: var(--green); }
.hi-status.transferred { background: var(--orange); }
.hi-status.failed { background: var(--red); }
.hi-info { flex: 1; }
.hi-number { font-size: 0.75rem; font-weight: 600; color: var(--text-primary); display: block; }
.hi-agent { font-size: 0.62rem; color: var(--text-muted); }
.hi-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.hi-time { font-size: 0.62rem; color: var(--text-muted); }
.hi-sentiment { font-size: 0.8rem; }
.history-detail { display: flex; flex-direction: column; gap: 12px; }
.detail-actions { display: flex; gap: 6px; }
.ai-summary-box {
  background: rgba(168,85,247,0.06); border: 1px solid rgba(168,85,247,0.15);
  border-radius: var(--radius-md); padding: 12px;
}
.summary-header { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.summary-icon { font-size: 0.9rem; }
.summary-title { font-size: 0.75rem; font-weight: 700; color: var(--purple); }
.summary-text { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 10px; }
.summary-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.stag {
  font-size: 0.62rem; font-weight: 600; padding: 2px 8px; border-radius: 20px;
  background: rgba(168,85,247,0.1); border: 1px solid rgba(168,85,247,0.2); color: var(--purple);
}
.detail-transcript { }
.dt-title { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.dt-messages { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.dt-msg { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.5; padding: 6px 10px; border-radius: var(--radius-sm); }
.dt-msg.ai { background: rgba(168,85,247,0.05); }
.dt-msg.user { background: rgba(6,182,212,0.05); }

/* ═══════════════════════════════════════════════════════════════
   ANALYTICS
═══════════════════════════════════════════════════════════════ */
.analytics-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 16px; }
.kpi-card {
  background: var(--bg-card); backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  padding: 14px; display: flex; flex-direction: column; gap: 4px;
  transition: var(--transition);
}
.kpi-card:hover { border-color: rgba(168,85,247,0.2); transform: translateY(-2px); }
.kpi-icon { font-size: 1.2rem; }
.kpi-val { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--text-primary); }
.kpi-label { font-size: 0.65rem; color: var(--text-muted); }
.kpi-trend { font-size: 0.62rem; font-weight: 600; }
.kpi-trend.up { color: var(--green); }
.kpi-trend.down { color: var(--red); }
.analytics-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.analytics-chart-card { }
.perf-bar-cell { display: flex; align-items: center; gap: 8px; }
.perf-bar { height: 4px; background: linear-gradient(90deg, var(--purple), var(--cyan)); border-radius: 2px; }

/* ═══════════════════════════════════════════════════════════════
   LANGUAGES
═══════════════════════════════════════════════════════════════ */
.lang-grid-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.lang-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-md);
  border: 1px solid var(--glass-border); background: rgba(255,255,255,0.02);
  cursor: pointer; transition: var(--transition);
}
.lang-item:hover { border-color: rgba(168,85,247,0.3); }
.lang-item.active { background: var(--purple-dim); border-color: rgba(168,85,247,0.3); }
.lang-flag { font-size: 1rem; }
.lang-name { font-size: 0.72rem; font-weight: 600; color: var(--text-primary); flex: 1; }
.lang-code { font-size: 0.58rem; color: var(--text-muted); font-family: var(--font-mono); }
.lang-stats { display: flex; flex-direction: column; gap: 10px; }
.ls-item { display: flex; align-items: center; gap: 10px; font-size: 0.72rem; color: var(--text-muted); }
.ls-bar { flex: 1; height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.ls-fill { height: 100%; background: linear-gradient(90deg, var(--purple), var(--cyan)); border-radius: 3px; }

/* ═══════════════════════════════════════════════════════════════
   INTEGRATIONS
═══════════════════════════════════════════════════════════════ */
.integrations-layout { display: flex; flex-direction: column; gap: 20px; }
.int-category { }
.int-cat-title { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; }
.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.int-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--radius-md);
  border: 1px solid var(--glass-border); background: rgba(255,255,255,0.02);
  cursor: pointer; transition: var(--transition);
}
.int-card:hover:not(.connected) { border-color: rgba(168,85,247,0.3); background: var(--purple-dim); }
.int-card.connected { border-color: rgba(34,197,94,0.2); background: rgba(34,197,94,0.03); cursor: default; }
.int-logo {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 800; flex-shrink: 0;
}
.int-logo.openai { background: rgba(16,163,127,0.2); color: #10a37f; }
.int-logo.claude { background: rgba(210,140,100,0.2); color: #d28c64; }
.int-logo.gemini { background: rgba(66,133,244,0.2); color: #4285f4; }
.int-logo.deepseek { background: rgba(168,85,247,0.2); color: var(--purple); }
.int-logo.twilio { background: rgba(239,68,68,0.2); color: var(--red); }
.int-logo.sip { background: rgba(6,182,212,0.2); color: var(--cyan); }
.int-logo.elevenlabs { background: rgba(249,115,22,0.2); color: var(--orange); }
.int-logo.deepgram { background: rgba(34,197,94,0.2); color: var(--green); }
.int-logo.cartesia { background: rgba(236,72,153,0.2); color: var(--pink); }
.int-logo.whisper { background: rgba(255,255,255,0.1); color: var(--text-secondary); }
.int-logo.hubspot { background: rgba(249,115,22,0.2); color: var(--orange); }
.int-logo.zapier { background: rgba(249,115,22,0.2); color: var(--orange); }
.int-logo.whatsapp { background: rgba(34,197,94,0.2); color: var(--green); }
.int-logo.slack { background: rgba(236,72,153,0.2); color: var(--pink); }
.int-logo.api { background: rgba(168,85,247,0.2); color: var(--purple); }
.int-logo.webhook { background: rgba(6,182,212,0.2); color: var(--cyan); }
.int-info { flex: 1; min-width: 0; }
.int-name { font-size: 0.78rem; font-weight: 600; color: var(--text-primary); display: block; }
.int-desc { font-size: 0.62rem; color: var(--text-muted); }
.int-status { font-size: 0.62rem; font-weight: 700; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.int-status.connected { background: rgba(34,197,94,0.1); color: var(--green); }

/* ═══════════════════════════════════════════════════════════════
   SETTINGS
═══════════════════════════════════════════════════════════════ */
.settings-tabs-layout { display: grid; grid-template-columns: 160px 1fr; gap: 16px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.sn-item {
  padding: 8px 12px; border-radius: var(--radius-md);
  font-size: 0.78rem; color: var(--text-secondary); cursor: pointer;
  transition: var(--transition);
}
.sn-item:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.sn-item.active { background: var(--purple-dim); color: var(--purple); font-weight: 600; }
.stab { display: none; }
.stab.active { display: block; }
.stab-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 14px; font-family: var(--font-display); }
.stab-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.settings-section-title { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--glass-border); }
.setting-row:last-child { border-bottom: none; }
.setting-info { display: flex; flex-direction: column; gap: 2px; }
.setting-name { font-size: 0.78rem; font-weight: 600; color: var(--text-primary); }
.setting-desc { font-size: 0.65rem; color: var(--text-muted); }
.team-list { display: flex; flex-direction: column; gap: 8px; }
.team-member { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); }
.tm-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: white; flex-shrink: 0;
}
.tm-info { flex: 1; }
.tm-name { font-size: 0.78rem; font-weight: 600; color: var(--text-primary); display: block; }
.tm-email { font-size: 0.65rem; color: var(--text-muted); }
.tm-role { font-size: 0.62rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.tm-role.admin { background: rgba(168,85,247,0.1); color: var(--purple); }
.tm-role.manager { background: rgba(6,182,212,0.1); color: var(--cyan); }
.tm-role.viewer { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.billing-plan-card {
  background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(6,182,212,0.1));
  border: 1px solid rgba(168,85,247,0.3); border-radius: var(--radius-lg);
  padding: 20px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px;
}
.plan-badge { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.1em; color: var(--purple); }
.plan-price { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--text-primary); }
.plan-price span { font-size: 0.9rem; color: var(--text-muted); }
.plan-features { display: flex; flex-direction: column; gap: 4px; }
.plan-features span { font-size: 0.72rem; color: var(--text-secondary); }
.usage-breakdown { display: flex; flex-direction: column; gap: 8px; }
.ub-item { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); padding: 6px 0; border-bottom: 1px solid var(--glass-border); }
.ub-item:last-child { border-bottom: none; }
.api-keys-list { display: flex; flex-direction: column; gap: 10px; }
.api-key-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; background: rgba(255,255,255,0.02); border-radius: var(--radius-md); gap: 12px; flex-wrap: wrap; }
.ak-info { display: flex; flex-direction: column; gap: 4px; }
.ak-name { font-size: 0.78rem; font-weight: 600; color: var(--text-primary); }
.ak-key { font-size: 0.68rem; color: var(--text-muted); }
.ak-actions { display: flex; align-items: center; gap: 8px; }
.ak-created { font-size: 0.62rem; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   DATA TABLE
═══════════════════════════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.data-table th {
  text-align: left; padding: 8px 12px;
  font-size: 0.65rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--glass-border);
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.03); color: var(--text-secondary); }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.data-table tr:last-child td { border-bottom: none; }
.mono { font-family: var(--font-mono); font-size: 0.7rem; }

/* Filter Buttons */
.filter-btn {
  padding: 5px 12px; border-radius: 20px; font-size: 0.72rem; font-weight: 600;
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border);
  color: var(--text-muted); transition: var(--transition);
}
.filter-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-secondary); }
.filter-btn.active { background: var(--purple-dim); border-color: rgba(168,85,247,0.3); color: var(--purple); }

/* ═══════════════════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  width: 480px; max-width: 90vw; max-height: 85vh;
  overflow-y: auto; transform: scale(0.95);
  transition: var(--transition);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); font-family: var(--font-display); }
.modal-close {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.06); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; font-size: 0.75rem;
  transition: var(--transition);
}
.modal-close:hover { background: rgba(239,68,68,0.2); color: var(--red); }
.modal-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--glass-border); padding-bottom: 10px; }
.modal-tab {
  padding: 5px 12px; border-radius: 20px; font-size: 0.72rem; font-weight: 600;
  color: var(--text-muted); transition: var(--transition);
}
.modal-tab.active { background: var(--purple-dim); color: var(--purple); }
.modal-body { margin-bottom: 16px; }
.mtab { display: none; }
.mtab.active { display: block; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--glass-border); padding-top: 14px; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
  .bottom-row { grid-template-columns: 1fr 1fr; }
  .analytics-kpis { grid-template-columns: repeat(3, 1fr); }
  .analytics-charts { grid-template-columns: 1fr; }
  .live-calls-layout { grid-template-columns: 220px 1fr; }
  .ai-insights { display: none; }
  .kb-layout { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 220px; }
  .two-col-layout { grid-template-columns: 1fr; }
  .col-side { }
  .workflow-layout { grid-template-columns: 1fr; height: auto; }
  .workflow-palette, .workflow-props { display: none; }
  .workflow-canvas { height: 400px; }
  .prompt-layout { grid-template-columns: 1fr; }
  .voice-layout { grid-template-columns: 1fr; }
  .history-layout { grid-template-columns: 1fr; }
  .lang-grid-layout { grid-template-columns: 1fr; }
  .settings-tabs-layout { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform var(--transition-slow); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-wrapper { margin-left: 0 !important; }
  .mobile-menu-btn { display: flex; }
  .status-indicator { display: none; }
  .header-center { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .bottom-row { grid-template-columns: 1fr; }
  .analytics-kpis { grid-template-columns: repeat(2, 1fr); }
  .live-calls-layout { grid-template-columns: 1fr; }
  .live-calls-list { max-height: 200px; }
  .agents-grid { grid-template-columns: 1fr 1fr; }
  .int-grid { grid-template-columns: 1fr; }
  .kb-layout { grid-template-columns: 1fr; }
  .content-area { padding: 12px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .agents-grid { grid-template-columns: 1fr; }
  .analytics-kpis { grid-template-columns: 1fr 1fr; }
  .module-header { flex-direction: column; }
  .module-actions { width: 100%; }
}