:root {
  --bg: #f8fafc;
  --sidebar: #1e1b2e;
  --surface: #ffffff;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --indigo: #4f46e5;
  --emerald: #059669;
  --red: #dc2626;
  --shadow: 0 22px 50px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at 10% 0%, rgba(79,70,229,.12), transparent 28rem), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--sidebar); color: #cbd5e1; padding: 22px 16px; }
.brand { align-items: center; color: #fff; display: flex; gap: 12px; margin-bottom: 28px; }
.brand-mark { align-items: center; background: var(--indigo); border-radius: 12px; display: flex; font-size: 25px; font-style: italic; font-weight: 900; height: 42px; justify-content: center; width: 42px; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 22px; }
.brand span { color: #94a3b8; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.nav-list { display: grid; gap: 6px; }
.nav-list a { border-radius: 12px; color: #cbd5e1; font-weight: 800; padding: 14px; text-decoration: none; }
.nav-list a.active, .nav-list a:hover { background: var(--indigo); color: #fff; }
.main-panel { display: grid; gap: 18px; padding: 26px clamp(18px, 4vw, 42px) 42px; }
.topbar { align-items: center; display: flex; justify-content: space-between; gap: 20px; }
.eyebrow { color: var(--indigo); font-size: 12px; font-weight: 900; margin: 0 0 7px; text-transform: uppercase; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1.02; }
h2 { font-size: 18px; }
.subtitle, .section-head span, .meta, .event-params { color: var(--muted); }
.subtitle { margin-top: 10px; }
.server-pill { background: #ecfdf5; border: 1px solid #bbf7d0; border-radius: 999px; color: var(--emerald); font-size: 13px; font-weight: 850; padding: 10px 14px; }
.summary { display: grid; gap: 12px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.summary article, .panel, .booth-card { background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.summary article { min-height: 108px; padding: 18px; }
.summary span { color: var(--muted); font-size: 13px; }
.summary strong { display: block; font-size: 34px; margin-top: 9px; }
.panel { padding: 18px; }
.section-head { border-bottom: 1px solid var(--line); margin: -2px 0 16px; padding-bottom: 14px; }
.booth-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.booth-card { box-shadow: none; display: grid; gap: 12px; padding: 16px; }
.booth-card header { align-items: center; display: flex; justify-content: space-between; }
.status { border-radius: 999px; font-size: 12px; font-weight: 900; padding: 7px 10px; }
.status.online { background: #ecfdf5; color: var(--emerald); }
.status.offline { background: #fff1f2; color: var(--red); }
.booth-stats { display: grid; gap: 8px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.booth-stats div { background: #f8fafc; border-radius: 10px; padding: 10px; }
.booth-stats span { color: var(--muted); display: block; font-size: 12px; }
.booth-stats strong { display: block; font-size: 23px; margin-top: 3px; }
.event-list { display: grid; gap: 8px; margin-top: 14px; }
.event-row { align-items: center; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 10px; grid-template-columns: minmax(140px, 1fr) minmax(120px, .8fr) minmax(200px, 1.5fr) minmax(140px, .9fr); padding: 12px; }
.event-type { color: var(--indigo); font-weight: 900; }
.empty { color: var(--muted); padding: 12px 0; }
.event-panel details { display: grid; }
.event-panel summary { cursor: pointer; list-style: none; }
.event-panel summary::-webkit-details-marker { display: none; }
.telemetry { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 6px; padding: 10px; }
.telemetry span { color: var(--muted); font-size: 12px; }
.command-row { display: flex; flex-wrap: wrap; gap: 8px; }
.command-row button { background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 9px; color: var(--indigo); cursor: pointer; font-weight: 900; min-height: 36px; padding: 0 11px; }
.command-row button:hover { background: #e0e7ff; }
.command-row button:disabled { cursor: wait; opacity: .7; }
.login-page { display: grid; min-height: 100vh; place-items: center; padding: 20px; }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); display: grid; gap: 14px; max-width: 440px; padding: 28px; width: 100%; }
.login-card input { border: 1px solid var(--line); border-radius: 10px; min-height: 44px; padding: 0 12px; }
.login-card button { background: var(--indigo); border: 0; border-radius: 10px; color: #fff; cursor: pointer; font-weight: 900; min-height: 44px; }
code { background: #eef2ff; border-radius: 6px; color: #4338ca; padding: 2px 6px; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .booth-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .summary, .booth-stats { grid-template-columns: 1fr; }
  .event-row { grid-template-columns: 1fr; }
}
