:root {
  --bg: #0f1419;
  --panel: #1a222c;
  --panel2: #243040;
  --text: #e8eef5;
  --muted: #8b9aab;
  --ok: #2ecc71;
  --warn: #f1c40f;
  --fail: #e74c3c;
  --skip: #5a6a7a;
  --radius: 12px;
  --gap: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.25;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 8px;
  gap: 8px;
  /* Target ~960x540 logical at 200% on 1920x1080 */
  min-height: 100dvh;
}

.top {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 8px 12px;
  min-height: 52px;
}

.logout-form { display: inline; margin: 0; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--panel2);
  color: var(--muted);
  min-width: 72px;
}

/* --- login --- */
.login-body {
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: auto;
}

.login-card {
  width: min(360px, 100%);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.login-brand span {
  color: var(--muted);
  font-weight: 500;
  font-size: 16px;
}

.login-error {
  background: color-mix(in srgb, var(--fail) 20%, transparent);
  color: var(--fail);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.login-form input {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--panel2);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
}
.login-form input:focus {
  outline: 2px solid color-mix(in srgb, var(--ok) 40%, transparent);
  border-color: transparent;
}
.login-btn {
  width: 100%;
  margin-top: 4px;
  background: color-mix(in srgb, var(--ok) 35%, var(--panel2));
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 13px;
  color: var(--muted);
}

.eco.ok { color: var(--ok); }
.eco.warn { color: var(--warn); }
.eco.fail { color: var(--fail); }
.eco.skip { color: var(--muted); }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}
.pill.ok { background: color-mix(in srgb, var(--ok) 25%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 25%, transparent); color: var(--warn); }
.pill.fail { background: color-mix(in srgb, var(--fail) 25%, transparent); color: var(--fail); }
.pill.unknown { background: var(--panel2); color: var(--muted); }

.btn {
  min-height: 44px;
  min-width: 88px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--panel2);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--gap);
  min-height: 0;
}

.card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  border: 2px solid transparent;
}
.card.fail { border-color: color-mix(in srgb, var(--fail) 55%, transparent); }
.card.warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.card.ok { border-color: color-mix(in srgb, var(--ok) 25%, transparent); }

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.loadline {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.card-title {
  font-size: 20px;
  font-weight: 700;
}
.card-role {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
}

.indicators {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  flex: 1;
  min-height: 0;
}

.ind {
  background: var(--panel2);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
}
.ind .label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ind .value {
  font-size: 16px;
  font-weight: 700;
}
.ind.ok .value { color: var(--ok); }
.ind.warn .value { color: var(--warn); }
.ind.fail .value { color: var(--fail); }
.ind.skip .value { color: var(--skip); }
.ind .detail {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.foot {
  min-height: 28px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.foot.has-issues { color: var(--fail); }

.empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 18px;
}

@media (max-height: 480px) {
  .card-title { font-size: 18px; }
  .ind { min-height: 48px; padding: 6px; }
  .ind .value { font-size: 15px; }
}
