:root {
  --bg-main: #0b0f19;
  --bg-card: #131b2e;
  --bg-card-hover: #18223a;
  --bg-card-subtle: #0e1626;
  --bg-input: #0e1526;
  --border-color: #23304d;
  --border-focus: #3b82f6;

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

  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.25);

  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  --warning: #f59e0b;
  --purple: #8b5cf6;
  --rose: #f43f5e;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(59, 130, 246, 0.09) 0%, transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(139, 92, 246, 0.07) 0%, transparent 40%);
  background-attachment: fixed;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

.hidden {
  display: none !important;
}

/* ==========================================
   BUTTONS & BADGES
========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4f94fc 0%, #1d4ed8 100%);
  box-shadow: 0 6px 20px var(--primary-glow);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: #1e293b;
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background: #28364e;
  border-color: #3b4d6e;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--danger-glow);
}
.btn-danger:hover {
  background: linear-gradient(135deg, #f87171 0%, #b91c1c 100%);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background: #1e293b;
  color: #fff;
}

.badge-neutral {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid var(--border-color);
}

.badge-success-pill {
  font-size: 11px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
}

.badge-danger-pill {
  font-size: 11px;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
}

.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-xs { font-size: 11px; }

/* ==========================================
   AUTH SCREEN
========================================== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  animation: fadeIn 0.4s ease-out;
}

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

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
  color: var(--primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
  margin-bottom: 16px;
}

.auth-title {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-hint {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

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

.input-with-icon svg {
  position: absolute;
  left: 12px;
  color: var(--text-dim);
  pointer-events: none;
}

.input-with-icon input {
  padding-left: 40px !important;
}

input[type="text"],
input[type="password"],
input[type="number"],
select.form-select {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-main);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  font-family: inherit;
}

select.form-select option {
  background-color: #0e1526;
  color: #fff;
}

input:focus,
select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.password-input-group {
  display: flex;
  gap: 8px;
}
.password-input-group input { flex: 1; }

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}

.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* ==========================================
   APP HEADER & 6 NAVIGATION TABS
========================================== */
.app-header {
  height: 68px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(19, 27, 46, 0.9);
  backdrop-filter: blur(14px);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  line-height: 1.2;
}

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

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  background: #0e1526;
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: 10px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background: #1e293b;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.nav-counter {
  font-size: 10px;
  background: #334155;
  color: #cbd5e1;
  padding: 1px 5px;
  border-radius: 8px;
}

.counter-active {
  background: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.counter-danger {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.pulse-dot-red {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: pulseRed 1.5s infinite;
}

@keyframes pulseRed {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-clock-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0e1526;
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #93c5fd;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--border-color);
}

.user-badge {
  background: #1e293b;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

/* Tab Panes */
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.25s ease-out; }

/* ==========================================
   LAYOUT & KPI GRIDS
========================================== */
.main-content {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px;
}

.dashboard-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.section-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}

.system-status-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.status-online {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.status-online .status-dot { background: #10b981; box-shadow: 0 0 8px #10b981; }

.status-offline {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.status-offline .status-dot { background: #64748b; }

.status-protected {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.status-protected .status-dot { background: #f59e0b; }

.status-live-indicator {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.status-neutral {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid var(--border-color);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: #3b4d6e;
}

.stat-card-security {
  border-color: rgba(244, 63, 94, 0.3);
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.05) 0%, var(--bg-card) 100%);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-blue { background: rgba(59, 130, 246, 0.12); color: var(--primary); }
.icon-green { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.icon-purple { background: rgba(139, 92, 246, 0.12); color: var(--purple); }
.icon-amber { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.icon-rose { background: rgba(244, 63, 94, 0.12); color: var(--rose); }

.kpi-period-toggle {
  display: flex;
  background: #0e1526;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.kpi-btn {
  background: transparent;
  border: none;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.kpi-btn.active { background: #1e293b; color: #fff; }

.stat-info { display: flex; flex-direction: column; }
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-val-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 2px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  font-family: 'Outfit', sans-serif;
}

.stat-subtext {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ==========================================
   LIVE MONITORING & BLF MATRIX
========================================== */
.blf-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.blf-legend-item { display: flex; align-items: center; gap: 6px; }
.dot-idle { background: #10b981; box-shadow: 0 0 6px #10b981; }
.dot-ringing { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; animation: pulse 1s infinite; }
.dot-busy { background: #ef4444; box-shadow: 0 0 6px #ef4444; }
.dot-offline { background: #64748b; }

.line-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.line-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.line-card-idle { border-color: rgba(16, 185, 129, 0.3); }
.line-card-idle:hover { border-color: #10b981; background: rgba(16, 185, 129, 0.04); }

.line-card-ringing {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.06);
  animation: pulseRing 1.2s infinite;
}

@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.line-card-busy {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.06);
}

.line-card-offline {
  opacity: 0.6;
}

.line-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.line-ext-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.line-info-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.line-active-call-box {
  background: #090e1a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================
   DIAGNOSTICS & TERMINAL LOG VIEWER
========================================== */
.quick-actions-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

.log-select {
  padding: 6px 12px;
  font-size: 13px;
  min-width: 320px;
}

.log-controls-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.log-search {
  max-width: 220px;
}
.log-search input {
  padding: 6px 10px;
  font-size: 12px;
}

.terminal-wrapper {
  background: #070b14;
  border: 1px solid #1e293b;
  border-radius: var(--radius-sm);
  padding: 14px;
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.7);
}

.terminal-box {
  height: 380px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.terminal-line {
  word-break: break-all;
  white-space: pre-wrap;
}

.log-error { color: #f87171; }
.log-warning { color: #fbbf24; }
.log-notice { color: #93c5fd; }
.log-sip { color: #34d399; font-weight: 500; }

/* ==========================================
   ANALYTICS & CHARTS
========================================== */
.dashboard-analytics-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card,
.highlights-card,
.recent-cdr-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.card-header-between {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 14px;
}

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-dim);
}

.chart-legend-custom {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-blue { background: #3b82f6; }
.dot-red { background: #ef4444; }
.dot-green { background: #10b981; }

.chart-container {
  position: relative;
  height: 270px;
  width: 100%;
}

.direction-stat-item { margin-bottom: 18px; }
.direction-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}
.direction-name { color: var(--text-muted); }
.direction-val { font-weight: 600; color: #fff; }

.progress-bar-bg {
  height: 7px;
  background: #0e1526;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
}

.progress-bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.fill-blue { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.fill-purple { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.fill-rose { background: linear-gradient(90deg, #f43f5e, #fb7185); }

.efficiency-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.eff-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #10b981;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.08);
}

.eff-num {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.eff-label {
  font-size: 8px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}

.eff-details h4 { font-size: 14px; font-weight: 600; color: #fff; }
.eff-details p { font-size: 12px; color: var(--text-dim); margin-top: 2px; line-height: 1.3; }

/* ==========================================
   SECURITY TAB: LEAFLET MAP & RADAR
========================================== */
.security-map-container {
  height: 290px;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
  background: #090e17;
  z-index: 1;
}

.country-threat-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.country-threat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.country-threat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.quick-action-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 16px;
}

.quick-action-box h4 {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

.quick-form-row {
  display: flex;
  gap: 8px;
}
.quick-form-row input { flex: 1; }

.incidents-stream {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.incident-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 8px 10px;
  background: #0d1322;
  border-radius: 6px;
  border-left: 3px solid var(--rose);
}

.flag-icon {
  font-size: 15px;
  margin-right: 6px;
}

/* ==========================================
   TELEGRAM BRIDGE & PHONEBOOK
========================================== */
.tg-instruction-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.tg-instruction-list li {
  background: #0d1322;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid #3b82f6;
}

/* ==========================================
   CDR TABLES
========================================== */
.table-responsive { overflow-x: auto; }
.cdr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.cdr-table th {
  padding: 12px 14px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.cdr-table td {
  padding: 12px 14px;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.badge-disposition {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.disp-answered {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.disp-busy {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.disp-failed {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-route {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 500;
}
.route-internal { background: #1e293b; color: #93c5fd; }
.route-tg {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

/* ==========================================
   SUBSCRIBERS TAB & TOOLBAR
========================================== */
.toolbar-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 440px;
  display: flex;
  align-items: center;
}

.search-box svg { position: absolute; left: 12px; color: var(--text-dim); }
.search-box input { padding-left: 38px; }

.filter-tabs {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.filter-tab {
  background: transparent;
  border: none;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-tab.active { background: #1e293b; color: #fff; }

.subscribers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 18px;
}

.subscriber-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.subscriber-card:hover {
  transform: translateY(-2px);
  border-color: #3b4d6e;
  background: var(--bg-card-hover);
}

.subscriber-card.protected-card {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.04) 0%, var(--bg-card) 100%);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ext-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  background: #1e293b;
  border: 1px solid #334155;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
}

.sub-title-group { flex: 1; }
.sub-name { font-size: 15px; font-weight: 600; color: #fff; margin-bottom: 2px; }
.sub-meta { font-size: 12px; color: var(--text-dim); }

.card-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #0d1322;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.detail-label { color: var(--text-muted); }
.detail-val {
  font-family: 'JetBrains Mono', monospace;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.secret-toggle {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
}
.secret-toggle:hover { color: var(--text-main); }

.btn-copy-sm {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  transition: color var(--transition-fast);
}
.btn-copy-sm:hover { color: var(--primary); }

.card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 12px;
}

/* ==========================================
   MODALS & POPUPS
========================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: slideUp 0.25s ease-out;
}

.modal-card-sm { max-width: 420px; }

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

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: #fff; }

.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: #0e1628;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon { margin-bottom: 12px; color: var(--text-dim); }

.sip-config-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.sip-config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0d1322;
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

.sip-label { font-size: 13px; color: var(--text-muted); }
.sip-val-group { display: flex; align-items: center; gap: 8px; }

/* ==========================================
   TOAST NOTIFICATIONS
========================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: #1e293b;
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  animation: slideInRight 0.25s ease-out;
}

.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
  background: #0e2e28;
  color: #6ee7b7;
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
  background: #381216;
  color: #fca5a5;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(50px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.spin-icon { transition: transform 0.5s ease; }
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 1100px) {
  .app-header { height: auto; padding: 12px 16px; flex-direction: column; gap: 12px; }
  .header-left { width: 100%; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  .nav-tabs { width: 100%; overflow-x: auto; }
  .header-actions { width: 100%; justify-content: space-between; }
  .dashboard-analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .main-content { padding: 16px; }
  .toolbar-section { flex-direction: column; align-items: stretch; }
  .search-box { max-width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .subscribers-grid { grid-template-columns: 1fr; }
  .line-matrix-grid { grid-template-columns: 1fr; }
}
