/* ==========================================================================
   🎨 SKUIO BROWSER FARM BALANCER SYSTEM CSS DESIGN SYSTEM
   ========================================================================== */

:root {
  /* Colors */
  --bg-primary: #070913;
  --bg-secondary: #0c0f1e;
  --panel-bg: rgba(15, 22, 42, 0.6);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-border-hover: rgba(255, 255, 255, 0.16);

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

  --brand-color: #10b981;
  --brand-cyan: #06b6d4;
  --brand-violet: #8b5cf6;
  --brand-yellow: #eab308;
  --brand-red: #ef4444;

  /* Glowing Neon Shadows */
  --glow-emerald: 0 0 20px rgba(16, 185, 129, 0.25);
  --glow-cyan: 0 0 20px rgba(6, 182, 212, 0.25);
  --glow-violet: 0 0 20px rgba(139, 92, 246, 0.25);
  --glow-yellow: 0 0 20px rgba(234, 179, 8, 0.2);
  --glow-red: 0 0 20px rgba(239, 68, 68, 0.25);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);

  /* Fonts */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', "SFMono-Regular", Consolas, monospace;
}

/* ==================== GLOBAL RESETS ==================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

/* Tech Grid Background Mesh Overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Radiant background glow effects */
body::after {
  content: "";
  position: fixed;
  top: -15%;
  left: 20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.04) 0%, rgba(6, 182, 212, 0.02) 50%, transparent 100%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

/* Custom Scrollbars */
.scrollbar-themed::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.scrollbar-themed::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.01);
}

.scrollbar-themed::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.scrollbar-themed::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.hide {
  display: none !important;
}

/* ==================== 1. ACCESS PORTAL (LOGIN SCREEN) ==================== */
.portal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
  background: radial-gradient(circle at center, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.portal-card {
  width: 100%;
  max-width: 460px;
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  box-shadow: var(--glass-shadow), var(--glow-emerald);
  border-radius: 20px;
  padding: 40px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
  animation: modalEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.portal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-color), var(--brand-cyan));
}

.portal-header {
  text-align: center;
  margin-bottom: 35px;
}

.portal-logo {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--brand-color);
  border: 1px solid rgba(16, 185, 129, 0.2);
  box-shadow: var(--glow-emerald);
}

.portal-logo svg {
  width: 32px;
  height: 32px;
}

.portal-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #ffffff 30%, #a7f3d0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.portal-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.portal-body label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.input-wrapper {
  position: relative;
  margin-bottom: 20px;
}

.input-wrapper input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 14px 48px 14px 16px;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--brand-color);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
  background: rgba(0, 0, 0, 0.5);
}

#toggle-key-visibility {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

#toggle-key-visibility:hover {
  color: var(--text-muted);
}

#toggle-key-visibility svg {
  width: 20px;
  height: 20px;
}

.submit-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--brand-color) 0%, #059669 100%);
  border: none;
  color: #ffffff;
  border-radius: 10px;
  padding: 15px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.submit-btn svg {
  width: 18px;
  height: 18px;
}

.error-toast {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  margin-bottom: 20px;
  text-align: center;
  animation: shake 0.3s ease-in-out;
}

.portal-footer {
  margin-top: 35px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: var(--text-dark);
  letter-spacing: 0.5px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 20px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--brand-color);
  border-radius: 50%;
  box-shadow: var(--glow-emerald);
  animation: pulseGreen 1.5s infinite;
}

/* ==================== 2. MAIN APP LAYOUT ==================== */
.dashboard-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  padding: 16px 24px;
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
}

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

.brand-logo {
  width: 44px;
  height: 44px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--brand-color);
  box-shadow: var(--glow-emerald);
}

.brand-logo svg {
  width: 24px;
  height: 24px;
}

.brand-text h2 {
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--brand-color);
  font-weight: 700;
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ffffff 40%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.global-stats-bar {
  display: flex;
  align-items: center;
  gap: 24px;
}

.stat-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding-right: 24px;
}

.stat-indicator:last-of-type {
  border-right: none;
}

.dot-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-indicator.green {
  background-color: var(--brand-color);
}

.dot-indicator.glow {
  box-shadow: var(--glow-emerald);
}

.green-text {
  color: var(--brand-color) !important;
}

.header-action-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.header-action-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  border-color: var(--panel-border-hover);
}

.header-action-btn svg {
  width: 14px;
  height: 14px;
}

/* ==================== 3. METRIC CARDS OVERVIEW ==================== */
.overview-metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  width: 100%;
}

@media (max-width: 1200px) {
  .overview-metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .overview-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.metric-card {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
}

.metric-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 2;
}

.metric-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.metric-subtitle {
  font-size: 0.68rem;
  color: var(--text-dark);
}

.metric-card h2 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  margin: 1px 0;
}

.metric-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #ffffff;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-icon-box.blue-glow {
  background: rgba(6, 182, 212, 0.08);
  color: var(--brand-cyan);
  border-color: rgba(6, 182, 212, 0.2);
  box-shadow: var(--glow-cyan);
}

.metric-icon-box.green-glow {
  background: rgba(16, 185, 129, 0.08);
  color: var(--brand-color);
  border-color: rgba(16, 185, 129, 0.2);
  box-shadow: var(--glow-emerald);
}

.metric-icon-box.yellow-glow {
  background: rgba(234, 179, 8, 0.08);
  color: var(--brand-yellow);
  border-color: rgba(234, 179, 8, 0.2);
  box-shadow: var(--glow-yellow);
}

.metric-icon-box.purple-glow {
  background: rgba(139, 92, 246, 0.08);
  color: var(--brand-violet);
  border-color: rgba(139, 92, 246, 0.2);
  box-shadow: var(--glow-violet);
}

.metric-icon-box svg {
  width: 18px;
  height: 18px;
}

/* Card bottom tiny indicator bar */
.card-progress-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
}

.progress-bar-bg {
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.03);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.blue-gradient {
  background: linear-gradient(90deg, var(--brand-cyan), #0891b2);
}

.green-gradient {
  background: linear-gradient(90deg, var(--brand-color), #059669);
}

.yellow-gradient {
  background: linear-gradient(90deg, var(--brand-yellow), #ca8a04);
}

.purple-gradient {
  background: linear-gradient(90deg, var(--brand-violet), #7c3aed);
}

/* ==================== 4. MAIN GRID LAYOUT ==================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
  width: 100%;
}

@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

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

.flex-grow-1 {
  flex-grow: 1;
}

.gap-2 {
  gap: 20px;
}

.pad-0 {
  padding: 0 !important;
}

.size-300 {
  height: 300px;
}

.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
}

.panel-card {
  width: 100%;
}

.panel-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.panel-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.panel-icon {
  width: 18px;
  height: 18px;
  color: var(--brand-cyan);
}

.count-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: var(--brand-cyan);
  padding: 1px 7px;
  border-radius: 10px;
}

.panel-body {
  padding: 20px;
  position: relative;
}

/* ==================== 5. SERVER NODES GRID ==================== */
.nodes-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.node-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.node-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

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

.node-card-title h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
}

.node-card-title p {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

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

.node-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}

.node-badge.online {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--brand-color);
  box-shadow: var(--glow-emerald);
}

.node-badge.offline {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--brand-red);
  box-shadow: var(--glow-red);
}

.node-badge.paused {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.2);
  color: var(--brand-yellow);
  box-shadow: var(--glow-yellow);
}

.remove-node-btn {
  background: transparent;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.remove-node-btn:hover {
  color: var(--brand-red);
  background: rgba(239, 68, 68, 0.08);
}

.remove-node-btn svg {
  width: 15px;
  height: 15px;
}

/* Node Resource Stats Bar */
.node-progress-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.node-progress-row {
  display: grid;
  grid-template-columns: 80px 1fr 40px;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
}

.progress-label {
  color: var(--text-muted);
  font-weight: 500;
}

.progress-val {
  font-family: var(--font-mono);
  color: #ffffff;
  font-weight: 600;
  text-align: right;
}

.node-mini-progress-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  overflow: hidden;
}

.node-mini-progress-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.node-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: var(--text-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  padding-top: 8px;
}

/* ==================== 6. ACTIVE CLIENT CREDENTIALS ==================== */
.keys-table-wrapper {
  max-height: 250px;
  overflow-y: auto;
}

.keys-list {
  display: flex;
  flex-direction: column;
}

.key-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.key-list-item:last-child {
  border-bottom: none;
}

.key-user-details h5 {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
}

.key-user-details p {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-dark);
}

.key-permissions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.perm-badge {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.perm-badge.camoufox {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.15);
  color: var(--brand-cyan);
}

.perm-badge.octo {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.15);
  color: var(--brand-violet);
}

.perm-badge.admin {
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.15);
  color: var(--brand-yellow);
}

.perm-badge.webkit {
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.15);
  color: #0ea5e9;
}

.perm-badge.chromium {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.perm-badge.cloakbrowser {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.perm-badge.chrome {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.15);
  color: #dc2626;
}

.perm-badge.brave {
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.perm-badge.firefox {
  background: rgba(236, 72, 153, 0.08);
  border: 1px solid rgba(236, 72, 153, 0.15);
  color: #ec4899;
}

/* Stretch body for panels that have flex-grow-1 */
.glass-panel.flex-grow-1 .panel-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* ==================== 7. RUNNING SESSIONS TABLE ==================== */
.table-container {
  flex-grow: 1;
  overflow-y: auto;
  width: 100%;
  height: 0;
  /* Allows table to respect scroll limits in flexbox */
}

/* Table Filters & Search Bar Styling */
.table-filters-bar {
  display: flex;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.01);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.table-filters-bar input,
.table-filters-bar select {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  color: #ffffff;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.8rem;
  outline: none;
  transition: all 0.25s ease;
}

.table-filters-bar input:focus,
.table-filters-bar select:focus {
  border-color: var(--brand-cyan);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.15);
}

.table-filters-bar input {
  flex-grow: 1;
  max-width: 320px;
}

.table-filters-bar select {
  cursor: pointer;
  padding-right: 28px;
}


table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.015);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

td {
  padding: 12px 18px;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  vertical-align: middle;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

.session-id-cell {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--brand-cyan);
  cursor: pointer;
  padding: 2px 6px;
  background: rgba(6, 182, 212, 0.05);
  border: 1px dashed rgba(6, 182, 212, 0.15);
  border-radius: 6px;
  display: inline-flex;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-id-cell:hover {
  background: rgba(6, 182, 212, 0.1);
}

.node-cell {
  font-weight: 500;
}

.node-cell span {
  font-size: 0.7rem;
  display: block;
  color: var(--text-dark);
  font-family: var(--font-mono);
}

.engine-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.engine-badge.camoufox {
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.engine-badge.octo {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.15);
  color: var(--brand-violet);
}

.engine-badge.webkit {
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.15);
  color: #0ea5e9;
}

.engine-badge.chromium {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.engine-badge.cloakbrowser {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.engine-badge.chrome {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.15);
  color: #dc2626;
}

.engine-badge.brave {
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.engine-badge.firefox {
  background: rgba(236, 72, 153, 0.08);
  border: 1px solid rgba(236, 72, 153, 0.15);
  color: #ec4899;
}

.timestamp-cell {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.duration-cell {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.8rem;
  color: #ffffff;
}

.action-cell {
  text-align: right;
}

.align-right {
  text-align: right;
}

.stop-session-btn {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: var(--brand-red);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stop-session-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  box-shadow: var(--glow-red);
}

.stop-session-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==================== 8. LIVE GATEWAY ACCESS STREAM ==================== */
.logs-feed {
  max-height: 236px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  font-size: 0.75rem;
}

.log-item:last-child {
  border-bottom: none;
}

.log-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.log-ts {
  color: var(--text-dark);
  font-family: var(--font-mono);
}

.log-action {
  font-family: var(--font-mono);
  color: #ffffff;
  font-weight: 500;
}

.log-status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.log-status-badge.status-2xx {
  background: rgba(16, 185, 129, 0.1);
  color: var(--brand-color);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.log-status-badge.status-4xx {
  background: rgba(234, 179, 8, 0.1);
  color: var(--brand-yellow);
  border: 1px solid rgba(234, 179, 8, 0.2);
}

.log-status-badge.status-5xx {
  background: rgba(239, 68, 68, 0.1);
  color: var(--brand-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ==================== 9. ADD SERVER MODAL ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 7, 18, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-secondary);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  animation: modalEntrance 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.close-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.close-icon-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.close-icon-btn svg {
  width: 18px;
  height: 18px;
}

.modal-form {
  padding: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-group label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.form-group input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 12px;
  color: #ffffff;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--brand-cyan);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.15);
}

.input-tip {
  font-size: 0.65rem;
  color: var(--text-dark);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 30px;
}

.cancel-btn {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cancel-btn:hover {
  background: rgba(255, 255, 255, 0.03);
  color: #ffffff;
}

.submit-btn-sm {
  background: linear-gradient(135deg, var(--brand-cyan) 0%, #0891b2 100%);
  border: none;
  color: #ffffff;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.submit-btn-sm:hover {
  box-shadow: var(--glow-cyan);
}

.submit-btn-sm svg {
  width: 14px;
  height: 14px;
}

/* ==================== 10. HELPER STATES ==================== */
.loading-state {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  gap: 16px;
  width: 100%;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--brand-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  color: var(--text-dark);
  text-align: center;
  gap: 12px;
}

.empty-state svg {
  width: 36px;
  height: 36px;
  opacity: 0.3;
}

.accent-btn-sm {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: var(--brand-cyan);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.accent-btn-sm:hover {
  background: rgba(6, 182, 212, 0.15);
  box-shadow: var(--glow-cyan);
}

.accent-btn-sm svg {
  width: 14px;
  height: 14px;
}

/* Keyframe animations */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulseGreen {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-4px);
  }

  75% {
    transform: translateX(4px);
  }
}

@keyframes modalEntrance {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ==================== SUMMARY TABLES LAYOUT ==================== */
.summary-tables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
}

@media (max-width: 768px) {
  .summary-tables-grid {
    grid-template-columns: 1fr;
  }
}

.summary-table-card {
  flex-grow: 1;
}

.summary-table-container {
  max-height: 160px;
  overflow-y: auto;
  padding: 4px 12px 12px 12px;
}

.summary-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.summary-mini-table th,
.summary-mini-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.summary-mini-table th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.015);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.summary-mini-table td {
  color: var(--text-main);
  font-size: 0.8rem;
}

.summary-mini-table tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

.summary-mini-table tr:last-child td {
  border-bottom: none;
}

.text-center {
  text-align: center !important;
}
/* ==========================================================================
   📊 SUMMARY-FIRST DASHBOARD COMPONENTS (v2)
   ========================================================================== */

/* Quick stat strip */
.quickstat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .quickstat-strip { grid-template-columns: repeat(2, 1fr); } }
.quickstat {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  backdrop-filter: blur(12px);
}
.quickstat .qs-label {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-muted); font-weight: 600;
}
.quickstat strong {
  font-size: 1.7rem; font-weight: 700; color: var(--text-main); line-height: 1.1;
  font-family: var(--font-mono);
}
.quickstat .qs-sub { font-size: 0.68rem; color: var(--text-dark); }

/* Node-health chips */
.health-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 700px) { .health-chips { grid-template-columns: repeat(2, 1fr); } }
.health-chip {
  cursor: pointer;
  border-radius: 12px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  color: var(--text-main);
}
.health-chip:hover { transform: translateY(-2px); border-color: var(--panel-border-hover); }
.health-chip .hc-count { font-size: 1.8rem; font-weight: 700; font-family: var(--font-mono); line-height: 1; }
.health-chip .hc-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.health-chip.up { border-left: 3px solid var(--brand-color); }
.health-chip.up .hc-count { color: var(--brand-color); }
.health-chip.unreachable { border-left: 3px solid var(--brand-red); }
.health-chip.unreachable .hc-count { color: var(--brand-red); }
.health-chip.degraded { border-left: 3px solid var(--brand-yellow); }
.health-chip.degraded .hc-count { color: var(--brand-yellow); }
.health-chip.other { border-left: 3px solid var(--text-dark); }
.health-chip.other .hc-count { color: var(--text-muted); }

.stacked-bar {
  display: flex;
  width: 100%;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.04);
}
.stack-seg { height: 100%; transition: width 0.6s ease; }
.stack-seg.seg-up { background: var(--brand-color); }
.stack-seg.seg-unreachable { background: var(--brand-red); }
.stack-seg.seg-503 { background: var(--brand-yellow); }
.stack-seg.seg-other { background: var(--text-dark); }

.drill-hint { margin-top: 12px; font-size: 0.68rem; color: var(--text-dark); }

/* Capacity aggregate header cluster */
.cap-aggregate { display: flex; align-items: center; gap: 16px; font-size: 0.72rem; color: var(--text-muted); flex-wrap: wrap; }
.cap-aggregate strong { font-family: var(--font-mono); font-size: 0.9rem; color: var(--text-main); margin-left: 4px; }
.c-cyan { color: var(--brand-cyan) !important; }
.c-green { color: var(--brand-color) !important; }

.util-pill {
  font-family: var(--font-mono); font-weight: 700; font-size: 0.75rem;
  padding: 3px 10px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.06); color: var(--text-main);
}
.util-pill.pill-green { background: rgba(16, 185, 129, 0.15); color: var(--brand-color); }
.util-pill.pill-yellow { background: rgba(234, 179, 8, 0.15); color: var(--brand-yellow); }
.util-pill.pill-red { background: rgba(239, 68, 68, 0.15); color: var(--brand-red); }

/* Histograms */
.histogram {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 180px;
  padding-top: 8px;
}
.hist-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: none;
  color: var(--text-muted);
  border-radius: 8px;
  padding: 4px 2px;
  transition: background 0.15s ease;
}
.hist-col:hover { background: rgba(255, 255, 255, 0.03); }
.hist-col.is-empty { cursor: default; opacity: 0.55; }
.hist-count { font-size: 0.72rem; font-weight: 700; font-family: var(--font-mono); color: var(--text-main); }
.hist-bar {
  width: 100%;
  max-width: 46px;
  min-height: 2px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--brand-cyan), rgba(6, 182, 212, 0.35));
  position: relative;
  display: flex;
  align-items: flex-end;
  transition: height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.hist-bar-used {
  width: 100%;
  border-radius: 0 0 2px 2px;
  background: rgba(255, 255, 255, 0.28);
}
.hist-bar.sev-low { background: linear-gradient(180deg, var(--brand-color), rgba(16, 185, 129, 0.3)); }
.hist-bar.sev-mid { background: linear-gradient(180deg, var(--brand-yellow), rgba(234, 179, 8, 0.3)); }
.hist-bar.sev-high { background: linear-gradient(180deg, var(--brand-red), rgba(239, 68, 68, 0.3)); }
.hist-label { font-size: 0.64rem; color: var(--text-dark); text-align: center; font-family: var(--font-mono); }

/* Two-up distribution grid */
.dist-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .dist-grid { grid-template-columns: 1fr; } }

/* Open-browsers breakdown */
.breakdown-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 800px) { .breakdown-grid { grid-template-columns: 1fr; } }
.breakdown-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 12px; font-weight: 600; }
.bars { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.bars-empty { font-size: 0.75rem; color: var(--text-dark); }
.hbar {
  display: grid;
  grid-template-columns: 130px 1fr 46px;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  background: none;
  padding: 4px 6px;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.hbar:hover { background: rgba(255, 255, 255, 0.03); }
.hbar-label { font-size: 0.74rem; color: var(--text-main); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 10px; background: rgba(255, 255, 255, 0.05); border-radius: 6px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 6px; transition: width 0.5s ease; }
.hbar-fill.browser { background: linear-gradient(90deg, var(--brand-violet), rgba(139, 92, 246, 0.4)); }
.hbar-fill.client { background: linear-gradient(90deg, var(--brand-cyan), rgba(6, 182, 212, 0.4)); }
.hbar-count { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700; color: var(--text-main); text-align: right; }

/* Detail (drill-down) modal */
.detail-modal-card { max-width: 1000px; display: flex; flex-direction: column; max-height: 88vh; }
.detail-filter-bar { display: flex; gap: 10px; padding: 14px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.detail-filter-bar input, .detail-filter-bar select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 0.78rem;
  font-family: var(--font-sans);
}
.detail-filter-bar input { flex: 1; }
.detail-body { overflow-y: auto; flex: 1; padding: 4px 0; }
.detail-empty, .detail-loading { padding: 40px 20px; text-align: center; color: var(--text-dark); font-size: 0.8rem; }
.detail-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.detail-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.footer-note { font-size: 0.72rem; color: var(--text-muted); }

.detail-table { width: 100%; border-collapse: collapse; font-size: 0.76rem; }
.detail-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg-secondary);
  text-align: left; padding: 10px 16px;
  font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); border-bottom: 1px solid var(--panel-border);
}
.detail-table tbody td { padding: 10px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); vertical-align: middle; }
.detail-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.detail-table .mono { font-family: var(--font-mono); }
.detail-table .muted { color: var(--text-dark); }
.detail-table .align-right { text-align: right; }
.nd-name { font-weight: 600; color: var(--text-main); }
.nd-url { font-size: 0.66rem; color: var(--text-dark); font-family: var(--font-mono); }
.node-err { font-size: 0.66rem; color: var(--brand-red); margin-top: 3px; }
.mini-meter { width: 90px; height: 8px; background: rgba(255, 255, 255, 0.06); border-radius: 5px; overflow: hidden; display: inline-block; vertical-align: middle; }
.mini-meter span { display: block; height: 100%; border-radius: 5px; }

/* ==========================================================================
   📈 24H HISTORY MODAL + LINE CHARTS
   ========================================================================== */
.history-modal-card { max-width: 1060px; display: flex; flex-direction: column; max-height: 90vh; }
.history-body { overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 22px; }
.chart-panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px 18px 10px;
}
.chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.chart-head h4 { font-size: 0.82rem; font-weight: 700; color: var(--text-main); text-transform: uppercase; letter-spacing: 0.4px; }
.chart-sub { font-size: 0.66rem; color: var(--text-dark); font-weight: 500; text-transform: none; letter-spacing: 0; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; }
.legend-item { font-size: 0.72rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; }
.legend-item strong { font-family: var(--font-mono); color: var(--text-main); font-size: 0.74rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-host { width: 100%; }
.line-chart { width: 100%; height: auto; display: block; }
.line-chart .grid-line { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; }
.line-chart .axis-label { fill: var(--text-dark); font-size: 13px; font-family: var(--font-mono); }
.line-chart .axis-label.y { text-anchor: end; dominant-baseline: middle; }
.line-chart .axis-label.x { text-anchor: middle; }
.chart-empty { padding: 40px 20px; text-align: center; color: var(--text-dark); font-size: 0.82rem; }

/* Inline history section on the main page + hover tooltip */
.history-inline { display: flex; flex-direction: column; gap: 22px; }
.chart-host { position: relative; }
.line-chart { overflow: visible; }
.line-chart .crosshair-line { stroke: rgba(255, 255, 255, 0.35); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tooltip {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  pointer-events: none;
  background: rgba(8, 12, 24, 0.95);
  border: 1px solid var(--panel-border-hover);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 118px;
  box-shadow: var(--glass-shadow);
  z-index: 5;
}
.chart-tooltip .tt-time { font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-muted); margin-bottom: 5px; }
.chart-tooltip .tt-row { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.chart-tooltip .tt-row .tt-name { flex: 1; }
.chart-tooltip .tt-row strong { font-family: var(--font-mono); color: var(--text-main); }
.chart-tooltip .tt-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* ==========================================================================
   ⚖️ BALANCERS PANEL + AUTOSCALE ADVISORY
   ========================================================================== */
.autoscale-advice {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  padding: 5px 12px; border-radius: 20px; white-space: nowrap;
  background: rgba(255, 255, 255, 0.05); color: var(--text-muted);
  border: 1px solid var(--panel-border);
}
.autoscale-advice.hold { color: var(--text-muted); }
.autoscale-advice.out { background: rgba(234, 179, 8, 0.14); color: var(--brand-yellow); border-color: rgba(234, 179, 8, 0.3); }
.autoscale-advice.in { background: rgba(6, 182, 212, 0.14); color: var(--brand-cyan); border-color: rgba(6, 182, 212, 0.3); }

.balancers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.balancer-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 14px 16px;
}
.balancer-card.self { border-left: 3px solid var(--brand-color); }
.balancer-card.offline { opacity: 0.6; }
.bc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.bc-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.bc-dot.green { background: var(--brand-color); box-shadow: var(--glow-emerald); }
.bc-dot.yellow { background: var(--brand-yellow); }
.bc-dot.red { background: var(--brand-red); }
.bc-name { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-main); font-weight: 600; }
.bc-self { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--brand-color); background: rgba(16,185,129,0.12); padding: 2px 6px; border-radius: 4px; }
.bc-offline { font-size: 0.75rem; color: var(--brand-red); }
.bc-metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.bc-metrics > div { display: flex; flex-direction: column; gap: 1px; }
.bc-metrics span { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-dark); }
.bc-metrics strong { font-family: var(--font-mono); font-size: 0.92rem; color: var(--text-main); }
.bc-metrics small { font-size: 0.6rem; color: var(--text-dark); font-family: var(--font-mono); }
@media (max-width: 700px) { .bc-metrics { grid-template-columns: repeat(3, 1fr); } }


/* ---- history range selector ---- */
.history-header-right { display: flex; align-items: center; gap: 14px; }
.range-seg {
  display: inline-flex;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}
.range-btn {
  background: transparent;
  border: 0;
  border-right: 1px solid var(--panel-border);
  color: var(--text-dark);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.range-btn:last-child { border-right: 0; }
.range-btn:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.05); }
.range-btn.is-active {
  color: var(--bg-primary);
  background: var(--brand-cyan);
  font-weight: 600;
}
@media (max-width: 700px) {
  .history-header-right { flex-direction: column; align-items: flex-end; gap: 6px; }
  .history-header-right .drill-hint { display: none; }
}


/* ---- proxy traffic panel ---- */
.gost-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
@media (max-width: 800px) { .gost-tiles { grid-template-columns: repeat(2, 1fr); } }
.gost-tile {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 12px 14px;
}
.gost-tile-label { font-size: 0.66rem; color: var(--text-dark); text-transform: uppercase; letter-spacing: 0.05em; }
.gost-tile-value { font-family: var(--font-mono); font-size: 1.15rem; color: var(--text-main); margin-top: 4px; }
.gost-split { display: flex; height: 10px; border-radius: 999px; overflow: hidden; margin: 10px 0 6px; background: rgba(255,255,255,0.05); }
.gost-split-dc { background: var(--brand-cyan); }
.gost-split-resi { background: var(--brand-violet); }
.gost-split-unknown { background: var(--text-dark); }
.gost-split-legend { display: flex; gap: 16px; font-size: 0.7rem; color: var(--text-dark); margin-bottom: 14px; }
.gost-split-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }


/* ---- inline panel tables ----
   .table-container is for the drill-down modal: it relies on a flex parent to
   give it height, and carries `height: 0` so it can scroll inside one. Used in a
   normal panel body there is no flex context, so it collapses to nothing and the
   table renders invisibly. Inline panel tables use this instead. */
.panel-table-wrap {
  width: 100%;
  overflow-x: auto;
  max-height: 520px;
  overflow-y: auto;
}
.panel-table-wrap thead th {
  position: sticky;
  top: 0;
  background: var(--panel-bg);
  z-index: 1;
}
