:root {
  --bg: #071019;
  --panel: rgba(15, 28, 40, .92);
  --panel-2: #122434;
  --line: #24394a;
  --text: #eaf2f7;
  --muted: #8da2b3;
  --cyan: #4bd6c3;
  --blue: #65a8ff;
  --amber: #ffc467;
  --red: #ff7182;
  --green: #4bdd9d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 80% -10%, #16475b 0, transparent 38%),
    radial-gradient(circle at 5% 30%, #152949 0, transparent 30%),
    var(--bg);
  font-family: Vazirmatn, IRANSans, Tahoma, sans-serif;
  min-height: 100vh;
}
main { width: min(1500px, 100%); margin: auto; padding: 32px 24px 56px; }
.topbar { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 24px; }
.eyebrow { color: var(--cyan); font: 700 11px/1.5 monospace; letter-spacing: 2px; }
h1 { margin: 7px 0 5px; font-size: clamp(27px, 4vw, 42px); letter-spacing: -.8px; }
h2, h3, p { margin: 0; }
.topbar p, .panel-head p { color: var(--muted); font-size: 12px; margin-top: 6px; }
.controls { display: grid; justify-items: end; gap: 13px; }
.health { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.health i { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px currentColor; }
.health.ok i { background: var(--green); }
.health.error i { background: var(--red); }
.windows { display: flex; gap: 5px; padding: 4px; border: 1px solid var(--line); background: #08141f99; border-radius: 11px; }
button { border: 0; color: var(--muted); background: transparent; padding: 8px 11px; border-radius: 8px; cursor: pointer; font-family: inherit; }
button.active { color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px #2d485d; }
.cards { display: grid; grid-template-columns: repeat(8, minmax(120px, 1fr)); gap: 11px; }
.card, .panel { border: 1px solid var(--line); background: var(--panel); box-shadow: 0 16px 42px #0004; }
.card { padding: 16px; border-radius: 14px; min-height: 104px; position: relative; overflow: hidden; }
.card::after { content: ""; position: absolute; inset: auto -18px -32px auto; width: 80px; height: 80px; border-radius: 50%; background: var(--accent, var(--blue)); opacity: .08; }
.card label { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; }
.card strong { display: block; direction: ltr; text-align: right; font-size: 25px; margin-top: 11px; }
.card small { color: var(--muted); font-size: 10px; }
.pipeline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.pipeline span { direction: ltr; color: var(--muted); background: #091722aa; border: 1px solid var(--line); border-radius: 99px; padding: 6px 10px; font: 10px monospace; }
.pipeline b { color: var(--text); margin-left: 5px; }
.grid { display: grid; gap: 14px; margin-top: 14px; }
.grid.two { grid-template-columns: minmax(0, 1.35fr) minmax(390px, .65fr); }
.panel { border-radius: 16px; padding: 18px; margin-top: 14px; min-width: 0; }
.grid .panel { margin-top: 0; }
.sync-panel { margin-bottom: 14px; }
.sync-panel button { color: var(--text); background: var(--panel-2); border: 1px solid #2d485d; white-space: nowrap; }
#sync-command { margin: 0; padding: 14px; overflow: auto; direction: ltr; text-align: left; color: #cce3f4; background: #07131e; border: 1px solid #203648; border-radius: 10px; font: 12px/1.7 monospace; }
.panel-head { display: flex; align-items: start; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.panel h2 { font-size: 15px; }
.panel h3 { color: var(--muted); font-size: 11px; margin-bottom: 8px; }
.legend { display: flex; gap: 14px; direction: rtl; font-size: 10px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 5px; }
.legend .request::before { background: var(--blue); }
.legend .success::before { background: var(--green); }
.legend .error::before { background: var(--red); }
#request-chart { width: 100%; height: 250px; direction: ltr; overflow: visible; }
.chart-grid { stroke: #294052; stroke-width: 1; opacity: .55; }
.chart-label { fill: var(--muted); font: 10px monospace; }
.chart-line { fill: none; stroke-width: 2.4; vector-effect: non-scaling-stroke; }
.chart-line.request { stroke: var(--blue); }
.chart-line.success { stroke: var(--green); }
.chart-line.error { stroke: var(--red); }
.breakdowns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bar { margin: 9px 0; }
.bar-meta { display: flex; justify-content: space-between; gap: 8px; direction: ltr; color: var(--muted); font: 10px monospace; }
.bar-track { height: 5px; background: #09151f; border-radius: 8px; overflow: hidden; margin-top: 5px; }
.bar-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--red), var(--amber)); }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 12px 10px; text-align: right; border-bottom: 1px solid #213646; font-size: 11px; }
th { color: var(--muted); font-weight: 500; }
tbody tr:last-child td { border: 0; }
code { color: #cce3f4; direction: ltr; display: inline-block; font-size: 10px; }
.pill, .badge { display: inline-flex; padding: 4px 8px; border: 1px solid #375065; border-radius: 99px; color: var(--muted); background: #101f2d; font-size: 10px; }
.pill.ok { color: var(--green); border-color: #235b48; background: #102d26; }
.pill.warn { color: var(--amber); border-color: #5c4927; background: #302718; }
.pill.error { color: var(--red); border-color: #66313b; background: #321920; }
.events { display: grid; gap: 8px; max-height: 330px; overflow: auto; }
.event { display: grid; grid-template-columns: 85px 86px 1fr auto; gap: 12px; align-items: center; background: #0b1924; border: 1px solid #203648; border-radius: 10px; padding: 10px 12px; font-size: 11px; }
.event time, .event .category { color: var(--muted); font-family: monospace; direction: ltr; }
.empty { color: var(--muted); text-align: center; padding: 30px !important; }
footer { display: flex; justify-content: space-between; color: var(--muted); font: 10px monospace; direction: ltr; margin-top: 16px; }

@media (max-width: 1250px) { .cards { grid-template-columns: repeat(4, 1fr); } .grid.two { grid-template-columns: 1fr; } }
@media (max-width: 720px) { main { padding: 22px 13px 42px; } .topbar { align-items: start; flex-direction: column; } .controls { justify-items: start; width: 100%; } .cards { grid-template-columns: repeat(2, 1fr); } .breakdowns { grid-template-columns: 1fr; } .event { grid-template-columns: 72px 70px 1fr; } .event .details { display: none; } }
