/* ============================================================================
   ZENTRA HOME — dashboard.css (preview)
   Navy/gold Zentra design system · mobile-first
   ============================================================================ */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("PlusJakartaSans-var.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --navy-deep: #071120;
  --navy: #0b1b2e;
  --navy-panel: #12283f;
  --navy-elevated: #16304a;
  --gold: #c9a227;
  --gold-light: #e8ce86;
  --gold-deep: #9a7a2e;
  --text: #e8eef8;
  --text-body: #c7d1dc;
  --muted: #8c9fb4;
  --ok: #43b02a;
  --warn: #d98a1f;
  --alert: #e8776a;
  --line: rgba(201, 162, 39, 0.22);
  --hairline: rgba(201, 162, 39, 0.4);
  --r: 14px;
  --r-lg: 20px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tap: 46px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--navy-deep); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.55; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
.hidden { display: none !important; }
.btn { background: var(--navy-elevated); border: 1px solid var(--line); color: var(--text); border-radius: 12px; min-height: var(--tap); padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; transition: transform .08s, border-color .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--gold-light), var(--gold) 55%, var(--gold-deep)); color: #0b1b2e; border: none; font-weight: 800; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: .85rem; }
.btn.xs { min-height: 30px; padding: 4px 10px; font-size: .78rem; border-radius: 9px; }
input, select { background: #0a1628; border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 12px 14px; font: inherit; width: 100%; min-height: var(--tap); }
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: -1px; }

/* ---------- LOGIN ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(900px 460px at 50% -10%, #1b2a46, var(--navy-deep)); }
.login-card { width: min(400px, 100%); background: var(--navy); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; display: grid; gap: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.login-mark { width: 34px; height: 34px; }
.login h1 { font-size: 1.5rem; letter-spacing: -.01em; }
.login .desc { color: var(--muted); margin: -6px 0 6px; font-size: .88rem; }
.login label { display: grid; gap: 6px; font-size: .85rem; color: var(--muted); }
.login .msg { color: var(--alert); min-height: 1.2em; margin: 0; font-size: .85rem; }
.login .footnote { color: var(--muted); font-size: .75rem; text-align: center; margin: 4px 0 0; }

/* ---------- TOP BAR ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(7,17,32,.88); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; gap: 18px; max-width: 1240px; margin: 0 auto; padding: 10px 20px; min-height: 60px; flex-wrap: wrap; }
.top-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.top-name { font-weight: 800; letter-spacing: .12em; font-size: .95rem; }
.top-name small { color: var(--gold); font-weight: 800; }
.top-nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.top-nav a { color: var(--muted); text-decoration: none; padding: 8px 13px; border-radius: 10px; font-size: .87rem; font-weight: 600; }
.top-nav a:hover { color: var(--gold-light); background: rgba(201,162,39,.08); }
.top-nav a.on { color: var(--gold-light); background: rgba(201,162,39,.14); }
.top-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pill { border-radius: 999px; padding: 5px 12px; font-size: .78rem; background: var(--navy-elevated); border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: rgba(67,176,42,.4); }
.pill.warn { color: var(--warn); border-color: rgba(217,138,31,.4); }

/* ---------- LAYOUT ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 22px 20px 40px; }
.tab { display: none; }
.tab.on { display: block; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--navy); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 2px; }
.stat b { font-size: 1.6rem; color: var(--gold-light); letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .82rem; }
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .grid-2col { grid-template-columns: 1fr; } }
.panel { background: var(--navy); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.panel-h { font-weight: 700; font-size: .95rem; color: var(--gold-light); margin-bottom: 14px; letter-spacing: .02em; }

/* ---------- CAMERAS ---------- */
.cam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.cam { background: var(--navy-panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cam-img { position: relative; aspect-ratio: 16/9; background: #0a1628; }
.cam-img::after { content: "● LIVE PREVIEW"; position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.6); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; font-size: .62rem; color: var(--muted); letter-spacing: .08em; }
.cam .live-dot { position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--alert); box-shadow: 0 0 10px var(--alert); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.cam-meta { padding: 10px 12px; }
.cam-meta b { display: block; font-size: .92rem; }
.cam-meta span { font-size: .78rem; color: var(--muted); }

/* ---------- DEVICES ---------- */
.dev-list { display: grid; gap: 2px; }
.dev { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid rgba(201,162,39,.1); font-size: .9rem; }
.dev:last-child { border-bottom: 0; }
.dev .dev-val { margin-left: auto; color: var(--gold-light); font-weight: 600; font-size: .85rem; }
.dev-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.dev-dot.on { background: var(--ok); box-shadow: 0 0 8px rgba(67,176,42,.6); }
.dev-dot.off { background: var(--muted); }
.dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.dvc { background: var(--navy); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.dvc b { font-size: .98rem; }
.dvc .dvc-icon { font-size: 1.5rem; }
.dvc .dvc-st { color: var(--muted); font-size: .85rem; }
.dvc .dvc-st.on { color: var(--ok); }
.dvc .btn { margin-top: auto; }

/* ---------- ENERGY ---------- */
.bar-list { display: grid; gap: 12px; }
.bar-list > div { display: grid; grid-template-columns: 90px 1fr 48px; align-items: center; gap: 12px; font-size: .88rem; color: var(--muted); }
.bar-list .bar { height: 10px; background: var(--navy-panel); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); border-radius: 999px; }

/* ---------- LOG TABLE ---------- */
.log-tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.log-tbl tr { border-bottom: 1px solid rgba(201,162,39,.1); }
.log-tbl tr:last-child { border-bottom: 0; }
.log-tbl td { padding: 10px 6px; }
.log-tbl .ts { color: var(--muted); white-space: nowrap; text-align: right; }
.sev { font-size: .55rem; }
.sev.i { color: var(--gold); }
.sev.w { color: var(--warn); }
.sev.a { color: var(--alert); }

/* ---------- FOOTER ---------- */
@media (max-width: 620px) {
  .top-nav { order: 3; width: 100%; justify-content: center; }
  .top-badges { gap: 5px; }
  .top-badges .pill { display: none; }
}