:root {
    --bg: #050505;
    --bg-soft: #0f1012;
    --panel: #121417;
    --panel-2: #181b20;
    --text: #f2f4f8;
    --muted: #9aa4b2;
    --accent: #7c3aed;
    --accent-2: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: rgba(255,255,255,0.08);
    --shadow: 0 20px 50px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, sans-serif; background: radial-gradient(circle at top right, rgba(124,58,237,.18), transparent 24%), linear-gradient(180deg, #020202, #0a0c0f 55%, #050505); color: var(--text); }
a { color: inherit; text-decoration: none; }
.shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar { background: rgba(0,0,0,.45); border-right: 1px solid var(--border); padding: 24px; backdrop-filter: blur(8px); }
.brand { display:flex; gap:14px; align-items:center; margin-bottom: 30px; }
.brand-mark { width:52px; height:52px; border-radius:16px; display:grid; place-items:center; background: linear-gradient(135deg, var(--accent), #1d4ed8); font-weight:700; box-shadow: var(--shadow); }
.brand h1 { font-size: 18px; margin:0; }
.brand p { margin:4px 0 0; color: var(--muted); font-size: 13px; }
.nav { display:grid; gap:10px; }
.nav a { padding: 12px 14px; background: rgba(255,255,255,.03); border:1px solid transparent; border-radius: 14px; color: #d9e0ea; }
.nav a:hover { border-color: var(--border); background: rgba(124,58,237,.12); }
.main { padding: 26px; }
.topbar { display:flex; justify-content:space-between; align-items:center; margin-bottom: 20px; }
.topbar h2 { margin:0 0 6px; font-size: 28px; }
.muted { color: var(--muted); }
.pill { padding: 10px 14px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--border); }
.grid { display:grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.card { background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02)); border:1px solid var(--border); border-radius: 22px; padding: 20px; box-shadow: var(--shadow); }
.stat .value { font-size: 34px; font-weight: 800; margin-top: 8px; }
.stat .label { color: var(--muted); font-size: 14px; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse: collapse; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--border); text-align:left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tr:hover td { background: rgba(255,255,255,.02); }
input, select, textarea { width:100%; background: #0a0c0f; color: var(--text); border:1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
label { display:block; margin-bottom: 8px; color: #dbe3ef; font-size:14px; }
.form-grid { display:grid; gap:16px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid-3 { display:grid; gap:16px; grid-template-columns: repeat(3, minmax(0,1fr)); }
.actions { display:flex; gap:10px; flex-wrap:wrap; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding: 12px 16px; border-radius: 14px; border:1px solid var(--border); background: rgba(255,255,255,.04); color: var(--text); cursor:pointer; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #2563eb); border: 0; }
.btn-success { background: linear-gradient(135deg, var(--accent-2), #16a34a); border: 0; }
.btn-danger { background: linear-gradient(135deg, #dc2626, #b91c1c); border: 0; }
.flash { padding: 12px 14px; border-radius: 14px; margin-bottom: 14px; }
.flash-success { background: rgba(34,197,94,.14); border:1px solid rgba(34,197,94,.25); }
.flash-error { background: rgba(239,68,68,.14); border:1px solid rgba(239,68,68,.25); }
.flash-info { background: rgba(59,130,246,.14); border:1px solid rgba(59,130,246,.25); }
.badge { padding: 6px 10px; border-radius: 999px; font-size: 12px; display:inline-block; }
.badge-green { background: rgba(34,197,94,.15); color: #86efac; }
.badge-red { background: rgba(239,68,68,.15); color: #fca5a5; }
.badge-yellow { background: rgba(245,158,11,.15); color: #fcd34d; }
.login-wrap { max-width: 460px; margin: 10vh auto; }
canvas { width:100% !important; max-height: 320px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: #c7d2fe; background: rgba(124,58,237,.12); padding: 2px 8px; border-radius: 999px; }
@media (max-width: 980px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: sticky; top: 0; z-index: 20; }
    .grid-4, .grid-2, .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
}
