:root {
  color-scheme: dark;
  --bg: #0a0d12;
  --surface: #10151d;
  --surface-2: #151c26;
  --surface-3: #1b2430;
  --border: #253041;
  --text: #eef3f8;
  --muted: #8e9aaa;
  --accent: #7dd3fc;
  --accent-2: #a78bfa;
  --good: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --cpu: #60a5fa;
  --memory: #a78bfa;
  --disk: #2dd4bf;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 15% -10%, rgba(96,165,250,.09), transparent 34%), var(--bg); color: var(--text); }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(1500px, calc(100% - 40px)); margin: 0 auto; padding: 26px 0 36px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.brand-row, .top-actions, .metric-head, .panel-head, .connection-row { display: flex; align-items: center; }
.brand-row { gap: 12px; }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(145deg, #1e293b, #111827); border: 1px solid var(--border); font-size: 24px; font-weight: 800; color: var(--accent); }
.brand-mark.small { width: 44px; height: 44px; border-radius: 13px; font-size: 19px; }
.eyebrow { margin: 0 0 4px; font-size: 10px; letter-spacing: .18em; color: var(--muted); font-weight: 800; direction: ltr; text-align: inherit; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(19px, 2vw, 25px); }
h2 { margin: 0; font-size: 17px; }
.muted { color: var(--muted); }
.top-actions { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.health-pill, .live-time { min-height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid var(--border); border-radius: 999px; background: rgba(16,21,29,.8); font-size: 12px; }
.status-dot, .live-indicator { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px rgba(142,154,170,.08); }
.status-dot.healthy, .health-pill.healthy .status-dot, .service-card.up .status-dot { background: var(--good); box-shadow: 0 0 0 4px rgba(52,211,153,.08); }
.health-pill.warning .status-dot { background: var(--warn); }
.health-pill.danger .status-dot, .service-card.down .status-dot { background: var(--danger); box-shadow: 0 0 0 4px rgba(251,113,133,.08); }
.live-indicator { background: var(--good); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.ghost-button, .range-picker button { border: 1px solid var(--border); color: var(--text); background: var(--surface); border-radius: 11px; min-height: 40px; padding: 0 14px; }
.ghost-button:hover, .range-picker button:hover { background: var(--surface-2); }
.hero-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.metric-card, .panel { background: linear-gradient(180deg, rgba(21,28,38,.9), rgba(16,21,29,.92)); border: 1px solid var(--border); border-radius: var(--radius); }
.metric-card { padding: 18px; min-width: 0; }
.metric-head { justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; }
.metric-value { direction: ltr; display: flex; align-items: baseline; gap: 5px; margin: 20px 0 13px; }
.metric-value strong { font-size: clamp(30px, 3.5vw, 44px); letter-spacing: -.04em; line-height: 1; }
.metric-value span { color: var(--muted); }
.load-value strong { font-size: 33px; }
.progress { height: 6px; background: #202a38; border-radius: 99px; overflow: hidden; }
.progress i { display: block; width: 0; height: 100%; background: var(--accent); border-radius: inherit; transition: width .35s ease; }
.metric-card[data-metric="memory"] .progress i { background: var(--memory); }
.metric-card[data-metric="disk"] .progress i { background: var(--disk); }
.metric-card.warning { border-color: rgba(251,191,36,.45); }
.metric-card.danger { border-color: rgba(251,113,133,.55); }
.metric-sub { color: var(--muted); font-size: 12px; margin: 12px 0 0; direction: ltr; text-align: right; }
.mini-triplet { direction: ltr; display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-top: 5px; }
.mini-triplet span { text-align: center; padding: 6px; background: var(--surface-3); border-radius: 8px; font-size: 11px; color: var(--muted); }
.panel { padding: 19px; min-width: 0; }
.chart-panel { margin-top: 14px; }
.panel-head { justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head.wrap { flex-wrap: wrap; }
.range-picker { direction: ltr; display: flex; gap: 6px; }
.range-picker button { min-height: 34px; padding: 0 12px; font-size: 11px; }
.range-picker button.active { border-color: rgba(125,211,252,.42); background: rgba(125,211,252,.09); color: var(--accent); }
.chart-legend { display: flex; gap: 16px; margin-bottom: 8px; color: var(--muted); font-size: 11px; direction: ltr; }
.chart-legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend { width: 8px; height: 8px; border-radius: 50%; }
.legend.cpu { background: var(--cpu); } .legend.memory { background: var(--memory); } .legend.disk { background: var(--disk); }
.chart-wrap { height: 250px; position: relative; }
.chart-wrap.compact { height: 150px; margin-top: 18px; }
canvas { width: 100%; height: 100%; display: block; }
.two-col { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 14px; }
.throughput-grid { direction: ltr; display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; }
.throughput-grid > div { display: grid; grid-template-columns: 31px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 9px; padding: 11px; border: 1px solid var(--border); border-radius: 12px; background: rgba(10,13,18,.34); }
.throughput-grid .arrow { grid-row: 1 / 3; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(96,165,250,.09); color: var(--cpu); }
.throughput-grid small { color: var(--muted); }
.throughput-grid strong { font-size: 14px; margin-top: 3px; }
.core-grid { direction: ltr; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.core { border: 1px solid var(--border); background: rgba(10,13,18,.35); padding: 10px; border-radius: 11px; }
.core-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; margin-bottom: 8px; }
.core .progress { height: 4px; }
.connection-row { margin-top: 18px; justify-content: space-between; gap: 10px; font-size: 12px; }
.connection-pills { direction: ltr; display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.connection-pills span { padding: 4px 7px; border-radius: 7px; background: var(--surface-3); color: var(--muted); font-size: 10px; }
.service-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 9px; }
.service-card { min-height: 68px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: rgba(10,13,18,.32); }
.service-card strong { display: block; font-size: 12px; }
.service-card small { color: var(--muted); font-size: 10px; }
.process-section { align-items: start; }
.table-panel { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 470px; direction: ltr; }
th, td { text-align: left; border-bottom: 1px solid rgba(37,48,65,.68); padding: 10px 8px; font-size: 11px; }
th { color: var(--muted); font-weight: 600; }
td:first-child { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
tbody tr:last-child td { border-bottom: 0; }
.alerts-panel { margin-top: 14px; }
.alert-list { display: grid; gap: 7px; }
.alert-item { direction: ltr; display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 11px; background: rgba(10,13,18,.3); }
.alert-item .event-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.alert-item.resolved .event-dot { background: var(--good); }
.alert-item strong { font-size: 11px; display: block; }
.alert-item small, .empty { color: var(--muted); font-size: 10px; margin: 0; }
footer { display: flex; justify-content: space-between; gap: 12px; color: #657184; font-size: 10px; padding: 22px 3px 0; direction: ltr; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.login-shell { width: min(430px, 100%); }
.login-card { border: 1px solid var(--border); border-radius: 24px; padding: 28px; background: linear-gradient(180deg, rgba(21,28,38,.98), rgba(13,18,25,.98)); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.login-card > .brand-mark { margin-bottom: 22px; }
.login-copy h1 { margin: 0 0 9px; font-size: 25px; }
.login-copy p { line-height: 1.7; }
.login-form { display: grid; gap: 14px; margin-top: 24px; }
.login-form label { display: grid; gap: 7px; font-size: 12px; color: var(--muted); }
.login-form input { min-height: 48px; border-radius: 12px; border: 1px solid var(--border); background: #0d1219; color: var(--text); padding: 0 13px; outline: 0; direction: ltr; }
.login-form input:focus { border-color: rgba(125,211,252,.62); box-shadow: 0 0 0 3px rgba(125,211,252,.08); }
.primary-button { min-height: 48px; border: 0; border-radius: 12px; background: var(--accent); color: #071018; font-weight: 800; margin-top: 3px; }
.primary-button:disabled { opacity: .6; cursor: wait; }
.form-error { min-height: 18px; margin: 0; color: var(--danger); font-size: 11px; }
.login-meta { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border); margin-top: 18px; padding-top: 16px; color: var(--muted); font-size: 10px; line-height: 1.6; }
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .service-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .app-shell { width: min(100% - 22px, 1500px); padding-top: 16px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .top-actions { justify-content: flex-start; }
  .two-col { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .core-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .chart-wrap { height: 210px; }
}
@media (max-width: 460px) {
  .hero-grid { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: 1fr; }
  .throughput-grid { grid-template-columns: 1fr; }
  .login-card { padding: 22px; }
  .live-time { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
