@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex-shrink: 0; overflow: visible; }
.nav a svg, .btn-logout svg { width: 15px; height: 15px; }
.btn svg { width: 13px; height: 13px; }

/* ─── VARIABLES ─── */
:root {
  /* Fallback = Dark + Violet */
  --bg:#0a0a12; --bg-card:rgba(255,255,255,0.045); --bg-hover:rgba(255,255,255,0.06);
  --bg-input:rgba(255,255,255,0.035); --bg-glass:rgba(255,255,255,0.045);
  --surface:rgba(255,255,255,0.045); --surface-2:rgba(22,22,34,0.92); --sidebar-bg:rgba(255,255,255,0.035);
  --backdrop:rgba(6,4,16,0.6);
  --text:#f4f4fb; --text-2:#a9a8c0; --text-3:#6d6c85; --text-4:#50506a;
  --border:rgba(255,255,255,0.07); --border-2:rgba(255,255,255,0.11);
  --grid:rgba(255,255,255,0.05);
  --shadow-card:0 16px 42px -16px rgba(0,0,0,0.5); --shadow-hover:0 22px 54px -18px rgba(0,0,0,0.62);
  --accent:#8b5cf6; --accent-2:#c4b5fd; --accent-3:#ddd6fe; --accent-rgb:139,92,246;

  --neon-blue:#38bdf8; --neon-cyan:#06b6d4; --neon-pink:#e879f9; --neon-green:#4ade80; --neon-yellow:#fbbf24;
  --sidebar-w:248px;
  --shadow-glow:0 0 40px rgba(var(--accent-rgb),0.18);
  /* Legacy-Aliases (alte Variablennamen weiter nutzbar) */
  --purple:var(--accent); --purple-2:var(--accent-2); --purple-3:var(--accent-3);
  --purple-dim:rgba(var(--accent-rgb),0.55); --purple-dark:rgba(var(--accent-rgb),0.32);
  --purple-glow:rgba(var(--accent-rgb),0.25); --purple-glow-2:rgba(var(--accent-rgb),0.15);
  --border-glow:rgba(var(--accent-rgb),0.32);
}
/* ── Modus: Dunkel / Hell ── */
[data-mode="light"] {
  --bg:#eef0f8; --bg-card:rgba(255,255,255,0.80); --bg-hover:rgba(20,20,45,0.05);
  --bg-input:rgba(255,255,255,0.92); --bg-glass:rgba(255,255,255,0.80);
  --surface:rgba(255,255,255,0.80); --surface-2:rgba(255,255,255,0.96); --sidebar-bg:rgba(255,255,255,0.72);
  --backdrop:rgba(30,25,60,0.35);
  --text:#14152a; --text-2:#4a4c63; --text-3:#8587a0; --text-4:#aaabc0;
  --border:rgba(15,23,42,0.09); --border-2:rgba(15,23,42,0.13);
  --grid:rgba(20,20,45,0.06);
  --shadow-card:0 16px 40px -18px rgba(40,30,90,0.20); --shadow-hover:0 22px 50px -18px rgba(40,30,90,0.28);
}
/* ── Akzentfarben ── */
[data-accent="violet"]  { --accent:#8b5cf6; --accent-2:#c4b5fd; --accent-3:#ddd6fe; --accent-rgb:139,92,246; }
[data-accent="blue"]    { --accent:#3b82f6; --accent-2:#93c5fd; --accent-3:#bfdbfe; --accent-rgb:59,130,246; }
[data-accent="emerald"] { --accent:#10b981; --accent-2:#6ee7b7; --accent-3:#a7f3d0; --accent-rgb:16,185,129; }

/* ─── PAGE SHELL ─── */
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  display: flex;
  align-items: stretch;
  overflow-x: hidden;
  transition: background .4s ease, color .4s ease;
}

/* Background grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(72% 55% at 10% -5%, rgba(var(--accent-rgb),0.12) 0%, transparent 58%),
    radial-gradient(58% 50% at 105% 20%, rgba(var(--accent-rgb),0.07) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
  transition: background .5s ease;
}

/* background radial glow removed for performance */

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--sidebar-bg); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border-right: 1px solid var(--border-2);
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 4px 0 30px rgba(0,0,0,0.5);
}

/* sidebar ambient glow removed for performance */

.sidebar-logo {
  padding: 22px 20px;
  border-bottom: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.sidebar-logo::after {
  content: '';
  position: absolute;
  bottom: 0; left: 20px; right: 20px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb),0.4), transparent);
}

.sigil {
  width: 30px; height: 30px; flex-shrink: 0;
  background: linear-gradient(150deg, var(--purple-2) 0%, var(--purple-dim) 100%);
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
  box-shadow: 0 0 20px rgba(var(--accent-rgb),0.5), 0 0 40px rgba(var(--accent-rgb),0.2);
}

.sidebar-logo svg {
  filter: drop-shadow(0 0 8px rgba(var(--accent-rgb),0.5));
}

.sidebar-logo h1 {
  font-family: 'Cinzel', serif;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--purple-2);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  line-height: 1.4;
}

.sidebar-logo h1 span {
  display: block;
  font-size: 8px;
  color: var(--text-3);
  letter-spacing: 3px;
  font-weight: 400;
  margin-top: 2px;
}

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

.nav-section {
  font-size: 8.5px; font-weight: 700;
  letter-spacing: 3px; color: var(--text-4);
  text-transform: uppercase;
  padding: 16px 20px 6px;
}

.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 20px;
  color: var(--text-2); font-size: 12.5px; font-weight: 400;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 2px solid transparent;
  margin: 1px 0;
  position: relative;
  overflow: hidden;
}

.nav a::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--purple-glow), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.nav a svg {
  opacity: 0.4;
  transition: all 0.2s;
  flex-shrink: 0;
}

.nav a:hover {
  color: var(--text);
  border-left-color: var(--purple-dim);
}

.nav a:hover::before { opacity: 1; }
.nav a:hover svg { opacity: 0.8; filter: drop-shadow(0 0 6px var(--purple)); }

.nav a.active {
  color: var(--purple-2);
  background: linear-gradient(90deg, rgba(var(--accent-rgb),0.15) 0%, rgba(var(--accent-rgb),0.03) 100%);
  border-left-color: var(--purple);
  font-weight: 500;
}

.nav a.active::after {
  content: '';
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 70%;
  background: linear-gradient(180deg, transparent, var(--purple), transparent);
  border-radius: 2px 0 0 2px;
  box-shadow: -2px 0 12px rgba(var(--accent-rgb),0.5);
}

.nav a.active svg {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb),0.8));
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border-2);
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-hover);
}

.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--purple-dim), var(--purple-dark));
  border: 1px solid rgba(var(--accent-rgb),0.4);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 12px; color: var(--purple-2); font-weight: 600;
  box-shadow: 0 0 12px rgba(var(--accent-rgb),0.3), inset 0 1px 0 rgba(255,255,255,0.05);
}

.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 12.5px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-role {
  font-size: 9.5px; color: var(--purple);
  text-transform: uppercase; letter-spacing: 2px; margin-top: 1px;
}

.btn-logout {
  background: none; border: none; color: var(--text-3); cursor: pointer;
  padding: 6px; border-radius: 6px; transition: all 0.2s;
}
.btn-logout:hover {
  color: #f87171;
  background: rgba(248,113,113,0.08);
  box-shadow: 0 0 12px rgba(248,113,113,0.2);
}

/* ─── MAIN ─── */
.main {
  flex: 1; min-width: 0; min-height: 100vh;
  display: flex; flex-direction: column; overflow-x: hidden;
  position: relative;
  z-index: 1;
}

/* ─── TOPBAR ─── */
.topbar {
  height: 52px;
  background: var(--surface); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-2);
  display: flex; align-items: center;
  padding: 0 24px; gap: 14px;
  flex-shrink: 0;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 rgba(var(--accent-rgb),0.08), 0 4px 20px rgba(0,0,0,0.4);
}

.topbar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(var(--accent-rgb),0.3) 30%, rgba(56,189,248,0.2) 70%, transparent 100%);
}

.topbar-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text); letter-spacing: -0.2px;
}

.content {
  flex: 1;
  padding: 24px 26px;
  position: relative;
}

/* ─── STATS GRID ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-card);
  cursor: default;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(var(--accent-rgb),0.5) 50%, transparent 100%);
}

.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: radial-gradient(ellipse at 50% 0%, rgba(var(--accent-rgb),0.06) 0%, transparent 60%);
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--accent-rgb),0.3);
  box-shadow: var(--shadow-hover);
}

.stat-card:hover::before {
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb),0.8), rgba(56,189,248,0.4), transparent);
}

.stat-card .stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; flex-shrink: 0;
}

.stat-card .stat-icon svg { width: 18px; height: 18px; }

.stat-card .stat-trend {
  font-size: 11px; font-weight: 500; letter-spacing: 0.3px;
  display: inline-flex; align-items: center; gap: 3px;
}

.stat-card .stat-row { display: flex; align-items: flex-end; justify-content: space-between; }
.stat-card .stat-right { text-align: right; }

.icon-purple {
  background: rgba(var(--accent-rgb),0.12);
  color: var(--purple-2);
  box-shadow: 0 0 16px rgba(var(--accent-rgb),0.15), inset 0 1px 0 rgba(var(--accent-rgb),0.2);
  border: 1px solid rgba(var(--accent-rgb),0.15);
}
.icon-green {
  background: rgba(74,222,128,0.1);
  color: #4ade80;
  box-shadow: 0 0 16px rgba(74,222,128,0.12), inset 0 1px 0 rgba(74,222,128,0.15);
  border: 1px solid rgba(74,222,128,0.12);
}
.icon-yellow {
  background: rgba(251,191,36,0.1);
  color: #fbbf24;
  box-shadow: 0 0 16px rgba(251,191,36,0.12), inset 0 1px 0 rgba(251,191,36,0.15);
  border: 1px solid rgba(251,191,36,0.12);
}
.icon-blue {
  background: rgba(56,189,248,0.1);
  color: #38bdf8;
  box-shadow: 0 0 16px rgba(56,189,248,0.12), inset 0 1px 0 rgba(56,189,248,0.15);
  border: 1px solid rgba(56,189,248,0.12);
}

.stat-label {
  font-size: 10px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-2); margin-bottom: 10px;
}

.stat-value {
  font-size: 30px; font-weight: 700;
  color: var(--text); line-height: 1; margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.stat-sub { font-size: 10.5px; color: var(--text-3); }

/* Animated number counter */
.stat-value.counting {
  animation: countPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes countPop {
  0% { transform: scale(0.92); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

/* ─── CARD ─── */
.card {
  background: var(--surface);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s, box-shadow 0.3s;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb),0.3), transparent);
}

.card:hover {
  border-color: rgba(var(--accent-rgb),0.2);
  box-shadow: var(--shadow-hover);
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(var(--accent-rgb),0.03);
}

.card-title {
  font-size: 10.5px; font-weight: 700;
  color: var(--purple-2);
  letter-spacing: 2px; text-transform: uppercase;
}

.card-body { padding: 18px 20px; }

/* Chart wrap */
.chart-wrap {
  padding: 18px 20px 16px;
  position: relative; height: 210px;
}
.chart-wrap canvas { max-height: 100%; }

/* ─── TABLE ─── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }

thead th {
  text-align: left;
  padding: 10px 18px;
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-3);
  background: rgba(var(--accent-rgb),0.04);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 11px 18px;
  border-bottom: 1px solid rgba(18,8,40,0.8);
  font-size: 13px; color: var(--text);
  transition: background 0.15s;
}

tbody tr {
  transition: all 0.15s;
  position: relative;
}

tbody tr:hover td {
  background: rgba(var(--accent-rgb),0.05);
}

tbody tr:hover td:first-child {
  border-left: 2px solid var(--purple-dim);
  padding-left: 16px;
}

tbody tr:last-child td { border-bottom: none; }

.td-mono {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 11.5px; color: var(--text-2);
}

/* ─── BADGES ─── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 20px;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase;
  border: 1px solid;
}

.badge-active, .badge-done {
  background: rgba(74,222,128,0.08);
  color: #4ade80;
  border-color: rgba(74,222,128,0.2);
  box-shadow: 0 0 8px rgba(74,222,128,0.1);
}
.badge-pending {
  background: rgba(251,191,36,0.08);
  color: #fbbf24;
  border-color: rgba(251,191,36,0.2);
  box-shadow: 0 0 8px rgba(251,191,36,0.1);
}
.badge-running {
  background: rgba(56,189,248,0.08);
  color: #38bdf8;
  border-color: rgba(56,189,248,0.2);
  box-shadow: 0 0 8px rgba(56,189,248,0.1);
}
.badge-failed {
  background: rgba(248,113,113,0.08);
  color: #f87171;
  border-color: rgba(248,113,113,0.2);
  box-shadow: 0 0 8px rgba(248,113,113,0.1);
}
.badge-skipped {
  background: rgba(167,139,250,0.08);
  color: #a78bfa;
  border-color: rgba(167,139,250,0.2);
}
.badge-inactive, .badge-paused {
  background: rgba(107,114,128,0.08);
  color: #6b7280;
  border-color: rgba(107,114,128,0.2);
}
.badge-admin {
  background: rgba(var(--accent-rgb),0.12);
  color: var(--purple-2);
  border-color: rgba(var(--accent-rgb),0.3);
  box-shadow: 0 0 8px rgba(var(--accent-rgb),0.15);
}
.badge-viewer {
  background: rgba(148,163,184,0.08);
  color: #94a3b8;
  border-color: rgba(148,163,184,0.2);
}

/* ─── PHASE BADGES ─── */
.phase-badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 20px; font-size: 9.5px; font-weight: 600; letter-spacing: 0.5px;
  text-transform: uppercase; border: 1px solid;
}
.phase-AKTIV {
  background: rgba(74,222,128,0.08); color: #4ade80;
  border-color: rgba(74,222,128,0.2);
  box-shadow: 0 0 8px rgba(74,222,128,0.15);
}
.phase-WARMUP {
  background: rgba(251,191,36,0.08); color: #fbbf24;
  border-color: rgba(251,191,36,0.2);
  box-shadow: 0 0 8px rgba(251,191,36,0.15);
}
.phase-PROFIL_SETUP {
  background: rgba(56,189,248,0.08); color: #38bdf8;
  border-color: rgba(56,189,248,0.2);
}
.phase-WARTEND {
  background: rgba(107,114,128,0.08); color: #6b7280;
  border-color: rgba(107,114,128,0.2);
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  font-size: 12px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  border-radius: 8px; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none; font-family: inherit;
  white-space: nowrap; letter-spacing: 0.3px;
  position: relative; overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.1) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
}
.btn:hover::after { opacity: 1; }

.btn-primary {
  background: linear-gradient(135deg, rgba(var(--accent-rgb),0.9) 0%, rgba(var(--accent-rgb),0.9) 100%);
  color: #fff;
  border-color: rgba(var(--accent-rgb),0.5);
  font-weight: 600;
  box-shadow: 0 0 20px rgba(var(--accent-rgb),0.15), inset 0 1px 0 rgba(255,255,255,0.08);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-2) 100%);
  border-color: var(--purple);
  box-shadow: 0 0 30px rgba(var(--accent-rgb),0.4), 0 4px 16px rgba(var(--accent-rgb),0.2);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(var(--accent-rgb),0.04);
  color: var(--text-2);
  border-color: var(--border-2);
}
.btn-ghost:hover {
  color: var(--text);
  background: rgba(var(--accent-rgb),0.08);
  border-color: rgba(var(--accent-rgb),0.3);
  box-shadow: 0 0 16px rgba(var(--accent-rgb),0.08);
}

.btn-danger { background: transparent; color: #f87171; border-color: rgba(248,113,113,0.2); }
.btn-danger:hover {
  background: rgba(248,113,113,0.08);
  border-color: rgba(248,113,113,0.4);
  box-shadow: 0 0 16px rgba(248,113,113,0.15);
}

.btn-sm { padding: 4px 12px; font-size: 11.5px; border-radius: 6px; }
.btn-icon { padding: 6px 8px; }

/* ─── FORM ─── */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.form-label {
  display: block; font-size: 10.5px; font-weight: 600;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text-2); margin-bottom: 7px;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 9px 13px;
  font-size: 13px; border-radius: 8px;
  font-family: inherit; outline: none;
  transition: all 0.2s;
}
.form-control:focus {
  border-color: rgba(var(--accent-rgb),0.5);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.08), 0 0 20px rgba(var(--accent-rgb),0.1);
  background: var(--bg-input);
}
.form-control::placeholder { color: var(--text-3); }
select.form-control option { background: var(--bg-card); color: var(--text); }
textarea.form-control { resize: vertical; }

/* ─── MODAL ─── */
.modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: var(--backdrop);
  z-index: 200; align-items: center; justify-content: center;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--surface-2); backdrop-filter: blur(26px); -webkit-backdrop-filter: blur(26px);
  border: 1px solid var(--border-2);
  border-top: 2px solid var(--purple-dim);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.8), 0 0 60px rgba(var(--accent-rgb),0.08);
  width: 480px; max-width: 94vw; max-height: 92vh;
  overflow-y: auto;
  animation: modalIn 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-title {
  font-size: 11px; font-weight: 700;
  color: var(--purple-2); letter-spacing: 2.5px; text-transform: uppercase;
}

.modal-close {
  background: none; border: none; color: var(--text-3); cursor: pointer;
  font-size: 20px; line-height: 1; padding: 2px 6px;
  transition: all 0.15s; border-radius: 4px;
}
.modal-close:hover { color: var(--text); background: var(--bg-hover); }
.modal-body { padding: 22px 24px; }
.modal-footer {
  padding: 14px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ─── ALERTS ─── */
.alert {
  padding: 11px 16px; border-radius: 8px;
  font-size: 13px; border: 1px solid; margin-bottom: 16px;
}
.alert-error   { background: rgba(248,113,113,0.06); color: #f87171; border-color: rgba(248,113,113,0.2); }
.alert-success { background: rgba(74,222,128,0.06);  color: #4ade80; border-color: rgba(74,222,128,0.2); }
.alert-info    { background: rgba(var(--accent-rgb),0.06);  color: var(--purple-2); border-color: rgba(var(--accent-rgb),0.2); }

/* ─── LIVE INDICATOR ─── */
.live-indicator {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; color: var(--neon-green);
  font-weight: 600; letter-spacing: 1px;
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 8px rgba(74,222,128,0.8), 0 0 16px rgba(74,222,128,0.4);
  animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(74,222,128,0.8), 0 0 16px rgba(74,222,128,0.4); }
  50% { opacity: 0.5; box-shadow: 0 0 4px rgba(74,222,128,0.4); }
}

/* ─── ACTIVITY ─── */
.activity-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(18,8,40,0.6);
  transition: all 0.15s;
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { padding-left: 4px; }
.activity-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.activity-text { flex: 1; font-size: 12.5px; color: var(--text); }
.activity-text span { color: var(--text-2); }
.activity-time { font-size: 11px; color: var(--text-3); white-space: nowrap; }

/* ─── ACCOUNT MINI ─── */
.account-mini {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(18,8,40,0.6);
  transition: all 0.2s;
}
.account-mini:last-child { border-bottom: none; }
.account-mini:hover { padding-left: 4px; }
.account-mini-av {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--purple-dim), var(--purple-dark));
  border: 1px solid rgba(var(--accent-rgb),0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--purple-2);
  font-family: 'Cinzel', serif;
  box-shadow: 0 0 12px rgba(var(--accent-rgb),0.2);
}
.account-mini-info { flex: 1; min-width: 0; }
.account-mini-name { font-size: 13px; font-weight: 500; color: var(--text); }
.account-mini-sub  { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.account-mini-stat { text-align: right; flex-shrink: 0; }
.account-mini-stat strong { font-size: 14px; font-weight: 600; color: var(--text); display: block; }
.account-mini-stat small  { font-size: 10px; color: var(--text-3); letter-spacing: 0.5px; }

/* ─── NO DATA ─── */
.no-data-chart {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; color: var(--text-3); font-size: 12px; gap: 8px;
}
.no-data-chart svg { width: 32px; height: 32px; opacity: 0.25; }

/* ─── LOGIN ─── */
body:has(.login-page) { display: block !important; height: auto; }

.login-page {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background: radial-gradient(ellipse at 20% 30%, #5500aa 0%, #1a0040 40%, #04000e 70%);
}

.login-page::after {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 80% 80%, rgba(100,0,180,0.2) 0%, transparent 50%);
}

.login-box { width: 370px; position: relative; z-index: 1; }
.login-logo { text-align: center; margin-bottom: 30px; }

.sigil-lg {
  width: 56px; height: 56px; margin: 0 auto 16px;
  background: linear-gradient(150deg, var(--purple-2) 0%, #6600cc 50%, var(--purple-dark) 100%);
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
  box-shadow: 0 0 30px rgba(var(--accent-rgb),0.5), 0 0 70px rgba(var(--accent-rgb),0.2);
}

.login-logo h1 {
  font-family: 'Cinzel', serif;
  font-size: 22px; font-weight: 500;
  color: #fff; letter-spacing: 6px; text-transform: uppercase;
}

.login-logo p {
  font-size: 9.5px; color: rgba(255,255,255,0.3);
  letter-spacing: 4px; text-transform: uppercase; margin-top: 5px;
}

.login-card {
  background: var(--surface-2); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(var(--accent-rgb),0.2);
  border-top: 1px solid rgba(var(--accent-rgb),0.4);
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 60px rgba(var(--accent-rgb),0.1);
}

/* ─── UTILITY ─── */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.ml-auto { margin-left: auto; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.text-gold { color: var(--purple-2); }
.text-muted { color: var(--text-2); }
.text-dim { color: var(--text-3); }
.text-green { color: #4ade80; }
.text-red { color: #f87171; }
.text-blue { color: #38bdf8; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.empty { text-align: center; padding: 40px 24px; color: var(--text-3); }
.empty p { font-size: 13px; }

.sep {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb),0.2), transparent);
  margin: 20px 0;
}

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(var(--accent-rgb),0.15);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-green  { background: #4ade80; box-shadow: 0 0 8px rgba(74,222,128,0.6); }
.dot-yellow { background: #fbbf24; box-shadow: 0 0 8px rgba(251,191,36,0.6); }
.dot-red    { background: #f87171; box-shadow: 0 0 8px rgba(248,113,113,0.6); }
.dot-gray   { background: #4b5563; }

.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar .form-control { width: auto; min-width: 130px; padding: 6px 11px; font-size: 12px; }

/* ─── TOAST ─── */
#toast { position: fixed; bottom: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }

.toast-item {
  background: var(--surface-2); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-2);
  border-left: 3px solid var(--purple);
  padding: 12px 18px; border-radius: 10px;
  font-size: 13px; color: var(--text);
  animation: toastIn 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
  max-width: 300px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 20px rgba(var(--accent-rgb),0.1);
}
.toast-item.error { border-left-color: #f87171; box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 16px rgba(248,113,113,0.1); }
.toast-item.success { border-left-color: #4ade80; box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 16px rgba(74,222,128,0.1); }

@keyframes toastIn {
  from { transform: translateX(20px) scale(0.95); opacity: 0; }
  to   { transform: translateX(0) scale(1); opacity: 1; }
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb),0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-dim); }

/* ─── RESPONSIVE ─── */
@media(max-width:1200px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
}
@media(max-width:900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
}
@media(max-width:640px) {
  .stats-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 16px; }
}
