/* TRIDI Live TV — Lightweight Dark/Light Responsive Stylesheet (~7 KB, zero framework bloat) */
:root {
  --bg: #0b1120;
  --surface: #111827;
  --surface-alt: #1e293b;
  --border: #263349;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 10px;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --border: #cbd5e1;
  --text: #0f172a;
  --muted: #475569;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 1rem; }

/* Navigation */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.75rem 0; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.65rem; font-weight: 700; font-size: 1.1rem; color: var(--text); }
.brand img { height: 32px; width: auto; border-radius: 6px; }
.nav-links { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav-links a { color: var(--muted); font-size: 0.92rem; font-weight: 500; padding: 0.35rem 0.5rem; border-radius: 6px; }
.nav-links a.active, .nav-links a:hover { color: var(--text); background: var(--surface-alt); text-decoration: none; }

/* Status Badges */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.22rem 0.6rem; border-radius: 999px;
  background: var(--surface-alt); color: var(--muted); border: 1px solid var(--border);
}
.badge-live { background: rgba(239, 68, 68, 0.16); color: #f87171; border-color: rgba(239, 68, 68, 0.45); }
.badge-ok { background: rgba(16, 185, 129, 0.16); color: #34d399; border-color: rgba(16, 185, 129, 0.4); }
.badge-warn { background: rgba(245, 158, 11, 0.16); color: #fbbf24; border-color: rgba(245, 158, 11, 0.4); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border-color: rgba(239, 68, 68, 0.5); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* Layout Grids & Cards */
.main { padding: 1.5rem 0 3rem; }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.15rem; margin-bottom: 1rem;
}
.card h2, .card h3 { margin-top: 0; margin-bottom: 0.65rem; font-size: 1.05rem; }
.stat-value { font-size: 1.55rem; font-weight: 700; margin: 0.15rem 0; }
.muted { color: var(--muted); font-size: 0.88rem; }

/* Video Player Stage */
.player-wrap {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #020617; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
}
.player-wrap iframe, .player-wrap video {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.player-standby {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 1.5rem;
  background: radial-gradient(circle at top, #172554 0%, #020617 75%);
  color: #f8fafc;
}
.player-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.75rem; margin-top: 0.85rem;
}

/* Buttons & Forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.5rem 0.9rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-alt); color: var(--text); font-weight: 600; font-size: 0.88rem;
  cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-warn { background: var(--warn); border-color: var(--warn); color: #0f172a; }
.btn-sm { padding: 0.32rem 0.65rem; font-size: 0.8rem; }

input, select, textarea {
  width: 100%; padding: 0.55rem 0.7rem; border-radius: 7px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font: inherit; font-size: 0.9rem;
}
label { display: block; font-size: 0.84rem; font-weight: 600; margin-bottom: 0.3rem; color: var(--muted); }
.field { margin-bottom: 0.85rem; }
.check-field { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.7rem; }
.check-field input { width: auto; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 0.6rem 0.65rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; border: 1px solid var(--border); }
.alert-ok { background: rgba(16, 185, 129, 0.14); border-color: rgba(16, 185, 129, 0.4); color: #6ee7b7; }
.alert-err { background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.45); color: #fca5a5; }

/* Admin Sidebar Shell */
.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin-nav { background: var(--surface); border-right: 1px solid var(--border); padding: 1rem; display: flex; flex-direction: column; gap: 0.25rem; }
.admin-nav a { display: block; padding: 0.55rem 0.75rem; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 0.9rem; }
.admin-nav a.active, .admin-nav a:hover { background: var(--surface-alt); color: var(--text); text-decoration: none; }
.admin-content { padding: 1.5rem; max-width: 1240px; width: 100%; }
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { border-right: 0; border-bottom: 1px solid var(--border); flex-direction: row; flex-wrap: wrap; }
}

.footer { border-top: 1px solid var(--border); padding: 1.5rem 0; color: var(--muted); font-size: 0.85rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.84rem; }
pre { background: var(--bg); padding: 0.8rem; border-radius: 8px; border: 1px solid var(--border); overflow-x: auto; }
