/* Gemeinsame agt-Design-Tokens (Light/Dark) — einzige Quelle für Farben,
   Radien und Schatten. Seiten-CSS deklariert KEIN eigenes :root mehr für
   diese Namen, sonst gewinnt es in der Kaskade und Dark-Mode bricht. */

/* Weicher Cross-Fade bei kompletten Seitenwechseln (Sidebar-Links laden
   die Seite komplett neu, kein SPA-Router). Progressive Enhancement:
   Browser ohne Cross-Document-View-Transitions ignorieren die Regel
   einfach und laden wie bisher ohne Übergang. */
@view-transition {
  navigation: auto;
}
/* Selbst gehostet statt local() — lässt sich nicht darauf verlassen, dass
   jeder Mitarbeiter-Rechner die CI-Schrift installiert hat. Dateien liegen
   in /static/fonts (WOFF2, aus den Original-TTFs der Mediathek konvertiert). */
@font-face {
  font-family: "TT Hoves Pro";
  src: url("/static/fonts/tt-hoves-pro-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TT Hoves Pro";
  src: url("/static/fonts/tt-hoves-pro-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TT Hoves Pro";
  src: url("/static/fonts/tt-hoves-pro-demibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TT Hoves Pro";
  src: url("/static/fonts/tt-hoves-pro-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f2f3f6;
  --surface: #ffffff;
  --surface2: #f7f8fa;
  --surface3: #edeff3;
  --line: #e3e5ec;
  --line2: #d7dae4;
  --ink: #020b3d;
  --ink2: #2a3358;
  --muted: #6b7280;
  --navy: #020b3d;
  --accent: #3165ff;
  --accent-soft: #eaf0ff;
  --on-navy: #ffffff;
  --fill: #020b3d;
  --on-fill: #ffffff;
  --fill-soft: #9aa3c4;
  --logo-filter: none;
  --shadow:
    0 1px 2px rgba(2, 11, 61, 0.05),
    0 8px 24px rgba(2, 11, 61, 0.05);

  /* Status-/Kategorienfarben für Charts, Pills und Prioritäten (siehe
     dataviz-Skill: fixe Reihenfolge, nie zyklisch neu vergeben). */
  --status-new: #3165ff;
  --status-progress: #e79a28;
  --status-waiting: #8a93ad;
  --status-done: #2e9b74;
  --status-critical: #cc4b58;

  /* Priorität (Balken/Punkte an Ticketzeilen, getrennt von Status-Farben). */
  --prio-low: #39c52f;
  --prio-normal: var(--accent);
  --prio-high: var(--status-progress);
  --prio-critical: var(--status-critical);

  /* Radien (siehe design_handoff_helpdesk_redesign/css/tokens.css). */
  --r-sm: 8px;
  --r-md: 9px;
  --r-lg: 10px;
  --r-xl: 14px;
  --r-pill: 999px;

  /* Icon-Rail-Breiten, gemeinsam von shell.css und shell.js genutzt. */
  --rail-w: 68px;
  --rail-w-open: 236px;

  /* Alt-Namen als Aliase, damit bestehendes Seiten-CSS ohne Änderung auf
     die neuen Tokens umzieht, sobald es sein eigenes :root entfernt. */
  --blue: var(--accent);
  --cyan: #6f93ff;
  --green: var(--status-done);
  --orange: var(--status-progress);
  --red: var(--status-critical);
  --card: var(--surface);
}

:root[data-theme="dark"] {
  --bg: #05091c;
  --surface: #0b1029;
  --surface2: #0f1533;
  --surface3: #151c40;
  --line: #1e2650;
  --line2: #2a3466;
  --ink: #eaedf8;
  --ink2: #c3cae4;
  --muted: #8b95bc;
  --navy: #080d22;
  --accent: #5b84ff;
  --accent-soft: #141f45;
  --on-navy: #eaedf8;
  --fill: #c3cae4;
  --on-fill: #05091c;
  --fill-soft: #59648f;
  --logo-filter: brightness(0) invert(1);
  --shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 8px 28px rgba(0, 0, 0, 0.35);

  --status-new: #5b84ff;
  --status-progress: #f2b24a;
  --status-waiting: #a6aec9;
  --status-done: #3db483;
  --status-critical: #e2707d;

  --blue: var(--accent);
  --cyan: #7fa1ff;
  --green: var(--status-done);
  --orange: var(--status-progress);
  --red: var(--status-critical);
  --card: var(--surface);
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "TT Hoves Pro", Arial, sans-serif;
  letter-spacing: -0.01em;
}
a {
  color: var(--accent);
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--line2);
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
}

/* Wiederverwendbarer Light/Dark-Umschalter für Seiten ohne Sidebar
   (Login, Landing, Portal, Benutzerverwaltung, Legacy-Dashboard). Der
   Agent-Workspace bekommt seine eigene Variante in shell.css. */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--ink2);
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.theme-toggle:hover {
  border-color: var(--line2);
}
.theme-toggle svg {
  width: 14px;
  height: 14px;
  flex: none;
}
.theme-toggle.active {
  border-color: var(--accent);
  color: var(--accent);
}

/* Weiche Übergänge für interaktive Elemente statt hartem Umschalten bei
   Hover/Fokus — gilt seitenübergreifend, weil tokens.css überall zuerst
   eingebunden wird. Bewusst auf Farb-/Rahmen-/Schatten-/Transform-
   Eigenschaften begrenzt (kein `transition: all`), damit Layout-Animationen
   wie die Sidebar-Breite (siehe shell.css) nicht versehentlich mitlaufen.
   .ticket-row/.portal-row/tbody-Zeilen sind eigene <div>/<tr>-Hover-Ziele
   ohne native Button-Semantik, alles andere ist über Tag-Selektoren
   abgedeckt. */
button,
a,
input,
select,
textarea,
.ticket-row,
.portal-row,
.department-legend tbody tr {
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease,
    transform 0.12s ease,
    filter 0.15s ease;
}

/* Betriebssystem-Einstellung „Bewegung reduzieren" respektieren: Übergänge
   und Animationen praktisch abschalten statt sie zu erzwingen. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Natives <dialog> blendet per Default hart ein/aus. Seiten setzen ihre
   eigene dialog::backdrop-Hintergrundfarbe (siehe agent-tickets.css etc.) —
   hier nur Opazität/Transform, damit sich das mit jeder Seitenfarbe
   verträgt. Läuft bei jedem showModal() neu an, siehe Kommentar in
   agent-tickets.css zum selben display:none→sichtbar-Trick. */
dialog[open] {
  animation: tokensDialogPopIn 0.2s cubic-bezier(0.22, 0.8, 0.3, 1);
}
dialog::backdrop {
  animation: tokensFadeIn 0.18s ease;
}
@keyframes tokensDialogPopIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
@keyframes tokensFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
