/* =========================================================================
   HOSTL.eu – Statusseite
   Ergänzt das Dashboard-Design (theme.css, base.css, components.css,
   admin.css) um die Bausteine der Statusseite. Farben ausschließlich
   über die --hostl-* / --nord-* Tokens aus theme.css.
   ========================================================================= */

/* Textauswahl deaktivieren */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Eingabefelder (Admin, Login) bleiben bedienbar */
input,
textarea,
[contenteditable="true"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

:root {
  /* Zusätzlicher Statuston zwischen Warnung und Gefahr (Teilausfall). */
  --st-major: #f76b15;
  --st-major-text: #ff8b3e;
  --st-major-soft: rgba(247, 107, 21, 0.16);
  --st-major-ring: rgba(247, 107, 21, 0.32);

  --st-nodata: var(--hostl-surface-3);
  --st-content-max: 980px;
}

/* -------------------------------------------------------------------------
   Statusfarben (gemeinsam für Pills, Punkte, Balken)
   ------------------------------------------------------------------------- */
.st-c-ok { --st-c: var(--nord-success); --st-c-text: var(--nord-success-text); --st-c-soft: var(--nord-success-soft); --st-c-ring: var(--nord-success-ring); }
.st-c-degraded { --st-c: var(--nord-warning); --st-c-text: var(--nord-warning-text); --st-c-soft: var(--nord-warning-soft); --st-c-ring: var(--nord-warning-ring); }
.st-c-major { --st-c: var(--st-major); --st-c-text: var(--st-major-text); --st-c-soft: var(--st-major-soft); --st-c-ring: var(--st-major-ring); }
.st-c-down { --st-c: var(--nord-danger); --st-c-text: var(--nord-danger-text); --st-c-soft: var(--nord-danger-soft); --st-c-ring: var(--nord-danger-ring); }
.st-c-maintenance { --st-c: var(--nord-primary); --st-c-text: var(--nord-primary-text); --st-c-soft: var(--nord-primary-soft); --st-c-ring: var(--hostl-primary-ring); }
.st-c-unknown { --st-c: var(--nord-text-faint); --st-c-text: var(--nord-text-subtle); --st-c-soft: var(--nord-secondary-soft); --st-c-ring: var(--nord-ring); }

.st-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--nord-radius-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--st-c-soft);
  color: var(--st-c-text);
  border: 1px solid var(--st-c-ring);
}

.st-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.st-pill.no-dot::before { display: none; }

.st-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--st-c-text);
  white-space: nowrap;
}

.st-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--st-c);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--st-c-soft);
}

.st-c-down .st-dot,
.st-dot.st-c-down {
  animation: st-pulse 1.6s ease-in-out infinite;
}

@keyframes st-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--st-c-soft); }
  50% { box-shadow: 0 0 0 6px var(--st-c-soft); }
}

@media (prefers-reduced-motion: reduce) {
  .st-c-down .st-dot,
  .st-dot.st-c-down { animation: none; }
}

/* =========================================================================
   Öffentliche Seite
   ========================================================================= */
body.st-public {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Kopfzeile – gleiche Fläche und Linie wie die Dashboard-Navbar */
.st-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nord-bg-alt);
  border-bottom: 1px solid var(--nord-divider);
}

.st-topbar-inner {
  max-width: var(--st-content-max);
  margin: 0 auto;
  min-height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-sizing: border-box;
}

.st-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  line-height: 0;
  border-radius: var(--hostl-radius-sm);
  flex-shrink: 0;
}

.st-brand img {
  height: 34px;
  width: auto;
  max-width: 170px;
  object-fit: contain;
}

.st-brand-tag {
  line-height: 1;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nord-text-subtle);
  padding: 5px 9px;
  border: 1px solid var(--nord-ring);
  border-radius: var(--nord-radius-pill);
  background: var(--nord-surface-2);
}

.st-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.st-nav::-webkit-scrollbar { display: none; }

.st-nav a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--hostl-radius-sm);
  color: var(--nord-text-muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--nord-transition), color var(--nord-transition);
}

.st-nav a:hover {
  background: var(--nord-surface-2);
  color: var(--nord-text-strong);
}

.st-nav a.active {
  background: var(--nord-surface-2);
  color: var(--nord-primary-text);
  font-weight: 600;
}

/* Inhalt */
.st-main {
  flex: 1;
  width: 100%;
  max-width: var(--st-content-max);
  margin: 0 auto;
  padding: 32px 20px 64px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.st-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.st-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.st-section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--nord-text-subtle);
}

.st-section-link {
  font-size: 13px;
  font-weight: 500;
}

/* Gesamtstatus */
.st-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  border-radius: var(--hostl-radius);
  background: var(--nord-card-bg);
  border: 1px solid var(--st-c-ring);
  box-shadow: inset 4px 0 0 var(--st-c), var(--nord-shadow-sm);
}

.st-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--st-c-soft);
  color: var(--st-c-text);
  font-size: 22px;
}

.st-banner-text {
  min-width: 0;
}

.st-banner-title {
  margin: 0;
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 700;
  color: var(--nord-text-strong);
  letter-spacing: -0.2px;
  line-height: 1.3;
}

.st-banner-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--nord-text-subtle);
}

/* Hinweisbox (Ankündigung) */
.st-notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--hostl-radius);
  background: var(--st-c-soft);
  border: 1px solid var(--st-c-ring);
  color: var(--nord-text);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-line;
}

.st-notice i {
  color: var(--st-c-text);
  margin-top: 3px;
}

/* Vorfall-/Wartungskarte */
.st-event {
  display: block;
  padding: 18px 20px;
  border-radius: var(--hostl-radius);
  background: var(--nord-card-bg);
  border: 1px solid var(--nord-ring);
  border-left: 4px solid var(--st-c);
  color: var(--nord-text);
  text-decoration: none;
  transition: border-color var(--nord-transition), background var(--nord-transition);
}

a.st-event:hover {
  background: var(--nord-surface-2);
  color: var(--nord-text);
}

.st-event-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.st-event-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--nord-text-strong);
}

.st-event-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.st-event-text {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--nord-text-muted);
  white-space: pre-line;
}

.st-event-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  color: var(--nord-text-faint);
}

.st-event-meta i {
  margin-right: 5px;
}

/* Dienstgruppe */
.st-group {
  background: var(--nord-card-bg);
  border: 1px solid var(--nord-ring);
  border-radius: var(--hostl-radius);
  box-shadow: var(--nord-shadow-sm);
  overflow: hidden;
}

.st-group-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--nord-divider);
  background: var(--nord-surface-head);
}

.st-group-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--hostl-radius-sm);
  background: var(--nord-surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.st-group-text {
  flex: 1;
  min-width: 0;
}

.st-group-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--nord-text-strong);
}

.st-group-desc {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--nord-text-subtle);
}

.st-monitor {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--nord-divider);
}

.st-monitor:last-child {
  border-bottom: none;
}

.st-monitor-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.st-monitor-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--nord-text-strong);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.st-info {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--nord-ring-strong);
  color: var(--nord-text-subtle);
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  background: transparent;
  padding: 0;
  font-family: var(--nord-font);
}

.st-info:hover,
.st-info:focus-visible {
  color: var(--nord-text-strong);
  border-color: var(--nord-ring-hover);
}

.st-monitor-extra {
  font-size: 12px;
  color: var(--nord-text-faint);
  font-weight: 500;
}

.st-monitor-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.st-uptime {
  font-size: 13px;
  font-weight: 600;
  color: var(--nord-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 90-Tage-Balken */
.st-bars {
  display: flex;
  gap: 2px;
  height: 34px;
  align-items: stretch;
}

.st-bar {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 2px;
  background: var(--st-nodata);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.st-bar.ok { background: var(--nord-success); }
.st-bar.degraded { background: var(--nord-warning); }
.st-bar.down { background: var(--nord-danger); }
.st-bar.maintenance { background: var(--nord-primary); }

.st-bars:hover .st-bar { opacity: 0.55; }
.st-bars .st-bar:hover,
.st-bars .st-bar:focus-visible {
  opacity: 1;
  transform: scaleY(1.08);
}

.st-bar:focus-visible {
  outline: 2px solid var(--nord-text-strong);
  outline-offset: 1px;
}

.st-bars-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--nord-text-faint);
}

.st-bars-legend .st-line {
  flex: 1;
  height: 1px;
  background: var(--nord-divider);
  margin: auto 10px;
}

.st-only-mobile { display: none; }

/* Unter 640px nur die letzten 30 Tage, damit die Balken lesbar bleiben. */
@media (max-width: 640px) {
  .st-bars[data-days="90"] .st-bar:nth-child(-n+60),
  .st-bars[data-days="60"] .st-bar:nth-child(-n+30) {
    display: none;
  }
  .st-only-desktop { display: none; }
  .st-only-mobile { display: inline; }
}

/* Tooltip der Balken (per JS positioniert) */
.st-tooltip {
  position: fixed;
  z-index: 1000;
  min-width: 200px;
  max-width: 280px;
  padding: 12px 14px;
  border-radius: var(--hostl-radius-sm);
  background: var(--nord-surface-2);
  border: 1px solid var(--nord-ring-strong);
  box-shadow: var(--nord-shadow-lg);
  font-size: 12px;
  color: var(--nord-text);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.st-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

.st-tooltip-date {
  font-weight: 700;
  color: var(--nord-text-strong);
  font-size: 13px;
  margin-bottom: 6px;
}

.st-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--nord-text-muted);
  margin-top: 3px;
}

.st-tooltip-row strong {
  font-variant-numeric: tabular-nums;
}

.st-tooltip-incidents {
  margin: 8px 0 0;
  padding: 8px 0 0;
  list-style: none;
  border-top: 1px solid var(--nord-divider);
}

.st-tooltip-incidents li {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 3px;
  color: var(--nord-text);
}

/* Verlauf */
.st-history {
  background: var(--nord-card-bg);
  border: 1px solid var(--nord-ring);
  border-radius: var(--hostl-radius);
  overflow: hidden;
}

.st-day {
  padding: 16px 20px;
  border-bottom: 1px solid var(--nord-divider);
}

.st-day:last-child { border-bottom: none; }

.st-day-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--nord-text-strong);
}

.st-day-empty {
  margin: 0;
  font-size: 13px;
  color: var(--nord-text-faint);
}

.st-day-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  margin: 0 -12px;
  border-radius: var(--hostl-radius-sm);
  text-decoration: none;
  color: var(--nord-text);
  transition: background var(--nord-transition);
}

.st-day-item:hover {
  background: var(--nord-surface-2);
  color: var(--nord-text);
}

.st-day-item .st-dot { margin-top: 6px; }

.st-day-item-main { flex: 1; min-width: 0; }

.st-day-item-title {
  font-weight: 600;
  color: var(--nord-text-strong);
  font-size: 14px;
}

.st-day-item-text {
  margin-top: 3px;
  font-size: 13px;
  color: var(--nord-text-muted);
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.st-day-item-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--nord-text-faint);
}

/* Monatsnavigation */
.st-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.st-pager-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--nord-text-strong);
}

/* Detailseite (Vorfall / Wartung) */
.st-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--nord-text-subtle);
}

.st-back:hover { color: var(--nord-text-strong); }

.st-detail-title {
  margin: 8px 0 0;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  color: var(--nord-text-strong);
  letter-spacing: -0.3px;
}

.st-detail-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.st-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 12px;
}

.st-fact {
  padding: 14px 16px;
  background: var(--nord-card-bg);
  border: 1px solid var(--nord-ring);
  border-radius: var(--hostl-radius);
}

.st-fact-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--nord-text-subtle);
}

.st-fact-value {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--nord-text-strong);
}

.st-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.st-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--nord-radius-pill);
  background: var(--nord-surface-2);
  border: 1px solid var(--nord-ring);
  font-size: 12px;
  font-weight: 500;
  color: var(--nord-text);
}

/* Zeitleiste der Updates */
.st-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.st-timeline-item {
  position: relative;
  padding: 0 0 22px 28px;
}

.st-timeline-item::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: -2px;
  width: 2px;
  background: var(--nord-divider);
}

.st-timeline-item:last-child { padding-bottom: 0; }
.st-timeline-item:last-child::before { display: none; }

.st-timeline-item .st-dot {
  position: absolute;
  left: 0;
  top: 5px;
  width: 12px;
  height: 12px;
}

.st-timeline-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.st-timeline-status {
  font-weight: 700;
  color: var(--st-c-text);
  font-size: 14px;
}

.st-timeline-time {
  font-size: 12px;
  color: var(--nord-text-faint);
}

.st-timeline-text {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--nord-text);
  white-space: pre-line;
}

/* Footer – eine Zeile: Copyright links, Rechtliches rechts */
.st-footer {
  border-top: 1px solid var(--nord-divider);
}

.st-footer-inner {
  max-width: var(--st-content-max);
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--nord-text-faint);
}

.st-footer-links {
  display: flex;
  gap: 6px 20px;
  flex-wrap: wrap;
}

.st-footer-links a { color: var(--nord-text-faint); }
.st-footer-links a:hover { color: var(--nord-text-strong); }

@media (max-width: 640px) {
  .st-footer-inner { justify-content: center; text-align: center; padding: 18px 16px; }
  .st-footer-links { justify-content: center; }
}

/* Fehlerseite */
.st-error {
  text-align: center;
  padding: 64px 20px;
}

.st-error-code {
  font-size: 64px;
  font-weight: 800;
  color: var(--nord-text-strong);
  letter-spacing: -2px;
  margin: 0;
}

.st-error-text {
  color: var(--nord-text-muted);
  margin: 8px 0 24px;
  font-size: 15px;
}

@media (max-width: 640px) {
  .st-topbar-inner { padding: 0 16px; gap: 10px; }
  .st-brand img { height: 28px; }
  .st-brand-tag { display: none; }
  .st-main { padding: 20px 16px 48px; gap: 22px; }
  .st-banner { padding: 18px; gap: 14px; }
  .st-banner-icon { width: 40px; height: 40px; font-size: 18px; }
  .st-group-head, .st-monitor, .st-day { padding-left: 16px; padding-right: 16px; }
  .st-monitor-right { width: 100%; margin-left: 0; justify-content: space-between; }
}

/* =========================================================================
   Adminbereich – Ergänzungen
   ========================================================================= */
.st-admin-initials {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nord-primary-soft);
  color: var(--nord-primary-text);
  font-weight: 700;
  font-size: 14px;
}

.st-admin-initials.lg {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

img.st-admin-initials { object-fit: cover; }

.st-cell-sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--nord-text-faint);
  font-family: var(--nord-font-mono);
  word-break: break-all;
}

.st-cell-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--nord-text-strong);
}

.st-cell-name:hover { color: var(--nord-primary-text); }

.st-icon-cell {
  width: 32px;
  height: 32px;
  border-radius: var(--hostl-radius-sm);
  background: var(--nord-surface-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.st-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--nord-ring);
  border-radius: var(--hostl-radius-sm);
  background: var(--nord-surface-sunken);
}

.st-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--nord-text);
  cursor: pointer;
  min-width: 0;
}

.st-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--nord-primary);
  flex-shrink: 0;
  margin: 0;
}

.st-check span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.st-fieldset {
  border: 1px solid var(--nord-ring);
  border-radius: var(--hostl-radius);
  padding: 16px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.st-fieldset legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--nord-text-subtle);
}

.st-type-fields[hidden] { display: none !important; }

.st-copy {
  display: flex;
  gap: 8px;
}

.st-copy .adm-input { font-family: var(--nord-font-mono); font-size: 12px; }

/* Antwortzeit-Diagramm */
.st-chart {
  width: 100%;
  height: 180px;
  display: block;
}

.st-chart-grid { stroke: var(--nord-divider); stroke-width: 1; }
.st-chart-line { fill: none; stroke: var(--nord-primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.st-chart-area { fill: var(--nord-primary-soft); }
.st-chart-down { fill: var(--nord-danger-soft); }
.st-chart-label { fill: var(--nord-text-faint); font-size: 11px; font-family: var(--nord-font); }

.st-hb-list {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.st-hb {
  width: 8px;
  height: 24px;
  border-radius: 2px;
  background: var(--st-nodata);
}

.st-hb.up { background: var(--nord-success); }
.st-hb.degraded { background: var(--nord-warning); }
.st-hb.down { background: var(--nord-danger); }
.st-hb.maintenance { background: var(--nord-primary); }

.st-admin-timeline .st-timeline-item { padding-bottom: 18px; }

.st-timeline-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.st-empty-inline {
  padding: 28px 20px;
  text-align: center;
  color: var(--nord-text-subtle);
  font-size: 14px;
}

.st-empty-inline i {
  display: block;
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--nord-text-faint);
}

.st-code-block {
  font-family: var(--nord-font-mono);
  font-size: 12px;
  background: var(--nord-surface-sunken);
  border: 1px solid var(--nord-ring);
  border-radius: var(--hostl-radius-sm);
  padding: 10px 12px;
  color: var(--nord-text);
  overflow-x: auto;
  white-space: pre;
}

.st-drag {
  cursor: grab;
  color: var(--nord-text-faint);
  padding: 0 4px;
}

tr.st-dragging td { opacity: 0.5; }

.adm-modal .adm-modal-box.st-modal-lg { max-width: 760px; }

/* Zähler in der Sidebar (wie im Dashboard, tickets.css) */
.sidebar-nav-item .nav-count {
  display: inline-block;
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--hostl-radius-pill);
  background: var(--hostl-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

/* Seitenkopf mit Aktionen: Titel links statt zentriert (admin.css zentriert
   .adm-page-title für Seiten ohne Aktionsleiste). */
.adm-page .adm-page-header .adm-page-title {
  text-align: left;
  margin: 0;
}

.adm-page .adm-page-header {
  margin-top: 8px;
}

.adm-page-desc .st-pill { vertical-align: middle; }

/* Abhängige Formularblöcke: [hidden] muss gegen display:grid/flex gewinnen. */
[data-switch-group][hidden] {
  display: none !important;
}

/* -------------------------------------------------------------------------
   Server-Kapazität (Free-Server aus dem Dashboard)
   ------------------------------------------------------------------------- */
.st-capacity-updated {
  font-size: 12px;
  color: var(--nord-text-faint);
}

.st-meter {
  height: 12px;
  border-radius: var(--nord-radius-pill);
  background: var(--nord-surface-sunken);
  border: 1px solid var(--nord-ring);
  overflow: hidden;
}

.st-meter-sm { height: 8px; }

.st-meter-fill {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: var(--st-c);
  transition: width 0.4s ease;
}

.st-node .st-monitor-head { margin-bottom: 8px; }

.st-node-icon {
  color: var(--nord-text-subtle);
  font-size: 13px;
}


/* -------------------------------------------------------------------------
   Einklappbare Dienstgruppen
   ------------------------------------------------------------------------- */
.st-group-heading {
  margin: 0;
  font: inherit;
}

.st-group-toggle {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--nord-divider);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--nord-transition);
}

.st-group-toggle:hover { background: var(--nord-surface-2); }

.st-group-toggle:focus-visible {
  outline: none;
  box-shadow: inset var(--nord-focus-ring);
}

.st-group-text { display: flex; flex-direction: column; }
.st-group-name { display: block; }
.st-group-desc { display: block; }

.st-group-meta {
  font-size: 13px;
  font-weight: 500;
  color: var(--nord-text-subtle);
  white-space: nowrap;
}

.st-group-meta[class*="st-c-"] {
  color: var(--st-c-text);
  font-weight: 600;
}

.st-chevron {
  color: var(--nord-text-subtle);
  font-size: 13px;
  transition: transform 0.2s ease;
}

.st-group.collapsed .st-chevron { transform: rotate(-90deg); }
.st-group.collapsed .st-group-toggle { border-bottom-color: transparent; }
.st-group.collapsed .st-group-body { display: none; }

@media (prefers-reduced-motion: reduce) {
  .st-chevron { transition: none; }
}

/* Freie Plätze rechts in der Node-Zeile */
.st-node-free {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--nord-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Mobil nur Störungshinweise zeigen, nicht die reine Anzahl. */
@media (max-width: 640px) {
  .st-group-meta:not([class*="st-c-"]) { display: none; }
}

/* =========================================================================
   Größere Darstellung der öffentlichen Seite
   (überschreibt die kompakteren Werte weiter oben)
   ========================================================================= */
:root {
  --st-content-max: 1120px;
}

body.st-public {
  font-size: 15px;
}

.st-topbar-inner { min-height: 72px; }
.st-brand img { height: 40px; max-width: 200px; }
.st-nav a { height: 42px; padding: 0 14px; font-size: 15px; }

.st-main { padding: 40px 24px 72px; gap: 36px; }
.st-section { gap: 14px; }
.st-section-title { font-size: 14px; }
.st-section-link, .st-capacity-updated { font-size: 14px; }

/* Gesamtstatus */
.st-banner { padding: 28px 30px; gap: 22px; }
.st-banner-icon { width: 58px; height: 58px; font-size: 26px; }
.st-banner-title { font-size: clamp(22px, 2.8vw, 28px); }
.st-banner-sub { font-size: 14px; margin-top: 6px; }

/* Vorfälle / Wartungen */
.st-event { padding: 22px 26px; }
.st-event-title { font-size: 19px; }
.st-event-text { font-size: 15px; margin-top: 12px; }
.st-event-meta { font-size: 13px; margin-top: 14px; gap: 8px 20px; }
.st-notice { font-size: 15px; padding: 16px 20px; }

/* Gruppen & Dienste */
.st-group-head { padding: 20px 26px; gap: 16px; }
.st-group-icon { width: 48px; height: 48px; font-size: 23px; }
.st-group-name { font-size: 19px; }
.st-group-desc { font-size: 14px; margin-top: 3px; }
.st-group-meta { font-size: 14px; }
.st-chevron { font-size: 15px; }

.st-monitor { padding: 20px 26px 18px; }
.st-monitor-head { margin-bottom: 12px; gap: 12px; }
.st-monitor-name { font-size: 17px; gap: 10px; }
.st-monitor-extra { font-size: 13px; }
.st-uptime { font-size: 15px; }
.st-info { width: 20px; height: 20px; font-size: 11px; }

.st-bars { height: 44px; gap: 3px; }
.st-bar { border-radius: 3px; }
.st-bars-legend { font-size: 13px; margin-top: 8px; }

/* Free-Server */
.st-node .st-monitor-head { margin-bottom: 12px; }
.st-node-icon { font-size: 15px; }
.st-node-free { font-size: 16px; }
.st-meter-sm { height: 14px; }

/* Verlauf */
.st-day { padding: 20px 26px; }
.st-day-title { font-size: 16px; margin-bottom: 10px; }
.st-day-empty { font-size: 14px; }
.st-day-item-title { font-size: 16px; }
.st-day-item-text { font-size: 14px; }
.st-day-item-meta { font-size: 13px; }

/* Detailseiten */
.st-detail-title { font-size: clamp(26px, 3.4vw, 34px); }
.st-detail-sub { margin: 10px 0 0; font-size: 15px; color: var(--nord-text-muted); }
.st-fact { padding: 18px 20px; }
.st-fact-label { font-size: 12px; }
.st-fact-value { font-size: 16px; }
.st-timeline-status { font-size: 15px; }
.st-timeline-time { font-size: 13px; }
.st-timeline-text { font-size: 15px; }
.st-tag { font-size: 13px; padding: 5px 12px; }

.st-footer-inner { font-size: 14px; padding: 24px; }

@media (max-width: 640px) {
  body.st-public { font-size: 15px; }
  .st-topbar-inner { min-height: 64px; padding: 0 16px; }
  .st-brand img { height: 32px; }
  .st-main { padding: 24px 16px 56px; gap: 28px; }
  .st-banner { padding: 20px; gap: 16px; }
  .st-banner-icon { width: 46px; height: 46px; font-size: 20px; }
  .st-event { padding: 18px 18px; }
  .st-group-head, .st-monitor, .st-day { padding-left: 18px; padding-right: 18px; }
  .st-group-name { font-size: 17px; }
  .st-monitor-name { font-size: 16px; }
  .st-bars { height: 40px; }
}
