/* =====================================================================
   Billy Live Stream - tema "control room"
   Palette e linguaggio visivo allineati al portale Link Wireless:
   navy profondo, accenti ciano/verde, card traslucide, label monospace.
   ===================================================================== */

@font-face {
  font-family: 'Space Grotesk';
  src: url('/vendor/fonts/space-grotesk-latin-ext.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('/vendor/fonts/space-grotesk-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #020617;
  --bg-2: #030b1a;
  --panel: rgba(13, 23, 42, .72);
  --panel-solid: #0b1526;
  --panel-2: rgba(9, 16, 31, .9);
  --border: rgba(148, 163, 184, .14);
  --border-strong: rgba(148, 163, 184, .24);
  --text: #e8eefb;
  --muted: #91a4be;
  --accent: #00d2ef;
  --accent-2: #53eafd;
  --accent-dim: rgba(0, 210, 239, .12);
  --ok: #00d294;
  --ok-2: #5ee9b5;
  --warn: #ffd236;
  --danger: #fb2c36;
  --radius: 22px;
  --shadow: 0 24px 60px rgba(2, 6, 23, .55);
  --font: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', 'Consolas', 'SFMono-Regular', monospace;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

/* griglia sottile + alone, come il portale */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .055) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
  mask-image: radial-gradient(1200px 800px at 50% 0%, #000 20%, transparent 85%);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(0, 210, 239, .12), transparent 60%),
    radial-gradient(800px 480px at 92% 4%, rgba(0, 210, 148, .09), transparent 60%),
    linear-gradient(180deg, #04101f 0%, #020617 45%, #010310 100%);
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: .95rem; }
a { color: var(--accent-2); text-decoration: none; }
p { margin: .35rem 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: var(--mono); font-size: .8rem; }
.hidden { display: none !important; }
[hidden] { display: none !important; }

kbd, code, .kicker, .ver {
  font-family: var(--mono);
  text-transform: uppercase;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .68rem;
  letter-spacing: .22em;
  color: rgba(94, 234, 181, .78);
  font-weight: 500;
}
.ver {
  font-size: .68rem;
  letter-spacing: .1em;
  color: rgba(0, 210, 239, .8);
}

/* ---------- boot ---------- */
.boot {
  position: fixed; inset: 0; display: grid; place-content: center; gap: 16px;
  justify-items: center; color: var(--muted); z-index: 50; font-size: .9rem;
}
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid rgba(148,163,184,.18); border-top-color: var(--accent);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- login ---------- */
.login-view {
  min-height: 100vh; display: grid; place-items: center; padding: 28px 20px;
}
.login-card {
  width: min(440px, 100%);
  background: linear-gradient(165deg, rgba(15, 23, 43, .92), rgba(4, 10, 22, .92));
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 34px 32px 30px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 14px; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 700; letter-spacing: .02em;
  background: linear-gradient(140deg, var(--accent) 0%, var(--ok) 100%);
  color: #021016;
  box-shadow: 0 10px 26px rgba(0, 210, 239, .22);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; }
.brand h1 { font-size: 1.45rem; }
.login-card .kicker { margin-bottom: 14px; }
.login-foot { margin-top: 18px; text-align: center; font-size: .76rem; }

/* ---------- form ---------- */
label {
  display: block; margin: 0 0 14px;
  font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(148, 163, 184, .9); font-weight: 500;
}
input, select, textarea {
  width: 100%; margin-top: 7px; padding: 12px 14px;
  background: rgba(2, 6, 23, .62); color: var(--text);
  border: 1px solid rgba(148, 163, 184, .16); border-radius: 12px;
  font: inherit; font-size: .92rem; text-transform: none; letter-spacing: 0;
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: rgba(145, 164, 190, .6); }
input:focus, select:focus, textarea:focus {
  border-color: rgba(0, 210, 239, .55);
  box-shadow: 0 0 0 3px rgba(0, 210, 239, .12);
  background: rgba(2, 6, 23, .8);
}
textarea { min-height: 84px; resize: vertical; }
input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--accent); }
select option { background: #081226; }
.hint { font-size: .74rem; }
.form-error { color: #ff8f99; min-height: 1.2em; font-size: .8rem; margin-top: 10px; }
.form-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ---------- bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px; border: 1px solid rgba(148, 163, 184, .18);
  background: rgba(148, 163, 184, .07); color: var(--text);
  font: inherit; font-size: .84rem; font-weight: 500; cursor: pointer;
  white-space: nowrap;
  transition: transform .08s, background .15s, border-color .15s, color .15s, opacity .15s;
}
.btn:hover { background: rgba(148, 163, 184, .12); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(140deg, rgba(0, 210, 239, .22), rgba(0, 210, 148, .22));
  color: #c9fff2; border-color: rgba(0, 210, 148, .45);
}
.btn.primary:hover { background: linear-gradient(140deg, rgba(0, 210, 239, .34), rgba(0, 210, 148, .32)); }
.btn.danger { background: rgba(251, 44, 54, .12); color: #ffb3ba; border-color: rgba(251, 44, 54, .38); }
.btn.danger:hover { background: rgba(251, 44, 54, .2); }
.btn.ghost { background: rgba(2, 6, 23, .35); border-color: rgba(148, 163, 184, .16); color: #cbd7e8; }
.btn.ghost:hover { background: rgba(0, 210, 239, .08); border-color: rgba(0, 210, 239, .35); color: #d9fbff; }
.btn.small { padding: 6px 12px; font-size: .76rem; }
.btn.block { width: 100%; }
.btn.icon { padding: 8px 11px; font-size: 1rem; }
.btn.primary.block {
  padding: 13px 18px; font-size: .74rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .18em;
  background: linear-gradient(160deg, rgba(0, 210, 148, .22), rgba(0, 210, 239, .14));
  color: #b9ffe9; border-color: rgba(0, 210, 148, .5);
}
#btn-logout { background: rgba(251, 44, 54, .12); color: #ffb3ba; border-color: rgba(251, 44, 54, .38); }
#btn-logout:hover { background: rgba(251, 44, 54, .2); }
#btn-account { background: rgba(148, 163, 184, .07); }

/* ---------- shell ---------- */
.app {
  max-width: 1360px; margin: 0 auto; padding: 26px 24px 64px;
  display: block;
}
.sidebar {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "brand foot" "nav nav";
  gap: 18px 24px;
  padding: 24px 28px 20px;
  background: linear-gradient(165deg, rgba(15, 23, 43, .88), rgba(4, 10, 22, .72));
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .035);
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
}
.sidebar::after {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 210, 239, .45), rgba(0, 210, 148, .35), transparent);
}
.brand.small { grid-area: brand; margin: 0; }
.brand.small .brand-mark { width: 42px; height: 42px; border-radius: 12px; font-size: .85rem; }
.brand.small .brand-text strong { font-size: 1.35rem; }
.brand.small .brand-text span { font-size: .74rem; letter-spacing: .06em; }

.nav {
  grid-area: nav; display: flex; flex-wrap: wrap; gap: 8px;
  padding-top: 4px; border-top: 1px solid rgba(148, 163, 184, .1);
  margin-top: 2px; padding-top: 16px;
}
.nav-item {
  padding: 9px 16px; border-radius: 999px; color: #c3d0e2;
  font-size: .84rem; font-weight: 500; border: 1px solid rgba(148, 163, 184, .13);
  background: rgba(2, 6, 23, .5);
  transition: color .15s, border-color .15s, background .15s;
}
.nav-item:hover { color: #eaf6ff; background: rgba(0, 210, 239, .07); border-color: rgba(0, 210, 239, .3); }
.nav-item.active {
  color: #9ff6ff; background: rgba(0, 210, 239, .1);
  border-color: rgba(0, 210, 239, .5);
  box-shadow: 0 0 0 1px rgba(0, 210, 239, .12) inset;
}

.sidebar-foot {
  grid-area: foot; display: flex; align-items: center; gap: 8px;
}
.user-box {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px;
  border: 1px solid rgba(148, 163, 184, .13); border-radius: 999px;
  background: rgba(2, 6, 23, .45);
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), var(--ok)); color: #021016;
  font-weight: 700; font-size: .82rem; flex: 0 0 auto;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.user-meta strong { font-size: .82rem; font-weight: 600; }
.user-meta span { font-size: .7rem; }
.user-meta strong, .user-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .btn { padding: 8px 14px; font-size: .78rem; }

.main { min-width: 0; display: block; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 26px 4px 14px;
}
.topbar-title { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topbar h2 { font-size: 1.6rem; letter-spacing: -.025em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.view { padding: 0 2px 40px; }
#btn-menu { display: none; }

/* ---------- pill / badge / dot ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px;
  font-family: var(--mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  background: rgba(148, 163, 184, .08); border: 1px solid rgba(148, 163, 184, .16);
  color: #b9c8db; white-space: nowrap;
}
.pill.ok { color: #b6ffe4; border-color: rgba(0, 210, 148, .42); background: rgba(0, 210, 148, .12); }
.pill.err { color: #ffb9bf; border-color: rgba(251, 44, 54, .42); background: rgba(251, 44, 54, .12); }
.pill.warn { color: #ffe9a8; border-color: rgba(255, 210, 54, .38); background: rgba(255, 210, 54, .1); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.online { background: var(--ok); box-shadow: 0 0 0 4px rgba(0, 210, 148, .16); }
.dot.offline { background: var(--danger); box-shadow: 0 0 0 4px rgba(251, 44, 54, .16); }
.dot.reachable, .dot.unknown { background: var(--warn); box-shadow: 0 0 0 4px rgba(255, 210, 54, .13); }
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-family: var(--mono); font-size: .64rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  background: rgba(0, 210, 239, .12); color: #a5f3ff;
  border: 1px solid rgba(0, 210, 239, .3);
}
.badge.admin { background: rgba(255, 210, 54, .12); color: #ffe9a8; border-color: rgba(255, 210, 54, .32); }
.badge.operator { background: rgba(0, 210, 239, .12); color: #a5f3ff; border-color: rgba(0, 210, 239, .3); }
.badge.viewer { background: rgba(148, 163, 184, .13); color: #d4deec; border-color: rgba(148, 163, 184, .28); }

/* ---------- card / grid ---------- */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card {
  position: relative;
  background: linear-gradient(165deg, rgba(15, 23, 43, .78), rgba(3, 9, 20, .62));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 18px 40px rgba(2, 6, 23, .28);
  backdrop-filter: blur(8px);
}
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title h3 { font-size: 1.12rem; }
.stat-card { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.stat-card::before {
  content: ''; position: absolute; inset: -40% -20% auto auto; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(0, 210, 239, .16), transparent 65%);
  pointer-events: none;
}
.stat-card.ok::before { background: radial-gradient(circle, rgba(0, 210, 148, .2), transparent 65%); }
.stat-card.warn::before { background: radial-gradient(circle, rgba(255, 210, 54, .14), transparent 65%); }
.stat { font-size: 2.1rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.stat small { font-size: .8rem; color: var(--muted); font-weight: 500; margin-left: 6px; letter-spacing: 0; }
.stat-sub { font-size: .76rem; color: var(--muted); }
.stat-card.ok .stat { color: #b6ffe4; }
.stat-card.warn .stat { color: #ffe9a8; }
.section { margin-top: 24px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.section-head h3 { font-size: 1.25rem; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1.55fr 1fr; }
@media (max-width: 1050px) { .grid-2 { grid-template-columns: 1fr; } }

/* meters */
.meter { height: 6px; border-radius: 99px; background: rgba(148, 163, 184, .12); overflow: hidden; margin: 8px 0 4px; }
.meter > i { display: block; height: 100%; border-radius: 99px; transition: width .4s; background: linear-gradient(90deg, var(--ok), var(--accent)); }
.meter.warn > i { background: linear-gradient(90deg, var(--warn), #f59e0b); }
.meter.danger > i { background: linear-gradient(90deg, #ff7a83, var(--danger)); }

/* ---------- tabelle ---------- */
.table-wrap {
  overflow-x: auto; border: 1px solid var(--border); border-radius: 18px;
  background: linear-gradient(165deg, rgba(15, 23, 43, .6), rgba(3, 9, 20, .55));
}
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid rgba(148, 163, 184, .1); vertical-align: middle; }
th {
  font-family: var(--mono); font-size: .64rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .16em;
  color: rgba(94, 234, 181, .72); background: rgba(2, 6, 23, .45);
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(0, 210, 239, .04); }
.cell-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- live wall ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(148, 163, 184, .14);
  background: rgba(2, 6, 23, .5); color: #c3d0e2; font-weight: 500; font-size: .8rem; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.chip:hover { color: #eaf6ff; border-color: rgba(0, 210, 239, .3); }
.chip.active { color: #9ff6ff; background: rgba(0, 210, 239, .1); border-color: rgba(0, 210, 239, .5); }
.wall { display: grid; gap: 12px; }
.wall.g1 { grid-template-columns: 1fr; }
.wall.g2 { grid-template-columns: repeat(2, 1fr); }
.wall.g3 { grid-template-columns: repeat(3, 1fr); }
.wall.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .wall.g3, .wall.g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .wall.g2, .wall.g3, .wall.g4 { grid-template-columns: 1fr; } }

.tile {
  position: relative; aspect-ratio: 16/9; background: #01040c;
  border: 1px solid var(--border); border-radius: 18px; overflow: hidden;
}
.tile video { width: 100%; height: 100%; object-fit: contain; background: #01040c; display: block; }
.tile .tile-top {
  position: absolute; inset: 0 0 auto 0; display: flex; gap: 8px; align-items: center;
  padding: 10px 12px; background: linear-gradient(180deg, rgba(2, 6, 23, .88), transparent);
  font-size: .84rem; font-weight: 500;
}
.tile .tile-top .spacer { flex: 1; }
.tile .tile-bottom {
  position: absolute; inset: auto 0 0 0; display: flex; gap: 8px; align-items: center;
  padding: 10px 12px; background: linear-gradient(0deg, rgba(2, 6, 23, .9), transparent);
}
.tile .tile-msg {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 8px;
  justify-items: center; text-align: center; color: var(--muted); font-size: .84rem;
  background: linear-gradient(180deg, rgba(2, 6, 23, .55), rgba(2, 6, 23, .85));
  padding: 12px;
}
.tile .tile-msg strong { color: #ffb9bf; }
.tile select, .tile button { background: rgba(2, 6, 23, .82); border-color: rgba(148, 163, 184, .2); }
.tile select { width: auto; max-width: 60%; padding: 6px 9px; font-size: .76rem; margin: 0; border-radius: 999px; }
.tile .btn { padding: 6px 10px; font-size: .76rem; }
.tile .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 3px rgba(251, 44, 54, .22); }
.tile.fullscreen { position: fixed; inset: 0; z-index: 90; border-radius: 0; aspect-ratio: auto; }
.preview-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ---------- eventi ---------- */
.event-list { display: grid; gap: 8px; max-height: 340px; overflow: auto; }
.event {
  display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 12px; background: rgba(2, 6, 23, .4);
  border: 1px solid rgba(148, 163, 184, .1); border-radius: 12px; font-size: .84rem;
}
.event .dot { width: 8px; height: 8px; }
.event .dot.info { background: var(--accent); }
.event .dot.warning { background: var(--warn); }
.event .dot.error { background: var(--danger); }
.event time { color: var(--muted); font-size: .72rem; white-space: nowrap; font-family: var(--mono); }

/* ---------- modali ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80; background: rgba(1, 3, 10, .75);
  display: grid; place-items: center; padding: 18px; backdrop-filter: blur(6px);
}
.modal {
  width: min(680px, 100%); max-height: 90vh; overflow: auto;
  background: linear-gradient(165deg, #0c1728, #040b18);
  border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow);
  padding: 24px 26px;
}
.modal.wide { width: min(920px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { font-size: 1.25rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.checkbox-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px;
  max-height: 240px; overflow: auto; padding: 12px;
  border: 1px solid rgba(148, 163, 184, .14); border-radius: 14px;
  background: rgba(2, 6, 23, .42);
}
.checkbox-list label {
  display: flex; align-items: center; gap: 8px; margin: 0;
  color: var(--text); font-weight: 500; font-size: .84rem;
  text-transform: none; letter-spacing: 0;
}

/* ---------- toast ---------- */
.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: grid; gap: 10px; }
.toast {
  min-width: 240px; max-width: 380px; padding: 13px 16px; border-radius: 14px;
  background: linear-gradient(165deg, #0d1a2e, #050c19);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  font-size: .85rem; animation: slide .18s ease-out;
}
.toast.ok { border-color: rgba(0, 210, 148, .45); }
.toast.err { border-color: rgba(251, 44, 54, .5); }
@keyframes slide { from { transform: translateY(8px); opacity: 0; } }

/* ---------- misc ---------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: .84rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  padding: 8px 15px; border-radius: 999px; border: 1px solid rgba(148, 163, 184, .14);
  background: rgba(2, 6, 23, .5); color: #c3d0e2; cursor: pointer;
  font-weight: 500; font-size: .82rem;
}
.tab.active { color: #9ff6ff; background: rgba(0, 210, 239, .1); border-color: rgba(0, 210, 239, .5); }
pre.log {
  margin: 0; padding: 16px; max-height: 480px; overflow: auto;
  background: rgba(1, 4, 12, .85); border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 16px;
  font: .76rem/1.6 var(--mono); color: #a9c1dc; white-space: pre-wrap;
}
.empty { padding: 30px; text-align: center; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .app { padding: 16px 14px 48px; }
  .sidebar {
    grid-template-columns: 1fr;
    grid-template-areas: "brand" "nav" "foot";
    padding: 18px;
    border-radius: 20px;
  }
  .sidebar-foot { flex-wrap: wrap; }
  .topbar { padding: 18px 2px 12px; flex-wrap: wrap; }
  .topbar h2 { font-size: 1.35rem; }
  .stat { font-size: 1.75rem; }
  h1 { font-size: 1.6rem; }
}
@media (max-width: 520px) {
  .user-meta { display: none; }
  .nav-item { padding: 8px 12px; font-size: .78rem; }
}
