/* Corporate Design helvascale – einzige Token-Datei des Frontends (CD-06, UI-01).
   Farbwerte (CD-02: Palette, Statusfarben, abgeleitete Neutraltöne), Schrift Geist Sans (CD-03, selbst gehostet,
   SIL OFL 1.1: assets/fonts/OFL.txt), semantische Tokens für Hell und Dunkel (SPEC-042) und Grundstile.
   Komponenten verwenden ausschließlich die Tokens; Hex-Werte stehen nur hier, weitere Abstufungen nur per color-mix(). */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Palette (CD-02) */
  --hs-deep-teal: #00314c;
  --hs-icy-blue: #91d2ee;
  --hs-frosted-breeze: #e6f7ff;
  --hs-light-blue: #f3fcff;
  --hs-royal-blue: #3242d7;
  --hs-slate-blue: #638aaa;
  --hs-orange: #ff7029;
  --hs-peach: #ffb68d;
  --hs-logo-blue: #649ec4;
  --hs-status-error: #c8102e;
  --hs-status-success: #1a7a43;
  /* Textfarbe auf gefüllten Statusflächen der Ticket-Badges (CD-02: Text darauf Weiß) */
  --hs-on-status: #ffffff;
  --hs-status-warning: var(--hs-orange);
  --hs-status-info: var(--hs-royal-blue);
  /* Hinweis „Update verfügbar“ (SPEC-070): Kreis in der Hinweisfarbe (nie Orange), Zeichen darauf; dunkel helle Variante */
  --status-info-icon: var(--hs-status-info);
  --status-info-icon-mark: var(--hs-on-status);

  /* Fremdmarken-Logos neben Distribution und Infrastruktur (CD-02 Ausnahme Fremdmarken-Logos, IDEA-020, Entscheidung Tim 2026-11-03):
     Markenfarben laut Simple Icons 16.36.0 (frontends/shared/assets/logos/QUELLEN.md); nur für diese Logos, nie für Flächen, Text oder
     Aktionen. GKE nutzt wie im Mockup das Google-Cloud-Symbol und dessen Farbe. */
  --logo-openshift: #ee0000;
  --logo-okd: #f22b29;
  --logo-rancher: #0075a8;
  --logo-k3s-yellow: #ffc61c;
  /* K3s-Gelb hat auf Weiß nur 1,6:1: hell Deep Teal, dunkel das Markengelb (Entscheidung Tim 2026-11-03) */
  --logo-k3s: var(--hs-deep-teal);
  --logo-kubernetes: #326ce5;
  --logo-googlecloud: #4285f4;
  --logo-openstack: #ed1944;
  /* Logos der Bindungsarten in AppCare (CHG-007, gleiche Rolle): Helm Dunkelblau (hell), Argo Orange. Helm hat auf dunklem Grund nur ca. 1:1: dort Light Blue.
     Argo hat auf Weiß 2,8:1 (große gefüllte Form, bewusst die Markenfarbe), auf Dunkel über 5:1. Operator Framework ist ein PNG ohne Token. */
  --logo-helm: #0f1689;
  --logo-argo: #ef7b4d;

  /* Abgeleitete Neutraltöne (CD-02, Entscheidung Tim 2026-11-03) – nur als Grundlage der Rollen-Tokens */
  --hs-neutral-page: #f8fafc;
  --hs-neutral-white: #ffffff;
  --hs-neutral-text: #111827;
  --hs-neutral-muted: #64748b;
  --hs-neutral-border: #e2e8f0;
  --hs-neutral-divider: #eef2f6;
  --hs-neutral-hover: #f3f7fa;
  --hs-black: #000000;

  /* Badges für Priorität und Status von Tickets (CD-02, Ausnahme IDEA-014): in Hell und Dunkel dieselben Flächen.
     „Niedrig“ hat keine Fläche, nur den Rand --hs-badge-low-border; seine Textfarbe ist die des Modus (--text-primary). */
  --hs-badge-critical-bg: var(--hs-status-error);
  --hs-badge-critical-text: var(--hs-on-status);
  --hs-badge-high-bg: var(--hs-orange);
  --hs-badge-high-text: var(--hs-deep-teal);
  --hs-badge-medium-bg: var(--hs-peach);
  --hs-badge-medium-text: var(--hs-deep-teal);
  --hs-badge-low-border: var(--hs-slate-blue);
  --hs-badge-open-bg: var(--hs-royal-blue);
  --hs-badge-open-text: var(--hs-on-status);
  --hs-badge-closed-bg: var(--hs-status-success);
  --hs-badge-closed-text: var(--hs-on-status);

  /* Status geplanter Updates (CD-02, Ausnahme „Update-Status und Umgebung“, IDEA-021, SPEC-089): in Hell und Dunkel dieselben Flächen,
     immer mit Symbol und Text. Planned ohne Fläche (Umriss Slate Blue, Text des Modus), Cancelled gedämpft (Rand-Ton, Nebentext). */
  --upd-planned-border: var(--hs-slate-blue);
  --upd-approved-bg: var(--hs-royal-blue);
  --upd-approved-text: var(--hs-on-status);
  --upd-ongoing-bg: var(--hs-icy-blue);
  --upd-ongoing-text: var(--hs-deep-teal);
  --upd-done-bg: var(--hs-status-success);
  --upd-done-text: var(--hs-on-status);
  --upd-missed-bg: var(--hs-orange);
  --upd-missed-text: var(--hs-deep-teal);
  /* Umgebung im Kalender (CD-02, Ausnahme „Update-Status und Umgebung“, SPEC-090): Randstreifen und leichte Tönung, immer mit Legende.
     Prod Royal Blue (Dunkelmodus Icy Blue, Royal Blue liegt dort unter 3:1), Non-Prod Slate Blue; Tönung nur per Mischung mit der Karte. */
  --env-prod: var(--hs-royal-blue);
  --env-nonprod: var(--hs-slate-blue);
  --env-prod-surface: color-mix(in srgb, var(--env-prod) 16%, var(--surface-card));
  --env-nonprod-surface: color-mix(in srgb, var(--env-nonprod) 7%, var(--surface-card));

  /* Bedienelemente mit Kontrast 3:1 (Rand von Eingaben, Avatar-Rand SPEC-034) */
  --hs-border: var(--hs-slate-blue);
  --hs-avatar-logo-bg: var(--hs-light-blue);
  --hs-avatar-initials-bg: var(--hs-deep-teal);
  --hs-avatar-initials-text: var(--hs-light-blue);

  /* ---- Semantische Tokens, hell (SPEC-042-AC-03, UI-01) ---- */
  /* Flächen: Seite neutral, Karten, Seitenleiste und Kopfzeile weiß */
  --surface-app: var(--hs-neutral-page);
  --surface-card: var(--hs-neutral-white);
  --surface-sidebar: var(--hs-neutral-white);
  --surface-header: var(--surface-card);
  --surface-field: var(--hs-neutral-white);
  --surface-hover: var(--hs-neutral-hover);
  --surface-lane: var(--surface-hover);
  --surface-brand-subtle: color-mix(in srgb, var(--hs-icy-blue) 18%, var(--hs-neutral-white));
  /* Gewählter Zustand (aktiver Bereich, gewählter Reiter, offenes Menü): Icy Blue mit Deep-Teal-Text (CD-05) */
  /* Auswahl- und Hervorhebungsflächen: hell Frosted Breeze, dunkel Icy Blue (Entscheidung Tim 2026-11-03). Fokusring bleibt Icy Blue. */
  --surface-selected: var(--hs-frosted-breeze);
  /* Aktiver Navigationseintrag: hell Frosted Breeze, dunkel Icy Blue (Entscheidung Tim 2026-11-03, SPEC-015-AC-05). */
  --surface-nav-active: var(--hs-frosted-breeze);
  --text-on-selected: var(--hs-deep-teal);
  --surface-inverse: var(--hs-deep-teal);
  --text-on-inverse: var(--hs-light-blue);
  /* Text: Überschriften Deep Teal, Fließtext dunkles Neutral, Nebentext zugängliches Neutral (UI-04) */
  --text-primary: var(--hs-deep-teal);
  --text-body: var(--hs-neutral-text);
  --text-secondary: var(--hs-neutral-muted);
  --text-link: var(--hs-royal-blue);
  /* Ränder */
  --border-default: var(--hs-neutral-border);
  --border-subtle: var(--hs-neutral-divider);
  --border-field: var(--hs-border);
  /* Aktionen */
  --action-primary: var(--hs-royal-blue);
  --action-primary-text: var(--hs-light-blue);
  --action-primary-hover: color-mix(in srgb, var(--hs-royal-blue) 85%, var(--hs-deep-teal));
  --action-emphasis: var(--hs-orange);
  --action-emphasis-text: var(--hs-deep-teal);
  --focus-ring: var(--hs-icy-blue);
  /* Meldungen (CD-02: Statusfarben nur für Rückmeldungen) */
  --message-error-bg: var(--hs-status-error);
  --message-success-bg: var(--hs-status-success);
  --message-info-bg: var(--hs-status-info);
  --message-warning-bg: var(--hs-status-warning);
  --message-on-status: var(--hs-light-blue);
  --message-on-warning: var(--hs-deep-teal);
  --field-error-bg: var(--hs-light-blue);
  --field-error-text: var(--hs-status-error);
  --crop-shade: color-mix(in srgb, var(--hs-deep-teal) 35%, transparent);
  /* Issues (CD-02 „Erweiterung Issues“, SPEC-126): getönte Pillen = Palettenfarbe in --tint bzw. --tint-strong Deckkraft auf der Kartenfläche;
     Text in der dunklen (hell) bzw. hellen (dunkel) Variante derselben Farbe */
  --tint: 12%;
  --tint-strong: 40%;
  --ink-default: var(--hs-deep-teal);
  --ink-open: var(--hs-royal-blue);
  --ink-orange: color-mix(in srgb, var(--hs-orange) 62%, var(--hs-deep-teal));
  --ink-success: var(--hs-status-success);
  --ink-error: var(--hs-status-error);
  --ink-type: var(--hs-neutral-text);
  /* Bewertungssterne und Text der Eskalationsmarken (CD-02 „Erweiterung Issues“, CHG-018): Sterne Royal Blue, Eskalation in der Warnfarbe mit Deep Teal */
  --ink-rating: var(--hs-royal-blue);
  --ink-warning: var(--hs-deep-teal);

  /* Schrift (CD-03, UI-02): Skala 12 / 13 / 14 / 16 / 20 / 24 px, Schnitte 400 / 500 / 600 */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --tracking-h1: -0.03em;
  --tracking-h2: -0.02em;
  --tracking-figure: -0.025em;
  --leading-body: 1.5;
  --leading-tight: 1.25;

  /* Radien (UI-03) und Abstände auf dem 4-px-Raster (UI-06) */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-pill: 999px;
  /* Sprachflaggen (SPEC-055): feiner Radius nur für die Flaggen der Sprachauswahl */
  --radius-flag: 2px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* Maße des Rahmens und Bewegung (SPEC-037-AC-22) */
  --frame-header-height: 56px;
  --sidebar-width: 211px;
  --sidebar-width-collapsed: 64px;
  --control-height: 32px;
  --motion-sidebar: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  /* Senkrechtes Auf-/Zuklappen der Unterpunkte: halb so lang wie das seitliche Einklappen (Entscheidung Tim 2026-11-03). */
  --motion-subnav: 110ms cubic-bezier(0.4, 0, 0.2, 1);
  /* Aufklappbereich unter einer Cluster-Zeile (SPEC-071-AC-18, CHG-032): ruhige Höhenanimation, höchstens 250 ms. */
  --motion-panel: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  /* Beschriftungen und Schriftzug der Seitenleiste: rasch aus, beim Ausklappen kurz verzögert ein (Breite ist dann schon frei) */
  --motion-fade-out: 120ms ease;
  --motion-fade-in: 150ms ease 70ms;
  /* Unterpunkte der Seitenleiste: erst einblenden, wenn die Leiste fast ausgeklappt ist (ihr Text steht weiter rechts) */
  --motion-fade-in-late: 150ms ease 160ms;

  color-scheme: light;
}

/* Dunkler Modus: Systemeinstellung, sofern nicht manuell „Hell“ gewählt (SPEC-016). Flächen aus Deep Teal abgeleitet (UI-08):
   Seitenleiste am dunkelsten, Seite dazwischen, Karten am hellsten; Ränder aus Icy Blue gemischt, sichtbar, aber dezent. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* Logos mit zu wenig Kontrast auf dunklen Flächen (< 3:1): helle Variante bzw. Markengelb (SPEC-070) */
    --logo-rancher: var(--hs-light-blue);
    --logo-helm: var(--hs-light-blue);
    --logo-k3s: var(--logo-k3s-yellow);
    --status-info-icon: var(--hs-icy-blue);
    --status-info-icon-mark: var(--hs-deep-teal);
    --hs-border: var(--hs-icy-blue);
    --hs-avatar-logo-bg: var(--hs-deep-teal);
    --hs-avatar-initials-bg: var(--hs-icy-blue);
    --hs-avatar-initials-text: var(--hs-deep-teal);
    --surface-app: color-mix(in srgb, var(--hs-deep-teal) 72%, var(--hs-black));
    --surface-nav-active: var(--hs-icy-blue);
    --surface-selected: var(--hs-icy-blue);
    --surface-card: color-mix(in srgb, var(--hs-deep-teal) 90%, var(--hs-black));
    --surface-sidebar: color-mix(in srgb, var(--hs-deep-teal) 58%, var(--hs-black));
    --surface-header: var(--surface-sidebar);
    --surface-field: var(--surface-app);
    --surface-hover: color-mix(in srgb, var(--hs-icy-blue) 12%, transparent);
    --surface-lane: color-mix(in srgb, var(--hs-icy-blue) 12%, var(--surface-card));
    --surface-brand-subtle: color-mix(in srgb, var(--hs-icy-blue) 14%, var(--surface-card));
    --surface-inverse: var(--hs-light-blue);
    --text-on-inverse: var(--hs-deep-teal);
    --text-primary: var(--hs-light-blue);
    --text-body: var(--hs-light-blue);
    --text-secondary: color-mix(in srgb, var(--hs-light-blue) 70%, var(--surface-card));
    --text-link: var(--hs-icy-blue);
    --border-default: color-mix(in srgb, var(--hs-icy-blue) 22%, var(--surface-card));
    --border-subtle: color-mix(in srgb, var(--hs-icy-blue) 13%, var(--surface-card));
    --border-field: color-mix(in srgb, var(--hs-icy-blue) 55%, var(--surface-card));
    --action-primary: var(--hs-icy-blue);
    --action-primary-text: var(--hs-deep-teal);
    --action-primary-hover: color-mix(in srgb, var(--hs-icy-blue) 85%, var(--hs-light-blue));
    --env-prod: var(--hs-icy-blue);
    --tint: 24%;
    --tint-strong: 30%;
    --ink-default: var(--hs-light-blue);
    --ink-open: var(--hs-icy-blue);
    --ink-orange: var(--hs-peach);
    --ink-success: color-mix(in srgb, var(--hs-status-success) 40%, var(--hs-light-blue));
    --ink-error: color-mix(in srgb, var(--hs-status-error) 35%, var(--hs-light-blue));
    --ink-type: var(--text-secondary);
    --ink-rating: var(--hs-icy-blue);
    --ink-warning: var(--hs-light-blue);
    color-scheme: dark;
  }
}

/* Manuell „Dunkel“ gewählt – dieselbe Belegung wie oben */
:root[data-theme="dark"] {
  /* Logos mit zu wenig Kontrast auf dunklen Flächen (< 3:1): helle Variante bzw. Markengelb (SPEC-070) */
  --logo-rancher: var(--hs-light-blue);
  --logo-helm: var(--hs-light-blue);
  --logo-k3s: var(--logo-k3s-yellow);
  --status-info-icon: var(--hs-icy-blue);
  --status-info-icon-mark: var(--hs-deep-teal);
  --hs-border: var(--hs-icy-blue);
  --hs-avatar-logo-bg: var(--hs-deep-teal);
  --hs-avatar-initials-bg: var(--hs-icy-blue);
  --hs-avatar-initials-text: var(--hs-deep-teal);
  --surface-app: color-mix(in srgb, var(--hs-deep-teal) 72%, var(--hs-black));
  --surface-nav-active: var(--hs-icy-blue);
  --surface-selected: var(--hs-icy-blue);
  --surface-card: color-mix(in srgb, var(--hs-deep-teal) 90%, var(--hs-black));
  --surface-sidebar: color-mix(in srgb, var(--hs-deep-teal) 58%, var(--hs-black));
  --surface-header: var(--surface-sidebar);
  --surface-field: var(--surface-app);
  --surface-hover: color-mix(in srgb, var(--hs-icy-blue) 12%, transparent);
  --surface-lane: color-mix(in srgb, var(--hs-icy-blue) 12%, var(--surface-card));
  --surface-brand-subtle: color-mix(in srgb, var(--hs-icy-blue) 14%, var(--surface-card));
  --surface-inverse: var(--hs-light-blue);
  --text-on-inverse: var(--hs-deep-teal);
  --text-primary: var(--hs-light-blue);
  --text-body: var(--hs-light-blue);
  --text-secondary: color-mix(in srgb, var(--hs-light-blue) 70%, var(--surface-card));
  --text-link: var(--hs-icy-blue);
  --border-default: color-mix(in srgb, var(--hs-icy-blue) 22%, var(--surface-card));
  --border-subtle: color-mix(in srgb, var(--hs-icy-blue) 13%, var(--surface-card));
  --border-field: color-mix(in srgb, var(--hs-icy-blue) 55%, var(--surface-card));
  --action-primary: var(--hs-icy-blue);
  --action-primary-text: var(--hs-deep-teal);
  --action-primary-hover: color-mix(in srgb, var(--hs-icy-blue) 85%, var(--hs-light-blue));
  --env-prod: var(--hs-icy-blue);
  --tint: 24%;
  --tint-strong: 30%;
  --ink-default: var(--hs-light-blue);
  --ink-open: var(--hs-icy-blue);
  --ink-orange: var(--hs-peach);
  --ink-success: color-mix(in srgb, var(--hs-status-success) 40%, var(--hs-light-blue));
  --ink-error: color-mix(in srgb, var(--hs-status-error) 35%, var(--hs-light-blue));
  --ink-type: var(--text-secondary);
  --ink-rating: var(--hs-icy-blue);
  --ink-warning: var(--hs-light-blue);
  color-scheme: dark;
}

/* Grundstile (UI-02): Geist, 14 px Fließtext, Kantenglättung, keine künstlichen Schnitte */
html {
  font-family: var(--font-sans);
  font-weight: var(--weight-regular);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--surface-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

h1, h2, h3 {
  margin: 0 0 var(--space-3);
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
}

h1 {
  font-size: var(--text-2xl);
  letter-spacing: var(--tracking-h1);
}

h2 {
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-h2);
}

h3 {
  font-size: var(--text-base);
}

/* Fett nur bis Semibold (UI-02): auch Browser-Vorgaben für strong, b und Tabellenköpfe */
strong, b {
  font-weight: var(--weight-semibold);
}

th {
  font-weight: var(--weight-medium);
}

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

a {
  color: var(--text-link);
}

button, input, select, textarea {
  font: inherit;
}

/* Buttons (UI-03): 6 px Radius, 13 px Medium; primär in der Aktionsfarbe des Modus */
button {
  box-sizing: border-box;
  min-height: var(--control-height);
  padding: 0 var(--space-3);
  border: 1px solid var(--action-primary);
  border-radius: var(--radius-sm);
  background: var(--action-primary);
  color: var(--action-primary-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: var(--action-primary-hover);
  background: var(--action-primary-hover);
}

/* Eingaben: 6 px Radius, 14 px, Rand mit 3:1 Kontrast */
input, select, textarea {
  box-sizing: border-box;
  border: 1px solid var(--border-field);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  background: var(--surface-field);
  color: var(--text-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

/* Jedes fokussierte Element ist sichtbar hervorgehoben (IDEA-009, CD-05: Fokusring in Icy Blue) */
:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
