/*
 * Nordhort brand — design tokens as CSS variables.
 * Source of the values: CLAUDE.md (brand tokens). No color/font values hardcoded in
 * templates — always go through these variables. Token names keep the brand color
 * names (Tiefsee, Stahlblau, ...) on purpose; they are the brand's own vocabulary.
 *
 * Fonts (SIL OFL): Space Grotesk (headings), Inter (body), JetBrains Mono (code /
 * technical values). Self-hosted from static/fonts/ — as long as no font files are
 * present, the respective system fallback applies (see static/fonts/README.md).
 * Deliberately no external font CDN (digital sovereignty).
 */

:root {
  /* Brand colors */
  --c-tiefsee: #122C34;   /* primary dark, text */
  --c-stahlblau: #224870; /* secondary, surfaces */
  --c-hortblau: #2A4494;  /* strong accent */
  --c-lichtblau: #4EA5D9; /* light accent, lines */
  --c-nordlicht: #44CFCB; /* highlight, gradient */
  --c-nebel: #EDF2F4;     /* light background */
  --c-schiefer: #3A4A52;  /* muted body text */
  --c-segel: #FFFFFF;     /* base surface */

  /* Status indicator (dashboard from Phase 1) */
  --c-status-ok: #1E8E3E;
  --c-status-warn-bg: #E0991F;
  --c-status-warn-text: #B5750A;
  --c-status-crit: #D7263D;

  /* Nord gradient */
  --gradient-nord: linear-gradient(135deg, var(--c-hortblau) 0%, var(--c-nordlicht) 100%);

  /* Semantic roles */
  --bg-page: var(--c-nebel);
  --bg-surface: var(--c-segel);
  --text-strong: var(--c-tiefsee);
  --text-muted: var(--c-schiefer);
  --accent: var(--c-hortblau);
  --line: var(--c-lichtblau);

  /* Typography */
  --font-head: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  /* Dimensions */
  --radius: 10px;
  --shadow: 0 1px 3px rgba(18, 44, 52, 0.12), 0 1px 2px rgba(18, 44, 52, 0.08);
  --maxw: 1100px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-strong);
  background: var(--bg-page);
  line-height: 1.55;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--text-strong);
  line-height: 1.2;
  font-weight: 600;
}

code, pre, .mono { font-family: var(--font-mono); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Header / navigation --- */
.site-header {
  background: var(--gradient-nord);
  color: var(--c-segel);
}
.site-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.brand__name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--c-segel);
}
.brand__operator {
  font-size: 0.8rem;
  opacity: 0.85;
}
.nav { display: flex; gap: 1.1rem; }
.nav a {
  color: var(--c-segel);
  opacity: 0.9;
  font-size: 0.95rem;
}
.nav a:hover { opacity: 1; text-decoration: none; }

/* --- Content --- */
.site-main {
  max-width: var(--maxw);
  margin: 2rem auto;
  padding: 0 1.25rem;
}
.card {
  background: var(--bg-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 3px solid var(--line);
  padding: 1.5rem 1.75rem;
}

/* --- Footer --- */
.site-footer {
  max-width: var(--maxw);
  margin: 3rem auto 2rem;
  padding: 1rem 1.25rem 0;
  border-top: 1px solid rgba(18, 44, 52, 0.12);
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-footer__claim { font-style: italic; }

/* --- Status indicator helpers (ready for Phase 1) --- */
.status-dot {
  display: inline-block;
  width: 0.7em; height: 0.7em;
  border-radius: 50%;
  vertical-align: middle;
}
.status-dot--ok { background: var(--c-status-ok); }
.status-dot--warn { background: var(--c-status-warn-bg); }
.status-dot--crit { background: var(--c-status-crit); }
.status-dot--unknown { background: var(--c-schiefer); }

/* --- Fleet table (Phase 1) --- */
.fleet {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}
.fleet th, .fleet td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid rgba(18, 44, 52, 0.1);
  vertical-align: top;
}
.fleet th {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.fleet tbody tr:hover { background: var(--c-nebel); }

/* --- Badges --- */
.badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: nowrap;
}
.badge--ok { background: rgba(30, 142, 62, 0.12); color: var(--c-status-ok); }
.badge--warn { background: rgba(224, 153, 31, 0.16); color: var(--c-status-warn-text); }
.badge--muted { background: rgba(58, 74, 82, 0.12); color: var(--text-muted); }

/* --- Messages (Phase 2) --- */
.messages { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.message {
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  border-left: 4px solid var(--line);
  background: var(--bg-surface);
  box-shadow: var(--shadow);
}
.message--success { border-left-color: var(--c-status-ok); }
.message--warning { border-left-color: var(--c-status-warn-bg); }
.message--error { border-left-color: var(--c-status-crit); }

/* --- Test-alert button --- */
.test-alert { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.test-alert button {
  font-family: var(--font-head);
  background: var(--accent);
  color: var(--c-segel);
  border: none;
  border-radius: var(--radius);
  padding: 0.55rem 1.1rem;
  font-size: 0.95rem;
  cursor: pointer;
}
.test-alert button:hover { background: var(--c-hortblau); }
.test-alert .hint { color: var(--text-muted); font-size: 0.85rem; }

/* --- History charts (Phase 3.3) --- */
.chart { margin: 1rem 0 1.5rem; }
.chart__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}
.chart__plot { width: 100%; height: 72px; }
.chart__plot .spark { width: 100%; height: 100%; display: block; }
.chart__plot--accent { color: var(--accent); }
.chart__plot--ok { color: var(--c-status-ok); }
.version-timeline { list-style: none; padding: 0; margin: 0.3rem 0 0; }
.version-timeline li { padding: 0.15rem 0; display: flex; gap: 0.6rem; align-items: baseline; }

/* --- Detail view (Phase 1.7) --- */
.detail-back { margin-top: 0; font-size: 0.9rem; }
.card + .card { margin-top: 1.5rem; }
.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1.25rem;
  margin: 1rem 0;
}
.kv dt { color: var(--text-muted); font-size: 0.9rem; }
.kv dd { margin: 0; }
.raw {
  background: var(--c-tiefsee);
  color: var(--c-nebel);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.82rem;
  margin-top: 0.75rem;
}
