/* ---- Reset-ish ---- */
* { box-sizing: border-box; }
html, body { margin:0; padding:0; height:100%; font:14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; color:#0f172a; }
a { color: inherit; text-decoration: none; }

/* ---- App layout ---- */
.app { display:grid; grid-template-columns: 260px 1fr; min-height:100vh; background:#f6f7f9; }
.sidebar { background:#fff; border-right:1px solid #e5e7eb; padding:16px; display:flex; flex-direction:column; gap:14px; }
.brand { display:flex; align-items:center; gap:10px; }
.brand .logo { width:42px; height:42px; border-radius:14px; background:linear-gradient(145deg,#eef2ff,#f8fafc); border:1px solid #e5e7eb; display:grid; place-items:center; font-weight:700; }
.user { line-height:1.2; }
.nav { display:flex; flex-direction:column; gap:8px; margin-top:6px; }
.nav a { display:flex; gap:10px; align-items:center; padding:10px 12px; border:1px solid #e5e7eb; border-radius:12px; background:#f6f7f9; }
.nav a.active, .nav a:hover { background:#fff; }

.side-card { padding:12px; border:1px solid #e5e7eb; border-radius:14px; background:#f9fafb; }
.badge { padding:2px 8px; border:1px solid #e5e7eb; border-radius:999px; font-size:12px; }
.badge.ok { background:#eafff3; border-color:#a7f3d0; }
.badge.off { background:#f1f5f9; }

.btn { appearance:none; border:1px solid #e5e7eb; background:#fff; border-radius:10px; padding:8px 12px; cursor:pointer; }
.btn.secondary { background:#f8fafc; }

.main { padding:24px; }
.section { background:#fff; border:1px solid #e5e7eb; border-radius:16px; box-shadow:0 1px 0 #eef2f7; margin-bottom:18px; }
.section .head { padding:14px 16px; border-bottom:1px solid #eef2f7; font-weight:600; }
.section .body { padding:16px; }

.grid { display:grid; gap:12px; }
.grid.stats { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.stat { border:1px solid #e5e7eb; border-radius:14px; background:#fff; padding:12px; }
.stat .k { font-size:24px; font-weight:700; margin-top:6px; }
.progress { height:8px; width:100%; border-radius:999px; background:#f1f5f9; overflow:hidden; }
.progress > i { display:block; height:100%; background:#10b981; }

.table { width:100%; border-collapse:collapse; }
.table th, .table td { padding:8px 10px; border-top:1px solid #eef2f7; text-align:left; }
.table thead th { background:#f8fafc; color:#334155; font-weight:600; }
.row-muted { color:#64748b; }

/* Imaging canvas */
.canvas-wrap { position:relative; height:420px; border:1px solid #e5e7eb; border-radius:14px; overflow:hidden; }
#feedCanvas { width:100%; height:100%; display:block; cursor:crosshair; }
.overlay-off { position:absolute; inset:0; display:grid; place-items:center; background:rgba(255,255,255,.6); color:#475569; }

/* ---- Auth pages ---- */
.auth-wrap { min-height:100vh; display:grid; place-items:center; background:linear-gradient(180deg,#f8fafc,#eef2ff); padding:24px; }
.auth-card { width:min(92vw, 480px); background:#fff; border:1px solid #e5e7eb; border-radius:18px; padding:18px; box-shadow:0 6px 24px rgba(15,23,42,.06); }
.auth-head { font-size:22px; font-weight:700; margin-bottom:8px; }
.field { display:grid; gap:6px; margin-bottom:10px; }
.input { padding:10px 12px; border:1px solid #e5e7eb; border-radius:10px; }
.auth-actions { display:flex; gap:8px; align-items:center; justify-content:space-between; margin-top:10px; }
.small { font-size:12px; color:#64748b; }
.link { color:#2563eb; }

/* ---- Status lights ---- */
.light { display:inline-block; width:10px; height:10px; border-radius:999px; margin-right:6px; vertical-align:middle; border:1px solid #e5e7eb; }
.light.ok   { background:#16a34a; }
.light.warn { background:#f59e0b; }
.light.crit { background:#dc2626; }

/* 3D viewport */
.viewport3d { position:relative; height:520px; border:1px solid #e5e7eb; border-radius:14px; overflow:hidden; background:#eae7dc; }
.viewport3d .hud { position:absolute; left:10px; top:10px; padding:6px 8px; border-radius:10px; background:rgba(255,255,255,.75); border:1px solid #e5e7eb; font-size:12px; }
