/* Server-Verwaltung im mypacing-2.0-Design ("Ruhige Präzision").
   Farben, Schrift und Formen wörtlich aus src/src/styles/tokens.css und app.css der 2.0.
   Die PHP-Bausteine der Schaltzentrale (ad-*) bekommen hier das 2.0-Aussehen. */

@font-face { font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/inter-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/inter-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-display: swap; font-weight: 700;
  src: url(/fonts/poppins-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-display: swap; font-weight: 400;
  src: url(/fonts/instrument-serif-latin-400-italic.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --bg: #F4F2EC; --bg-deep: #ECE9E0; --surface: #FFFFFF; --surface-2: #F9F8F4;
  --glass-border: rgba(18, 26, 24, 0.07); --tabbar-bg: rgba(255, 255, 255, 0.95);
  --hairline: rgba(18, 26, 24, 0.09); --hairline-strong: rgba(18, 26, 24, 0.16);
  --ink: #111916; --ink-2: #46524E; --ink-3: #6E7A76;
  --brand: #2E7D6B; --brand-strong: #226353; --brand-soft: #E3F0EB; --brand-ink: #0F3B33; --wordmark: #1F2A28;
  --c-load: #C7761F; --c-load-soft: #F7E9D8; --c-recover: #2E8B74; --c-recover-soft: #DDF0E9;
  --c-heart: #C9505D; --c-heart-soft: #F7E1E3; --c-mood: #2F86B5; --c-mood-soft: #DDEEF7;
  --state-usual: #2E8B74; --state-above: #C7761F; --state-below: #2F86B5; --focus: #2E7D6B;
  --r-xs: 8px; --r-sm: 12px; --r-md: 18px; --r-lg: 26px; --r-xl: 34px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(17, 25, 22, .05), 0 2px 8px rgba(17, 25, 22, .04);
  --shadow-2: 0 2px 6px rgba(17, 25, 22, .05), 0 12px 32px rgba(17, 25, 22, .08);
  --font-sans: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-brand: "Poppins", var(--font-sans);
  --fs-xs: .75rem; --fs-sm: .875rem; --fs-md: 1rem; --fs-lg: 1.125rem; --fs-xl: 1.375rem; --fs-2xl: 1.75rem; --fs-3xl: 2.25rem;
  --ease: cubic-bezier(.2, .8, .2, 1); --t-fast: 160ms;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0A100E; --bg-deep: #070B0A; --surface: #111917; --surface-2: #16201D;
    --glass-border: rgba(238, 243, 241, 0.07); --tabbar-bg: rgba(17, 25, 23, 0.96);
    --hairline: rgba(238, 243, 241, 0.09); --hairline-strong: rgba(238, 243, 241, 0.16);
    --ink: #EDF2F0; --ink-2: #AEBBB7; --ink-3: #85938F;
    --brand: #5CC2A6; --brand-strong: #7AD3BA; --brand-soft: #16312A; --brand-ink: #CFF0E6; --wordmark: #EDF2F0;
    --c-load: #E9A45A; --c-load-soft: #3A2A18; --c-recover: #5CC2A6; --c-recover-soft: #15302A;
    --c-heart: #EE8490; --c-heart-soft: #3D1E23; --c-mood: #6EB9E3; --c-mood-soft: #16303F;
    --state-usual: #5CC2A6; --state-above: #E9A45A; --state-below: #6EB9E3; --focus: #7AD3BA;
    --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 8px 28px rgba(0,0,0,.45);
  }
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.ad-body {
  margin: 0; background: var(--bg); color: var(--ink); min-height: 100vh;
  font-family: var(--font-sans); font-size: var(--fs-md); line-height: 1.5;
  font-feature-settings: "cv11", "ss01", "ss03"; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; letter-spacing: -0.022em; line-height: 1.12; font-weight: 640; }
p, ul { margin: 0; }
ul { padding-left: 1.1rem; display: grid; gap: 6px; }
a { color: var(--brand); text-underline-offset: 3px; }
code { font-size: .9em; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 6px; padding: 1px 6px; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; color: var(--brand); }

/* ---------- Kopf mit Logo ---------- */
.ad-kopf {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(var(--safe-top) + 12px) max(18px, calc((100% - 1080px) / 2 + 18px)) 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--hairline);
}
.sa-lockup { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; line-height: 1; }
.sa-lockup svg { color: var(--brand); flex: none; }
.sa-lockup b { font-family: var(--font-brand); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; color: var(--wordmark); }
.sa-lockup small { font-size: var(--fs-xs); font-weight: 600; color: var(--brand); background: var(--brand-soft);
  padding: 3px 8px; border-radius: var(--r-pill); letter-spacing: .02em; }
.ad-kopf .rechts { display: flex; align-items: center; gap: 12px; font-size: var(--fs-sm); color: var(--ink-3); min-width: 0; }
.ad-kopf .wer { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }

/* ---------- Bereiche als Pillenleiste ---------- */
.ad-nav {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 10px 18px;
  max-width: 1080px; margin: 0 auto;
}
.ad-nav::-webkit-scrollbar { display: none; }
.ad-nav a {
  flex: none; padding: 8px 14px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 580;
  color: var(--ink-2); text-decoration: none; border: 1px solid transparent; min-height: 36px; display: inline-flex; align-items: center;
}
.ad-nav a:hover { background: var(--surface-2); }
.ad-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ad-nav a[aria-current="page"] { color: var(--brand-strong); } }

/* ---------- Rahmen ---------- */
.ad-huelle { max-width: 1080px; margin: 0 auto; padding: 8px 18px calc(var(--safe-bottom) + 48px); display: grid; gap: 14px; }
.ad-huelle.schmal { max-width: 460px; padding-top: 8vh; }
.ad-huelle > * { min-width: 0; }
.ad-huelle > h1 { font-size: var(--fs-3xl); font-weight: 680; letter-spacing: -0.035em; margin: 10px 2px 2px; }
.ad-huelle > h1 .serif { font-size: 1.08em; }
.ad-zurueck { font-size: var(--fs-sm); font-weight: 560; text-decoration: none; }

/* ---------- Karten ---------- */
.ad-karte {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: 18px; box-shadow: var(--shadow-1); display: grid; gap: 12px; margin: 0;
}
.ad-karte > h1 { font-size: var(--fs-2xl); font-weight: 680; letter-spacing: -0.03em; }
.ad-karte > h2 { font-size: var(--fs-sm); font-weight: 620; color: var(--ink-2); letter-spacing: .01em; }
.ad-still { font-size: var(--fs-sm); color: var(--ink-3); line-height: 1.45; }
small.ad-still { font-size: 12px; }

/* ---------- Kennzahlen ---------- */
.ad-kacheln { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin: 0; }
@media (max-width: 520px) { .ad-kacheln { grid-template-columns: 1fr 1fr; } }
.ad-kachel {
  display: grid; gap: 6px; align-content: start; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 16px;
  box-shadow: var(--shadow-1); transition: box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
a.ad-kachel:hover { box-shadow: var(--shadow-2); }
a.ad-kachel:active { transform: scale(.985); }
.ad-kachel-zahl { font-size: var(--fs-2xl); font-weight: 650; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.ad-kachel-text { font-size: var(--fs-sm); font-weight: 620; color: var(--ink-2); }
.ad-kachel-erklaerung { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }

/* ---------- Zustandsmarken (Chips) ---------- */
.ad-marke { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; vertical-align: 1px; }
.ad-marke.gut { background: var(--c-recover-soft); color: var(--state-usual); }
.ad-marke.warn { background: var(--c-load-soft); color: var(--state-above); }
.ad-marke.fehler { background: var(--c-heart-soft); color: var(--c-heart); }
.ad-marke.info { background: var(--c-mood-soft); color: var(--state-below); }
.ad-marke.still { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--hairline); }

/* ---------- Hinweise ---------- */
.ad-hinweis { padding: 12px 16px; border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 520; line-height: 1.45; border: 1px solid transparent; }
.ad-hinweis.gut { background: var(--c-recover-soft); color: var(--brand-ink); }
.ad-hinweis.warn { background: var(--c-load-soft); color: color-mix(in srgb, var(--c-load) 55%, var(--ink)); }
.ad-hinweis.fehler { background: var(--c-heart-soft); color: color-mix(in srgb, var(--c-heart) 55%, var(--ink)); }
.ad-hinweis.info { background: var(--c-mood-soft); color: color-mix(in srgb, var(--c-mood) 50%, var(--ink)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ad-hinweis { color: var(--ink); } }
.ad-hinweis p { margin: 0; }

/* ---------- Knöpfe ---------- */
.ad-reihe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ad-knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  border-radius: var(--r-pill); font: inherit; font-weight: 600; letter-spacing: -.005em; white-space: nowrap;
  min-height: 42px; padding: 0 18px; background: var(--ink); color: var(--bg); text-decoration: none;
  transition: transform var(--t-fast) var(--ease), opacity var(--t-fast);
}
.ad-knopf:active { transform: scale(.97); }
.ad-knopf.zweit { background: var(--surface); color: var(--ink); border: 1px solid var(--hairline-strong); }
.ad-knopf.gefahr { background: transparent; color: var(--c-heart); border: 1px solid color-mix(in srgb, var(--c-heart) 40%, transparent); }
.ad-knopf[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.sa-aktion { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.sa-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sa-knoepfe .ad-knopf, td .ad-knopf { min-height: 36px; padding: 0 14px; font-size: var(--fs-sm); }
.sa-link { background: none; border: 0; padding: 0; color: var(--brand); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; }
.sa-inline { display: inline; margin: 0; }
.sa-umbruch { flex-wrap: wrap; }

/* ---------- Formulare ---------- */
.ad-feld { display: grid; gap: 6px; }
.ad-feld > span:first-child { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.ad-feld .erklaerung { font-size: 12.5px; color: var(--ink-3); }
.ad-eingabe {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--hairline-strong);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 16px;
}
.ad-eingabe:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.sa-klein { width: 11rem; min-height: 42px; padding: 8px 12px; }
select.ad-eingabe { appearance: auto; }
.sa-freischalten { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--brand-soft); border-color: transparent; box-shadow: none; }
.sa-freischalten span { flex: 1 1 16rem; font-size: var(--fs-sm); font-weight: 560; color: var(--brand-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sa-freischalten span { color: var(--brand-strong); } }
.sa-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.sa-filter .ad-feld { flex: 1 1 12rem; }

/* ---------- Tabellen (auf dem Handy als Karten) ---------- */
.ad-tab { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--r-lg); overflow: hidden; }
.ad-tab th { text-align: left; font-weight: 620; color: var(--ink-3); font-size: 12.5px; letter-spacing: .01em; padding: 12px 14px; background: var(--surface-2); }
.ad-tab td { padding: 12px 14px; border-top: 1px solid var(--hairline); vertical-align: top; }
.ad-karte .ad-tab { border: 0; border-radius: 0; background: transparent; }
.ad-karte .ad-tab th { background: transparent; padding-left: 0; }
.ad-karte .ad-tab td { padding-left: 0; }
@media (max-width: 720px) {
  .ad-tab, .ad-tab tbody, .ad-tab tr, .ad-tab td { display: block; width: 100%; }
  .ad-tab thead { display: none; }
  .ad-tab { background: transparent; border: 0; }
  .ad-tab tr { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 6px 14px; margin-bottom: 10px; box-shadow: var(--shadow-1); }
  .ad-karte .ad-tab tr { box-shadow: none; background: var(--surface-2); }
  .ad-tab td { display: grid; grid-template-columns: 38% minmax(0, 1fr); gap: 10px; border-top: 1px solid var(--hairline); padding: 9px 0; }
  .ad-tab td:first-child { border-top: 0; }
  .ad-tab td::before { content: attr(data-spalte); font-weight: 600; color: var(--ink-3); font-size: 12.5px; }
  .ad-tab td[data-spalte=""] { grid-template-columns: 1fr; }
  .ad-tab td[data-spalte=""]::before { display: none; }
}

/* ---------- Ausgaben ---------- */
.sa-pre {
  margin: 0; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: var(--r-sm);
  padding: 12px 14px; font: 12.5px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--ink-2);
  white-space: pre-wrap; word-break: break-word; max-height: 70vh; overflow: auto;
}

.ad-tab td .ad-marke { justify-self: start; width: max-content; }
.ad-tab td > div > .ad-marke + .ad-marke { margin-left: 4px; }

/* CPU je Kern: Balken wie der 2.0-Fortschrittsbalken (Spur Haarlinie, Füllung Markenfarbe, ab 80 % Lastfarbe). */
.sa-kerne { display: grid; gap: 10px; margin: 4px 0 12px; }
.sa-kern { display: grid; grid-template-columns: 4.5em 1fr 4.2em; align-items: center; gap: 12px; }
.sa-kern-name { font-size: var(--fs-sm); font-weight: 620; color: var(--ink-2); }
.sa-kern-wert { font-weight: 650; letter-spacing: -0.01em; text-align: right; font-variant-numeric: tabular-nums; }
.sa-kern.gesamt { padding-top: 10px; border-top: 1px solid var(--hairline); }
.sa-kern.gesamt .sa-kern-name { color: var(--ink); }
.sa-balken { display: block; overflow: visible; }
.sa-balken-spur { fill: var(--hairline-strong); }
.sa-balken-fuell { fill: var(--brand); }
.sa-balken-fuell.hoch { fill: var(--c-load); }

/* 24-h-Verlauf (Hetzner-Metrik) */
.sa-verlauf { display: block; width: 100%; height: 88px; margin: 6px 0 10px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--hairline); }
.sa-verlauf-linie { stroke: var(--hairline-strong); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.sa-verlauf-kurve { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }

/* Lange Zeichenketten (Hostnamen, Fehlermeldungen) umbrechen statt aus der Karte zu laufen */
.ad-tab td { overflow-wrap: anywhere; min-width: 0; }
