/* ==========================================================================
   Botanika Bharat CloudPBX & Telephony Platform - Design System
   Modern Carrier-Grade Dark Glassmorphic Aesthetic
   ========================================================================== */

:root {
  --bg-primary: #0a0f1d;
  --bg-secondary: #111827;
  --bg-tertiary: #1f293d;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 61, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.04);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(34, 197, 94, 0.4);
  --border-active: #22c55e;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-wa: #25d366;
  --accent-wa-glow: rgba(37, 211, 102, 0.25);
  --accent-sip: #0ea5e9;
  --accent-sip-glow: rgba(14, 165, 233, 0.25);
  --accent-int: #8b5cf6;
  --accent-int-glow: rgba(139, 92, 246, 0.25);
  --accent-warn: #f59e0b;
  --accent-danger: #ef4444;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(14, 165, 233, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(37, 211, 102, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(139, 92, 246, 0.05) 0px, transparent 60%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* App Layout */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 20;
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #22c55e, #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
}

.brand-text h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
  line-height: 1.2;
}

.brand-text span {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.nav-links {
  list-style: none;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.nav-item:hover {
  background: var(--bg-tertiary);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(37, 211, 102, 0.15), rgba(14, 165, 233, 0.1));
  color: #fff;
  border-left: 3px solid var(--accent-wa);
  font-weight: 600;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-item.active svg {
  opacity: 1;
  color: var(--accent-wa);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(10, 15, 29, 0.6);
}

.agent-presence-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
}

.presence-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
}

.status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-tertiary);
}
.status-dot.online { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.status-dot.in_call { background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.status-dot.away { background: #f59e0b; }
.status-dot.offline { background: #64748b; }

.presence-info {
  flex: 1;
  min-width: 0;
}
.presence-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.presence-ext {
  font-size: 11px;
  color: var(--text-muted);
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* Header */
.topbar {
  height: 64px;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
}

.system-badge-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sys-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}
.sys-badge.domain {
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.25);
}
.sys-badge.port {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.25);
}
.sys-badge.active-pulse::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-open-softphone {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: var(--transition);
}
.btn-open-softphone:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* Page Containers */
.content-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards & Glass Containers */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Stat Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-icon.green { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.stat-icon.blue { background: rgba(14, 165, 233, 0.15); color: #0ea5e9; }
.stat-icon.purple { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.stat-icon.amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

.stat-val {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.stat-lbl {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Table Design */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(10, 15, 29, 0.4);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 16px;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
}
.badge-inbound { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.badge-outbound { background: rgba(14, 165, 233, 0.15); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.3); }
.badge-internal { background: rgba(139, 92, 246, 0.15); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.3); }

.badge-whatsapp { background: rgba(37, 211, 102, 0.15); color: #25d366; }
.badge-voice { background: rgba(14, 165, 233, 0.15); color: #38bdf8; }

.mos-badge {
  font-weight: 700;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
}
.mos-high { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.mos-med { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.mos-low { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* Audio Waveform Player Controls */
.audio-cell-player {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.btn-play-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-wa);
  color: #000;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}
.btn-play-mini:hover {
  transform: scale(1.08);
  box-shadow: 0 0 12px var(--accent-wa-glow);
}

.mini-waveform-canvas {
  width: 110px;
  height: 24px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.audio-dur {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
}
.btn-primary:hover {
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}
.btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
}
.btn-success:hover {
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.4);
}
.btn-outline {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-muted);
}
.btn-outline:hover {
  background: var(--bg-tertiary);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}
.btn-danger-outline {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}
.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* Forms & Inputs */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input, .form-select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fff;
  font-size: 13.5px;
  font-family: inherit;
  transition: var(--transition);
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.form-hint {
  font-size: 11px;
  color: var(--text-dim);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .3s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--accent-wa);
}
input:checked + .slider:before {
  transform: translateX(20px);
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}
.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Floating WebRTC Softphone Drawer */
.softphone-dock {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 360px;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(14, 165, 233, 0.15);
  z-index: 90;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.softphone-dock.minimized {
  transform: translateY(calc(100% - 56px));
}

.softphone-header {
  padding: 14px 18px;
  background: linear-gradient(90deg, #1e293b, #0f172a);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.softphone-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
}

.softphone-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dialer-display {
  background: #0a0f1d;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: right;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 20px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 1px;
}

.dialer-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.keypad-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.keypad-btn:hover {
  background: #334155;
  border-color: rgba(255, 255, 255, 0.2);
}
.keypad-btn:active {
  transform: scale(0.96);
}

.call-action-row {
  display: flex;
  gap: 10px;
}

.btn-call {
  flex: 1;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.4);
}
.btn-call:hover {
  filter: brightness(1.1);
}

.btn-hangup {
  flex: 1;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.active-call-overlay {
  display: none;
  background: #0f172a;
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.active-call-timer {
  font-size: 26px;
  font-weight: 800;
  color: #38bdf8;
  font-variant-numeric: tabular-nums;
  margin: 6px 0;
}

.live-audio-meter {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin: 10px 0;
}
.live-audio-bar {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #22c55e, #38bdf8);
  transition: width 0.1s ease;
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar { width: 70px; }
  .sidebar-header .brand-text, .nav-item span, .sidebar-footer { display: none; }
  .topbar { padding: 0 16px; }
  .content-body { padding: 16px; }
  .softphone-dock { width: 320px; right: 12px; bottom: 12px; }
}

/* --- Branded Ringback & Automated Audio Pipeline Styling --- */
.audio-hero-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.audio-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #22c55e, #38bdf8, #a855f7);
}

.soundwave-container {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 28px;
  padding: 0 8px;
}

.soundwave-bar {
  width: 4px;
  height: 30%;
  background: #38bdf8;
  border-radius: 2px;
  animation: soundwave-pulse 1.2s infinite ease-in-out alternate;
}
.soundwave-bar:nth-child(2) { animation-delay: 0.15s; height: 60%; }
.soundwave-bar:nth-child(3) { animation-delay: 0.3s; height: 90%; background: #22c55e; }
.soundwave-bar:nth-child(4) { animation-delay: 0.45s; height: 50%; }
.soundwave-bar:nth-child(5) { animation-delay: 0.6s; height: 80%; background: #a855f7; }
.soundwave-bar:nth-child(6) { animation-delay: 0.75s; height: 40%; }
.soundwave-bar:nth-child(7) { animation-delay: 0.9s; height: 100%; background: #38bdf8; }
.soundwave-bar:nth-child(8) { animation-delay: 1.05s; height: 35%; }

@keyframes soundwave-pulse {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1); }
}

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.pipeline-step-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
  transition: all var(--transition-fast);
}

.pipeline-step-card:hover {
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateY(-2px);
  background: rgba(30, 41, 59, 0.8);
}

.pipeline-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
}

.upload-dropzone {
  border: 2px dashed rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  background: rgba(15, 23, 42, 0.5);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.code-snippet-dark {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-family: 'Fira Code', monospace;
  font-size: 12px;
  color: #38bdf8;
  overflow-x: auto;
  line-height: 1.6;
}

/* --- Authentication Gateway Overlay & Modal --- */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 15, 29, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.auth-overlay.hidden {
  display: none !important;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.15);
  border-radius: 18px;
  padding: 34px 30px;
  position: relative;
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-brand-logo {
  font-size: 38px;
  margin-bottom: 8px;
  display: inline-block;
  animation: pulse 2s infinite ease-in-out;
}

.auth-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.auth-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.auth-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  margin-bottom: 16px;
  text-align: center;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  opacity: 0.6;
  pointer-events: none;
}

.input-with-icon .form-input {
  padding-left: 36px;
  width: 100%;
}

.btn-toggle-eye {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.7;
}

.btn-auth-submit {
  width: 100%;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  margin-top: 8px;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}

.quick-credentials {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.quick-cred-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.quick-cred-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cred-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cred-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #fff;
}

.cred-chip.admin {
  border-color: rgba(234, 179, 8, 0.3);
  color: #fde047;
}

.cred-chip.admin:hover {
  background: rgba(234, 179, 8, 0.15);
  border-color: #eab308;
}

/* --- Authentication Gateway Overlay & Modal --- */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 15, 29, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.auth-overlay.hidden {
  display: none !important;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.15);
  border-radius: 18px;
  padding: 34px 30px;
  position: relative;
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-brand-logo {
  font-size: 38px;
  margin-bottom: 8px;
  display: inline-block;
}

.auth-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.auth-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.auth-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  margin-bottom: 16px;
  text-align: center;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  opacity: 0.6;
  pointer-events: none;
}

.input-with-icon .form-input {
  padding-left: 36px;
  width: 100%;
}

.btn-toggle-eye {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.7;
}

.btn-auth-submit {
  width: 100%;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  margin-top: 8px;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}

.quick-credentials {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.quick-cred-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.quick-cred-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cred-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cred-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #fff;
}

.cred-chip.admin {
  border-color: rgba(234, 179, 8, 0.3);
  color: #fde047;
}

.cred-chip.admin:hover {
  background: rgba(234, 179, 8, 0.15);
  border-color: #eab308;
}

/* ==========================================================================
   Internal Team Directory - Filter Pills & Status Badges
   ========================================================================== */
.dir-pills-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dir-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.dir-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.dir-pill.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.dir-pill.pill-online.active {
  background: rgba(34, 197, 94, 0.15);
  border-color: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}

.dir-pill.pill-offline.active {
  background: rgba(148, 163, 184, 0.15);
  border-color: #94a3b8;
  box-shadow: 0 0 12px rgba(148, 163, 184, 0.25);
}

.dir-pill.pill-left.active {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

.dir-pill-count {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.dir-pill.active .dir-pill-count {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Status Badges */
.badge-status-online {
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-status-offline {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
}

.badge-status-left {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: line-through;
}

/* Outbound Route Badges */
.badge-route-wa {
  background: rgba(37, 211, 102, 0.12);
  color: #25d366;
  border: 1px solid rgba(37, 211, 102, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-route-voice {
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-route-inherit {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
}

/* CDR Modal Tab Navigation */
.cdr-tabs-bar {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
  padding-bottom: 2px;
}

.cdr-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.cdr-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.cdr-tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.cdr-log-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 6px;
  font-family: 'Fira Code', monospace;
  font-size: 12px;
  border-left: 3px solid #38bdf8;
}

.cdr-log-entry.level-WARN { border-left-color: #fbbf24; }
.cdr-log-entry.level-ERROR { border-left-color: #f87171; }
.cdr-log-entry.level-INFO { border-left-color: #38bdf8; }

.cdr-log-time {
  color: #64748b;
  white-space: nowrap;
  font-size: 11px;
}

.cdr-log-event {
  color: #38bdf8;
  font-weight: 700;
  min-width: 140px;
}

.cdr-log-detail {
  color: #cbd5e1;
  flex: 1;
}

