:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101312;
  color: #e9eeeb;
  --surface: #171b19;
  --surface-2: #1d2220;
  --line: #303633;
  --muted: #99a29d;
  --green: #52d6a2;
  --orange: #ffad5c;
  --red: #ff6b62;
  --blue: #68aee8;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #101312; }
button, input, select { font: inherit; }
button { color: inherit; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px; border-right: 1px solid var(--line); background: #121614; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 750; font-size: 17px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--green); color: #07110d; font-size: 12px; border-radius: 6px; }
nav { display: grid; gap: 6px; margin-top: 42px; }
.nav-item { width: 100%; border: 0; border-left: 2px solid transparent; background: transparent; color: var(--muted); padding: 10px 12px; text-align: left; cursor: pointer; }
.nav-item:hover, .nav-item.active { color: #fff; border-left-color: var(--green); background: #1a201d; }
.sidebar-status { margin-top: auto; padding: 14px 10px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.sidebar-status div { min-width: 0; display: grid; gap: 3px; }
.sidebar-status strong { font-size: 13px; }
.sidebar-status small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px #ffad5c20; }
.status-dot.ok { background: var(--green); box-shadow: 0 0 0 4px #52d6a220; }
.status-dot.error { background: var(--red); box-shadow: 0 0 0 4px #ff6b6220; }
main { min-width: 0; padding: 0 32px 64px; max-width: 1700px; width: 100%; margin: 0 auto; }
.topbar { min-height: 102px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; font-weight: 680; letter-spacing: 0; }
h2 { font-size: 18px; font-weight: 650; letter-spacing: 0; }
h3 { font-size: 14px; font-weight: 650; }
.eyebrow { margin-bottom: 5px; color: var(--muted); text-transform: uppercase; font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.privacy-badge { border: 1px solid #3b5147; color: #b9e5cf; background: #193126; padding: 7px 10px; border-radius: 4px; font-size: 12px; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: 5px; cursor: pointer; font-size: 18px; }
.icon-button:hover { border-color: #59615d; background: var(--surface-2); }
.section-block { padding-top: 30px; scroll-margin-top: 20px; }
.metrics-strip { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); border: 1px solid var(--line); background: var(--surface); }
.metrics-strip article { min-width: 0; padding: 17px 18px; border-right: 1px solid var(--line); display: grid; gap: 5px; }
.metrics-strip article:last-child { border-right: 0; }
.metrics-strip span, .traffic-kpis span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.metrics-strip strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.metrics-strip small { color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.overview-grid, .traffic-grid { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 16px; }
.panel { border: 1px solid var(--line); background: var(--surface); padding: 18px; min-width: 0; }
.panel-heading, .section-heading, .request-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-heading { min-height: 34px; }
.section-heading { margin-bottom: 14px; }
.count { min-width: 30px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--muted); border-radius: 4px; font-size: 12px; }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 11px; }
.legend span::before { content: ""; width: 7px; height: 7px; display: inline-block; border-radius: 50%; margin-right: 6px; }
.gpu-key::before { background: var(--green); }
.cpu-key::before { background: var(--orange); }
canvas { display: block; width: 100%; height: 230px; margin-top: 14px; }
.process-list { min-height: 230px; max-height: 260px; overflow: auto; }
.process-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.process-item:last-child { border-bottom: 0; }
.process-item strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.process-item span { font-size: 12px; font-variant-numeric: tabular-nums; }
.process-item small { color: var(--muted); }
.empty-state { color: var(--muted); display: grid; place-items: center; font-size: 13px; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; font-weight: 650; text-align: left; background: #141816; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #1c211f; }
.service-name, .client-name { color: #fff; font-weight: 600; }
.image-cell { max-width: 340px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.status.bad::before { background: var(--red); }
.status.warn::before { background: var(--orange); }
.empty-cell { padding: 34px; text-align: center; color: var(--muted); }
.source-strip { min-height: 44px; margin-bottom: 12px; padding: 9px 12px; border: 1px solid var(--line); background: #141816; display: flex; align-items: center; gap: 24px; }
.source-strip > div { display: flex; align-items: center; gap: 7px; font-size: 11px; }
.source-strip > div span:nth-child(2) { color: var(--muted); }
.source-strip > small { margin-left: auto; color: var(--muted); }
.source-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.source-dot.ok { background: var(--green); }
.source-dot.bad { background: var(--red); }
.source-label { color: #b9e5cf; }
.traffic-kpis { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); background: var(--surface); }
.traffic-kpis div { display: grid; gap: 5px; padding: 14px 18px; border-right: 1px solid var(--line); }
.traffic-kpis div:last-child { border-right: 0; }
.traffic-kpis strong { font-size: 20px; font-variant-numeric: tabular-nums; }
select, input { height: 34px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: #e9eeeb; padding: 0 10px; outline: none; }
select:focus, input:focus { border-color: var(--green); }
.bar-list { min-height: 120px; }
.bar-item { margin-top: 13px; }
.bar-label { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; margin-bottom: 6px; }
.bar-label span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 5px; background: #2b312e; }
.bar-fill { height: 100%; background: var(--green); min-width: 2px; }
.request-toolbar { margin: 28px 0 12px; }
.request-toolbar > div:first-child { display: flex; align-items: baseline; gap: 10px; }
.muted { color: var(--muted); font-size: 12px; }
.filters { display: flex; gap: 8px; }
.filters input { width: 150px; }
.requests-table tbody tr { cursor: pointer; }
.http-code { display: inline-block; min-width: 32px; padding: 3px 6px; border-radius: 3px; text-align: center; background: #1d3b2e; color: #99ebc4; }
.http-code.error { background: #44221f; color: #ffaaa4; }
.alert { border: 1px solid #76512f; background: #2e2318; color: #ffd0a0; padding: 10px 14px; margin-bottom: 14px; font-size: 12px; }
.hidden { display: none !important; }
dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; border: 1px solid #414945; border-radius: 6px; background: #151917; color: #e9eeeb; padding: 22px; box-shadow: 0 24px 80px #000a; }
dialog::backdrop { background: #050706b8; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.detail-meta { margin: 18px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.detail-meta div { border-left: 2px solid var(--line); padding-left: 9px; display: grid; gap: 3px; min-width: 0; }
.detail-meta small { color: var(--muted); text-transform: uppercase; font-size: 9px; }
.detail-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.payload-heading { margin: 18px 0 8px; display: flex; align-items: center; justify-content: space-between; }
.text-button { border: 0; background: transparent; color: var(--green); cursor: pointer; font-size: 11px; }
.payload { min-height: 88px; max-height: 260px; overflow: auto; margin: 0; padding: 12px; border: 1px solid var(--line); background: #0d100f; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; line-height: 1.5; }
.payload.masked { filter: blur(5px); user-select: none; }

@media (max-width: 1100px) {
  .metrics-strip { grid-template-columns: repeat(3, 1fr); }
  .metrics-strip article:nth-child(3) { border-right: 0; }
  .metrics-strip article:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .traffic-kpis { grid-template-columns: repeat(3, 1fr); }
  .traffic-kpis div:nth-child(3) { border-right: 0; }
  .traffic-kpis div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; width: auto; height: auto; padding: 14px 18px; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; align-items: center; gap: 14px; }
  .brand span:last-child, .sidebar-status { display: none; }
  nav { margin: 0; display: flex; overflow-x: auto; }
  .nav-item { width: auto; white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .nav-item:hover, .nav-item.active { border-left-color: transparent; border-bottom-color: var(--green); }
  main { padding: 0 16px 40px; }
  .topbar { min-height: 88px; }
  h1 { font-size: 22px; }
  .privacy-badge { display: none; }
  .metrics-strip { grid-template-columns: repeat(2, 1fr); }
  .metrics-strip article:nth-child(n) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .metrics-strip article:nth-child(2n) { border-right: 0; }
  .metrics-strip article:nth-last-child(-n+2) { border-bottom: 0; }
  .overview-grid, .traffic-grid { grid-template-columns: 1fr; }
  .traffic-kpis { grid-template-columns: repeat(2, 1fr); }
  .traffic-kpis div:nth-child(n) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .traffic-kpis div:nth-child(2n) { border-right: 0; }
  .traffic-kpis div:last-child { border-bottom: 0; }
  .request-toolbar { align-items: flex-start; flex-direction: column; }
  .source-strip { align-items: flex-start; flex-direction: column; gap: 7px; }
  .source-strip > small { margin-left: 0; }
  .filters { width: 100%; flex-wrap: wrap; }
  .filters input, .filters select { flex: 1 1 120px; min-width: 0; }
  .detail-meta { grid-template-columns: repeat(2, 1fr); }
}
