:root{
  --bg:#0b1220;         /* deep navy */
  --panel:#121a2b;      /* graphite */
  --panel-2:#0f1827;
  --text:#e5e7eb;       /* light */
  --muted:#9aa4b2;
  --accent:#8b5cf6;     /* violet */
  --accent-2:#06b6d4;   /* cyan */
  --danger:#ef4444;
  --warn:#f59e0b;
  --good:#22c55e;
  --bad:#ef4444;
  --shadow:0 8px 24px rgba(0,0,0,.25);
  --radius:16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,'Helvetica Neue',Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.45;
}

a{color:#c7d2fe;text-decoration:none}
a:hover{text-decoration:underline}

.topbar{
  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; gap:12px;
  padding:10px 16px; background:var(--panel-2);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.brand{font-weight:800; letter-spacing:.5px; color:#fff; text-decoration:none}
.top-nav{margin-left:auto; display:flex; gap:10px}
.nav-link{
  padding:8px 12px; border-radius:10px; color:var(--text);
}
.nav-link.active, .nav-link:hover{
  background:rgba(139,92,246,.18);
  text-decoration:none;
}

.icon-btn{
  background:transparent; color:var(--text);
  border:1px solid rgba(255,255,255,.15);
  border-radius:10px; padding:6px 10px; cursor:pointer;
}
.icon-btn:focus{outline:2px solid var(--accent)}

.sidebar{
  position:fixed; inset:0 auto 0 0; width:260px; background:var(--panel);
  transform:translateX(-100%); transition:transform .2s ease;
  box-shadow:var(--shadow); z-index:60;
}
.sidebar.open{ transform:translateX(0) }
.sidebar-head{display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid rgba(255,255,255,.06)}
.side-nav{display:flex; flex-direction:column; padding:8px}
.side-link{padding:10px 12px; border-radius:10px; color:var(--text)}
.side-link.active, .side-link:hover{background:rgba(139,92,246,.18)}

.content{padding:20px; max-width:1200px; margin:0 auto}

.hero{padding:60px 16px; text-align:center}
.hero h1{font-size:40px; margin:0 0 8px}
.hero p{color:var(--muted); max-width:780px; margin:0 auto 24px}
.cta-row{display:flex; gap:12px; justify-content:center}
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:10px 16px; border-radius:12px; font-weight:600; border:1px solid transparent;
  box-shadow:var(--shadow);
}
.btn:focus{outline:2px solid var(--accent)}
.btn-primary{background:linear-gradient(135deg,var(--accent),var(--accent-2)); color:#fff}
.btn-secondary{background:#1e293b; color:#fff; border-color:#334155}
.btn-ghost{background:transparent; color:#c7d2fe; border-color:#334155}

.page-head h2{margin:12px 0 0}
.page-head .muted{color:var(--muted)}

.cards-grid{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:14px; margin:16px 0 26px;
}
.card{
  background:var(--panel);
  border:1px solid rgba(255,255,255,.08);
  border-radius:var(--radius);
  padding:14px 14px 12px;
  box-shadow:var(--shadow);
}
.card-title{font-weight:600; display:flex; align-items:center; gap:10px; color:#fff}
.card-value{font-size:22px; margin-top:8px; display:flex; align-items:center; gap:8px}
.card .unit{font-size:14px; color:var(--muted)}
.card .trend{opacity:.8}
.status-dot{
  display:inline-block; width:10px; height:10px; border-radius:999px;
  background:#64748b; box-shadow:0 0 0 2px rgba(100,116,139,.2)
}
.status-on{ background:var(--good) }
.status-off{ background:var(--bad) }

.badge{display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px; border:1px solid rgba(255,255,255,.15)}
.badge-alert{background:rgba(239,68,68,.2); color:#fecaca; border-color:rgba(239,68,68,.35)}
.badge-na{background:#1f2937; color:#94a3b8}
.badge-good{background:rgba(34,197,94,.2); color:#bbf7d0}
.badge-warn{background:rgba(245,158,11,.2); color:#fde68a}
.badge-bad{background:rgba(239,68,68,.2); color:#fecaca}

.charts-grid{
  display:grid; grid-template-columns:repeat(12,1fr); gap:14px; margin-bottom:40px;
}
.chart-card{
  grid-column:span 12;
  background:var(--panel);
  border:1px solid rgba(255,255,255,.08);
  border-radius:var(--radius);
  padding:12px;
}
.chart-card.small{ grid-column:span 6 }
.chart-card h3{margin:6px 0 10px; font-size:15px; color:#cbd5e1}

.table-wrap{margin-top:16px; overflow:auto; border-radius:12px; border:1px solid rgba(255,255,255,.08)}
.table{width:100%; border-collapse:collapse}
.table th,.table td{padding:10px 12px; border-bottom:1px solid rgba(255,255,255,.08); text-align:left}
.table th{color:#cbd5e1; background:#0f1827}
.table tr:hover{background:#0f1827}

.lan-actions{display:flex; align-items:center; gap:12px}
#scanStatus{border-color:#334155}

code{background:#0f1827; padding:2px 6px; border-radius:8px; border:1px solid rgba(255,255,255,.08)}

@media (max-width: 720px){
  .chart-card.small{ grid-column:span 12 }
}

::-webkit-scrollbar{height:12px;width:12px}
::-webkit-scrollbar-track{background:#0f1827;border-radius:8px}
::-webkit-scrollbar-thumb{background:#334155;border-radius:8px;border:2px solid #0f1827}
::-webkit-scrollbar-thumb:hover{background:#475569}


/* Ensure hidden attribute actually hides elements */
[hidden]{display:none !important}
