/* ─── Design Tokens ────────────────────────────────────────────────────────── */
:root {
  color-scheme: dark;
  --bg:          #090b11;
  --bg-accent:   #10131b;
  --bg-card:     rgba(19, 23, 34, 0.88);
  --bg-hover:    rgba(255, 255, 255, 0.055);
  --bg-hero:     linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(16, 185, 129, 0.07));
  
  --primary:     #818cf8;
  --primary-glow: rgba(129, 140, 248, 0.22);
  --secondary:   #4f46e5;
  --secondary-glow: rgba(79, 70, 229, 0.24);
  
  --accent-cyan: #67e8f9;
  --accent-purple: #a78bfa;
  --accent-green: #34d399;
  --accent-red: #fb7185;
  --accent-orange: #fbbf24;
  
  --text-main:   #f4f6fb;
  --text-dim:    #a3abc0;
  --text-muted:  #6b7280;
  
  /* Legacy aliases used in older HTML */
  --text:        #f8fafc;
  --text2:       #94a3b8;
  --text3:       #475569;
  --bg2:         #0a0d14;
  --bg3:         rgba(255,255,255,0.03);
  --cyan:        #00f2ff;
  --cyan-dim:    rgba(0, 242, 255, 0.1);
  --purple:      #7000ff;
  --purple-dim:  rgba(112, 0, 255, 0.1);
  --green:       #00ff88;
  --red:         #ff3e3e;
  --orange:      #ff9d00;
  --blue:        #3b82f6;
  --orange-dim:  rgba(255, 157, 0, 0.1);
  --radius:      10px;
  
  --border:      rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 255, 255, 0.15);
  
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   24px;
  --radius-xl:   30px;
  --glass:       blur(18px) saturate(140%);
  --shadow-lg:   0 24px 64px rgba(0,0,0,0.38);
  --shadow-sm:   0 10px 30px rgba(0,0,0,0.20);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg:          #eef3f8;
  --bg-accent:   #f8fbff;
  --bg-card:     rgba(255, 255, 255, 0.8);
  --bg-hover:    rgba(15, 23, 42, 0.04);
  --primary-glow: rgba(0, 128, 255, 0.18);
  --secondary-glow: rgba(112, 0, 255, 0.12);
  --text-main:   #0f172a;
  --text-dim:    #475569;
  --text-muted:  #64748b;
  --text:        #0f172a;
  --text2:       #475569;
  --text3:       #64748b;
  --bg2:         #ffffff;
  --bg3:         rgba(15, 23, 42, 0.04);
  --border:      rgba(15, 23, 42, 0.10);
  --border-focus: rgba(15, 23, 42, 0.18);
  --glass:       blur(10px) saturate(160%);
}

/* ─── Base Styles ───────────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(circle at 8% 0%, rgba(99, 102, 241, 0.10) 0%, transparent 34%),
    radial-gradient(circle at 100% 100%, rgba(16, 185, 129, 0.055) 0%, transparent 38%);
  color: var(--text-main);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  height: 100vh;
  overflow: hidden;
  display: flex;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(99, 102, 241, 0.035), transparent 35%),
    linear-gradient(300deg, rgba(16, 185, 129, 0.025), transparent 40%);
}

/* ─── Scrollbars ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Layout ─────────────────────────────────────────────────────────────────── */
.layout {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
}

/* ─── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
  width: 248px;
  background: var(--bg-accent);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  backdrop-filter: var(--glass);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.02);
}

.sidebar-logo {
  padding: 30px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: white;
  font-size: 20px;
  box-shadow: 0 10px 28px var(--primary-glow);
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.sidebar-nav {
  flex: 1;
  padding: 0 16px;
  overflow-y: auto;
}

.nav-section {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 24px 12px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 4px;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  transform: translateX(5px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(0, 242, 255, 0.1), transparent);
  color: var(--primary);
  border-left: 3px solid var(--primary);
}

.nav-icon { font-size: 18px; }

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: white;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.sidebar-logout {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.sidebar-logout:hover {
  background: rgba(255, 62, 62, 0.1);
  color: var(--accent-red);
  border-color: rgba(255, 62, 62, 0.2);
}

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

.topbar {
  min-height: 72px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  backdrop-filter: var(--glass);
  background: rgba(4, 6, 10, 0.28);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.content {
  flex: 1;
  padding: 32px 40px 40px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

/* ─── Cards & Containers ─────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: var(--glass);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent 40%);
}

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

.card-title { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }

/* ─── Stats Grid ─────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: rgba(94, 252, 255, 0.3);
  box-shadow: var(--shadow-lg);
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), transparent 45%);
  pointer-events: none;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-value { font-size: 28px; font-weight: 700; color: var(--text-main); }
.stat-label { font-size: 13px; color: var(--text-dim); font-weight: 500; }

/* Color variants for stats */
.stat-card.cyan .stat-icon   { background: rgba(0, 242, 255, 0.1); color: var(--accent-cyan); }
.stat-card.purple .stat-icon { background: rgba(112, 0, 255, 0.1); color: var(--accent-purple); }
.stat-card.green .stat-icon  { background: rgba(0, 255, 136, 0.1); color: var(--accent-green); }
.stat-card.red .stat-icon    { background: rgba(255, 62, 62, 0.1); color: var(--accent-red); }
.stat-card.orange .stat-icon { background: rgba(255, 157, 0, 0.1); color: var(--accent-orange); }

/* ─── Tables ─────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 12px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 10px;
  font-size: 13px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:hover td { background: var(--bg-hover); color: var(--text-main); }

.mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--primary); }

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  text-decoration: none;
  position: relative;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #c6fbff);
  color: #021014;
  box-shadow: 0 8px 22px rgba(94, 252, 255, 0.22);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(94, 252, 255, 0.28); }

.btn-danger {
  background: rgba(255, 62, 62, 0.1);
  color: var(--accent-red);
  border-color: rgba(255, 62, 62, 0.2);
}

.btn-danger:hover {
  background: var(--accent-red);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 62, 62, 0.3);
}

.btn-success {
  background: rgba(0, 255, 136, 0.1);
  color: var(--accent-green);
  border-color: rgba(0, 255, 136, 0.2);
}

.btn-success:hover {
  background: var(--accent-green);
  color: #000;
  box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
}

.btn-warning {
  background: rgba(255, 157, 0, 0.1);
  color: var(--accent-orange);
  border-color: rgba(255, 157, 0, 0.2);
}

.btn-warning:hover {
  background: var(--accent-orange);
  color: #000;
  box-shadow: 0 4px 12px rgba(255, 157, 0, 0.3);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-main);
}

.btn-outline:hover { background: var(--bg-hover); border-color: rgba(94, 252, 255, 0.22); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
}

.btn-ghost:hover { color: var(--text-main); background: var(--bg-hover); }

.btn-sm {
  padding: 5px 9px;
  font-size: 11px;
  border-radius: var(--radius-sm);
  gap: 4px;
}

/* ─── Layout Utilities ──────────────────────────────────────────────────────── */
.action-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.key-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.copy-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 3px;
  font-size: 12px;
  line-height: 1;
  transition: all 0.2s ease;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.copy-btn:hover {
  color: var(--primary);
  background: rgba(0, 242, 255, 0.1);
}

/* ─── Badges ────────────────────────────────────────────────────────────────── */
.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-block;
}

.badge-active  { background: rgba(0, 255, 136, 0.1); color: var(--accent-green); }
.badge-banned  { background: rgba(255, 62, 62, 0.1); color: var(--accent-red); }
.badge-expired { background: rgba(255, 157, 0, 0.1); color: var(--accent-orange); }

/* ─── Inputs ────────────────────────────────────────────────────────────────── */
.input, .select {
  background: var(--bg-accent);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  width: 100%;
  transition: all 0.2s ease;
}

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

/* ─── Modals ────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--bg-accent);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  max-height: 85vh; /* Keep within viewport height */
  box-shadow: var(--shadow-lg);
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border-radius: 50%;
  width: 28px;
  height: 28px;
}
.modal-close:hover {
  background: var(--bg-hover);
  color: var(--accent-red);
}
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; flex-shrink: 0; }

/* ─── Toolbar ───────────────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.toolbar-spacer { flex: 1; }

/* ─── Login Page ────────────────────────────────────────────────────────────── */
.login-page {
  height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(0, 242, 255, 0.12), transparent 30%),
    radial-gradient(circle at bottom right, rgba(112, 0, 255, 0.10), transparent 26%),
    linear-gradient(180deg, #04060a 0%, #060913 62%, #04060a 100%);
}

.login-box {
  width: 100%;
  max-width: 460px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  backdrop-filter: var(--glass);
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.6s ease-out;
}

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

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.login-logo .logo-icon { width: 48px; height: 48px; font-size: 24px; }
.login-logo .logo-text { font-size: 26px; }

.login-subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 24px;
}

.login-error {
  background: rgba(255, 62, 62, 0.1);
  color: var(--accent-red);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid rgba(255, 62, 62, 0.2);
  margin-bottom: 20px;
  display: none;
}

.login-box .btn { width: 100%; margin-top: 10px; justify-content: center; }

.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; }

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.form-row .form-group {
  flex: 1;
  min-width: 120px;
  margin-bottom: 0;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: var(--bg-accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s ease;
  margin: 0;
  flex-shrink: 0;
}

.checkbox-row input[type="checkbox"]:checked {
  border-color: var(--primary);
  background: var(--primary);
}

.checkbox-row input[type="checkbox"]:checked::after {
  content: "✓";
  color: #000;
  font-size: 11px;
  font-weight: 800;
  position: absolute;
}

.checkbox-row input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* ─── Utilities ────────────────────────────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.empty {
  padding: 60px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.02);
}

.empty-icon { font-size: 48px; opacity: 0.3; }
.empty-text { color: var(--text-muted); font-weight: 500; }

.loading-row { padding: 40px; text-align: center; }

.badge-active { background: rgba(0, 255, 136, 0.1); color: var(--accent-green); border: 1px solid rgba(0, 255, 136, 0.2); }
.badge-banned { background: rgba(255, 62, 62, 0.1); color: var(--accent-red); border: 1px solid rgba(255, 62, 62, 0.2); }
.badge-expired { background: rgba(255, 157, 0, 0.1); color: var(--accent-orange); border: 1px solid rgba(255, 157, 0, 0.2); }
.badge-mod    { background: rgba(112, 0, 255, 0.1); color: #a855f7; border: 1px solid rgba(112, 0, 255, 0.2); }
.badge-owner  { background: rgba(0, 242, 255, 0.1); color: var(--primary); border: 1px solid rgba(0, 242, 255, 0.2); }
.badge-admin  { background: rgba(255, 157, 0, 0.1); color: var(--accent-orange); border: 1px solid rgba(255, 157, 0, 0.2); }

/* ─── Toast Notifications ─────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(10, 13, 20, 0.85);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px) saturate(180%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 250px;
  max-width: 380px;
  pointer-events: auto;
  animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), toastFadeOut 0.3s forwards 3.2s;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%) translateY(0);
    opacity: 0;
  }
  to {
    transform: translateX(0) translateY(0);
    opacity: 1;
  }
}

@keyframes toastFadeOut {
  to {
    transform: translateY(-10px);
    opacity: 0;
  }
}

.toast.success {
  border-color: rgba(0, 255, 136, 0.3);
  background: rgba(0, 255, 136, 0.08);
  color: var(--accent-green);
  box-shadow: 0 4px 20px rgba(0, 255, 136, 0.1);
}

.toast.error {
  border-color: rgba(255, 62, 62, 0.3);
  background: rgba(255, 62, 62, 0.08);
  color: var(--accent-red);
  box-shadow: 0 4px 20px rgba(255, 62, 62, 0.1);
}

.toast.warning {
  border-color: rgba(255, 157, 0, 0.3);
  background: rgba(255, 157, 0, 0.08);
  color: var(--accent-orange);
  box-shadow: 0 4px 20px rgba(255, 157, 0, 0.1);
}

.toast.info {
  border-color: rgba(0, 242, 255, 0.3);
  background: rgba(0, 242, 255, 0.08);
  color: var(--accent-cyan);
  box-shadow: 0 4px 20px rgba(0, 242, 255, 0.1);
}

/* ─── Secret Display ─────────────────────────────────────────────────────── */
.secret-display {
  background: var(--bg-accent);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--primary);
  word-break: break-all;
  line-height: 1.5;
}

/* ─── Topbar Badge ───────────────────────────────────────────────────────── */
.topbar-badge {
  background: rgba(94, 252, 255, 0.08);
  border: 1px solid rgba(94, 252, 255, 0.16);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--primary);
}

.page-hero {
  background: var(--bg-hero);
  border: 1px solid rgba(94, 252, 255, 0.14);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: -40% auto auto -10%;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(94, 252, 255, 0.16), transparent 70%);
  pointer-events: none;
}

.page-hero__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.page-hero__title {
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.page-hero__subtitle {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
  max-width: 70ch;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.quick-action {
  min-height: 110px;
  justify-content: center;
  padding: 18px;
  flex-direction: column;
  gap: 8px;
  height: auto;
  background: rgba(255,255,255,0.02);
}

.quick-action:hover {
  border-color: rgba(94, 252, 255, 0.22);
  transform: translateY(-2px);
}

/* ─── Button icon variant ────────────────────────────────────────────────── */
.btn-icon {
  padding: 6px;
  width: 32px;
  height: 32px;
  justify-content: center;
}

@media (max-width: 920px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .main {
    min-height: 0;
  }

  .topbar,
  .content {
    padding-left: 20px;
    padding-right: 20px;
  }

  .content {
    padding-top: 24px;
  }

  .page-hero__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .quick-actions-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .sidebar {
    width: 100%;
  }

  .topbar {
    padding: 0 16px;
    min-height: 64px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .content {
    padding: 18px 16px 24px;
  }

  .card,
  .login-box,
  .page-hero {
    border-radius: var(--radius-lg);
    padding: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .quick-actions-grid {
    grid-template-columns: 1fr;
  }

  .card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal {
    max-width: calc(100vw - 24px);
  }
}
