:root{
  --bg:#0b0d12; --panel:#12151c; --panel-2:#171b24; --line:#222837;
  --text:#e7ecf3; --muted:#8a93a6; --accent:#7c5cff; --accent-2:#22d3ee;
  --ok:#22c55e; --off:#6b7280; --danger:#ef4444;
  --radius:14px; --shadow:0 10px 30px rgba(0,0,0,.35);
}
*{box-sizing:border-box}

html,body{
    margin:0;background:var(--bg);color:var(--text);
    font:15px/1.5 ui-sans-serif,system-ui,-apple-system,Segoe UI,Inter,sans-serif;
    background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 30px 30px;
}
a{color:inherit;text-decoration:none}

/* Auth */
.auth-page{min-height:100vh;display:grid;place-items:center;background:
  radial-gradient(800px 400px at 20% 10%, rgba(124,92,255,.15), transparent 60%),
  radial-gradient(700px 400px at 90% 90%, rgba(34,211,238,.1), transparent 60%), var(--bg);}
.auth-card{width:380px;max-width:92vw;background:var(--panel);border:1px solid var(--line);
  border-radius:var(--radius);padding:28px;box-shadow:var(--shadow)}
.auth-card h1{margin:0 0 4px;font-size:24px}
.muted{color:var(--muted)}
.auth-card form{display:grid;gap:14px;margin-top:20px}
.auth-card label{display:grid;gap:6px;font-size:13px;color:var(--muted)}
.auth-card input{background:var(--panel-2);border:1px solid var(--line);color:var(--text);
  padding:10px 12px;border-radius:10px;outline:none;transition:border-color .15s}
.auth-card input:focus{border-color:var(--accent)}
button{background:linear-gradient(135deg,var(--accent),var(--accent-2));color:#0b0d12;font-weight:600;
  border:0;padding:11px 14px;border-radius:10px;cursor:pointer;transition:transform .05s}
button:active{transform:translateY(1px)}
button.ghost{background:transparent;color:var(--text);border:1px solid var(--line)}
.error{background:rgba(239,68,68,.1);color:#fecaca;border:1px solid rgba(239,68,68,.35);
  padding:8px 10px;border-radius:8px;font-size:13px}
.htmx-indicator{opacity:0;margin-left:6px}
.htmx-request .htmx-indicator{opacity:1}

/* App shell */
.app-shell{display:grid;grid-template-columns:240px 1fr;min-height:100vh}
.sidebar{background:var(--panel);border-right:1px solid var(--line);padding:20px;display:flex;flex-direction:column;gap:8px}
.brand{font-weight:700;letter-spacing:.3px;margin-bottom:12px;color:var(--accent-2)}
.sidebar nav{display:grid;gap:2px}
.sidebar nav a{padding:8px 10px;border-radius:8px;color:var(--muted)}
.sidebar nav a:hover{background:var(--panel-2);color:var(--text);cursor:pointer}
.sidebar nav a.active{background:var(--panel-2);color:var(--text)}
.logout{margin-top:auto}
.content{padding:28px}
.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}
.topbar h1{margin:0;font-size:22px}
.avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;
  background:linear-gradient(135deg,var(--accent),var(--accent-2));color:#0b0d12;font-weight:700}

.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.card{
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.card.wide{grid-column:1/-1}
.stat .stat-label{color:var(--muted);font-size:13px}
.stat .stat-value{font-size:32px;font-weight:700;margin-top:6px}
.stat.accent{background:linear-gradient(135deg,rgba(124,92,255,.15),rgba(34,211,238,.1));border-color:transparent}

table.data{width:100%;border-collapse:collapse}
table.data th,table.data td{padding:10px 8px;border-bottom:1px solid var(--line);text-align:left;font-size:14px}
table.data th{color:var(--muted);font-weight:500}
.badge{background:var(--panel-2);border:1px solid var(--line);padding:2px 8px;border-radius:999px;font-size:12px}
.dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:6px;vertical-align:middle}
.dot.ok{background:var(--ok)} .dot.off{background:var(--off)}

@media (max-width:760px){
  .app-shell{grid-template-columns:1fr}
  .sidebar{flex-direction:row;flex-wrap:wrap;align-items:center}
  .grid{grid-template-columns:1fr}
}

/* Light Mode - Level 6 Depth (High Contrast Professional) */
body.light {
    --bg: #e2e8f0;       /* Keep the page background light */
    --panel: #cbd5e1;    /* Card background is now a solid mid-grey (the '6') */
    --panel-2: #f1f5f9;  /* Secondary elements */
    --line: #94a3b8;     /* Border remains distinct */
    --text: #0f172a;     /* Dark text pops perfectly against the mid-grey */
    --muted: #334155;
}

body.light .card {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Force dark text and labels for perfect legibility */
body.light .stat-value,
body.light .stat-label,
body.light h1, 
body.light h2 { 
    color: #0f172a !important; 
}

/* Add a colored accent strip to the cards */
.card {
    border-left: 4px solid var(--accent); /* Adds the contrast color */
}

/* Optional: If you want the accent to be more subtle in dark mode */
body.light .card {
    border-left: 4px solid var(--accent);
}

/* Style the buttons to match the accent */
body.light button {
    background: var(--accent);
    color: white;
}


/* --- BLING: Adding Depth & Interaction --- */

/* 1. Subtle title glow */
h1, h2 {
    text-shadow: 0 0 10px rgba(124, 92, 255, 0.3);
}

/* 2. Card "Bling" - Interactive Glow */
.card {
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(124, 92, 255, 0.15);
    transform: translateY(-2px);
}

/* 3. Stat Value "Bling" - Shiny Gradient Text */
.stat-value {
    background: linear-gradient(to right, #fff, var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* 4. Button "Bling" - Pulsing Border */
button:hover {
    box-shadow: 0 0 15px var(--accent);
}

/* Force white text on all buttons that have a background color */
button, .btn, .ghost {
    color: #ffffff !important;
}

/* Specifically target the purple buttons shown in your screenshot */
.btn, 
.ghost:hover, 
button[hx-post], 
button[hx-get] {
    color: #ffffff !important;
}