/* ==========================================================================
   VoiceAgent Admin Dashboard - Premium Dark Glassmorphism CSS
   ========================================================================== */

:root {
  --bg-main: #070a12;
  --bg-surface: rgba(16, 23, 38, 0.7);
  --bg-surface-hover: rgba(26, 38, 62, 0.85);
  --bg-card: rgba(18, 26, 43, 0.65);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-card-border-glow: rgba(99, 102, 241, 0.35);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);
  
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;
  --accent-cyan: #06b6d4;

  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.12), transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(168, 85, 247, 0.08), transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.04), transparent 50%);
  background-attachment: fixed;
}

/* ================= AUTH OVERLAY ================= */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 18, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(22, 32, 54, 0.75);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 40px rgba(99, 102, 241, 0.15);
  animation: authSlideUp 0.35s ease-out forwards;
}

@keyframes authSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 28px;
}

.brand-badge {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 14px;
  box-shadow: 0 0 25px var(--primary-glow);
}

.brand-text h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-text h1 span {
  color: var(--primary);
  margin-left: 2px;
}

.brand-text p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.auth-form .form-group {
  margin-bottom: 18px;
}

.auth-error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fda4af;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
}

.auth-footer-hint {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.auth-footer-hint code {
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* ================= HEADER ================= */
.app-header {
  height: 68px;
  background: rgba(14, 21, 37, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--bg-card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 16px var(--primary-glow);
}

.logo-name .title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.badge-role {
  font-size: 10px;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  margin-left: 6px;
  letter-spacing: 0.05em;
}

.system-pills {
  display: flex;
  gap: 10px;
  margin-left: 12px;
}

.pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
}

.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.pill-success .dot {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.pill-info .dot {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 14px;
  border-left: 1px solid var(--bg-card-border);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ================= NAV TABS ================= */
.app-nav {
  background: rgba(11, 17, 30, 0.6);
  border-bottom: 1px solid var(--bg-card-border);
  padding: 0 28px;
}

.nav-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
}

.nav-tab.active {
  color: #fff;
  border-bottom-color: var(--primary);
  background: rgba(99, 102, 241, 0.06);
}

.tab-badge {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.nav-tab.active .tab-badge {
  background: var(--primary);
  color: #fff;
}

/* ================= MAIN CONTENT ================= */
.app-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px;
}

.tab-content {
  display: none;
  animation: fadeIn 0.2s ease-out forwards;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Section Top Bar */
.section-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-heading {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-subtext {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ================= METRICS GRID ================= */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.metric-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.bg-indigo { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.bg-emerald { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.bg-amber { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.bg-purple { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

.metric-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.metric-subtext {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 8px;
}

.trend-up {
  color: #34d399;
  font-weight: 600;
}

/* ================= PANEL CARDS & TOOLBARS ================= */
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.toolbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 14px;
}

.filter-group, .action-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  background: rgba(11, 16, 28, 0.7);
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 8px 14px 8px 38px;
  font-size: 13.5px;
  width: 280px;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ================= TABLES ================= */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.data-table th {
  padding: 12px 16px;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--bg-card-border);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.02);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.empty-state {
  text-align: center;
  padding: 40px !important;
  color: var(--text-muted);
  font-style: italic;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  text-transform: capitalize;
}

.badge-transferred { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-completed { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-dnc { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-in-progress { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

.audio-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.tag-fastpath { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.tag-tts { background: rgba(168, 85, 247, 0.12); color: #c084fc; }

/* Pagination */
.pagination-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--bg-card-border);
  font-size: 12.5px;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ================= AI BOTS GRID ================= */
.bots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 22px;
}

.bot-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.bot-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-3px);
}

.bot-card.active-primary {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 12px 35px -10px rgba(99, 102, 241, 0.25);
}

.bot-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.bot-profile {
  display: flex;
  gap: 14px;
  align-items: center;
}

.bot-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #4f46e5, #9333ea);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.bot-name-row h3 {
  font-size: 16px;
  font-weight: 700;
}

.bot-name-row p {
  font-size: 12px;
  color: var(--text-secondary);
}

.primary-badge {
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.bot-card-body {
  margin-bottom: 20px;
}

.bot-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.bot-info-cell {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

.bot-info-cell .lbl {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.bot-info-cell .val {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bot-greeting-preview {
  font-size: 12px;
  background: rgba(0, 0, 0, 0.25);
  border-left: 3px solid var(--primary);
  padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #cbd5e1;
  font-style: italic;
}

.bot-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--bg-card-border);
}

/* ================= DIALER DETAILS ================= */
.dialer-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .dialer-layout-grid {
    grid-template-columns: 1fr;
  }
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 13px;
}

.info-item .label {
  color: var(--text-secondary);
}

.info-item .value {
  font-weight: 600;
}

.info-item .value.highlight {
  color: #38bdf8;
}

.telephony-flow-diagram {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
  background: rgba(0, 0, 0, 0.25);
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 90px;
}

.flow-step .step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.flow-step strong {
  font-size: 11.5px;
}

.flow-step small {
  font-size: 10px;
  color: var(--text-muted);
}

.flow-arrow {
  color: var(--text-muted);
  font-size: 14px;
}

/* ================= KNOWLEDGE BASE ================= */
.kb-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .kb-editor-grid {
    grid-template-columns: 1fr;
  }
}

.panel-header-with-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bg-card-border);
}

.badge-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.tier-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.custom-faq-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.custom-faq-item .faq-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

/* ================= BUTTONS & INPUTS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--bg-card-border);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger-ghost {
  background: transparent;
  color: #fb7185;
}

.btn-danger-ghost:hover {
  background: rgba(244, 63, 94, 0.1);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 11.5px;
}

.btn-block {
  width: 100%;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-text, .textarea-input, .select-dropdown {
  width: 100%;
  background: rgba(10, 15, 26, 0.7);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: var(--transition);
}

.input-text:focus, .textarea-input:focus, .select-dropdown:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrapper svg {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
}

.input-icon-wrapper input {
  width: 100%;
  background: rgba(10, 15, 26, 0.7);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px 10px 38px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: var(--transition);
}

.input-icon-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.form-checkbox input {
  cursor: pointer;
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

.input-action-row {
  display: flex;
  gap: 8px;
}

.font-mono {
  font-family: var(--font-mono) !important;
}

.divider {
  height: 1px;
  background: var(--bg-card-border);
  margin: 18px 0;
}

.alert-banner {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}

.alert-banner.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.alert-banner.error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fda4af;
}

/* ================= DIALPAD ================= */
.dialpad-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .dialpad-layout-grid {
    grid-template-columns: 1fr;
  }
}

.pill-warning .dot {
  background: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}

.pill-danger .dot {
  background: var(--accent-rose);
  box-shadow: 0 0 8px var(--accent-rose);
}

.dialpad-display {
  text-align: center;
  font-size: 22px;
  letter-spacing: 1px;
  font-family: var(--font-mono);
  margin-bottom: 18px;
  cursor: default;
}

.dialpad-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.dialpad-key {
  aspect-ratio: 1;
  border: 1px solid var(--bg-card-border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.dialpad-key:hover { background: rgba(255, 255, 255, 0.09); }
.dialpad-key:active { background: var(--primary); }

.dialpad-key .sub {
  display: block;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.dialpad-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.dialpad-actions .btn {
  flex: 1;
}

/* ================= MODALS & DRAWERS ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-dialog {
  width: 100%;
  max-width: 620px;
  background: rgba(18, 26, 45, 0.95);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-dialog.modal-lg {
  max-width: 820px;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header, .drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--bg-card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer, .drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--bg-card-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.btn-close:hover {
  color: #fff;
}

/* Side Drawer Panel */
.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 580px;
  background: rgba(14, 21, 38, 0.96);
  border-left: 1px solid var(--bg-card-border);
  box-shadow: -15px 0 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  animation: drawerSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes drawerSlide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-meta-bar {
  display: flex;
  gap: 10px;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--bg-card-border);
  flex-wrap: wrap;
}

.drawer-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Chat Stream in Drawer */
.chat-turn {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  line-height: 1.45;
  max-width: 85%;
  position: relative;
}

.chat-bubble.user {
  align-self: flex-end;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-bottom-right-radius: 4px;
}

.chat-bubble.agent {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  border-bottom-left-radius: 4px;
}

.bubble-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.bubble-author {
  font-weight: 700;
  font-size: 11px;
  margin-bottom: 3px;
  color: var(--text-secondary);
}

.chat-bubble.agent .bubble-author {
  color: #818cf8;
}

.chat-bubble.user .bubble-author {
  color: #60a5fa;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .app-header { padding: 0 16px; }
  .system-pills { display: none; }
  .app-main { padding: 16px; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .drawer-panel { max-width: 100%; }
}
