:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #101624;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(28, 38, 60, 0.85);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-hover: rgba(56, 189, 248, 0.4);
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --cyan-accent: #06b6d4;
  --blue-accent: #3b82f6;
  --purple-accent: #8b5cf6;
  --emerald-success: #10b981;
  --amber-warning: #f59e0b;
  --rose-danger: #f43f5e;
  --telegram-blue: #229ED9;
  
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  --neon-cyan-glow: 0 0 25px rgba(6, 182, 212, 0.25);
  --neon-danger-glow: 0 0 25px rgba(244, 63, 94, 0.3);
  --neon-warning-glow: 0 0 25px rgba(245, 158, 11, 0.3);
}

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

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

body.dark-theme {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(14, 165, 233, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 40%),
    linear-gradient(180deg, #07090e 0%, #0d121d 100%);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  padding: 18px 24px;
  gap: 18px;
  box-sizing: border-box;
}

/* Glassmorphic Utility */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ======================================================
   Header Styles
   ====================================================== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(16, 22, 36, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

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

.emblem-container {
  position: relative;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--neon-cyan-glow);
}

.emblem-svg {
  width: 26px;
  height: 26px;
  stroke: var(--cyan-accent);
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.system-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--cyan-accent);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 6px;
}

.live-pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald-success);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 6px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--emerald-success);
  box-shadow: 0 0 10px var(--emerald-success);
  animation: pulse-live 1.5s infinite;
}

@keyframes pulse-live {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.2); 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); }
}

.main-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff 0%, #cbd5e1 50%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

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

.clock-card {
  text-align: right;
  padding: 6px 12px;
  background: rgba(10, 15, 26, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
}

.clock-time {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.05em;
}

.clock-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-icon {
  width: 16px;
  height: 16px;
}

.btn-simulator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-simulator:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(139, 92, 246, 0.35));
  border-color: rgba(139, 92, 246, 0.7);
  color: #fff;
}

.btn-simulator.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(6, 182, 212, 0.25));
  border-color: rgba(16, 185, 129, 0.6);
  color: #6ee7b7;
}

.sim-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a78bfa;
}

.btn-simulator.active .sim-dot {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-live 1s infinite;
}

/* ======================================================
   KPI Ribbon (6 Cards)
   ====================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.kpi-card {
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.primary-glow::before { background: linear-gradient(90deg, #38bdf8, #818cf8); }
.central-glow::before { background: linear-gradient(90deg, #818cf8, #c084fc); }
.region-glow::before { background: linear-gradient(90deg, #2dd4bf, #06b6d4); }
.warning-glow::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.danger-glow::before { background: linear-gradient(90deg, #f43f5e, #fb7185); }
.success-glow::before { background: linear-gradient(90deg, #10b981, #34d399); }

.clickable-kpi {
  cursor: pointer;
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: var(--neon-warning-glow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.clickable-kpi:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.45);
}

.warning-action-link {
  color: #fbbf24;
  font-weight: 600;
  font-size: 0.72rem;
}

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

.kpi-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-icon-pill {
  font-size: 0.72rem;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #e2e8f0;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kpi-icon-pill.danger {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fb7185;
  font-weight: 700;
}
.kpi-icon-pill.warning {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  font-weight: 700;
}
.kpi-icon-pill.success {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-weight: 700;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
}

.kpi-number {
  font-family: var(--font-mono);
  font-size: 1.95rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.danger-text { color: var(--rose-danger); }
.success-text { color: var(--emerald-success); }
.warning-text { color: var(--amber-warning); }
.primary-text { color: #38bdf8; }

.kpi-sub { font-size: 0.74rem; color: var(--text-secondary); }
.kpi-footer { font-size: 0.7rem; color: var(--text-muted); }
.danger-badge { color: #f87171; font-weight: 600; }

/* ======================================================
   Dashboard Body & Switcher
   ====================================================== */
.dashboard-body {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 18px;
  flex: 1;
}

.territory-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Switcher Bar */
.view-switcher-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
}

.switcher-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.switcher-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.view-toggle-btns {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
}

.toggle-tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-tab-btn.active {
  background: #0284c7;
  color: #fff;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.4);
}

.btn-warning-pill {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-warning-pill:hover {
  background: rgba(245, 158, 11, 0.3);
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

/* ======================================================
   MAP VIEW & CENTRAL APPARATUS NODE
   ====================================================== */
.map-view-container {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  position: relative;
  min-height: 580px;
  background: radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.8) 0%, rgba(10, 15, 26, 0.95) 100%);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

/* Central Floating Node */
.central-map-node {
  padding: 12px 20px;
  margin-bottom: 12px;
  border: 1px solid rgba(168, 85, 247, 0.45);
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.3) 0%, rgba(15, 23, 42, 0.9) 100%);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.central-map-node:hover {
  transform: translateY(-2px);
  border-color: #c084fc;
  box-shadow: 0 6px 25px rgba(168, 85, 247, 0.35);
}

.node-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: #d8b4fe;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.node-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.node-icon { font-size: 1.2rem; }

.node-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  flex: 1;
}

.node-task-badge {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(168, 85, 247, 0.25);
  color: #e9d5ff;
  border: 1px solid rgba(168, 85, 247, 0.5);
}

.node-sub-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

.node-click-hint {
  margin-left: auto;
  color: #c084fc;
  font-weight: 600;
  font-size: 0.74rem;
}

/* SVG Map Styling */
.uzb-map-wrapper {
  position: relative;
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-legend {
  position: absolute;
  top: 8px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.68rem;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  z-index: 10;
}

.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-box { width: 10px; height: 10px; border-radius: 2px; }
.legend-box.safe { background: rgba(56, 189, 248, 0.4); border: 1px solid #38bdf8; }
.legend-box.medium { background: rgba(245, 158, 11, 0.4); border: 1px solid #f59e0b; }
.legend-box.high { background: rgba(139, 92, 246, 0.4); border: 1px solid #a855f7; }
.legend-box.danger { background: rgba(244, 63, 94, 0.5); border: 1px solid #f43f5e; }

.uzb-svg-map {
  width: 100%;
  max-height: 560px;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.8));
}

.water-path {
  fill: rgba(6, 182, 212, 0.12);
  stroke: rgba(6, 182, 212, 0.35);
  stroke-width: 1;
  stroke-dasharray: 4, 3;
}

.region-svg-group {
  cursor: pointer;
  transition: all 0.2s ease;
}

.region-path {
  fill: rgba(18, 26, 44, 0.88);
  stroke: rgba(56, 189, 248, 0.45);
  stroke-width: 1.2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.region-svg-group:hover .region-path {
  fill: rgba(14, 165, 233, 0.5);
  stroke: #38bdf8;
  stroke-width: 2.2;
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.7));
}

.region-svg-label {
  font-family: var(--font-main);
  font-size: 9.5px;
  font-weight: 700;
  fill: #f1f5f9;
  text-anchor: middle;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.95));
}

.region-svg-count {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  fill: #38bdf8;
  text-anchor: middle;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.95));
}

.city-indicator-dot {
  fill: #3b82f6;
  stroke: #ffffff;
  stroke-width: 2;
  filter: drop-shadow(0 0 8px #38bdf8);
}

.city-capital-node:hover .city-indicator-dot {
  fill: #0ea5e9;
  transform-origin: 617px 270px;
  transform: scale(1.3);
}

.region-svg-label.capital { font-size: 8px; fill: #fff; font-weight: 800; }
.region-svg-count.capital { font-size: 8px; fill: #fcd34d; font-weight: 800; }

/* ======================================================
   TELEGRAM SIDEBAR PANEL
   ====================================================== */
.telegram-sidebar {
  display: flex;
  flex-direction: column;
  padding: 16px;
  height: 100%;
}

.telegram-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-glass);
}

.tg-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tg-icon-wrap {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #0088cc, #229ED9);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tg-svg-icon {
  width: 18px;
  height: 18px;
  stroke: #fff;
}

.tg-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.tg-sub-status {
  font-size: 0.68rem;
  color: #34d399;
}

.icon-btn-mini {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.icon-btn-mini:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.tg-target-card {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tg-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
}

.tg-info-row .label { color: var(--text-muted); }
.tg-info-row .value { color: #38bdf8; font-family: var(--font-mono); font-weight: 600; }
.badge-active {
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  padding: 2px 6px;
  border-radius: 4px;
}

.tg-action-buttons {
  margin-top: 10px;
}

.btn-tg-test {
  width: 100%;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: none;
  color: #fff;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-tg-test:hover {
  background: #0284c7;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}

.tg-log-header {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}

.tg-log-counter {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-secondary);
}

.tg-messages-stream {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding-right: 4px;
  max-height: calc(100vh - 540px);
  min-height: 200px;
}

.tg-messages-stream::-webkit-scrollbar { width: 4px; }
.tg-messages-stream::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 4px; }

.tg-message-card {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(34, 158, 217, 0.08);
  border-left: 3px solid var(--telegram-blue);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.74rem;
}

.tg-card-top {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.tg-card-time { font-family: var(--font-mono); }
.tg-card-text { color: #e2e8f0; line-height: 1.35; white-space: pre-line; }

/* Quick Simulator Panel */
.quick-test-panel {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-glass);
}

.quick-test-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.quick-test-buttons {
  display: flex;
  gap: 8px;
}

.btn-action-add {
  flex: 1;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fcd34d;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 7px 6px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-action-resolve {
  flex: 1;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 7px 6px;
  border-radius: 8px;
  cursor: pointer;
}

/* ======================================================
   3-DAY WARNING MODAL & TABLE
   ====================================================== */
.modal-warning {
  border-color: rgba(245, 158, 11, 0.5) !important;
  max-width: 960px !important;
}

.modal-region-badge.warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.modal-top-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: rgba(245, 158, 11, 0.08);
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  font-size: 0.8rem;
  color: #fde68a;
}

.btn-tg-all {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
  transition: all 0.2s;
}

.btn-tg-all:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}

.day-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
}

.day-badge.urgent-1 { background: rgba(244, 63, 94, 0.2); color: #f43f5e; border: 1px solid rgba(244, 63, 94, 0.4); }
.day-badge.urgent-2 { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.day-badge.urgent-3 { background: rgba(234, 179, 8, 0.15); color: #fde047; }

.btn-send-tg {
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  border: none;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.btn-send-tg:hover { background: #0284c7; transform: translateY(-1px); }
.btn-send-tg.sent { background: #059669; }

/* Grid View styling (Cards) */
.regions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.region-card {
  padding: 14px 16px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-glass);
}

.region-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-hover);
  transform: translateY(-3px);
}

.region-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.region-code-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 5px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border-radius: 4px;
}

.region-name { font-size: 0.95rem; font-weight: 700; color: #f8fafc; margin-top: 2px; }
.region-metric-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 8px; }
.region-task-number { font-family: var(--font-mono); font-size: 1.7rem; font-weight: 800; line-height: 1; color: #fff; }

.status-pill { font-size: 0.65rem; font-weight: 600; padding: 2px 6px; border-radius: 4px; }
.status-pill.danger { background: rgba(244, 63, 94, 0.15); color: #f87171; }
.status-pill.success { background: rgba(16, 185, 129, 0.15); color: #4ade80; }

.region-bottom-row { font-size: 0.7rem; color: var(--text-muted); display: flex; justify-content: space-between; }

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

.modal-overlay.active { display: flex; }

.modal-card {
  width: 100%;
  max-width: 860px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  animation: zoomModal 0.2s ease;
}

.modal-sm { max-width: 480px !important; }
.modal-md { max-width: 640px !important; }
.modal-xl { max-width: 1120px !important; width: 96% !important; }

@keyframes zoomModal {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-title { font-size: 1.25rem; font-weight: 700; color: #fff; margin-top: 2px; }
.modal-subtitle { font-size: 0.76rem; color: var(--text-secondary); }

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close-btn:hover { color: #fff; }

.modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; }

.employee-table { width: 100%; border-collapse: collapse; }
.employee-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.employee-table td {
  padding: 10px;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
}

.text-center { text-align: center !important; }
.emp-name { font-weight: 600; color: #fff; display: block; }
.emp-sub { font-size: 0.7rem; color: var(--text-muted); }

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid var(--border-glass);
}

.modal-footer-info { font-size: 0.72rem; color: var(--text-muted); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: #cbd5e1;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.78rem;
  cursor: pointer;
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }

.btn-primary {
  background: #0284c7;
  border: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover { background: #0369a1; }

.settings-form { display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 0.74rem; color: #94a3b8; font-weight: 600; }
.form-group input {
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  font-size: 0.8rem;
}
.form-group input:focus { outline: none; border-color: #38bdf8; }
.form-hint { font-size: 0.68rem; color: #64748b; }
.form-checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 0.74rem; color: #cbd5e1; }

/* ==========================================================================
   ADMINISTRATOR PANELI (RBAC & USER MANAGEMENT)
   ========================================================================== */
.admin-badge-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.admin-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

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

.admin-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 0.82rem;
  color: #cbd5e1;
  font-weight: 600;
}

.admin-stat-pill b {
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  margin-left: 2px;
}

.admin-stat-pill.admin-pill-admin {
  background: rgba(124, 58, 237, 0.18);
  border-color: rgba(124, 58, 237, 0.4);
  color: #d8b4fe;
}

.admin-stat-pill.admin-pill-active {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.admin-table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.6);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.admin-users-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
  color: #e2e8f0;
}

.admin-users-table th {
  background: rgba(30, 41, 59, 0.9);
  color: #94a3b8;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  white-space: nowrap;
}

.admin-users-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.admin-users-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.table-user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
}

.table-user-avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 2px solid rgba(56, 189, 248, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.35);
  flex-shrink: 0;
}

.table-user-avatar.admin-avatar {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.45);
}

.table-user-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.table-user-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #f8fafc;
  line-height: 1.25;
}

.table-user-login {
  font-size: 0.74rem;
  font-family: var(--font-mono);
  color: #38bdf8;
}

.perm-badges-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 330px;
}

.perm-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  white-space: nowrap;
}

.perm-chip svg {
  flex-shrink: 0;
}

.perm-chip.chip-monitoring {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.perm-chip.chip-telegram {
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(14, 165, 233, 0.4);
  color: #38bdf8;
}

.perm-chip.chip-sms {
  background: rgba(168, 85, 247, 0.14);
  border-color: rgba(168, 85, 247, 0.4);
  color: #c084fc;
}

.perm-chip.chip-call {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fb7185;
}

.perm-chip.chip-settings {
  background: rgba(234, 179, 8, 0.14);
  border-color: rgba(234, 179, 8, 0.4);
  color: #facc15;
}

.perm-chip.chip-admin {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.45);
  color: #a5b4fc;
}

.table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-table-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 8px;
  color: #38bdf8;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-table-edit svg {
  flex-shrink: 0;
  color: #38bdf8;
}

.btn-table-edit:hover {
  background: rgba(56, 189, 248, 0.28);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.btn-table-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  width: 34px;
  height: 34px;
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.4);
  border-radius: 8px;
  color: #f43f5e;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-table-delete svg {
  color: #f43f5e;
}

.btn-table-delete:hover:not(:disabled) {
  background: rgba(244, 63, 94, 0.3);
  border-color: #f43f5e;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.35);
}

.btn-table-delete:hover:not(:disabled) svg {
  color: #ffffff;
}

.btn-table-delete:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.05);
}

.btn-table-delete:disabled svg {
  color: #64748b;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-glass);
}

/* ======================================================
   RESPONSIVE DESIGN (TELEFON VA PLANSHETLAR UCHUN ADAPTATSIYA)
   ====================================================== */

/* ======================================================
   RESPONSIVE DESIGN (TELEFON VA PLANSHETLAR UCHUN 100% ADAPTATSIYA)
   ====================================================== */

.employee-table-container,
.admin-table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 1. Katta planshetlar va noutbuklar (1024px - 1200px) */
@media (max-width: 1200px) {
  .dashboard-body {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .sidebar-right {
    width: 100%;
  }
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .regions-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 2. Standart planshetlar (iPad / Android Tablet: 768px - 1024px) */
@media (max-width: 1024px) {
  .app-container {
    padding: 14px 16px;
    gap: 14px;
    width: 100%;
    max-width: 100%;
  }
  
  .app-header {
    padding: 14px 18px;
    border-radius: 14px;
  }

  .header-left {
    gap: 12px;
  }
  
  .emblem-container {
    width: 44px;
    height: 44px;
  }
  
  .main-title {
    font-size: 1.2rem;
  }

  .subtitle {
    font-size: 0.74rem;
  }

  /* Planshetda 3 ustunli teng kartalar */
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .kpi-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
    height: 100%;
    padding: 12px 14px;
    border-radius: 12px;
  }

  .kpi-label {
    font-size: 0.8rem;
    font-weight: 700;
  }

  .kpi-number {
    font-size: 1.8rem;
    font-weight: 800;
  }

  .kpi-sub {
    font-size: 0.8rem;
  }

  .regions-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .central-map-node {
    padding: 12px 16px;
  }

  .uzb-svg-map {
    max-height: 440px;
  }

  .modal-card {
    max-width: 92vw;
    max-height: 88vh;
  }
}

/* 3. Smartfonlar va Kichik Planshetlar (< 768px - Barcha telefonlar uchun 100% moslik) */
@media (max-width: 768px) {
  .app-container {
    padding: 8px 10px !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  /* Header mobil ko'rinishi */
  .app-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px 14px !important;
    border-radius: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .header-left {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .emblem-container {
    width: 40px !important;
    height: 40px !important;
    flex-shrink: 0 !important;
  }

  .emblem-svg {
    width: 22px !important;
    height: 22px !important;
  }

  .main-title {
    font-size: 1.12rem !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
  }

  .subtitle {
    font-size: 0.74rem !important;
    line-height: 1.3 !important;
    color: #94a3b8 !important;
    margin-top: 2px !important;
  }

  .header-right {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding-top: 8px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  .clock-card {
    display: none !important; /* Telefonda joy tejash uchun yashiriladi */
  }

  .action-buttons {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  #soundBtn, 
  #openApiSettingsBtn, 
  #systemHealthPill {
    flex: 1 1 calc(33% - 6px) !important;
    min-height: 36px !important;
    padding: 6px 8px !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    justify-content: center !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
  }

  #fullscreenBtn {
    display: none !important; /* Telefonda to'liq ekran tugmasi kerak emas */
  }

  /* Foydalanuvchi qatori */
  .user-profile-widget {
    width: 100% !important;
    margin-top: 2px !important;
  }

  .user-info-pill {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
    padding: 6px 10px !important;
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
  }

  .user-avatar {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.75rem !important;
    flex-shrink: 0 !important;
  }

  .user-text-meta {
    flex: 1 !important;
    min-width: 0 !important;
  }

  .user-name {
    font-size: 0.84rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
  }

  .user-role-badge {
    font-size: 0.7rem !important;
  }

  #openAdminPanelBtn, 
  #logoutBtn {
    padding: 6px 10px !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    flex-shrink: 0 !important;
  }

  /* ======================================================
     RAMKALAR TENG BO'LSIN, YOZUVLAR SAL KATTAROQ BO'LSIN:
     KPI Grid: 2 ustunli, mutlaqo teng o'lchamli kartalar
     ====================================================== */
  .kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .kpi-card {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    min-height: 128px !important;
    height: 100% !important;
    padding: 12px 14px !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: rgba(16, 23, 40, 0.88) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    box-sizing: border-box !important;
  }

  .kpi-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 4px !important;
    width: 100% !important;
  }

  .kpi-label {
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    color: #e2e8f0 !important;
    letter-spacing: 0.02em !important;
  }

  .kpi-icon-pill {
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    padding: 3px 7px !important;
    border-radius: 6px !important;
  }

  .kpi-value-row {
    display: flex !important;
    align-items: baseline !important;
    gap: 6px !important;
    margin: 4px 0 !important;
  }

  .kpi-number {
    font-size: 2.1rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    color: #ffffff !important;
    text-shadow: 0 0 15px rgba(56, 189, 248, 0.3) !important;
  }

  .kpi-sub {
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    color: #94a3b8 !important;
  }

  .kpi-footer {
    font-size: 0.76rem !important;
    font-weight: 600 !important;
    color: #64748b !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-top: auto !important;
    padding-top: 4px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.04) !important;
  }

  .warning-action-link {
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    color: #fbbf24 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* ======================================================
     KO'RINISHLARNI TANLASH PANELI (VIEW SWITCHER BAR)
     ====================================================== */
  .view-switcher-bar {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    width: 100% !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  .switcher-left {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 6px !important;
    align-items: stretch !important;
  }

  .switcher-title {
    display: block !important;
    font-size: 0.8rem !important;
    font-weight: 800 !important;
    color: #94a3b8 !important;
    letter-spacing: 0.04em !important;
    text-align: center !important;
  }

  .view-toggle-btns {
    display: flex !important;
    width: 100% !important;
    background: rgba(0, 0, 0, 0.4) !important;
    border-radius: 10px !important;
    padding: 3px !important;
    gap: 4px !important;
    box-sizing: border-box !important;
  }

  .toggle-tab-btn {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.86rem !important;
    font-weight: 700 !important;
    padding: 9px 12px !important;
    border-radius: 8px !important;
    min-height: 40px !important;
    text-align: center !important;
  }

  .switcher-right {
    width: 100% !important;
  }

  .btn-warning-pill {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.88rem !important;
    font-weight: 800 !important;
    padding: 11px 14px !important;
    border-radius: 10px !important;
    min-height: 42px !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
  }

  /* ======================================================
     MARKAZIY APPARAT KARTASI (ASOSIY BOSHQARUV MARKAZI)
     ====================================================== */
  .central-map-node {
    padding: 12px 14px !important;
    border-radius: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .node-badge {
    font-size: 0.72rem !important;
    font-weight: 800 !important;
  }

  .node-title-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-top: 4px !important;
  }

  .node-name {
    font-size: 1.02rem !important;
    font-weight: 800 !important;
  }

  .node-task-badge {
    font-size: 0.92rem !important;
    font-weight: 800 !important;
    padding: 5px 12px !important;
    border-radius: 8px !important;
  }

  .node-sub-info {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    margin-top: 8px !important;
    width: 100% !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    text-align: center !important;
  }

  .node-sub-info span {
    background: rgba(255, 255, 255, 0.05) !important;
    padding: 6px 3px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    white-space: nowrap !important;
  }

  .node-click-hint {
    grid-column: span 3 !important;
    font-size: 0.8rem !important;
    color: #38bdf8 !important;
    font-weight: 700 !important;
    margin-top: 6px !important;
    text-align: center !important;
  }

  /* ======================================================
     O'ZBEKISTON XARITASI VA AFSONASI (LEGEND)
     ====================================================== */
  .map-view-container {
    padding: 10px 12px !important;
    border-radius: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .uzb-map-wrapper {
    padding: 4px 0 !important;
    width: 100% !important;
    overflow: hidden !important;
  }

  .map-legend {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px 10px !important;
    padding: 8px 12px !important;
    border-radius: 10px !important;
    width: 100% !important;
    background: rgba(10, 15, 28, 0.6) !important;
    margin-bottom: 6px !important;
    box-sizing: border-box !important;
  }

  .legend-item {
    font-size: 0.76rem !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .uzb-svg-map {
    width: 100% !important;
    height: auto !important;
    max-height: 330px !important;
    min-height: 230px !important;
  }

  .region-path {
    stroke-width: 1.5px !important;
    fill: rgba(22, 33, 56, 0.95) !important;
    stroke: rgba(56, 189, 248, 0.55) !important;
  }

  .region-svg-label {
    font-size: 11px !important;
    font-weight: 700 !important;
    fill: #ffffff !important;
  }

  .region-svg-count {
    font-size: 10.5px !important;
    font-weight: 800 !important;
    fill: #38bdf8 !important;
  }

  /* Hududlar kartalari paneli */
  .regions-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .region-card {
    padding: 12px !important;
    border-radius: 12px !important;
  }

  /* Telegram paneli */
  .telegram-card {
    padding: 12px 14px !important;
    border-radius: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .tg-title {
    font-size: 0.95rem !important;
    font-weight: 800 !important;
  }

  .btn-send-tg-group {
    width: 100% !important;
    height: 42px !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
  }

  .stream-empty {
    font-size: 0.82rem !important;
  }

  /* Modallar va Jadvallar */
  .modal-overlay {
    padding: 8px !important;
    box-sizing: border-box !important;
  }

  .modal-card {
    width: 96vw !important;
    max-width: 96vw !important;
    max-height: 92vh !important;
    border-radius: 14px !important;
    box-sizing: border-box !important;
  }

  .modal-header {
    padding: 10px 12px !important;
  }

  .modal-title {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
  }

  .modal-subtitle {
    font-size: 0.78rem !important;
  }

  .modal-body {
    padding: 10px 12px !important;
  }

  .employee-table-container,
  .admin-table-container {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .employee-table th,
  .admin-users-table th {
    font-size: 0.76rem !important;
    padding: 7px 8px !important;
    white-space: nowrap !important;
  }

  .employee-table td,
  .admin-users-table td {
    font-size: 0.8rem !important;
    padding: 8px 6px !important;
    white-space: nowrap !important;
  }

  /* Login modali */
  #loginModal .modal-card,
  #loginModal.gate-mode .modal-card {
    width: 94vw !important;
    max-width: 94vw !important;
    padding: 20px 16px !important;
    margin: auto !important;
  }

  .login-input-group input {
    height: 46px !important;
    font-size: 16px !important;
  }

  .btn-primary-block {
    height: 46px !important;
    font-size: 0.92rem !important;
  }
}

/* ======================================================
   TEZKOR ALOQA & QO'NG'IROQLAR (SMS, TELEGRAM, CALLS)
   ====================================================== */
.btn-sms-all {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  border: 1px solid rgba(52, 211, 153, 0.4);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}

.btn-sms-all:hover {
  background: linear-gradient(135deg, #047857, #059669);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}

.comm-actions-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comm-btn-row {
  display: flex;
  gap: 5px;
  align-items: center;
}

.btn-action-comm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn-action-comm span { font-size: 0.85rem; }

/* 1. Telegram Lichka */
.btn-comm-tg {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}
.btn-comm-tg:hover {
  background: #0284c7;
  color: #fff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}
.btn-comm-tg.sent {
  background: #059669 !important;
  color: #fff !important;
  border-color: #10b981 !important;
}

/* 2. SMS Eslatma */
.btn-comm-sms {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.35);
}
.btn-comm-sms:hover {
  background: #059669;
  color: #fff;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.45);
}
.btn-comm-sms.sent {
  background: #047857 !important;
  color: #fff !important;
}

/* 3. Shaxsiy Mobil Qo'ng'iroq */
.btn-comm-mobile {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.35);
}
.btn-comm-mobile:hover {
  background: #7c3aed;
  color: #fff;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.45);
}

/* 4. Tashkilot IP Telefoni */
.btn-comm-ip {
  background: rgba(20, 184, 166, 0.15);
  color: #2dd4bf;
  border-color: rgba(45, 212, 191, 0.35);
}
.btn-comm-ip:hover {
  background: #0d9488;
  color: #fff;
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.45);
}

.emp-contact-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  font-size: 0.68rem;
  font-family: var(--font-mono);
}
.emp-phone-tag { color: #a78bfa; display: flex; align-items: center; gap: 4px; }
.emp-ip-tag { color: #2dd4bf; display: flex; align-items: center; gap: 4px; }

/* ======================================================
   CALL DIALOG MODAL (Interaktiv Qo'ng'iroq Oynasi)
   ====================================================== */
.call-dialog-card {
  max-width: 440px;
  width: 100%;
  text-align: center;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.95), rgba(15, 23, 42, 0.98));
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85), 0 0 30px rgba(56, 189, 248, 0.2);
}

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

.call-type-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(139, 92, 246, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
  letter-spacing: 0.05em;
}

.call-type-tag.ip-mode {
  background: rgba(20, 184, 166, 0.2);
  color: #5eead4;
  border-color: rgba(45, 212, 191, 0.4);
}

.call-avatar-wrap {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0 auto 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-avatar-icon {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  z-index: 2;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.call-radar-wave {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.45);
  animation: radarPulse 2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
  z-index: 1;
}

.call-radar-wave.wave-2 {
  animation-delay: 0.75s;
}

@keyframes radarPulse {
  0% { transform: scale(0.7); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

.call-contact-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 4px;
}

.call-contact-sub {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 12px;
}

.call-number-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 16px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  margin-bottom: 16px;
}

.call-status-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 16px;
}

.call-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
  animation: pulseDot 1s infinite alternate;
}

.call-status-dot.connected {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.call-timer {
  font-family: var(--font-mono);
  color: #4ade80;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.15);
  padding: 2px 8px;
  border-radius: 6px;
}

.call-task-context {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.74rem;
  color: #94a3b8;
  margin-bottom: 22px;
  text-align: left;
}

.call-task-context b { color: #f59e0b; }

.call-action-row {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.btn-call-control {
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-call-control.mute-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-call-control.mute-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.btn-call-control.mute-btn.muted {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: #ef4444;
}

.btn-call-control.end-call-btn {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
  border: 1px solid rgba(248, 113, 113, 0.4);
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
}
.btn-call-control.end-call-btn:hover {
  background: linear-gradient(135deg, #b91c1c, #991b1b);
  transform: scale(1.03);
}

/* ======================================================
   EDO.IJRO.UZ API INTEGRATSIYASI SOZLAMALARI
   ====================================================== */
.btn-api-config {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #f1f5f9;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-api-config:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
}

.api-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  transition: all 0.3s ease;
}

.api-status-dot.online {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.api-status-dot.error {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

.api-mode-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
}

.api-mode-info b { color: #38bdf8; font-size: 0.88rem; }
.api-mode-info p { color: #94a3b8; font-size: 0.72rem; margin-top: 2px; }

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.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: 24px;
}
.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: #0284c7; }
input:checked + .slider:before { transform: translateX(20px); }

.form-select {
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  font-size: 0.8rem;
  width: 100%;
}
.form-select:focus { outline: none; border-color: #38bdf8; }

.webhook-info-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px dashed rgba(56, 189, 248, 0.4);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 4px;
}

.webhook-url-display {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  background: rgba(0, 0, 0, 0.6);
  color: #38bdf8;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  user-select: all;
  word-break: break-all;
}

.copy-btn {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.copy-btn:hover {
  background: #0284c7;
  color: #fff;
}

.api-test-result {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 8px;
  animation: fadeIn 0.2s ease;
}
.api-test-result.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10b981;
  color: #34d399;
}
.api-test-result.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #f87171;
}

/* ======================================================
   ADMIN PANEL, RBAC & AUTENTIFIKATSIYA STILLARI
   ====================================================== */
.modal-xl {
  max-width: 1100px;
  width: 95%;
}

/* Full-Screen Login Gate for Unauthorized State */
body.auth-locked .app-container {
  filter: blur(14px) brightness(0.35);
  pointer-events: none;
  user-select: none;
  transition: filter 0.4s ease;
}

#loginModal.gate-mode {
  background: rgba(4, 8, 20, 0.95);
  backdrop-filter: blur(25px);
  z-index: 99999;
}

#loginModal.gate-mode .modal-card {
  box-shadow: 0 0 50px rgba(2, 132, 199, 0.35), 0 25px 60px rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.35);
  animation: modalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#loginModal.gate-mode #closeLoginModalBtn {
  display: none !important;
}

.login-security-notice {
  background: rgba(2, 132, 199, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.72rem;
  color: #7dd3fc;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

/* Header User Profile Widget */
.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-info-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  padding: 4px 12px 4px 6px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
  text-transform: uppercase;
}

.user-text-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: #f8fafc;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  font-size: 0.62rem;
  font-weight: 600;
  color: #38bdf8;
  letter-spacing: 0.3px;
}

.btn-admin-nav {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #fff;
  border: 1px solid rgba(167, 139, 250, 0.4);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.35);
  transition: all 0.2s ease;
}
.btn-admin-nav:hover {
  background: linear-gradient(135deg, #6d28d9, #4338ca);
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(124, 58, 237, 0.6);
}

.btn-logout-icon {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #f43f5e;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-logout-icon:hover {
  background: rgba(244, 63, 94, 0.3);
  color: #fff;
}

.btn-login-trigger {
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  color: #fff;
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.3);
  transition: all 0.2s ease;
}
.btn-login-trigger:hover {
  background: linear-gradient(135deg, #0369a1, #0284c7);
  transform: translateY(-1px);
.system-health-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}
.live-dot-green {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-dot 2s infinite ease-in-out;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}
.quick-login-section {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.section-sublabel {
  display: block;
  font-size: 0.7rem;
  color: #94a3b8;
  margin-bottom: 8px;
}
.role-pills-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.role-pill-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}
.role-pill-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}
.role-pill-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

/* Admin Dashboard Top Bar */
.admin-badge-icon {
  font-size: 1.8rem;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid rgba(124, 58, 237, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-stats-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-stat-pill {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.74rem;
  color: #94a3b8;
}
.admin-stat-pill b { color: #f8fafc; }
.admin-pill-admin { border-color: rgba(167, 139, 250, 0.4); color: #c084fc; }
.admin-pill-admin b { color: #e9d5ff; }
.admin-pill-active { border-color: rgba(16, 185, 129, 0.4); color: #34d399; }
.admin-pill-active b { color: #6ee7b7; }

/* Admin Users Table */
.admin-table-container {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.4);
}
.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.78rem;
}
.admin-users-table th {
  background: rgba(30, 41, 59, 0.8);
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.admin-users-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
  color: #cbd5e1;
}
.admin-users-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.table-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.table-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #3b82f6);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  flex-shrink: 0;
}
.table-user-meta {
  display: flex;
  flex-direction: column;
}
.table-user-name {
  font-weight: 700;
  color: #f8fafc;
  font-size: 0.82rem;
}
.table-user-login {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #38bdf8;
}

/* Permission Badges Wrap */
.perm-badges-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 340px;
}
.perm-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 0.66rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #64748b;
}
.perm-chip.active {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}
.perm-chip.active-admin {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(192, 132, 252, 0.4);
  color: #c084fc;
  font-weight: 700;
}
.perm-chip.active-tg {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}
.perm-chip.active-sms {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(52, 211, 153, 0.4);
  color: #34d399;
}
.perm-chip.active-call {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fbbf24;
}

/* User Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 14px;
  font-size: 0.7rem;
  font-weight: 600;
}
.status-pill.active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.status-pill.blocked {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Table Action Buttons */
.table-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.btn-table-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.74rem;
  transition: all 0.2s ease;
}
.btn-table-action:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #fff;
}
.btn-table-action.delete:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: #f43f5e;
  color: #f43f5e;
}

/* Permissions Card in Add/Edit User Form */
.permissions-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 12px;
  margin-top: 10px;
}
.permissions-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.permissions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.perm-checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.perm-checkbox-item:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
}
.perm-checkbox-item input[type="checkbox"] {
  margin-top: 3px;
  cursor: pointer;
  accent-color: #0284c7;
  width: 16px;
  height: 16px;
}
.perm-admin-item {
  border-color: rgba(168, 85, 247, 0.3);
  background: rgba(88, 28, 135, 0.15);
}
.perm-info {
  display: flex;
  flex-direction: column;
}
.perm-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: #f1f5f9;
}
.perm-desc {
  font-size: 0.65rem;
  color: #94a3b8;
  line-height: 1.25;
  margin-top: 2px;
}

/* Feedback alert box */
.form-alert-box {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  animation: fadeIn 0.2s ease;
}
.form-alert-box.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #f87171;
}
.form-alert-box.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10b981;
  color: #34d399;
}

