:root {
  --navy: #0d1b2a;
  --navy-mid: #16324a;
  --navy-line: #1f3d57;
  --yellow: #f5c518;
  --yellow-dark: #d4a70f;
  --workspace: #f4f6f8;
  --card: #ffffff;
  --ink: #15202b;
  --muted: #5d6b78;
  --line: #dce3ea;
  --ok: #1f8a4c;
  --warn: #c47b11;
  --bad: #b42318;
  --sidebar: 248px;
  --header: 72px;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(13, 27, 42, 0.06);
  font-family: "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--workspace); color: var(--ink); }
button, input { font: inherit; }
a { color: inherit; }

body.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
body.login-only { display: block; }

.sidebar {
  background: var(--navy);
  color: #e8eef4;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 6px 10px 16px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--yellow); color: var(--navy);
  display: grid; place-items: center; font-weight: 800;
}
.brand h1 { margin: 0; font-size: 15px; letter-spacing: 0.02em; }
.brand p { margin: 2px 0 0; color: #93a4b5; font-size: 12px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button {
  appearance: none; border: 0; background: transparent; color: #d5dee7;
  text-align: left; padding: 11px 12px; border-radius: 10px; cursor: pointer;
}
.nav button:hover, .nav button.active { background: var(--navy-mid); color: #fff; }
.nav button.active { box-shadow: inset 3px 0 0 var(--yellow); }
.nav .soon { color: #7f8fa0; }

.sidebar-foot { margin-top: auto; color: #7f8fa0; font-size: 12px; padding: 8px 12px; }

.workspace { min-width: 0; }
.topbar {
  height: var(--header);
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}
.topbar h2 { margin: 0; font-size: 22px; font-weight: 700; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.select {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 14px; color: var(--muted); min-width: 160px;
}
.live {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 700;
  letter-spacing: 0.04em; background: #e8f6ee; color: var(--ok);
}
.live.offline { background: #fdecea; color: var(--bad); }
.live.degraded { background: #fff4df; color: var(--warn); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.content { padding: 24px; display: grid; gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px;
}
.card h3 { margin: 0 0 12px; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.hero-status { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.hero-status strong { font-size: 28px; }
.kicker { color: var(--muted); font-size: 13px; }

.attention { border-color: #f0d48a; }
.attention.has-items { border-color: #f0b4ae; background: #fffaf8; }
.attention.empty { color: var(--muted); }
.item { padding: 12px 0; border-top: 1px solid var(--line); }
.item:first-of-type { border-top: 0; }
.item h4 { margin: 0 0 4px; }
.sev { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--warn); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.stat { font-size: 32px; font-weight: 700; }
.placeholder { color: var(--muted); font-style: italic; }

.menu-toggle { display: none; background: transparent; border: 0; color: var(--navy); font-size: 22px; }

.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(160deg, #0d1b2a 0%, #16324a 55%, #1b4332 140%);
}
.login-card {
  width: min(420px, 100%); background: #fff; border-radius: 20px; padding: 32px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.login-card h1 { margin: 8px 0 6px; }
.login-card p { margin: 0 0 22px; color: var(--muted); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field input {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px;
}
.primary {
  width: 100%; border: 0; background: var(--yellow); color: var(--navy);
  font-weight: 800; border-radius: 10px; padding: 12px; cursor: pointer;
}
.primary:hover { background: var(--yellow-dark); }
.error { color: var(--bad); min-height: 1.2em; font-size: 14px; }

.coming { min-height: 180px; display: grid; place-items: center; color: var(--muted); text-align: center; }
.hidden { display: none !important; }
.status {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; border-radius: 999px; padding: 4px 9px;
}
.status.HEALTHY { background: #e8f6ee; color: var(--ok); }
.status.WARNING { background: #fff4df; color: var(--warn); }
.status.CRITICAL { background: #fdecea; color: var(--bad); }
.status.UNKNOWN { background: #eef2f6; color: var(--muted); }
.module-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; cursor: pointer; }
.module-row:hover h4 { color: var(--navy-mid); }
.facts { display: grid; gap: 8px; }
.facts div { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 8px; }
.facts div:first-child { border-top: 0; padding-top: 0; }
.back { border: 0; background: transparent; color: var(--navy); font-weight: 700; cursor: pointer; padding: 0 0 12px; }

@media (max-width: 960px) {
  body.app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); transform: translateX(-105%); z-index: 20; }
  body.nav-open .sidebar { transform: none; }
  .menu-toggle { display: block; }
  .grid { grid-template-columns: 1fr; }
  .hero-status { flex-direction: column; align-items: flex-start; }
  .topbar { padding: 0 14px; }
  .content { padding: 16px; }
}
