/**
 * Trialog Maklergruppe GmbH - Design System Variables
 * Corporate Design: Bodoni 72, #16254A
 * Modern, Professional UI Foundation
 */

:root {
  /* ========================================
     BRAND COLORS - Trialog Corporate Design
     ======================================== */

  /* Primary Palette */
  --color-primary: #16254a;
  --color-primary-rgb: 22, 37, 74;
  --color-primary-50: #e8ebf0;
  --color-primary-100: #c5cdd9;
  --color-primary-200: #9eacc0;
  --color-primary-300: #778ba7;
  --color-primary-400: #597394;
  --color-primary-500: #3b5b81;
  --color-primary-600: #345379;
  --color-primary-700: #2c496e;
  --color-primary-800: #244064;
  --color-primary-900: #16254a;

  /* Secondary Palette */
  --color-secondary: #2a5298;
  --color-secondary-rgb: 42, 82, 152;
  --color-secondary-light: #4a7ad8;
  --color-secondary-dark: #1e3d70;

  /* Lit top-stop of the navy gradients used by the header and the root card.
     Distinct from --color-secondary-dark (#1e3d70), which is a different hue. */
  --color-primary-highlight: #1a3a6e;
  --color-primary-highlight-rgb: 26, 58, 110;
  --color-primary-deep: #0d1f3c;

  /* Accent Colors */
  --color-accent: #d4a853;
  --color-accent-rgb: 212, 168, 83;
  --color-accent-light: #e6c77a;
  --color-accent-dark: #b08a3d;

  /* ========================================
     NEUTRAL COLORS
     ======================================== */

  --color-white: #ffffff;
  --color-off-white: #fafbfc;
  --color-light-gray: #f5f6f8;
  --color-gray-100: #f0f1f3;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  /* Symbole und Bedienelemente, nicht Text: Fuer sie verlangt WCAG 3:1
     (non-text contrast), nicht 4,5:1. --color-gray-400 kam auf Weiss nur
     auf 2,54:1 und riss damit auch diese Schwelle. Ein eigenes Token statt
     einer Verdunklung von gray-400: Das ist zugleich --color-text-muted,
     und dort wuerde ein Sprung auf 4,5:1 die ganze Tonalitaet verschieben. */
  --color-icon-muted: #8d95a3;
  /* 5.288.0: wie --color-slate-500, aus demselben Grund (4,41:1 -> 4,54:1). */
  --color-gray-500: #69707e;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-black: #111827;

  /* Cool neutral ramp. The premium surfaces (root card, org search, zoom controls)
     are built on this, not on the warm --color-gray-* ramp above; the two are not
     interchangeable and mixing them shifts the palette visibly. */
  --color-slate-50: #f8fafc;
  --color-slate-100: #f1f5f9;
  --color-slate-200: #e2e8f0;
  --color-slate-400: #94a3b8;
  /* 5.288.0 von #64748b auf #627188 nachgezogen: Auf --color-slate-100
     (#f1f5f9) stand grauer Hilfstext bei 4,34:1 und riss damit WCAG AA an
     rund zwanzig Stellen. Jetzt 4,52:1. Der Unterschied ist mit blossem
     Auge nicht zu sehen - der Verstoss war es auch nicht. */
  --color-slate-500: #627188;
  --color-slate-600: #475569;
  --color-slate-800: #1e293b;
  --color-slate-900: #0f172a;

  /* Lightest slate that still clears WCAG AA (4.5:1) for body text on white.
     --color-slate-400 sits at ~2.8:1 and is for decorative icons only. */
  --color-slate-text-muted: var(--color-slate-500);

  /* Semantic Aliases */
  --color-background: var(--color-off-white);
  --color-surface: var(--color-white);
  --color-surface-elevated: var(--color-white);
  --color-border: var(--color-gray-200);
  --color-border-light: var(--color-gray-100);
  --color-text-primary: var(--color-primary);
  --color-text-secondary: var(--color-gray-600);
  --color-text-muted: var(--color-gray-400);

  /* ========================================
     STATUS COLORS
     ======================================== */

  --color-success: #059669;
  --color-success-light: #d1fae5;
  --color-success-dark: #047857;

  --color-warning: #b36205;
  --color-warning-light: #fef3c7;
  --color-warning-dark: #b45309;

  --color-error: #da2323;
  --color-error-light: #fee2e2;
  --color-error-dark: #b91c1c;

  --color-info: #0284c7;
  --color-info-light: #e0f2fe;
  --color-info-dark: #0369a1;

  /* ========================================
     TYPOGRAPHY - Bodoni 72
     ======================================== */

  /* ZWEI SCHRIFTEN, KLARE ROLLEN (aufgeräumt am 04.08.2026).
     Bis dahin gab es zwei Systeme nebeneinander — `--font-family-*` hier und
     `--in-font`/`--in-serif` in intranet.css. Auf einem einzigen Bildschirm
     standen dadurch VIER Schriftstapel: Inter, Libre Bodoni, Iowan Old Style
     und -apple-system. Jetzt zeigen alle vier Token auf dieselben zwei
     Schriften; die alten Namen bleiben, damit kein Bildschirm umgeschrieben
     werden muss.

     `primary` ist die AUSZEICHNUNGSSCHRIFT und gehört ausschließlich in große
     Titel (ab etwa 20 px). Libre Bodoni ist eine Didone: extremer
     Strichkontrast, sehr schön groß — bei 16 px werden die Haarstriche dünn,
     und sie wirkt geziert. Wer sie kleiner einsetzt, macht genau den Fehler,
     der hier abgestellt wurde. */
  --font-family-primary: 'Libre Bodoni', 'Bodoni 72', 'Bodoni MT', Georgia, serif;
  /* Die LESESCHRIFT und damit die Grundschrift des Dokuments. Inter zuerst,
     danach die Systemschriften als Rückfall. */
  --font-family-secondary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-family-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;

  /* Font Sizes - Modular Scale (1.25 ratio) */
  --font-size-2xs: 0.64rem;   /* 10.24px */
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-md: 1.125rem;   /* 18px */
  --font-size-lg: 1.25rem;    /* 20px */
  --font-size-xl: 1.5rem;     /* 24px */
  --font-size-2xl: 1.875rem;  /* 30px */
  --font-size-3xl: 2.25rem;   /* 36px */
  --font-size-4xl: 3rem;      /* 48px */
  --font-size-5xl: 3.75rem;   /* 60px */

  /* Brand-specific sizes */
  --font-size-logo: 1.5rem;
  --font-size-logo-sub: 0.875rem;

  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Line Heights */
  --line-height-none: 1;
  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;

  /* Letter Spacing */
  --letter-spacing-tighter: -0.05em;
  --letter-spacing-tight: -0.025em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.025em;
  --letter-spacing-wider: 0.05em;
  --letter-spacing-widest: 0.1em;

  /* ========================================
     SPACING SYSTEM (8px base grid)
     ======================================== */

  --spacing-0: 0;
  --spacing-px: 1px;
  --spacing-0-5: 0.125rem;  /* 2px */
  --spacing-1: 0.25rem;     /* 4px */
  --spacing-1-5: 0.375rem;  /* 6px */
  --spacing-2: 0.5rem;      /* 8px */
  --spacing-2-5: 0.625rem;  /* 10px */
  --spacing-3: 0.75rem;     /* 12px */
  --spacing-3-5: 0.875rem;  /* 14px */
  --spacing-4: 1rem;        /* 16px */
  --spacing-5: 1.25rem;     /* 20px */
  --spacing-6: 1.5rem;      /* 24px */
  --spacing-7: 1.75rem;     /* 28px */
  --spacing-8: 2rem;        /* 32px */
  --spacing-9: 2.25rem;     /* 36px */
  --spacing-10: 2.5rem;     /* 40px */
  --spacing-11: 2.75rem;    /* 44px */
  --spacing-12: 3rem;       /* 48px */
  --spacing-14: 3.5rem;     /* 56px */
  --spacing-16: 4rem;       /* 64px */
  --spacing-20: 5rem;       /* 80px */
  --spacing-24: 6rem;       /* 96px */

  /* Legacy aliases for backwards compatibility */
  --spacing-xxs: var(--spacing-0-5);
  --spacing-xs: var(--spacing-1);
  --spacing-sm: var(--spacing-2);
  --spacing-md: var(--spacing-4);
  --spacing-lg: var(--spacing-6);
  --spacing-xl: var(--spacing-8);
  --spacing-xxl: var(--spacing-12);
  --spacing-xxxl: var(--spacing-16);

  /* ========================================
     BORDER RADIUS
     ======================================== */

  --radius-none: 0;
  --radius-sm: 0.25rem;     /* 4px */
  --radius-md: 0.375rem;    /* 6px */
  --radius-lg: 0.5rem;      /* 8px */
  --radius-xl: 0.75rem;     /* 12px */
  --radius-2xl: 1rem;       /* 16px */
  --radius-3xl: 1.5rem;     /* 24px */
  --radius-full: 9999px;

  /* Legacy aliases */
  --border-radius-none: var(--radius-none);
  --border-radius-sm: var(--radius-sm);
  --border-radius-md: var(--radius-md);
  --border-radius-lg: var(--radius-lg);
  --border-radius-xl: var(--radius-xl);
  --border-radius-full: var(--radius-full);

  /* ========================================
     SHADOWS - Refined layered system
     ======================================== */

  --shadow-xs: 0 1px 2px 0 rgba(22, 37, 74, 0.04);
  --shadow-sm:
    0 1px 2px rgba(22, 37, 74, 0.06),
    0 1px 3px rgba(22, 37, 74, 0.08);
  --shadow-md:
    0 2px 4px rgba(22, 37, 74, 0.04),
    0 4px 8px rgba(22, 37, 74, 0.06),
    0 8px 16px rgba(22, 37, 74, 0.04);
  --shadow-lg:
    0 4px 8px rgba(22, 37, 74, 0.04),
    0 8px 16px rgba(22, 37, 74, 0.06),
    0 16px 32px rgba(22, 37, 74, 0.04);
  --shadow-xl:
    0 8px 16px rgba(22, 37, 74, 0.04),
    0 16px 32px rgba(22, 37, 74, 0.06),
    0 24px 48px rgba(22, 37, 74, 0.04);
  --shadow-2xl:
    0 16px 32px rgba(22, 37, 74, 0.08),
    0 32px 64px rgba(22, 37, 74, 0.08);
  --shadow-inner: inset 0 2px 4px 0 rgba(22, 37, 74, 0.04);
  --shadow-none: 0 0 #0000;

  /* Wiederholte Schatten aus dem Fachcode (5.291.0).
     Jeder Wert hier stand vorher wortgleich an mehreren Stellen in den
     Stylesheets - zusammen 68 Deklarationen auf 21 Werten. Die Namen
     beschreiben die Rolle am Fundort, nicht eine neue Gestaltungsabsicht:
     Was hier steht, ist der bisherige Wert, unveraendert. Wer eine Ebene
     aendern will, aendert sie hier - und damit ueberall zugleich.
     Die fuenf Fokusringe sind ABSICHTLICH noch fuenf: sie zusammenzulegen
     waere eine Gestaltungsentscheidung, keine Umbenennung.

     WARUM DIE NACHGELADENEN STYLESHEETS EINEN RUECKFALLWERT TRAGEN
     (`var(--shadow-..., 0 1px ...)`, 5.292.1): Ein Tab, der VOR dem Deploy
     offen war, hat diese Datei noch im alten Stand - ohne die Tokens hier.
     Oeffnet jemand darin danach zum ersten Mal einen Bildschirm, laedt
     `stilLader.js` dessen Stylesheet frisch vom Server nach, und die
     Versionskennung im Query archiviert keine alte Datei. Das neue
     Stylesheet traefe also auf alte Tokens, und der Schatten verschwaende
     bis zum naechsten Neuladen - beim Fokusring zusammen mit
     `outline: none` besonders unangenehm. Fest eingebundene Stylesheets
     (index.html und die main.css-Kette) brauchen das nicht: Sie kommen
     immer mit derselben variables.css. */
  --shadow-panel: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-panel-slate: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-panel-flat: 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-panel-stack: 0 2px 4px rgba(0, 0, 0, 0.02), 0 4px 8px rgba(0, 0, 0, 0.03);
  --shadow-raised: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-dialog-deep: 0 20px 50px rgba(15, 23, 42, 0.3);
  --shadow-hover-navy: 0 4px 12px rgba(22, 37, 74, 0.08);
  --shadow-hover-sm: 0 2px 4px rgba(22, 37, 74, 0.08);
  --shadow-hover-field: 0 1px 4px rgba(22, 37, 74, 0.14);
  --shadow-navy-md: 0 2px 8px rgba(22, 37, 74, 0.12);
  --shadow-selected-navy: 0 4px 12px rgba(22, 37, 74, 0.24), 0 0 0 3px rgba(22, 37, 74, 0.08);
  --shadow-slider-thumb: 0 1px 4px rgba(19, 37, 72, 0.35);
  --shadow-avatar-level:
    0 2px 4px rgba(42, 82, 152, 0.25),
    0 1px 2px rgba(42, 82, 152, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  --shadow-focus-blue: 0 0 0 3px rgba(59, 111, 212, 0.14);
  --shadow-focus-blue-strong: 0 0 0 3px rgba(59, 111, 212, 0.16);
  --shadow-focus-navy: 0 0 0 3px rgba(22, 37, 74, 0.08);
  --shadow-focus-navy-strong: 0 0 0 3px rgba(22, 37, 74, 0.1);
  --shadow-focus-gold: 0 0 0 3px rgba(201, 162, 75, 0.15);
  --glow-insert-line: 0 0 6px rgba(37, 99, 235, 0.55);
  --glow-gold-soft: 0 0 4px rgba(201, 162, 75, 0.14);

  /* Card-specific shadows */
  --shadow-card:
    0 0 0 1px rgba(22, 37, 74, 0.04),
    0 1px 2px rgba(22, 37, 74, 0.04),
    0 2px 4px rgba(22, 37, 74, 0.02);
  --shadow-card-hover:
    0 0 0 1px rgba(22, 37, 74, 0.06),
    0 4px 8px rgba(22, 37, 74, 0.06),
    0 12px 24px rgba(22, 37, 74, 0.04);
  --shadow-card-active:
    0 0 0 2px var(--color-primary),
    0 0 0 4px rgba(22, 37, 74, 0.08),
    0 4px 8px rgba(22, 37, 74, 0.06);

  /* Colored shadows */
  --shadow-primary:
    0 4px 12px rgba(22, 37, 74, 0.15),
    0 8px 24px rgba(22, 37, 74, 0.1);
  --shadow-accent:
    0 4px 12px rgba(212, 168, 83, 0.2),
    0 8px 24px rgba(212, 168, 83, 0.15);

  /* Glow effects */
  --glow-primary: 0 0 24px rgba(22, 37, 74, 0.12);
  --glow-accent: 0 0 24px rgba(212, 168, 83, 0.15);
  --glow-focus: 0 0 0 3px rgba(42, 82, 152, 0.12);

  /* ========================================
     GLASS PANEL PRIMITIVE
     ======================================== */

  /* The floating-glass look shared by the org search and the zoom controls.
     Named here because those two files carry the same stack duplicated verbatim. */
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-bg-solid: rgba(255, 255, 255, 0.98);
  --glass-border: 1px solid rgba(226, 232, 240, 0.7);
  --glass-blur: blur(12px);
  --shadow-glass:
    0 4px 6px rgba(22, 37, 74, 0.06),
    0 8px 16px rgba(22, 37, 74, 0.08),
    0 0 0 1px rgba(22, 37, 74, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);

  /* Lit navy surface: multi-stop and off-axis so it reads as a lit plane
     rather than a flat fill. Shared DNA with the app header and root card. */
  --gradient-navy-surface: linear-gradient(
    165deg,
    var(--color-primary-highlight) 0%,
    var(--color-primary) 45%,
    var(--color-primary-deep) 100%
  );
  --shadow-navy-raised:
    0 2px 8px rgba(22, 37, 74, 0.12),
    0 8px 24px rgba(22, 37, 74, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  --shadow-navy-raised-hover:
    0 4px 12px rgba(22, 37, 74, 0.16),
    0 16px 40px rgba(22, 37, 74, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);

  /* ========================================
     TRANSITIONS & ANIMATIONS
     ======================================== */

  /* Duration */
  --duration-75: 75ms;
  --duration-100: 100ms;
  --duration-150: 150ms;
  --duration-200: 200ms;
  --duration-300: 300ms;
  --duration-500: 500ms;
  --duration-700: 700ms;
  --duration-1000: 1000ms;

  /* Easing Functions */
  --ease-linear: linear;
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* The two curves the premium surfaces actually use. Neither is expressible
     through the generic ones above: --ease-out is a gentler decelerate, and
     --ease-spring overshoots harder than --ease-back-out. */
  --ease-expo-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-back-out: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Transition Presets */
  --transition-fast: var(--duration-150) var(--ease-in-out);
  --transition-normal: var(--duration-300) var(--ease-in-out);
  --transition-slow: var(--duration-500) var(--ease-in-out);
  --transition-colors: color var(--duration-150) var(--ease-in-out),
                       background-color var(--duration-150) var(--ease-in-out),
                       border-color var(--duration-150) var(--ease-in-out);
  --transition-transform: transform var(--duration-200) var(--ease-out);
  --transition-shadow: box-shadow var(--duration-200) var(--ease-in-out);
  --transition-all: all var(--duration-200) var(--ease-in-out);

  /* ========================================
     Z-INDEX SCALE
     ======================================== */

  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-overlay: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-toast: 800;
  --z-max: 9999;

  /* Legacy aliases */
  --z-index-dropdown: var(--z-dropdown);
  --z-index-sticky: var(--z-sticky);
  --z-index-fixed: var(--z-fixed);
  --z-index-modal-backdrop: var(--z-overlay);
  --z-index-modal: var(--z-modal);
  --z-index-popover: var(--z-popover);
  --z-index-tooltip: var(--z-tooltip);

  /* ========================================
     LAYOUT DIMENSIONS
     ======================================== */

  --header-height: 72px;

  /* Die Kopfleiste der Intranet-Huelle (`.in-topbar`). Sie steht hier und
     nicht nur in `intranet.css`, weil das Organigramm sich danach richten
     muss: Seine Seitenspalte haengt `fixed` am Ansichtsfenster und braucht
     den Abstand als Zahl. Zwei getrennte Werte waren es bis 5.9.2 - 70 gegen
     72 px, und die Spalte sass um zwei Pixel daneben. */
  --in-topbar-hoehe: 70px;
  --toolbar-height: 56px;
  --sidebar-width: 360px;
  --sidebar-width-collapsed: 60px;
  --container-max-width: 1440px;
  --content-max-width: 1200px;
  --narrow-max-width: 720px;

  /* ========================================
     BREAKPOINTS (for reference in JS)
     ======================================== */

  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;

  /* ========================================
     ORGANIGRAMM SPECIFIC
     ======================================== */

  /* Node dimensions */
  --node-min-width: 180px;
  --node-max-width: 280px;
  --node-padding: var(--spacing-4);
  --node-gap: var(--spacing-8);
  --node-vertical-gap: var(--spacing-12);

  /* Connection lines */
  --line-color: var(--color-gray-300);
  --line-width: 2px;
  --line-style: solid;

  /* Level colors */
  --level-0-color: var(--color-primary);
  --level-1-color: var(--color-secondary);
  --level-2-color: var(--color-accent);
  --level-3-color: var(--color-gray-500);
}

/* ========================================
   DUNKLER MODUS — BEWUSST NICHT VORHANDEN
   ========================================

   Hier standen bis 5.0.0 acht dunkle Farbtoken unter `:root.auto-dark`,
   eingefasst in eine `prefers-color-scheme`-Abfrage. Die Klasse `auto-dark`
   wurde im gesamten Projekt NIRGENDS gesetzt — die Farben waren toter Code.

   Sie sind entfernt, und das ist eine Entscheidung, kein Versehen. Ein
   dunkler Modus, den niemand sieht, veraltet unbemerkt: Jede Fläche, die
   seit dem Anlegen dazukam — Karriere-Hero, Fin CRM, Immo CRM, IPM,
   Zeiterfassung, Registrierungsseite — hat keinen dunklen Gegenwert, und die
   acht Token hätten davon nicht einmal die Hälfte getragen.

   WER IHN BAUEN WILL, braucht drei Dinge und nicht dieses Fragment:
   einen dreistufigen Schalter in den Einstellungen (Hell / Dunkel / Wie das
   System), die Einstellung im Firestore-Profil statt im Browser, und eine
   Durchsicht aller 55 Stylesheets — die Hälfte trägt feste Weißwerte, die
   dann auffallen.
*/

/* ========================================
   REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-75: 0ms;
    --duration-100: 0ms;
    --duration-150: 0ms;
    --duration-200: 0ms;
    --duration-300: 0ms;
    --duration-500: 0ms;
    --duration-700: 0ms;
    --duration-1000: 0ms;
  }
}
