/* ============================================================
   Nebula UI Design System — 火神面板
   Complete Redesign: Dark • Gloss • Gaming-inspired
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Brand Colors */
  --nebula-primary: #22d3ee;
  --nebula-primary-dark: #0891b2;
  --nebula-secondary: #8b5cf6;
  --nebula-accent: #3b82f6;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);
  --gradient-secondary: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  --gradient-sidebar: linear-gradient(180deg, #0f1729 0%, #1a1f3a 100%);
  --gradient-header: linear-gradient(135deg, #0f1729 0%, #1a2341 100%);
  --gradient-card: linear-gradient(145deg, rgba(30, 41, 79, 0.6) 0%, rgba(25, 33, 61, 0.4) 100%);
  --gradient-success: linear-gradient(135deg, #10b981, #059669);
  --gradient-warning: linear-gradient(135deg, #f59e0b, #d97706);
  --gradient-danger: linear-gradient(135deg, #ef4444, #dc2626);

  /* Surfaces */
  --bg-deep: #080c1a;
  --bg-body: #0d1128;
  --bg-card: rgba(20, 28, 58, 0.75);
  --bg-card-hover: rgba(30, 41, 79, 0.85);
  --bg-sidebar: rgba(12, 18, 40, 0.95);
  --bg-input: rgba(30, 41, 79, 0.6);
  --bg-glass: rgba(255, 255, 255, 0.04);

  /* Borders */
  --border-card: 1px solid rgba(255, 255, 255, 0.08);
  --border-input: 1px solid rgba(255, 255, 255, 0.12);
  --border-focus: 1px solid rgba(34, 211, 238, 0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(34, 211, 238, 0.15);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);

  /* Typography */
  --font-body: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #22d3ee;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed: 0px;
  --header-height: 64px;

  /* Key Visual */
  --glow-cyan: 0 0 15px rgba(34, 211, 238, 0.3);
  --noise-texture: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
}

/* ---------- Base Styles ---------- */
body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--bg-body);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 背景图层 */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url('/R-C.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

::selection {
  background: rgba(34, 211, 238, 0.3);
  color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }

/* ---------- Layout ---------- */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar — 毛玻璃效果 */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: rgba(6, 10, 22, 0.65);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1040;
  transition: transform var(--transition-normal);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  box-shadow: var(--glow-cyan);
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-user {
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}

.sidebar-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--text-accent);
  letter-spacing: 0.5px;
}

/* Sidebar Navigation */
.sidebar-nav {
  padding: var(--space-sm);
  flex: 1;
}

.sidebar-section-title {
  padding: var(--space-md) var(--space-md) var(--space-sm);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  opacity: 0.6;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-md);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  font-size: 14px;
  font-weight: 500;
  position: relative;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-link.active {
  color: var(--text-primary);
  background: rgba(34, 211, 238, 0.12);
  box-shadow: inset 3px 0 0 var(--nebula-primary);
}

.sidebar-link .bi {
  width: 20px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-link .badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--gradient-primary);
  color: white;
}

.sidebar-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-footer .sidebar-link {
  font-size: 13px;
  color: var(--text-muted);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-normal);
}

/* Top Header Bar — 毛玻璃效果 */
.top-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--header-height);
  background: rgba(6, 10, 22, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
}

.top-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: none;
}

.sidebar-toggle:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.top-header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.top-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header-user-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  cursor: default;
}

/* Page Content — 透明背景，显露 body 背景图 */
.page-content {
  padding: var(--space-lg);
  flex: 1;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.page-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 24px;
  color: var(--text-primary);
  margin: 0;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 4px 0 0;
}

/* ---------- Cards — 毛玻璃效果 ---------- */
.nebula-card {
  background: rgba(15, 22, 50, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: all var(--transition-normal);
  overflow: hidden;
}

.nebula-card:hover {
  background: rgba(25, 38, 80, 0.65);
  border-color: rgba(34, 211, 238, 0.2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 20px rgba(34, 211, 238, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.nebula-card-header {
  padding: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.nebula-card-header h5,
.nebula-card-header .card-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  margin: 0;
}

.nebula-card-body {
  padding: var(--space-lg);
}

/* ---------- Stat Cards — 毛玻璃效果 ---------- */
.stat-card {
  background: rgba(15, 22, 50, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stat-card:nth-child(1)::before { background: var(--gradient-primary); }
.stat-card:nth-child(2)::before { background: var(--gradient-secondary); }
.stat-card:nth-child(3)::before { background: var(--gradient-success); }
.stat-card:nth-child(4)::before { background: var(--gradient-warning); }

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: var(--space-md);
}

.stat-card:nth-child(1) .stat-card-icon { background: rgba(34, 211, 238, 0.15); color: var(--nebula-primary); }
.stat-card:nth-child(2) .stat-card-icon { background: rgba(139, 92, 246, 0.15); color: var(--nebula-secondary); }
.stat-card:nth-child(3) .stat-card-icon { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.stat-card:nth-child(4) .stat-card-icon { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

.stat-card-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-card-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
  font-weight: 500;
}

.stat-card:hover {
  background: rgba(25, 38, 80, 0.65);
  border-color: rgba(34, 211, 238, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 20px rgba(34, 211, 238, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ---------- Buttons ---------- */
.nebula-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  font-family: var(--font-body);
  white-space: nowrap;
}

.nebula-btn:focus-visible {
  outline: 2px solid var(--nebula-primary);
  outline-offset: 2px;
}

.nebula-btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 2px 10px rgba(34, 211, 238, 0.25);
}

.nebula-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.35);
  color: white;
}

.nebula-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: var(--border-input);
}

.nebula-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.nebula-btn-danger {
  background: var(--gradient-danger);
  color: white;
}

.nebula-btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
  color: white;
}

.nebula-btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.nebula-btn-lg {
  padding: 12px 28px;
  font-size: 16px;
}

/* ---------- Forms ---------- */
.nebula-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-input);
  border: var(--border-input);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  outline: none;
}

.nebula-input:focus {
  border-color: var(--nebula-primary);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.nebula-input::placeholder {
  color: var(--text-muted);
}

.nebula-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-input);
  border: var(--border-input);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.nebula-form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.nebula-form-group {
  margin-bottom: var(--space-lg);
}

.nebula-error {
  color: #f87171;
  font-size: 12px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nebula-error::before {
  content: '\F332';
  font-family: 'bootstrap-icons';
  font-size: 12px;
}

/* ---------- Tables (DataTables) ---------- */
.table-nebula {
  width: 100% !important;
  margin: 0 !important;
}

.table-nebula thead th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: var(--border-card);
  padding: 12px 16px;
  white-space: nowrap;
}

.table-nebula tbody td {
  padding: 12px 16px;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.table-nebula tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.table-nebula tbody tr:last-child td {
  border-bottom: none;
}

/* DataTables Custom Overrides */
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  color: var(--text-secondary) !important;
  font-size: 13px !important;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
  border: var(--border-input) !important;
  border-radius: var(--radius-sm) !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
}

.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--nebula-primary) !important;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1) !important;
}

.dataTables_wrapper .dataTables_info {
  color: var(--text-muted) !important;
  font-size: 13px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--text-secondary) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: var(--border-card) !important;
  border-radius: var(--radius-sm) !important;
  padding: 6px 14px !important;
  font-size: 13px !important;
  margin: 0 2px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  color: var(--text-primary) !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  color: white !important;
  background: var(--gradient-primary) !important;
  border-color: transparent !important;
  box-shadow: 0 2px 8px rgba(34, 211, 238, 0.3) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
}

/* ---------- Alerts & Messages ---------- */
.nebula-alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 14px;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  animation: alertSlideIn 0.3s ease-out;
}

.nebula-alert-success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.nebula-alert-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.nebula-alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.2);
  color: #fde68a;
}

.nebula-alert-info {
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.2);
  color: #67e8f9;
}

@keyframes alertSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Badges ---------- */
.nebula-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.nebula-badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.nebula-badge-inactive {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.nebula-badge-admin {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
}

.nebula-badge-user {
  background: rgba(34, 211, 238, 0.15);
  color: #67e8f9;
}

/* ---------- Auth Pages ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  padding: var(--space-lg);
}

.auth-container {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  background: var(--gradient-card);
  border: var(--border-card);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(34, 211, 238, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-logo-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--gradient-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
  margin-bottom: var(--space-md);
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

/* ---------- Key Display ---------- */
.key-sensi {
  filter: blur(5px);
  transition: filter var(--transition-normal);
  user-select: none;
}

.key-sensi:hover {
  filter: blur(0);
}

.key-monospace {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.5px;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1039;
  }

  .sidebar-overlay.show {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: flex;
  }
}

@media (max-width: 767.98px) {
  .top-header-title {
    display: none;
  }

  .page-content {
    padding: var(--space-md);
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-title {
    font-size: 20px;
  }

  .auth-container {
    max-width: 100%;
  }
}

/* ---------- Misc Utilities ---------- */
.text-accent { color: var(--text-accent); }
.text-muted-custom { color: var(--text-muted); }
.bg-glass { background: var(--bg-glass); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* Grid helpers */
.row-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

/* Divider */
.nebula-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  margin: var(--space-lg) 0;
}

/* ---------- Navbar Toggler Animation ---------- */
.sidebar-brand .bi-laptop,
.top-header .bi-laptop {
  color: var(--text-accent);
}

/* ---------- Tooltip Override ---------- */
.tooltip-inner {
  background: var(--bg-card) !important;
  border: var(--border-card) !important;
  color: var(--text-primary) !important;
  font-size: 12px !important;
  backdrop-filter: blur(12px) !important;
}

.tooltip-arrow::before {
  border-top-color: var(--bg-card) !important;
}

/* ---------- Smooth SweetAlert2 ---------- */
.swal2-popup {
  background: var(--bg-card) !important;
  border: var(--border-card) !important;
  border-radius: var(--radius-lg) !important;
  backdrop-filter: blur(20px) !important;
}

.swal2-title {
  color: var(--text-primary) !important;
}

.swal2-content {
  color: var(--text-secondary) !important;
}

.swal2-confirm {
  background: var(--gradient-primary) !important;
  box-shadow: 0 2px 10px rgba(34, 211, 238, 0.25) !important;
}
