:root {
  --bg: #0b1020;
  --panel: #121a2f;
  --panel-border: #233052;
  --text: #e6ecf8;
  --muted: #93a3c7;
  --accent: #4f8cff;
  --ok: #22c55e;
  --warn: #f59e0b;
  --crit: #ef4444;
  --info: #38bdf8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.82rem;
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.login-card {
  width: 100%;
  max-width: 390px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.login-card h1 {
  margin: 0;
  font-size: 1.35rem;
}

.brand-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: rgba(79, 140, 255, 0.18);
  color: var(--accent);
  border: 1px solid rgba(79, 140, 255, 0.35);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
}

input,
select {
  background: #0d1426;
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 0.58rem 0.75rem;
  font-size: 0.92rem;
}

.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.55rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-secondary {
  background: #1b2744;
  color: var(--text);
  border-color: var(--panel-border);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--panel-border);
}

.full-width {
  width: 100%;
}

.error-banner {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--panel-border);
  padding: 0.95rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.topbar-left h1 {
  margin: 0;
  font-size: 1.15rem;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.2rem;
  font-size: 0.82rem;
}

.topbar-actions {
  display: flex;
  gap: 0.6rem;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 1rem 1.15rem;
}

.card-header {
  margin-bottom: 0.8rem;
}

.card-header h2 {
  margin: 0;
  font-size: 1rem;
}

.card-header-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.kpi-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0.2rem 0 0.45rem;
}

.progress {
  height: 7px;
  background: #0d1426;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.25s ease;
}

.progress-fill.warn {
  background: var(--warn);
}

.progress-fill.crit {
  background: var(--crit);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.65rem;
}

.service-tile {
  background: #0d1426;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
}

.pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
}

.pill-ok {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
}

.pill-warn {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

.pill-crit {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.pill-info {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
}

.pill-muted {
  background: rgba(147, 163, 199, 0.15);
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th,
td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--panel-border);
}

th {
  color: var(--muted);
  font-weight: 600;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.subhead {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.8rem;
}

.mono-box {
  background: #0d1426;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
}

.alert-controls {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.alert-item {
  background: #0d1426;
  border: 1px solid var(--panel-border);
  border-left: 4px solid var(--info);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
}

.alert-item.severity-warning {
  border-left-color: var(--warn);
}

.alert-item.severity-critical {
  border-left-color: var(--crit);
}

.alert-item.acknowledged {
  opacity: 0.6;
}

.alert-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.alert-title {
  font-weight: 600;
  font-size: 0.92rem;
}

.alert-detail {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}
