:root {
  color-scheme: dark;
  --page: #101214;
  --surface: #191c1f;
  --surface-strong: #202428;
  --line: #33393e;
  --line-soft: #252a2e;
  --text: #f5f3ed;
  --muted: #9ca4a8;
  --yellow: #ffd12a;
  --orange: #f68c22;
  --green: #a8d548;
  --red: #f06855;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.dashboard { width: min(1160px, calc(100% - 48px)); margin: 0 auto; padding: 34px 0 72px; }

.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 62px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 48px; height: 48px; object-fit: contain; pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy > span, .section-kicker { color: var(--yellow); font-size: 11px; font-weight: 800; line-height: 1; text-transform: uppercase; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; font-weight: 700; line-height: 1.1; }
.live-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.live-state i, .card-state { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgb(246 140 34 / 13%); }
.live-state i { background: var(--green); box-shadow: 0 0 0 4px rgb(168 213 72 / 12%); }

.overview { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin-top: 34px; padding: 28px 0 25px; border-bottom: 1px solid var(--line); }
.overview-status { max-width: 700px; }
.overview h2 { margin: 10px 0 8px; font-size: 32px; line-height: 1.12; font-weight: 700; }
.overview p { color: var(--muted); font-size: 15px; line-height: 1.55; }
.overview-meta { display: grid; justify-items: end; gap: 3px; padding-bottom: 3px; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.fleet-count { color: var(--text); font-size: 42px; font-weight: 700; line-height: .9; }

.fleet { margin-top: 32px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 14px; }
.section-heading p { margin-top: 6px; color: var(--muted); font-size: 14px; }
time { color: var(--muted); font-size: 12px; }
.server-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.fleet-card { min-width: 0; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.fleet-card:hover { border-color: #4c545b; }
.card-head { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--line-soft); }
.card-head h3 { margin-top: -3px; overflow: hidden; font-size: 17px; font-weight: 700; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.card-head p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.availability { padding: 4px 7px; color: var(--green); background: rgb(168 213 72 / 8%); border: 1px solid rgb(168 213 72 / 20%); border-radius: 4px; font-size: 11px; font-weight: 700; line-height: 1; }
.fleet-card.offline .card-state { background: var(--red); box-shadow: 0 0 0 4px rgb(240 104 85 / 13%); }
.fleet-card.offline .availability { color: var(--red); background: rgb(240 104 85 / 8%); border-color: rgb(240 104 85 / 20%); }

.metrics { display: grid; gap: 13px; padding: 18px 0; }
.metric-line { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 7px; }
.metric-line span { color: var(--muted); font-size: 12px; }
.metric-line strong { color: var(--text); font-size: 14px; font-weight: 700; }
.metric-track { display: block; height: 4px; overflow: hidden; background: #2b3034; border-radius: 1px; }
.metric-fill { display: block; width: var(--fill); height: 100%; background: var(--yellow); border-radius: inherit; }
.metric:nth-child(2) .metric-fill { background: var(--orange); }
.metric:nth-child(3) .metric-fill { background: #d4d9d4; }

.card-foot { display: grid; grid-template-columns: auto auto auto 1fr; align-items: end; gap: 12px; padding-top: 15px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; white-space: nowrap; }
.card-foot b { color: var(--text); font-size: 12px; font-weight: 700; }
.card-foot .load { display: grid; justify-items: end; gap: 1px; }
.card-foot small { color: var(--muted); font-size: 10px; text-transform: uppercase; }

.fleet-card.loading { display: flex; align-items: center; gap: 12px; min-height: 144px; color: var(--muted); }
.fleet-card.loading .card-state { flex: 0 0 9px; }

@media (max-width: 760px) {
  .dashboard { width: min(100% - 28px, 1160px); padding-top: 22px; }
  .topbar { min-height: 55px; }
  .brand-mark { width: 40px; height: 40px; }
  h1 { font-size: 22px; }
  .overview { margin-top: 25px; padding: 22px 0; }
  .overview h2 { font-size: 25px; }
  .server-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .live-state { font-size: 11px; }
  .overview { align-items: start; flex-direction: column; gap: 20px; }
  .overview-meta { justify-items: start; }
  .fleet-count { font-size: 32px; }
  .card-foot { grid-template-columns: repeat(3, auto); gap: 8px; }
  .card-foot .load { grid-column: 1 / -1; justify-items: start; grid-template-columns: auto auto; gap: 6px; align-items: baseline; }
}
