@font-face {
  font-family: Vazirmatn;
  src: url('/static/vazirmatn.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #060914;
  --bg2: #0b1020;
  --panel: rgba(19, 26, 46, .92);
  --panel2: rgba(24, 33, 58, .94);
  --text: #f4f7fb;
  --muted: #9ca8c3;
  --line: rgba(255, 255, 255, .10);
  --green: #3ddc97;
  --yellow: #ffd166;
  --red: #ff5d73;
  --blue: #65a7ff;
  --purple: #a78bfa;
  --shadow: 0 16px 44px rgba(0, 0, 0, .30);
  --radius: 22px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Vazirmatn, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body:has(#app:not([hidden])) {
  background: radial-gradient(circle at top right, #22315f 0, var(--bg2) 42%, var(--bg) 100%);
}
[hidden] { display: none !important; }

.wrap { width: min(980px, 100%); margin: 0 auto; padding: 18px 14px 32px; }
.hero { display: flex; gap: 14px; align-items: stretch; margin-bottom: 14px; }
.hero-main {
  flex: 1;
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(61, 220, 151, .16), rgba(101, 167, 255, .12));
  box-shadow: var(--shadow);
}
.hero-main::after {
  content: "";
  position: absolute;
  inset: auto -45px -55px auto;
  width: 170px;
  height: 170px;
  border-radius: 999px;
  background: rgba(61, 220, 151, .16);
  filter: blur(12px);
}
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.title { position: relative; z-index: 1; margin: 4px 0 0; font-size: clamp(24px, 6vw, 34px); font-weight: 950; letter-spacing: -.03em; }
.sub { position: relative; z-index: 1; margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.status-pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 7px 12px;
  border: 1px solid rgba(61, 220, 151, .35);
  border-radius: 999px;
  background: rgba(61, 220, 151, .12);
  font-size: 13px;
  font-weight: 900;
}
.status-pill.warn { border-color: rgba(255, 209, 102, .42); background: rgba(255, 209, 102, .12); }
.status-pill.critical, .status-pill.error { border-color: rgba(255, 93, 115, .45); background: rgba(255, 93, 115, .12); }
.status-dot { width: 10px; height: 10px; border-radius: 99px; background: var(--green); box-shadow: 0 0 20px currentColor; }
.status-pill.warn .status-dot { background: var(--yellow); }
.status-pill.critical .status-dot, .status-pill.error .status-dot { background: var(--red); }
.refresh {
  width: 54px;
  flex: 0 0 54px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
}
.refresh:active { transform: translateY(1px); }

.loading-card, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
}
.loading-card { padding: 16px; display: grid; gap: 12px; }
.skeleton-line, .skeleton-grid span {
  display: block;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.14), rgba(255,255,255,.05));
  animation: pulse 1.4s ease-in-out infinite;
}
.skeleton-line { width: 58%; }
.skeleton-line.wide { width: 86%; height: 18px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.skeleton-grid span { height: 64px; border-radius: 16px; }
@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { padding: 14px; min-width: 0; }
.card h2, .card h3 { margin: 0 0 10px; color: #dce6ff; font-size: 14px; }
.card h3 { margin-top: 16px; color: var(--muted); font-size: 12px; }
.metric { direction: ltr; text-align: right; font-size: 30px; font-weight: 950; letter-spacing: -.04em; }
.muted { color: var(--muted); font-size: 12px; margin: 0; }
.bar { height: 10px; margin: 10px 0 7px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .08); }
.bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--blue)); transition: width .45s ease; }
.bar.warn span { background: linear-gradient(90deg, var(--yellow), #ff9f1c); }
.bar.danger span { background: linear-gradient(90deg, var(--red), #ff8fa0); }
.wide { grid-column: 1 / -1; }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  background: rgba(255, 255, 255, .05);
  color: var(--muted);
  font-family: inherit;
  font-weight: 850;
}
.tab.active { background: rgba(101, 167, 255, .18); color: var(--text); border-color: rgba(101, 167, 255, .42); }
.panel { display: none; }
.panel.active { display: block; }

.row, .alert, .empty, .mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child, .alert:last-child, .empty:last-child { border-bottom: 0; }
.row > span:first-child { color: var(--muted); }
.value, .badge { direction: ltr; text-align: left; font-weight: 900; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: var(--text);
}
.badge.ok, .ok { color: var(--green); }
.badge.warn, .warn { color: var(--yellow); }
.badge.critical, .badge.error, .critical, .error { color: var(--red); }
.alert { color: #ffe4e9; justify-content: flex-start; }
.alert::before { content: "•"; color: var(--yellow); font-size: 22px; line-height: 0; }
.empty { color: var(--muted); justify-content: center; text-align: center; }
.mini { margin-top: 8px; color: var(--muted); font-size: 11px; justify-content: center; border-bottom: 0; }
.footer { margin-top: 14px; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 560px) {
  .wrap { padding: 14px 10px 28px; }
  .grid { grid-template-columns: 1fr; }
  .hero { gap: 10px; }
  .refresh { width: 50px; flex-basis: 50px; }
  .metric { font-size: 26px; }
}
