:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #08111f;
  color: #e8f0ff;
  --panel: #111d30;
  --line: #24334a;
  --muted: #94a5bd;
  --blue: #63a7ff;
  --green: #44d7a8;
  --red: #ff7188;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 10% 0%, #17345f 0, #08111f 34rem); }
button, input, select { font: inherit; }
.shell { width: min(1440px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0 80px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -0.04em; }
h2 { margin-bottom: 18px; font-size: 1.2rem; }
.eyebrow { margin-bottom: 8px; color: var(--blue); font-size: .75rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.subtitle, .status, .panel-title p, .panel-title span { color: var(--muted); }
.controls { display: flex; align-items: end; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(17, 29, 48, .86); }
label { display: grid; gap: 7px; color: var(--muted); font-size: .78rem; font-weight: 700; }
input, select, button { height: 42px; border: 1px solid var(--line); border-radius: 10px; }
input, select { min-width: 170px; padding: 0 12px; background: #091322; color: #fff; }
button { padding: 0 18px; border-color: #2782f2; background: #2782f2; color: #fff; cursor: pointer; font-weight: 800; }
button:hover { background: #4093fa; }
.status { min-height: 24px; margin: 0 0 20px; }
.status.error { color: var(--red); }
.dashboard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.kpis { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 12px; }
.kpi, .panel { border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(20, 35, 58, .98), rgba(12, 23, 40, .98)); box-shadow: 0 18px 55px rgba(0, 0, 0, .18); }
.kpi { padding: 18px; }
.kpi span { display: block; margin-bottom: 8px; color: var(--muted); font-size: .78rem; }
.kpi strong { font-size: 1.75rem; letter-spacing: -.03em; }
.panel { min-width: 0; padding: 22px; }
.panel-wide { grid-column: 1 / -1; }
.panel-title { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.panel-title p, .panel-title span { font-size: .78rem; }
canvas { display: block; width: 100%; height: 280px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: .83rem; }
th { color: var(--muted); font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
td:last-child, th:last-child { text-align: right; }
#events td:last-child, #events th:last-child { text-align: left; max-width: 540px; overflow-wrap: anywhere; }
.empty { color: var(--muted); text-align: left !important; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 18px; }
.pagination span { min-width: 150px; color: var(--muted); text-align: center; font-size: .83rem; }
.pagination button { height: 38px; min-width: 100px; padding: 0 14px; }
.pagination button:disabled { border-color: var(--line); background: #17243a; color: #64748b; cursor: not-allowed; }

@media (max-width: 1100px) {
  .hero { align-items: stretch; flex-direction: column; }
  .controls { align-items: stretch; flex-wrap: wrap; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  .shell { width: min(100% - 20px, 1440px); padding-top: 28px; }
  .dashboard { grid-template-columns: 1fr; }
  .panel, .panel-wide { grid-column: 1; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .controls, .controls label, input, select, button { width: 100%; }
  .pagination { justify-content: center; }
  .pagination button { width: auto; }
}
