/* ==========================================================================
   BASE CSS — Fundament für alle Seiten
   ========================================================================== */

/* ── Status-Farben (Light) ───────────────────────────────── */
:root {
    --status-draft-bg:     #fef3c7; --status-draft-text:     #92400e;
    --status-preview-bg:   #dbeafe; --status-preview-text:   #1e40af;
    --status-hold-bg:      #fde8e8; --status-hold-text:      #991b1b;
    --status-published-bg: #d1fae5; --status-published-text: #065f46;
    --status-success-bg:   #d1fae5; --status-success-text:   #065f46;
    --status-error-bg:     #fef2f2; --status-error-text:     #dc2626;
    --status-warning-bg:   #fffbeb; --status-warning-text:   #b45309;
}
[data-theme="dark"] {
    --status-draft-bg:     #422006; --status-draft-text:     #fde68a;
    --status-preview-bg:   #1e3a5f; --status-preview-text:   #93c5fd;
    --status-hold-bg:      #7f1d1d; --status-hold-text:      #fca5a5;
    --status-published-bg: #14532d; --status-published-text: #86efac;
    --status-success-bg:   #14532d; --status-success-text:   #86efac;
    --status-error-bg:     #7f1d1d; --status-error-text:     #fca5a5;
    --status-warning-bg:   #422006; --status-warning-text:   #fde68a;
}

/* ==========================================================================
   SELF-HOSTED INTER FONT (Variable Font, latin + latin-ext)
   ========================================================================== */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('/fonts/inter-latin-ext.woff2') format('woff2');
    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';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('/fonts/inter-latin.woff2') format('woff2');
    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;
}

/* ==========================================================================
   MARKET INSIDER - MODERN DATA GRID (OPTIMIZED & FIXED)
   ========================================================================== */

/* 1. VARIABLEN & THEMES */
:root {
    /* --- UI BASIS (MD3) --- */
    --bg-app:       #f9f9ff;
    --bg-panel:     #ffffff; /* from surface-container-lowest */
    --text-main:    #111c2d;
    --text-muted:   #424754;
    --border-color: #c2c6d6;
    --border-strong:#727785;

    /* --- MD3 Surfaces --- */
    --surface-container:     #e7eeff;
    --surface-container-low: #f0f3ff;
    --surface-container-high:#dee8ff;
    --surface-dim:           #cfdaf2;
    --primary-container:     #2170e4;
    --on-primary-container:  #fefcff;
    --secondary:             #545f73;
    --secondary-container:   #d5e0f8;
    --tertiary:              #825100;
    --tertiary-container:    #a36700;
    --on-tertiary-container: #fffbff;

    /* --- RADIEN --- */
    --radius-xs:  0.125rem;
    --radius-sm:  0.25rem;
    --radius-md:  0.5rem;
    --radius-lg:  0.75rem;
    --radius-full: 9999px;

    /* --- SCHATTEN --- */
    --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm:  0 2px 6px rgba(0,0,0,0.08);
    --shadow-md:  0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg:  0 8px 24px rgba(0,0,0,0.15);
    --shadow-xl:  0 12px 32px rgba(0,0,0,0.18);
    --shadow-focus: 0 0 0 3px rgba(59, 130, 246, 0.15);
    --shadow-primary-sm: 0 1px 3px rgba(0, 88, 190, 0.3);
    --shadow-primary-md: 0 2px 8px rgba(0, 88, 190, 0.15);
    --shadow-primary-lg: 0 4px 16px rgba(0, 88, 190, 0.3);

    /* --- ABSTÄNDE --- */
    --space-xs:  0.25rem;
    --space-sm:  0.5rem;
    --space-md:  1rem;
    --space-lg:  1.5rem;
    --space-xl:  2rem;
    --space-2xl: 3rem;

    /* --- LAYOUT --- */
    --toolbar-height: 42px;

    /* --- BUTTONS (Light) --- */
    --btn-bg:       #ffffff;
    --btn-text:     #111c2d;
    --btn-border:   #c2c6d6;
    --btn-shadow:   0 1px 2px rgba(0,0,0,0.05);

    /* Primary Action (Blau MD3) */
    --btn-primary-bg:    #0058be;
    --btn-primary-hover: #004a9e; /* Unchanged, kept from original */
    --btn-primary-text:  #ffffff;

    /* --- PIVOT FARBEN --- */
    /* Header & Level 0 */
    --pvt-header-bg:  #1e293b;
    --pvt-header-txt: #f1f5f9;

    /* Level 1: deutlich erkennbar als Gruppe */
    --pvt-lvl1-bg:    #e2e8f0;
    --pvt-lvl1-txt:   #1a1a2e;

    /* Level 2 & Daten */
    --pvt-lvl2-bg:    #f1f5f9;
    --pvt-lvl2-txt:   #1a1a2e;
    --pvt-bg-even:    #ffffff;
    --pvt-bg-odd:     #f8fafc;

    /* Spalten Summen — ttl_line/ttl_share dunkelst → clevel0 → clevel1 → clevel2 hellst */
    --pvt-col-total: #c2c8d2; /* Gesamt (ttl_line/ttl_share): dunkelster Ton */
    --pvt-col-0-bg: #d0d5dd; --pvt-col-0-txt: #1a1a2e; /* clevel0: kräftig */
    --pvt-col-1-bg: #dfe3ea; --pvt-col-1-txt: #1a1a2e; /* clevel1: mittel */
    --pvt-col-2-bg: #ebeef3; --pvt-col-2-txt: #1a1a2e; /* clevel2: dezent */

    /* Header-Overlay: Spaltenfarben halbtransparent über Header-Hintergrund */
    --pvt-col-total-overlay: rgba(194, 200, 210, 0.45);
    --pvt-col-0-overlay: rgba(208, 213, 221, 0.38);
    --pvt-col-1-overlay: rgba(223, 227, 234, 0.30);
    --pvt-col-2-overlay: rgba(235, 238, 243, 0.22);

    /* Interaktion */
    --pvt-hover:      rgba(59, 130, 246, 0.08);
    --pvt-marked:     #fef3c7;
    --pvt-marked-txt: #000000;

    /* Sekundäre Flächen (z.B. KPI-Kacheln) */
    --bg-secondary:    #f0f3ff;
    --text-secondary:  #545f73;

    /* Card-Hintergrund (Light) */
    --bg-card: #ffffff;

    /* Links */
    --link-color:       #0058be;
    --link-hover:       #004a9e;
    --link-visited:     #4a2d8a;

    /* Icons (Light Mode: Orange) */
    --theme-icon-color: #825100;
}

[data-theme="dark"] {
    /* --- UI DARK (MD3 Dark) --- */
    --bg-app:       #121318;
    --bg-panel:     #1d1e25;
    --text-main:    #e2e2e9;
    --text-muted:   #c4c6d0;
    --border-color: #2e3038;
    --border-strong:#44474f;

    /* --- MD3 Dark Surfaces --- */
    --surface-container:     #1d1e25;
    --surface-container-low: #191a20;
    --surface-container-high:#272830;
    --surface-dim:           #121318;
    --primary-container:     #004a9e;
    --on-primary-container:  #d8e2ff;
    --secondary:             #bcc7de;
    --secondary-container:   #3c475a;
    --tertiary:              #ffb95f;
    --tertiary-container:    #653e00;
    --on-tertiary-container: #ffddb8;

    /* --- BUTTONS (Dark) --- */
    --btn-bg:       #272830;
    --btn-text:     #e2e2e9;
    --btn-border:   #44474f;
    --btn-shadow:   0 1px 3px rgba(0,0,0,0.5);

    --btn-primary-bg:    #adc6ff;
    --btn-primary-hover: #d8e2ff;
    --btn-primary-text:  #001a3d;

    /* --- PIVOT DARK --- */
    /* Header (thead): dunkelstes Schwarz */
    --pvt-header-bg: #0a0a0a; --pvt-header-txt:#e0e0e0;

    /* Zeilen-Gruppen: Level 0 = dunkelst, höhere Levels heller */
    --pvt-lvl1-bg:   #282828; --pvt-lvl1-txt:  #e0e0e0;
    --pvt-lvl2-bg:   #1e1e1e; --pvt-lvl2-txt:  #e0e0e0;

    /* Datenzeilen: neutrales Schwarz */
    --pvt-bg-even:   #111111;
    --pvt-bg-odd:    #141414;

    /* Spalten-Summen: ttl_line/ttl_share dunkelst → clevel0 → clevel1 → clevel2 hellst */
    --pvt-col-total: #050505; /* Gesamt (ttl_line/ttl_share): fast schwarz = dunkelst */
    --pvt-col-0-bg: #181818; --pvt-col-0-txt: #e0e0e0; /* clevel0: dunkel */
    --pvt-col-1-bg: #1e1e1e; --pvt-col-1-txt: #e0e0e0; /* clevel1: mittel */
    --pvt-col-2-bg: #252525; --pvt-col-2-txt: #e0e0e0; /* clevel2: hellst */

    /* Header-Overlay: Spaltenfarben halbtransparent über Header-Hintergrund */
    --pvt-col-total-overlay: rgba(255, 255, 255, 0.18);
    --pvt-col-0-overlay: rgba(255, 255, 255, 0.14);
    --pvt-col-1-overlay: rgba(255, 255, 255, 0.10);
    --pvt-col-2-overlay: rgba(255, 255, 255, 0.06);

    /* Akzentfarbe Blau nur für Interaktion */
    --pvt-hover:     rgba(59, 130, 246, 0.12);
    --pvt-marked:    #854d0e;
    --pvt-marked-txt:#ffffff;

    /* Sekundäre Flächen (z.B. KPI-Kacheln) */
    --bg-secondary:    #1d1e25;
    --text-secondary:  #bcc7de;

    /* Card-Hintergrund (Dark) */
    --bg-card: #1d1e25;

    /* Links (Dark: helles Blau, gut lesbar auf dunklem Hintergrund) */
    --link-color:       #8ab4f8;
    --link-hover:       #adc6ff;
    --link-visited:     #c58af9;

    /* Icons (Dark Mode: Blau-Akzent) */
    --theme-icon-color: #adc6ff;
}

/* 2. APP LAYOUT (Full Screen) */
html, body {
    height: 100vh;
    margin: 0; padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    background-color: var(--bg-app);
    color: var(--text-main);
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
}

a { color: var(--link-color); }
a:hover { color: var(--link-hover); }
a:visited { color: var(--link-visited); }

.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    background-color: var(--bg-app);
}

/* Header Animation (Compact Mode) */
.app-header {
    flex: 0 0 auto;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    max-height: 300px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0.0, 0.2, 1),
                opacity 0.3s ease, padding 0.3s ease;
}

body.compact-mode .app-header {
    max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; border-bottom: none;
}
/*
h1 { margin: 0; 
   padding: 10px 0px;
   letter-spacing: -0.01em; border-bottom: 0px solid var(--border-color); 
}*/
p, li { margin: 0; padding: 6px 16px; font-size: 0.9375rem; line-height: 1.5; color: var(--text-muted); }
ul { list-style: none; padding-left: 1.2em; }
ul > li { position: relative; }
ul > li::before {
  content: "›";
  position: absolute;
  left: -0.35em;
  color: var(--border-strong);
  font-weight: 700;
}

/* 3. TOOLBAR (Fixiert Links-Mitte-Rechts) */
.app-toolbar {
    flex: 0 0 auto;
    height: var(--toolbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between; /* WICHTIG: Verteilt die Gruppen */
    padding: 0 12px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-strong);
    position: relative;
/*    z-index: 1000; */
}

/* Gruppen-Reset: Keine automatischen Margins mehr */
.toolbar-group { display: flex; align-items: center; gap: 8px; margin: 0; }
/* Spezifische Klassen aus deinem HTML */
.pivot-toolbar { display: flex; align-items: center; }
.pivot-toolbar-group { display: flex; gap: 8px; }

.pivot-toolbar-sep, .toolbar-sep {
    width: 1px; height: 24px; background: var(--border-color); margin: 0 5px;
}

/* ── Dropdown Navigation ─────────────────────────────────── */
.app-nav-dropdown-container { position: relative; }
.app-nav-dropdown-menu {
    position: absolute; top: 100%; left: 0; z-index: 1001;
    min-width: 220px; background: var(--bg-panel);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-md);
    border-radius: 4px; padding: 5px 0;
}
.app-nav-dropdown-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 15px; color: var(--text-main);
    text-decoration: none; font-size: 0.95em;
}
.app-nav-icon { flex: 0 0 18px; width: 18px; height: 18px; opacity: 0.6; }
.app-nav-icon svg { width: 100%; height: 100%; }
.app-nav-dropdown-trigger .app-nav-icon { width: 16px; height: 16px; flex-basis: 16px; vertical-align: middle; display: inline-flex; margin-right: 5px; }
.app-nav-dropdown-trigger .app-nav-icon svg { width: 16px; height: 16px; }
.app-nav-dropdown-item:hover, .app-nav-dropdown-item.active {
    background-color: var(--surface-container-high);
}
.app-nav-dropdown-sep { height: 1px; background: var(--border-color); margin: 4px 0; }
.app-nav-dropdown-label {
    padding: 6px 15px 2px; font-size: 0.75em; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-muted); pointer-events: none;
}
.app-nav-dropdown-arrow { font-size: 0.7em; margin-left: 4px; opacity: 0.6; }

/* 4. UNIFIED BUTTON SYSTEM */
.btn {
    background-color: var(--btn-bg);
    color: var(--btn-text);
    border: 1px solid var(--btn-border);
    box-shadow: var(--btn-shadow);

    border-radius: var(--radius-md);
    padding: 0 12px;
    height: 30px;
    font-size: 0.90rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.4;
}
/* Links als Buttons: nie Link-Farbe erben */
a.btn, a.btn:visited, a.btn:hover { color: inherit; text-decoration: none; }

.btn:hover {
    border-color: var(--border-strong);
    background-color: var(--bg-panel);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 88, 190, 0.1);
}

.btn:active,
.btn.active {
    transform: translateY(0);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
    background-color: var(--border-color);
}

/* Primary */
.btn--primary,
a.btn--primary, a.btn--primary:visited {
    background-color: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border-color: transparent;
    box-shadow: var(--shadow-primary-sm);
}
.btn--primary:hover,
a.btn--primary:hover {
    background-color: var(--btn-primary-hover);
    color: var(--btn-primary-text);
    box-shadow: 0 2px 6px rgba(0, 88, 190, 0.35);
}

/* Secondary */
.btn--secondary, a.btn--secondary, a.btn--secondary:visited {
    background: var(--border-color, #e2e8f0);
    color: var(--text-main, #1a1a2e);
    border-color: transparent;
}
.btn--secondary:hover, a.btn--secondary:hover {
    background: var(--bg-panel, #d1d5db);
    color: var(--text-main);
}

/* Danger */
.btn--danger, a.btn--danger, a.btn--danger:visited {
    background: #ef4444;
    color: #fff;
    border-color: transparent;
}
.btn--danger:hover, a.btn--danger:hover { background: #dc2626; color: #fff; }

/* Outline */
.btn--outline {
    background: transparent;
    color: var(--btn-primary-bg);
    border-color: var(--btn-primary-bg);
}
.btn--outline:hover {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

/* Ghost (kein Border, kein Background) */
.btn--ghost {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: var(--text-muted);
}
.btn--ghost:hover {
    background: var(--surface-container-low, #f0f3ff);
    color: var(--text-main);
}

/* Size: Small */
.btn--sm { padding: 0 8px; height: 26px; font-size: 0.78rem; }

/* Size: Large (CTA Buttons) */
.btn--lg {
    padding: 12px 28px;
    height: auto;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px;
}

/* SVG Icons in Buttons */
.btn svg { width: 16px; height: 16px; stroke-width: 2.5; }
.btn .icon-svg { width: 18px; height: 18px; vertical-align: middle; fill: currentColor; flex-shrink: 0; }

/* 5. UNIFIED TABLE SYSTEM */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}
.data-table th,
.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}
.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-panel);
}
/* Compact (Help-Tabellen, Revision) */
.data-table--compact th,
.data-table--compact td { padding: 4px 8px; font-size: 0.8rem; }
/* Small (CMS-Listen) */
.data-table--sm th,
.data-table--sm td { padding: 6px 10px; font-size: 0.85rem; }
/* Striped rows */
.data-table--striped tbody tr:nth-child(even) td { background-color: var(--pvt-bg-even); }
.data-table--striped tbody tr:nth-child(odd) td  { background-color: var(--pvt-bg-odd); }
/* Row hover */
.data-table--hover tbody tr:hover td { background-color: var(--pvt-hover); }
/* Sticky header */
.data-table--sticky thead th { position: sticky; top: 0; z-index: 1; background: var(--pvt-lvl1-bg); color: var(--pvt-lvl1-txt); border-bottom: 1px solid var(--border-strong); }
/* Key-Value Layout (Label | Wert) */
.data-table--kv th { width: 180px; white-space: nowrap; background: var(--bg-panel); }
/* Header uppercase (CMS-Style) */
.data-table--caps th { text-transform: uppercase; letter-spacing: 0.03em; font-size: 0.8rem; }
/* No-wrap (Daten-Tabellen) */
.data-table--nowrap { white-space: nowrap; }
/* Code in Tabellen */
.data-table code { background: var(--bg-panel); padding: 1px 5px; border-radius: var(--radius-xs); font-size: 0.8rem; }

/* Toolbar Input (z.B. Date-Picker) */
.toolbar-input {
  height: 30px;
  padding: 0 8px;
  font-size: 0.90rem;
  border: 1px solid var(--btn-border);
  border-radius: 6px;
  background: var(--btn-bg);
  color: var(--btn-text);
  box-shadow: var(--btn-shadow);
  transition: all 0.15s ease-in-out;
}
.toolbar-input:focus {
  outline: none;
  border-color: var(--btn-primary-bg);
  box-shadow: var(--shadow-focus);
}

/* Theme Toggle Special */
#btn-theme-toggle .theme-icon { 
    color: var(--theme-icon-color); font-size: 1.3em; transition: transform 0.3s; 
}
#btn-theme-toggle:hover .theme-icon { transform: rotate(20deg); }

/* 5. WORKSPACE & TABLE CONTAINER */
.app-workspace {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    min-height: 0;
    padding: 0px 0px;
}
.app-workspace.loading {
    pointer-events: none;
    position: relative;
    min-height: 200px;
}
.app-workspace.loading > *:not(.page-loading-overlay) {
    opacity: 0.4;
    transition: opacity 0.15s;
}
.app-workspace.loading > .page-loading-overlay {
    opacity: 1;
}

#pivot-table-container {
    flex: 1;
    overflow: auto;
    width: 100%;
    position: relative;
    background-color: var(--bg-app);
    padding-top: 0; margin-top: 0;
}

/* ==========================================================================
   AUTH / USERMANAGEMENT STYLES
   ========================================================================== */

/* ── Guest Layout ────────────────────────────────────────────────────────── */
.app-shell--guest {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-panel);
}
.app-shell--guest .app-header {
  position: static;
  text-align: center;
  border: none;
  background: transparent;
  padding: 24px 0 0;
}
.app-workspace--guest {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  padding: 24px;
}

/* ── Auth Card ───────────────────────────────────────────────────────────── */
.auth-card {
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
}
.auth-card-title {
  margin: 0 0 8px;
  font-size: 1.4rem;
  color: var(--text-main);
}
.auth-subtitle {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Auth Form ───────────────────────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}
.auth-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.90rem;
  font-weight: 600;
  color: var(--text-main);
}
.auth-field--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auth-field-row {
  display: flex;
  gap: 12px;
}
.auth-field-row .auth-field {
  flex: 1;
}
.auth-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-app);
  color: var(--text-main);
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.auth-input:focus {
  outline: none;
  border-color: var(--btn-primary-bg);
  box-shadow: var(--shadow-focus);
}
.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.90rem;
  color: var(--text-main);
}

/* ── Auth Buttons ────────────────────────────────────────────────────────── */
.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--btn-border);
  border-radius: 6px;
  background: var(--btn-bg);
  color: var(--btn-text);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.auth-btn:hover {
  border-color: var(--border-strong);
}
.auth-btn--primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: var(--btn-primary-bg);
}
.auth-btn--primary:hover {
  background: var(--btn-primary-hover);
}
.auth-btn--danger {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}
.auth-btn--danger:hover {
  background: #dc2626;
}
.auth-btn--sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}
.auth-btn--small {
  padding: 4px 12px;
  font-size: 0.8rem;
}

/* ── OAuth Buttons ───────────────────────────────────────────────────────── */
.auth-btn--oauth {
  width: 100%;
  padding: 10px 16px;
  margin-top: 8px;
  background: #fff;
  color: #374151;
  border: 1px solid var(--border-color, #d1d5db);
  text-decoration: none;
  font-weight: 500;
}
.auth-btn--oauth:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}
.auth-btn--google {
  border-left: 3px solid #4285f4;
}
.auth-btn--microsoft {
  border-left: 3px solid #00a4ef;
}
.auth-divider {
  display: flex;
  align-items: center;
  margin: 16px 0 8px;
  color: #9ca3af;
  font-size: 0.85rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color, #e5e7eb);
}
.auth-divider span {
  padding: 0 12px;
}

/* ── OAuth Provider Profil ───────────────────────────────────────────────── */
.oauth-provider-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.oauth-provider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}
.oauth-provider-row:last-child {
  border-bottom: none;
}
.oauth-provider-label {
  font-weight: 600;
  min-width: 80px;
}

/* ── Auth Alerts ─────────────────────────────────────────────────────────── */
.auth-alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.auth-alert ul {
  margin: 0;
  padding-left: 18px;
}
.auth-alert--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.auth-alert--success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
[data-theme="dark"] .auth-alert--error {
  background: #2a1215;
  color: #fca5a5;
  border-color: #7f1d1d;
}
[data-theme="dark"] .auth-alert--success {
  background: #0f2417;
  color: #86efac;
  border-color: #14532d;
}

/* ── Auth Badges ─────────────────────────────────────────────────────────── */
.auth-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 10px;
  vertical-align: middle;
}
.auth-badge--success {
  background: #dcfce7;
  color: #166534;
}
.auth-badge--warning {
  background: #fef9c3;
  color: #854d0e;
}
.auth-badge--danger {
  background: #fee2e2;
  color: #991b1b;
}
.auth-badge--info {
  background: #dbeafe;
  color: #1e40af;
}
[data-theme="dark"] .auth-badge--success { background: #14532d; color: #86efac; }
[data-theme="dark"] .auth-badge--warning { background: #422006; color: #fde047; }
[data-theme="dark"] .auth-badge--danger  { background: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .auth-badge--info    { background: #1e3a5f; color: #93c5fd; }

/* ── Auth Footer / Links ─────────────────────────────────────────────────── */
.auth-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 0.90rem;
  color: var(--text-muted);
}
.auth-link {
  color: var(--btn-primary-bg);
  text-decoration: none;
  font-weight: 500;
}
.auth-link:hover {
  text-decoration: underline;
}

/* ── Auth Table ──────────────────────────────────────────────────────────── */
/* Legacy-Alias: auth-table → data-table --sticky --hover */
.auth-table { width: 100%; border-collapse: collapse; font-size: 0.90rem; }
.auth-table th, .auth-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border-color); }
.auth-table th { background: var(--bg-panel); font-weight: 600; color: var(--text-main); position: sticky; top: 0; z-index: 1; }
.auth-table tbody tr:hover { background: var(--pvt-hover); }
.user-alert-detail td {
  padding: 4px 12px 12px;
  background: var(--bg-panel);
}
.user-alert-detail .auth-table {
  font-size: 0.8rem;
}
.user-alert-detail .auth-table th {
  position: static;
}
.admin-filter-advanced {
  margin: 8px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-filter-advanced.hidden {
  display: none;
}

/* ── Profile Grid ────────────────────────────────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
  padding: 24px;
}
.profile-card {
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.profile-card .auth-form {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.profile-card .auth-form > button:last-child {
  margin-top: auto;
}
.profile-card h3 {
  margin: 0 0 16px;
  color: var(--text-main);
}
.profile-card--wide {
  grid-column: 1 / -1;
}

/* ── Admin Container ─────────────────────────────────────────────────────── */
.admin-container {
  padding: 24px;
}
.admin-toolbar {
  margin-bottom: 16px;
}
.admin-search {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.admin-pagination {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* ── User Menu Dropdown ──────────────────────────────────────────────────── */
.user-menu-container {
  position: relative;
  z-index: 1010; /* Ensures this stacking context is above other toolbar items */
}
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
}
.user-menu-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-dropdown {
  position: fixed;
  min-width: 200px;
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 10001;
  padding: 4px 0;
}
.user-menu-icon {
  display: inline-flex;
  align-items: center;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  flex-shrink: 0;
}
.user-menu-icon svg {
  width: 16px;
  height: 16px;
}
.user-menu-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.90rem;
  transition: background 0.1s;
}
.user-menu-item:hover {
  background: var(--pvt-hover);
}
.user-menu-item--danger {
  color: #ef4444;
}
.user-menu-item--primary {
  color: #2563eb;
  font-weight: 600;
}
.user-menu-sep {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

/* ── Gast-Banner ────────────────────────────────────────────────────────── */
.guest-banner-container {
  position: relative;
}
.guest-banner-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  cursor: pointer;
  padding: 4px 14px;
  border-radius: 6px;
  border: none;
  background: var(--btn-primary-bg, #2563eb);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.guest-banner-tab:hover {
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
.guest-banner-tab::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 100%
  );
  animation: shiny-sweep 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shiny-sweep {
  0%   { left: -100%; }
  50%  { left: 150%; }
  100% { left: 150%; }
}
.guest-banner-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 240px;
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 9000;
  padding: 12px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.guest-banner-dropdown.visible {
  display: block !important;
  opacity: 1;
  transform: translateY(0);
}
.guest-banner-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}
.guest-banner-actions {
  display: flex;
  gap: 8px;
}
.guest-banner-actions .btn {
  flex: 1;
  text-align: center;
  text-decoration: none;
  font-size: 13px;
}

/* ── Site-Toggle (Einstellungsseite) ────────────────────────────────────── */
.site-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
}
.site-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.site-toggle__slider {
  position: absolute;
  inset: 0;
  background: var(--border-color, #cbd5e1);
  border-radius: 22px;
  transition: background 0.2s;
}
.site-toggle__slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.site-toggle input:checked + .site-toggle__slider {
  background: var(--btn-primary-bg, #2563eb);
}
.site-toggle input:checked + .site-toggle__slider::before {
  transform: translateX(18px);
}

/* ── Audit Details ───────────────────────────────────────────────────────── */
.audit-details {
  font-size: 0.75rem;
  max-width: 300px;
  max-height: 80px;
  overflow: auto;
  margin: 0;
  background: var(--bg-panel);
  padding: 4px 8px;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Landing Page Komponenten ──────────────────────────────────────────── */
.landing-hero {
  text-align: center;
  padding: 80px 24px 64px;
  max-width: 720px;
  margin: 0 auto;
}
.landing-hero__title {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-main);
  margin: 0 0 20px;
  letter-spacing: -0.02em;
}
.landing-hero__subtitle {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 32px;
}

.landing-features {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 64px;
}
.landing-features__heading {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 40px;
}
.landing-features__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.landing-card {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 24px;
  background: var(--bg-app);
  transition: box-shadow 0.2s, transform 0.2s;
}
.landing-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.landing-card__icon {
  width: 48px;
  height: 48px;
  color: var(--btn-primary-bg);
  margin-bottom: 16px;
}
.landing-card__icon svg {
  width: 100%;
  height: 100%;
}
.landing-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 8px;
}
.landing-card__desc {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}

a.landing-card {
  text-decoration: none;
  color: inherit;
  display: block;
}
a.landing-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  cursor: pointer;
}

.landing-card__img-wrap {
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 6px;
  margin-bottom: 16px;
}
.landing-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.landing-card__tagline {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-main);
  margin: 0 0 8px;
  font-style: italic;
}

.landing-card__benefits {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding-left: 1.2em;
  margin: 12px 0 0;
  line-height: 1.6;
}

.landing-cta {
  text-align: center;
  padding: 64px 24px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-color);
}
.landing-cta__title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 12px;
}
.landing-cta__text {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 0 0 28px;
}
.landing-cta__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .landing-features__grid { grid-template-columns: 1fr; }
  .landing-hero__title { font-size: 1.8rem; }
  .landing-hero { padding: 48px 16px 40px; }
}

/* AGB-Seite: Guest-Layout Override – kein Zentrieren, normaler Scroll */
.app-shell--guest:has(.agb-wrapper) {
  justify-content: flex-start;
}
.app-workspace--guest:has(.agb-wrapper) {
  align-items: flex-start;
  justify-content: flex-start;
  overflow-y: auto;
}
.agb-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}
.agb-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}
.agb-logo-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.agb-logo-text {
  display: flex;
  flex-direction: column;
}
.agb-logo-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}
.agb-logo-company {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.agb-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0;
}
.agb-btn {
  padding: 8px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.agb-btn:hover {
  color: var(--text-main);
}
.agb-tabs {
  display: flex;
  gap: 4px;
}
.agb-tab {
  padding: 8px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}
.agb-tab:hover {
  color: var(--text-main);
}
.agb-tab--active {
  color: var(--text-main);
  border-bottom-color: var(--accent, #3b82f6);
  font-weight: 600;
}
.agb-content {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-main);
}
.agb-content h3 {
  font-size: 1.4em;
  margin: 0 0 16px;
}
.agb-content p {
  margin: 0 0 12px;
  font-size: 15px;
  padding: 0;
  color: var(--text-main);
}
.agb-content hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 24px 0;
}
.agb-content strong {
  color: var(--text-main);
}
.agb-content a {
  color: var(--accent, #3b82f6);
  text-decoration: underline;
}

/* AGB Druckansicht */
@media print {
  html, body {
    height: auto !important;
    width: auto !important;
    overflow: visible !important;
    font-size: 9pt !important;
    background: white !important;
    color: black !important;
  }
  body {
    display: block !important;
  }
  .app-shell,
  .app-shell--guest {
    display: block !important;
    height: auto !important;
    width: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: white !important;
  }
  .app-workspace,
  .app-workspace--guest {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
  }
  .app-header,
  .agb-toolbar {
    display: none !important;
  }
  .agb-logo {
    border-bottom: 1px solid #ccc !important;
  }
  .agb-logo-name {
    color: black !important;
  }
  .agb-logo-company {
    color: #555 !important;
  }
  .agb-wrapper {
    max-width: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: white !important;
  }
  .agb-content {
    font-size: 9pt !important;
    line-height: 1.5 !important;
    color: black !important;
  }
  .agb-content p {
    font-size: 9pt !important;
    padding: 0 !important;
    color: black !important;
  }
  .agb-content h3 {
    font-size: 11pt !important;
    color: black !important;
  }
  .agb-content strong {
    color: black !important;
  }
  .agb-content hr {
    border-top: 1px solid #ccc !important;
  }
  .agb-content a {
    color: black !important;
    text-decoration: none !important;
  }
  .agb-content a::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555;
  }
  .agb-content[style*="display:none"] {
    display: block !important;
    page-break-before: always;
  }
}

/* ==========================================================================
   WATCHLIST COMPONENTS
   ========================================================================== */

/* Dropdown auf StockDetail */
.wl-dropdown-container { position: relative; display: inline-block; }
.wl-dropdown-menu {
  background: var(--bg-app, #fff);
  border: 1px solid var(--border-color, #ddd);
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  min-width: 220px;
  z-index: 1000;
}
.wl-dropdown-list { max-height: 240px; overflow-y: auto; padding: 4px 8px; }
.wl-dropdown-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
  color: var(--text-main);
}
.wl-dropdown-label:hover { background: var(--bg-panel, #f5f7fa); }
.wl-dropdown-label input[type="checkbox"] { width: 15px; height: 15px; }
.wl-dropdown-empty { color: var(--text-muted); font-size: 13px; padding: 8px 4px; }

/* Notiz-Elemente in Pivot-Tabelle */
.wl-note-text { color: var(--text-muted); font-size: 12px; }
.wl-note-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 1px 6px;
}
.wl-note-btn:hover { background: var(--bg-panel); color: var(--text-main); }

/* Drag-Handle für Sortierung */
.wl-drag-handle {
  cursor: grab;
  color: var(--text-muted);
  padding: 0 6px;
  font-size: 14px;
  user-select: none;
}
.wl-drag-handle:active { cursor: grabbing; }

/* Checkbox für Bulk-Entfernen */
.wl-stock-checkbox { width: 15px; height: 15px; cursor: pointer; }

/* Select in Toolbar */
.app-select {
  padding: 4px 8px;
  border: 1px solid var(--btn-border, #cbd5e1);
  border-radius: 4px;
  background: var(--btn-bg, #fff);
  color: var(--btn-text, #1a1a2e);
  font-size: 13px;
  cursor: pointer;
}


/* ── Toast-Benachrichtigungen ─────────────────────────────────────── */
.app-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  max-width: 400px;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateX(40px);
  transition: opacity .3s, transform .3s;
  pointer-events: auto;
}
.app-toast-visible {
  opacity: 1;
  transform: translateX(0);
}
.app-toast-error {
  background: #dc2626;
  color: #fff;
}

/* ── Confirm-Dialog (Ersatz für native confirm()) ──────────────── */
.app-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: app-confirm-fadein .15s ease;
}
.app-confirm-overlay.app-confirm--closing {
  opacity: 0;
  transition: opacity .15s ease;
}
.app-confirm-dialog {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 20px 24px;
  min-width: 320px;
  max-width: 440px;
  animation: app-confirm-scalein .15s ease;
}
.app-confirm-body { margin-bottom: 20px; color: var(--text-main); line-height: 1.5; }
.app-confirm-body p { margin: 0 0 4px; }
.app-confirm-body p:last-child { margin-bottom: 0; }
.app-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.app-confirm-btn {
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: background .12s, box-shadow .12s;
}
.app-confirm-cancel {
  background: var(--btn-bg);
  color: var(--btn-text);
}
.app-confirm-cancel:hover { background: var(--surface-container-low); }
.app-confirm-ok {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: var(--btn-primary-bg);
}
.app-confirm-ok:hover { background: var(--btn-primary-hover); }
.app-confirm-ok--danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.app-confirm-ok--danger:hover { background: #b91c1c; }
@keyframes app-confirm-fadein { from { opacity: 0 } to { opacity: 1 } }
@keyframes app-confirm-scalein { from { transform: scale(0.95); opacity: 0 } to { transform: scale(1); opacity: 1 } }

[data-theme="dark"] .signal-preview {
  background: var(--bg-secondary, #1e293b);
}


/* ==========================================================================
   SITE HEADER (Top-Level Navigation)
   ========================================================================== */

.site-header {
    position: sticky; /* Stays sticky, more robust than fixed for this layout */
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-xs);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .site-header {
    background: rgba(18, 19, 24, 0.85); /* Matches old zone-nav dark */
    box-shadow: none;
}

.site-header-inner {
    max-width: 1280px; /* Corresponds to max-w-7xl */
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    height: 5rem; /* 80px */
}

.site-header-brand {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-main);
    text-decoration: none;
    white-space: nowrap;
}

.site-header-nav {
    display: flex;
    align-items: center;
    gap: 2rem; /* space-x-8 */
}

.site-header-nav-item {
    display: inline-flex;
    align-items: center;
    padding-bottom: 0.25rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.site-header-nav-item:hover {
    color: var(--text-main);
}

.site-header-nav-item.active {
    color: var(--btn-primary-bg);
    font-weight: 600;
    border-bottom-color: var(--btn-primary-bg);
}

.site-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-header-actions #btn-theme-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm, 4px);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    margin-left: auto;
}

.site-header-actions #btn-theme-toggle:hover {
    background: var(--hover-bg, rgba(0,0,0,0.05));
}

/* Adjust app-shell padding to account for fixed header height */
body:has(.site-header) .app-shell {
    height: calc(100vh - 5rem);
}


/* ==========================================================================
   GLOBALE FEINSCHLIFFE (MD3 Redesign)
   ========================================================================== */

:focus-visible {
    outline: 2px solid var(--btn-primary-bg);
    outline-offset: 2px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
}
