/*
  TERRY Status – Stylesheet (TERRY-Design)
  Werte aus dem HA-Theme «Terry - Basic» und dem Jellyfin-CSS «TERRY - JELLYFIN».

  Schriften: Orbitron nur für Titel, Logo und grosse Kennzahlen (--font-display).
             Alle Infotexte in der Systemschrift (--font-body).
*/

@font-face {
  font-family: "Orbitron";
  src: url("/assets/fonts/orbitron-variable.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  /* Marke */
  --terry-primary: #5A6D84;
  --terry-primary-light: #9CA6B3;
  --terry-primary-dark: #465667;
  --terry-accent: #8F75AD;
  --terry-bg: #090b0f;

  --terry-text: rgba(234, 235, 238, 0.98);
  --terry-text-secondary: rgba(234, 235, 238, 0.80);
  --terry-text-muted: rgba(234, 235, 238, 0.58);

  --terry-glass: rgba(28, 29, 33, 0.18);
  --terry-glass-medium: rgba(28, 29, 33, 0.48);
  --terry-glass-strong: rgba(25, 28, 45, 0.86);
  --terry-header-bg: rgba(18, 20, 27, 0.56);
  --terry-sidebar-bg: rgba(18, 20, 27, 0.74);
  --terry-input-bg: rgba(30, 33, 54, 0.55);
  --terry-row-bg: rgba(28, 29, 33, 0.50);
  --terry-border: rgba(234, 235, 238, 0.12);
  --terry-border-light: rgba(234, 235, 238, 0.08);

  --terry-radius: 18px;
  --terry-radius-small: 10px;
  --terry-shadow: 0 12px 20px rgba(0, 0, 0, 0.28);
  --terry-shadow-large: 0 20px 50px rgba(0, 0, 0, 0.42);
  --terry-blur: blur(10px) saturate(1.2);
  --terry-glass-inset:
    3px 3px 0.5px -3.5px rgba(255, 255, 255, 0.15) inset,
    -2px -2px 0.5px -2px rgba(255, 255, 255, 0.10) inset,
    0 0 8px 1px rgba(255, 255, 255, 0.06) inset,
    0 0 2px 0 rgba(0, 0, 0, 0.18);

  /* Status: HA success / warning / error / disabled */
  --ok: rgb(118, 214, 152);
  --warn: rgb(255, 219, 117);
  --down: rgb(234, 114, 135);
  --maint: var(--terry-accent);
  --unknown: rgb(173, 176, 184);

  /* Schriften */
  --font-display: "Orbitron", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Spaltenbreiten der Status-Pillen (überall gleich) */
  --col-container: 104px;
  --col-status: 172px;

  --sidebar-w: 252px;
  color-scheme: dark;
}

/* ---------------------------------------------------------------- Basis */

*, *::before, *::after { box-sizing: border-box; }

html {
  min-height: 100%;
  background-color: var(--terry-bg);
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.60), rgba(0, 0, 0, 0.20)),
    image-set(url("/assets/bg/frosted-glass-dark.webp") type("image/webp"),
              url("/assets/bg/frosted-glass-dark.jpg") type("image/jpeg"));
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--terry-text);
  font: 400 14px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; letter-spacing: 0.03em; }

a { color: var(--terry-primary-light); }
a:hover { color: var(--terry-accent); }

code, .mono { font-family: var(--font-mono); font-size: 0.92em; }

.muted { color: var(--terry-text-muted); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 2px solid var(--terry-accent); outline-offset: 2px; }
::selection { background: rgba(143, 117, 173, 0.55); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: rgba(90, 109, 132, 0.55) transparent; }

/* ---------------------------------------------------------------- Icons */

svg { box-sizing: border-box; max-width: 100%; }
.mdi {
  display: inline-block; width: 16px; height: 16px; min-width: 16px;
  fill: currentColor; vertical-align: -0.2em; flex-shrink: 0;
}
.mdi--sm { width: 13px; height: 13px; min-width: 13px; vertical-align: -0.15em; }
.mdi--lg { width: 22px; height: 22px; min-width: 22px; vertical-align: -0.25em; }

/* ---------------------------------------------------------------- Status-Farben */

[data-state="online"], [data-state="up"] { --state: var(--ok); }
[data-state="degraded"]    { --state: var(--warn); }
[data-state="down"]        { --state: var(--down); }
[data-state="maintenance"] { --state: var(--maint); }
[data-state="unknown"], [data-state="not_configured"], [data-state="off"] { --state: var(--unknown); }

/* ---------------------------------------------------------------- Pillen */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font: 500 12px/1.3 var(--font-body);
  color: var(--terry-text);
  background: color-mix(in srgb, var(--state, var(--unknown)) 16%, transparent);
  border: 0.5px solid color-mix(in srgb, var(--state, var(--unknown)) 45%, transparent);
  white-space: nowrap;
  flex-shrink: 0;
}
.pill .mdi { width: 13px; height: 13px; min-width: 13px; color: var(--state, currentColor); }
.pill--sm { padding: 2px 8px; font-size: 11px; }
.pill--sm .mdi { width: 12px; height: 12px; min-width: 12px; }
.pill--lg { padding: 6px 14px; font-size: 13px; }
.pill--neutral { --state: var(--terry-primary-light); }

/* Feste Spalten: Pille füllt die Spaltenbreite, Text links, Latenz rechts */
.pill--col { width: 100%; justify-content: flex-start; overflow: hidden; }
.pill__label { overflow: hidden; text-overflow: ellipsis; }
.pill__meta {
  margin-left: auto;
  color: var(--terry-text-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}
.pill__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--state, var(--unknown));
  box-shadow: 0 0 8px var(--state, var(--unknown));
  flex-shrink: 0;
}

.pill-cols {
  display: grid;
  grid-template-columns: var(--col-container) var(--col-status);
  gap: 8px;
  align-items: center;
  justify-content: end;
}

/* ---------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px;
  background: var(--terry-primary);
  color: #fff;
  border: 0;
  border-radius: var(--terry-radius-small);
  font: 500 13px/1.2 var(--font-body);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .18s ease, box-shadow .18s ease;
}
.btn:hover { background: var(--terry-accent); color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }
.btn--sm { padding: 5px 10px; font-size: 12px; gap: 6px; }
.btn--ghost { background: transparent; border: 1px solid var(--terry-border); color: var(--terry-text); }
.btn--ghost:hover { background: rgba(143, 117, 173, 0.14); border-color: var(--terry-accent); }
.btn--danger { background: color-mix(in srgb, var(--down) 85%, black); }
.btn--danger:hover { background: var(--down); }
.btn--icon { padding: 6px; width: 30px; height: 30px; }
.btn--icon.btn--danger-ghost { background: transparent; border: 1px solid color-mix(in srgb, var(--down) 45%, transparent); color: var(--down); }
.btn--icon.btn--danger-ghost:hover { background: color-mix(in srgb, var(--down) 18%, transparent); }

/* ---------------------------------------------------------------- Formulare */

input, select, textarea {
  width: 100%;
  padding: 8px 12px;
  background: var(--terry-input-bg);
  color: var(--terry-text);
  border: 1px solid var(--terry-border);
  border-radius: var(--terry-radius-small);
  font: 400 14px/1.4 var(--font-body);
  transition: border-color .18s ease, box-shadow .18s ease;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--terry-accent);
  box-shadow: 0 0 0 2px rgba(143, 117, 173, 0.35);
}
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--terry-accent); }
select[multiple] { min-height: 140px; }

label { display: block; font-size: 13px; color: var(--terry-text-secondary); margin-bottom: 6px; font-weight: 500; }
.form-group { margin-bottom: 14px; }
.form-hint { display: block; margin-top: 4px; font-size: 12px; color: var(--terry-text-muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 6px 0 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; color: var(--terry-text); font-weight: 400; }

/* ---------------------------------------------------------------- Karten & Tabellen */

.card {
  position: relative;
  background: var(--terry-glass-medium);
  -webkit-backdrop-filter: var(--terry-blur);
  backdrop-filter: var(--terry-blur);
  border: 0.5px solid var(--terry-border);
  border-radius: var(--terry-radius);
  box-shadow: var(--terry-glass-inset), var(--terry-shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.card__title { margin: 0 0 14px; font-size: 15px; color: var(--terry-text); }

.table-wrap {
  overflow-x: auto;
  background: var(--terry-glass-medium);
  -webkit-backdrop-filter: var(--terry-blur);
  backdrop-filter: var(--terry-blur);
  border: 0.5px solid var(--terry-border);
  border-radius: var(--terry-radius);
  box-shadow: var(--terry-glass-inset), var(--terry-shadow);
  margin-bottom: 24px;
}
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th, td { padding: 11px 16px; border-bottom: 1px solid var(--terry-border-light); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th { background: rgba(0, 0, 0, 0.30); color: var(--terry-text-secondary); font-weight: 600; font-size: 12px; white-space: nowrap; }
tbody tr:hover td { background: rgba(90, 109, 132, 0.08); }
td.cell-title strong { display: block; font-weight: 600; }
td.cell-title span { display: block; font-size: 12px; color: var(--terry-text-muted); }
td.cell-time { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--terry-text-secondary); font-size: 12px; }
td.cell-actions { width: 1%; white-space: nowrap; }
tr.is-off td { opacity: 0.55; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions form { margin: 0; }
.empty { text-align: center; color: var(--terry-text-muted); padding: 28px 16px; }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat {
  background: var(--terry-glass-medium);
  -webkit-backdrop-filter: var(--terry-blur);
  backdrop-filter: var(--terry-blur);
  border: 0.5px solid var(--terry-border);
  border-radius: var(--terry-radius);
  box-shadow: var(--terry-glass-inset), var(--terry-shadow);
  padding: 16px 18px;
}
.stat__value { display: block; font: 600 30px/1.1 var(--font-display); color: var(--state, var(--terry-text)); font-variant-numeric: tabular-nums; }
.stat__label { display: block; margin-top: 6px; font-size: 13px; color: var(--terry-text-secondary); }

/* Meldungen */
.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; margin-bottom: 20px;
  border-radius: var(--terry-radius-small);
  border: 1px solid color-mix(in srgb, var(--state) 55%, transparent);
  background: color-mix(in srgb, var(--state) 14%, rgba(18, 20, 27, 0.6));
  color: var(--terry-text);
  font-size: 14px;
}
.flash .mdi { color: var(--state); }
.flash--ok { --state: var(--ok); }
.flash--error { --state: var(--down); }

/* ---------------------------------------------------------------- Dialoge */

dialog.modal {
  width: min(600px, calc(100vw - 24px));
  max-height: calc(100vh - 48px);
  padding: 0;
  color: var(--terry-text);
  background: var(--terry-glass-strong);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid var(--terry-border);
  border-radius: var(--terry-radius);
  box-shadow: var(--terry-shadow-large);
}
dialog.modal--wide { width: min(760px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(2px); }
.modal form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); margin: 0; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 10px; }
.modal__head h2 { margin: 0; font-size: 17px; }
.modal__body { padding: 8px 22px 6px; overflow-y: auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--terry-border-light); }
.modal__foot .spacer { margin-right: auto; }

/* ---------------------------------------------------------------- Öffentliche Seite */

.header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px;
  background: var(--terry-header-bg);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--terry-border-light);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}
.header__brand { display: flex; align-items: center; text-decoration: none; }
.header__logo { height: 34px; width: auto; display: block; }
.header__actions { display: flex; align-items: center; gap: 16px; }
.header__meta { font-size: 12px; color: var(--terry-text-muted); text-align: right; font-variant-numeric: tabular-nums; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px 20px 48px; flex: 1; }

.banner {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 20px; margin-bottom: 20px;
  border-radius: var(--terry-radius);
  border: 1px solid color-mix(in srgb, var(--state, var(--terry-accent)) 50%, transparent);
  background: color-mix(in srgb, var(--state, var(--terry-accent)) 12%, rgba(28, 29, 33, 0.48));
  -webkit-backdrop-filter: var(--terry-blur);
  backdrop-filter: var(--terry-blur);
}
.banner--warn { --state: var(--warn); }
.banner--info { --state: var(--terry-accent); }
.banner--down { --state: var(--down); }
.banner__icon { color: var(--state); line-height: 1; padding-top: 2px; }
.banner__content h4 { margin: 0 0 4px; font-size: 15px; }
.banner__content p { margin: 0; font-size: 14px; color: var(--terry-text-secondary); }

/* Gesamtstatus: Titel, Balken und Fusszeile teilen dieselbe linke Kante */
.global-bar-card {
  background: var(--terry-glass-medium);
  -webkit-backdrop-filter: var(--terry-blur);
  backdrop-filter: var(--terry-blur);
  border: 0.5px solid var(--terry-border);
  border-radius: var(--terry-radius);
  box-shadow: var(--terry-glass-inset), var(--terry-shadow);
  padding: 18px 20px 16px;
  margin-bottom: 28px;
}
.global-bar-card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.global-bar-card__title { margin: 0; font-size: 15px; color: var(--terry-text); }
.global-uptime-bars {
  display: flex; align-items: stretch; gap: 3px;
  height: 34px; padding: 4px;
  background: rgba(0, 0, 0, 0.35);
  border: 0.5px solid var(--terry-border-light);
  border-radius: 8px;
}
.global-uptime-bar {
  flex: 1 1 2px; min-width: 2px;
  border-radius: 2px;
  background: var(--state, var(--unknown));
  opacity: 0.88;
  transition: opacity .15s ease, transform .15s ease;
}
.global-uptime-bar:hover { opacity: 1; transform: scaleY(1.18); }
.global-bar-card__footer { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--terry-text-muted); }

.groups-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.groups-toolbar__label { font-size: 13px; color: var(--terry-text-muted); }
.groups-toolbar__actions { display: flex; gap: 8px; }

.group-accordion {
  margin-bottom: 12px;
  border-radius: var(--terry-radius);
  border: 0.5px solid var(--terry-border);
  background: var(--terry-glass);
  -webkit-backdrop-filter: var(--terry-blur);
  backdrop-filter: var(--terry-blur);
  box-shadow: var(--terry-glass-inset), var(--terry-shadow);
  overflow: hidden;
}
.group-accordion summary::-webkit-details-marker { display: none; }
.group-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 18px;
  list-style: none; cursor: pointer; user-select: none;
  background: rgba(28, 29, 33, 0.35);
}
.group-summary:hover { background: rgba(28, 29, 33, 0.6); }
.group-summary__left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.group-summary__chevron { color: var(--terry-primary-light); transition: transform .2s ease; }
.group-accordion[open] .group-summary__chevron { transform: rotate(90deg); }
.group-summary__title { font: 500 15px/1.3 var(--font-display); letter-spacing: 0.03em; color: var(--terry-text); }
.group-summary__count { font-size: 12px; color: var(--terry-text-muted); }
.group-accordion__content { padding: 10px 12px 12px; background: rgba(10, 12, 16, 0.35); border-top: 1px solid var(--terry-border-light); }

/* Dienstzeile: feste Spalten, die Pillen stehen in allen Zeilen exakt untereinander */
.service-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, 300px) 52px var(--col-container) var(--col-status);
  align-items: center;
  gap: 14px;
  min-height: 44px;
  padding: 8px 14px;
  margin-bottom: 6px;
  background: var(--terry-row-bg);
  border: 0.5px solid var(--terry-border-light);
  border-radius: var(--terry-radius-small);
}
.service-row:last-child { margin-bottom: 0; }
.service-row:hover { background: rgba(45, 52, 64, 0.55); }

/* Nur Probleme werden hervorgehoben: Rahmen in der Statusfarbe und leichter Farbschleier */
.service-row[data-state="down"],
.service-row[data-state="degraded"],
.service-row[data-state="maintenance"] {
  border-color: color-mix(in srgb, var(--state) 45%, transparent);
  background: color-mix(in srgb, var(--state) 10%, var(--terry-row-bg));
}

.service-row__info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.service-row__icon {
  width: 28px; height: 28px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px;
  background: var(--terry-input-bg);
  border: 0.5px solid var(--terry-border);
  color: var(--terry-primary-light);
}
.service-row__text { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.service-row__name {
  font-size: 14px; font-weight: 600;
  color: var(--terry-text);
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
a.service-row__name:hover { color: var(--terry-primary-light); }
.service-row__desc { font-size: 13px; color: var(--terry-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.uptime-bars { display: flex; align-items: center; gap: 2px; height: 16px; min-width: 0; }
.uptime-bar {
  flex: 1 1 2px; min-width: 1px; height: 100%;
  border-radius: 1px;
  background: var(--state, var(--unknown));
  opacity: 0.85;
}
.uptime-bar:hover { opacity: 1; transform: scaleY(1.3); }
.service-row__uptime-pct { font-size: 12px; color: var(--terry-text-secondary); text-align: right; font-variant-numeric: tabular-nums; }

.footer {
  margin-top: auto;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 18px 24px;
  background: var(--terry-header-bg);
  border-top: 1px solid var(--terry-border-light);
  font-size: 13px;
  color: var(--terry-text-muted);
}
.footer__self { display: flex; align-items: center; gap: 10px; }
.footer__links { display: flex; gap: 8px; }

/* Anmeldung */
.auth-box {
  width: 100%; max-width: 420px;
  margin: 60px auto; padding: 32px;
  background: var(--terry-glass-medium);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--terry-border);
  border-radius: var(--terry-radius);
  box-shadow: var(--terry-shadow-large);
  text-align: center;
}
.auth-box__logo { width: 240px; height: auto; margin-bottom: 24px; }
.auth-box form { text-align: left; }

/* ---------------------------------------------------------------- Admin-Shell mit Sidebar */

body.admin { flex-direction: row; }
.admin-shell { display: flex; width: 100%; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0;
  width: var(--sidebar-w); height: 100vh; flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--terry-sidebar-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  border-right: 1px solid var(--terry-border-light);
  z-index: 150;
}
.sidebar__brand { display: block; padding: 20px 20px 16px; }
.sidebar__brand img { height: 30px; width: auto; display: block; }
.sidebar__nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.sidebar__section { margin: 14px 0 6px; padding: 0 10px; font-size: 12px; color: var(--terry-text-muted); }
.sidebar__link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; margin: 2px 0;
  border-radius: var(--terry-radius-small);
  color: var(--terry-text-secondary);
  text-decoration: none;
  font-size: 14px;
}
.sidebar__link .mdi { width: 18px; height: 18px; min-width: 18px; color: var(--terry-text-muted); }
.sidebar__link:hover { background: rgba(90, 109, 132, 0.20); color: var(--terry-text); }
.sidebar__link.is-active { background: rgba(90, 109, 132, 0.28); color: var(--terry-text); font-weight: 600; }
.sidebar__link.is-active .mdi { color: var(--terry-accent); }
.sidebar__foot { padding: 12px; border-top: 1px solid var(--terry-border-light); }
.sidebar__user { display: flex; align-items: center; gap: 10px; padding: 6px 10px 10px; font-size: 13px; color: var(--terry-text-secondary); }
.sidebar__user .mdi { width: 20px; height: 20px; color: var(--terry-primary-light); }
.sidebar__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.admin-content { flex: 1; width: 100%; max-width: 1320px; padding: 28px 32px 48px; }
.admin-footer { padding: 14px 32px; font-size: 12px; color: var(--terry-text-muted); border-top: 1px solid var(--terry-border-light); }

.topbar { display: none; }
.sidebar-backdrop { display: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head__text { min-width: 0; }
.page-title { margin: 0; font-size: 22px; color: var(--terry-text); }
.page-desc { margin: 6px 0 0; font-size: 14px; color: var(--terry-text-secondary); max-width: 72ch; }
.page-back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px; font-size: 13px; text-decoration: none; }

.secret-box {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-top: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--terry-border-light);
  border-radius: 8px;
}
.secret-box code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; color: var(--ok); }

@media (max-width: 900px) {
  body.admin { flex-direction: column; }
  .admin-shell { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--terry-shadow-large);
  }
  .admin-shell.is-nav-open .sidebar { transform: translateX(0); }
  .admin-shell.is-nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 140; }
  .topbar {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    background: var(--terry-header-bg);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid var(--terry-border-light);
  }
  .topbar img { height: 26px; }
  .admin-content { padding: 20px 14px 40px; }
  .admin-footer { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- Responsiv öffentlich */

@media (max-width: 900px) {
  :root { --col-container: 88px; --col-status: 148px; }
  .service-row { grid-template-columns: minmax(0, 1fr) 46px var(--col-container) var(--col-status); }
  .service-row .uptime-bars { display: none; }
  .service-row__desc { display: none; }
}

@media (max-width: 560px) {
  :root { --col-status: 120px; }
  .service-row { grid-template-columns: minmax(0, 1fr) var(--col-status); gap: 10px; }
  .service-row__uptime-pct, .service-row .pill-container { display: none; }
  .header { padding: 10px 14px; }
  .header__meta { display: none; }
  .container { padding: 16px 12px 32px; }
  html { background-attachment: scroll; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

[hidden] { display: none !important; }
