/* ===========================================
   STREAMLINED UNIFIED STYLES FÃœR TEACHER & STUDENT
   7-FARBEN-PALETTE SYSTEM (Phase 1: Foundation)
   =========================================== */

/* === FONT: Figtree (lokal, kein Tracking) === */
@import url('fonts.css');

/* === DESIGN TOKENS (consolidated â€” 2026-05-22) === */
@import url('premium-design-tokens.css');

/* === BASE RESET + LAYOUT + TYPOGRAPHY === */
@import url('base.css');

/* === UI-BASISKLASSEN (.card, .banner â€” wiederkehrende Container) === */
/* MUSS vor allen seitenspezifischen Komponenten kommen damit page-CSS
   ueberschreiben kann. Siehe components.css Header fuer Lade-Reihenfolge. */
@import url('components.css');

/* === KOMPONENTEN === */
@import url('3-calendar-panels.css');
@import url('panels.css');
@import url('homepage.css');
@import url('about-us.css');
@import url('catalog-teachers.css');

/* === PREMIUM COMPONENTS === */
@import url('navbar.css');
@import url('premium-auth.css');
/* premium-dashboard.css â†’ loaded directly by each dashboard HTML page */
@import url('premium-calendar.css');

/* === KOMPONENTEN (Phase 4+) === */
/* [5c1] 2026-05-23: dialog-base.css + custom-dialogs.css â†’ dialogs.css gemerged */
@import url('dialogs.css');
/* [5c2] 2026-05-23: calendar-keyboard-nav.css nach css/calendar-extras.css verschoben
   (jetzt nur noch auf Kalender-Seiten via <link> geladen). */

/* === UTILITIES (Phase 5 â€” Layout-Helfer .u-*) === */
@import url('utilities.css');

/* === KALENDER LAYOUT (wk-view / wk-sidebar / wk-main / grid-scroll) === */
/* [1/4] 2026-05-22: Portiert aus HTML-Projekt â€” nur auf Kalender-Seiten aktiv */
@import url('week-view-layout.css');

/* ===========================================
   APP-DESIGN TOKEN-OVERRIDES ("Minimal/Flat Design")
   ===========================================
   âš ï¸ ARCHITEKTUR â€” NICHT mit den anderen Token-Files "mergen"!

   Das Token-System hat DREI bewusste Rendering-Kontexte:

   1. Premium-Auth/Landing (index/login/register.html):
      laden NUR premium-design-tokens.css  -> Premium-Werte.
   2. Dashboards (teacher/student-dashboard.html, lessons-overview.html):
      laden combined-all.css + premium-design-tokens.css DANACH
      -> Premium-Werte gewinnen (zuletzt geladen).
   3. App-Seiten (Kalender, Profil, Wallet, Katalog, Messages):
      laden NUR combined-all.css -> dieser inline :root-Block (kommt NACH
      dem premium-Import in Z.11) gewinnt -> flaches/minimales Design.

   Deshalb sind Tokens wie --radius-sm BEWUSST kontextabhaengig:
   App-Seiten 2px (flach), Dashboards/Premium 4px (weicher). Das ist
   KEIN Bug. Ein Voll-Merge wuerde die Flat-vs-Premium-Unterscheidung
   zerstoeren. Details: CSS-AUDIT.md Abschnitt 2 + progress phase2.
   =========================================== */
:root {
    /* Typography - Minimal Design
       [5/5] 2026-05-22: Font auf Figtree (= HTML-Projekt Standard) umgestellt.
       --sp-N Spacing-Aliase (4px..128px) sind in premium-design-tokens.css B14
       definiert â€” Angleichung der Spacing-Namen bereits via Alias erledigt. */
    --font-family-base: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', Monaco, Consolas, monospace;
    /* @deprecated after WP-3 [3-4/6] migration â€” use --text-caption / --text-body / --text-heading / --text-display */
    --font-size-xs:   0.75rem;  /* 12px â€” @deprecated, use --text-caption */
    --font-size-sm:   0.875rem; /* 14px â€” @deprecated, use --text-caption (compact context) */
    --font-size-base: 1rem;     /* 16px â€” @deprecated, use --text-body (body{} still reads this) */
    --font-size-lg:   1rem;     /* 16px â€” @deprecated, use --text-body */
    --font-size-xl:   1.125rem; /* @deprecated, use --text-heading (nearest scale step) */
    --font-size-2xl:  1.5rem;   /* @deprecated */
    --font-size-3xl:  1.875rem; /* @deprecated, use --text-display (nearest scale step) */
    --font-size-4xl:  2.25rem;  /* @deprecated, use --text-display */
    
    /* Spacing - Minimal Design */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: clamp(1.25rem, 3vw, 3.125rem);
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --gutter: clamp(1.25rem, 3vw, 3.125rem);
    
    /* Border Radius - Minimal Design
       NOTE: --radius-lg kept at 16px to match premium-design-tokens.css â€”
       premium-nav.css, premium-auth.css, premium-calendar.css all use it
       for card/dropdown corners. Other radii intentionally 0 (flat design). */
    --radius-sm: 2px;
    --radius-base: 0;
    --radius-lg: 16px;  /* was 0; premium components need rounded corners */
    --radius-xl: 0;
    --radius-normal: 0;  /* still referenced internally in combined-all.css */
    --radius-full: 50%;

    /* Shadows - Minimal Design (intentionally flatter than premium-design-tokens.css) */
    --shadow-sm: 0 0 6px rgba(0, 0, 0, 0.1);
    --shadow-base: 0 0 6px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 0 6px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 4px 16px rgba(0, 0, 0, 0.2);
    --border-thin: 1px;  /* was 0.5px; sub-pixel borders are invisible on non-retina */

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* === GLOBAL RESET & BASE === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    font-feature-settings: normal;
    font-variation-settings: normal;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: 2;
    color: var(--text-primary);
    /* background removed - each page sets via body class */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===========================================
   PAGE BACKGROUND UTILITIES
   Standardized backgrounds for all page types
   =========================================== */

/* Default: weiÃŸer Hintergrund fÃ¼r alle App-Seiten (Kalender, Wallet, Messages, Profile â€¦)
   WP5 [8/8]+: page-green-gradient â†’ page-app, #F8DE00 â†’ var(--bg-surface) */
body.page-app {
    background: #469ea0;   /* --neutral-0 = #ffffff */
    min-height: 100vh;
    padding-bottom: 40px;
}

/* Light gray background (legacy support) */
body.page-light-gray {
    background-color: var(--neutral-50);
    min-height: 100vh;
}

/* White background (minimal pages) */
body.page-white {
    background-color: var(--bg-surface);
    min-height: 100vh;
}

/* Dark-Mode: Seiten-Leinwand abdunkeln (Light-Mode bleibt unberuehrt) */
@media (prefers-color-scheme: dark) {
    /* Globaler Fallback: html-Element deckt Seiten ab, deren body keine Klasse hat
       (z.B. catalog-teachers.html). Body-Spezifische Regeln darunter kÃ¶nnen Ã¼berschreiben. */
    html {
        background-color: var(--bg-page, #0a0e1a);
        color-scheme: dark;
    }
    body {
        background-color: var(--bg-page, #0a0e1a);
        color: var(--text-primary, #f9fafb);
    }

    body.page-white,
    body.page-light-gray,
    body.page-app,
    body.dashboard-page,
    body.auth-page,
    body.legal-page,
    body.about-us-page,
    body.setup-admin-page,
    body.homepage {
        background-color: var(--bg-page, #0a0e1a);
    }

    /* Legacy-Flaechen/Rahmen-Tokens flippen (premium-design-tokens.css deckt
       text/border-default bereits ab; diese hier bleiben sonst hell). Wirkt
       zentral auf alle token-basierten Legacy-Seiten + Karten (.card). */
    :root {
        --bg-page:            #0a0e1a;
        --bg-card:            #111827;
        --bg-input:           #111827;
        --border-light:       #1f2937;
        /* --card-bg / --card-border-color removed WP5 [1/8] â€” 0 consumers */
        --color-bg-primary:   #111827;
        --color-bg-secondary: #1f2937;
        --color-bg-hover:     #1f2937;

        /* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
           KALENDER â€” Status-Tokens dark-aware
           Cells/Panels nutzen abgeleitete --cell-*/--panel-*-Tokens, die
           wiederum auf diese Roh-Farben verweisen. Solide Akzente
           (--color-green-primary, --color-blue-primary, --color-yellow-amber,
           --color-purple-personal, --color-green-calendar, --color-blue-cyan)
           BLEIBEN â€” diese sind als kontrastreiche Status-Marker gewollt
           und werden im Dark-Mode auf dunklem Grund noch deutlicher.
           â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

        /* Cell-Backgrounds (hell -> dunkle transluzent) */
        --color-green-light:  rgba(16, 185, 129, 0.18);   /* available */
        --color-blue-light:   rgba(59, 130, 246, 0.18);   /* marked-booking */
        --color-yellow-light: rgba(245, 158, 11, 0.18);   /* timeout */
        --color-red-light:    rgba(239, 68, 68, 0.18);    /* marked-deletion */
        --color-red-pale:     rgba(239, 68, 68, 0.18);    /* blocked */
        --color-purple-light: rgba(168, 85, 247, 0.18);   /* personal */

        /* Cell-Borders (dunkler/saturierter) */
        --color-green-border:  rgba(16, 185, 129, 0.55);
        --color-yellow-border: rgba(245, 158, 11, 0.55);
        --color-red-border:    rgba(239, 68, 68, 0.55);
        --color-purple-border: rgba(168, 85, 247, 0.55);

        /* Cell-Text (hell auf dunklen Cell-Backgrounds) */
        --color-green-dark:   #6ee7b7;
        --color-green-darker: #34d399;
        --color-blue-text:    #93c5fd;
        --color-blue-dark:    #60a5fa;
        --color-yellow-dark:  #fcd34d;
        --color-red-dark:     #fca5a5;
        --color-red-darker:   #f87171;
        --color-purple-text:  #d8b4fe;

        /* Calendar Modern Palette (Google-inspired) â€” gleiches Schema */
        --color-calendar-available-bg-light: rgba(52, 168, 83, 0.18);
        --color-calendar-available-text:     #6ee7b7;
        --color-calendar-booked-bg-light:    rgba(234, 67, 53, 0.18);
        --color-calendar-booked-text:        #fca5a5;
        --color-calendar-timeout-bg-light:   rgba(251, 188, 4, 0.18);
        --color-calendar-timeout-text:       #fcd34d;
        --color-calendar-blocked-bg-light:   rgba(234, 67, 53, 0.18);
        --color-calendar-blocked-text:       #fca5a5;
        --color-calendar-personal-bg-light:  rgba(161, 66, 244, 0.18);
        --color-calendar-personal-text:      #d8b4fe;
        --color-calendar-confirmed-bg-light: rgba(66, 133, 244, 0.18);
        --color-calendar-confirmed-text:     #93c5fd;

        /* Milk = innerer Off-White-Hintergrund (z.B. Such-Hover) */
        --color-milk: #1f2937;

        /* --color-white wird bewusst NICHT geflippt: es wird in
           combined-all.css auch als color: var(--neutral-0) fuer
           Text auf farbigen Hintergruenden (Navbar-Buttons etc.) genutzt.
           Kalender-spezifische Weiss-Hintergruende werden stattdessen
           mit expliziten !important-Overrides in 3-calendar-panels.css
           und universal-calendar.css behandelt. */

        /* Sticky Calendar-Header dark-Mode: --neutral-100 calendar-scoped Override
           (siehe Regel weiter unten ausserhalb des :root-Blocks) */

        /* WP5 [8/8]: --gray-* Dark-Mode-Shims entfernt. Kein Component nutzt var(--gray-*). */
    }

    /* Sticky Calendar-Header Dark Mode â€” Fallback-Werte.
       Werden im Kalender-Kontext von den Regeln ab Z.~640 (3-calendar-panels-Code)
       Ã¼berschrieben, die thead th auf var(--dark-surface-navy) setzen.
       Gelten als Fallback fÃ¼r Nicht-Kalender-Seiten mit #calendar-table. */
    .calendar #calendar-table thead th,
    .calendar #calendar-table thead th:first-child,
    .calendar #calendar-table tbody tr td:first-child {
        background-color: var(--neutral-800, #1f2937) !important;
        color: var(--neutral-50, #f9fafb) !important;
    }

    /* Kalender-Tabelle Hintergrund (transparente Zellen erben Body-Dark sonst #fff) */
    #calendar-table {
        background-color: var(--bg-page, #0a0e1a);
    }
    #calendar-table tbody tr td {
        border-color: var(--border-light, #1f2937);
    }

    /* Sidebar (Kalender + Dashboard) */
    #sidebar {
        background: #111827;
        border-color: #1f2937;
    }
    #sidebar button:not(.button-standard-black):not(.cal-week-nav-btn):not(.tz-clock-btn) {
        background: #1f2937;
        color: #f9fafb;
        border-color: #374151;
    }
    #sidebar label,
    #sidebar h3,
    #sidebar h4,
    #sidebar p,
    #sidebar span:not([class*="badge"]):not([class*="status"]) {
        color: #d1d5db;
    }

    /* â”€â”€ Form-Section (background: var(--neutral-0) = always white) â”€â”€â”€â”€â”€â”€â”€ */
    .form-section {
        background: var(--bg-surface, #111827);
        border-color: var(--border-default, #1f2937);
    }
    .form-section h2 {
        color: var(--text-primary, #f9fafb);
        border-bottom-color: var(--border-default, #1f2937);
    }

    /* â”€â”€ Navbar drawer link: explicit background (avoid UA button appearance) */
    .navbar-drawer-link {
        background: var(--neutral-900, #111827) !important;
        -webkit-appearance: none;
        appearance: none;
    }

    /* â”€â”€ wallet-date-filter.js: preset-btn (JS-injected, background: white) */
    .preset-btn {
        background: var(--bg-subtle, #1f2937) !important;
        border-color: var(--border-strong, #374151) !important;
        color: var(--text-secondary, #d1d5db) !important;
    }
    .preset-btn:hover {
        background: var(--neutral-700, #374151) !important;
        color: var(--text-primary, #f9fafb) !important;
        border-color: var(--accent, #5b87cc) !important;
    }
    .preset-btn.active {
        background: var(--accent, #5b87cc) !important;
        border-color: var(--accent, #5b87cc) !important;
        color: var(--neutral-0, #ffffff) !important;
    }

    /* â”€â”€ wallet-teacher-filter.js: filter-info (JS-injected, background: #F9FAFB) */
    .filter-info {
        background: var(--bg-subtle, #1f2937) !important;
        border-color: var(--border-strong, #374151) !important;
        color: var(--text-muted, #9ca3af) !important;
    }

    /* â”€â”€ payment-ui-components.js: info-card (JS-injected, hardcoded light) */
    .info-card-blue {
        background: rgba(59, 130, 246, 0.12) !important;
        color: #93c5fd !important;
    }
    .info-card-blue i { color: #60a5fa !important; }
    .info-card-green {
        background: rgba(16, 185, 129, 0.12) !important;
        color: #6ee7b7 !important;
    }
    .info-card-green i { color: #34d399 !important; }
    .info-card-warning {
        background: rgba(245, 158, 11, 0.12) !important;
        color: #fcd34d !important;
    }
    .info-card-warning i { color: #fbbf24 !important; }

    /* â”€â”€ shared-chat-utils.js: service-message (inline style: background #f5f5f5) */
    .service-message {
        background: var(--bg-subtle, #1f2937) !important;
        color: var(--text-muted, #9ca3af) !important;
        border-left-color: var(--accent, #5b87cc) !important;
    }
}

/* === USER TYPE VARIANTS (Angepasst auf 7-Farben-Palette) === */
body.teacher {
    --current-primary: var(--success-text);
    --current-primary-dark: var(--success-hover);
    --current-accent: var(--accent);
}

body.student {
    --current-primary: var(--success-text);
    --current-primary-dark: var(--success-hover);
    --current-accent: var(--accent);
}

body:not(.teacher):not(.student) {
    --current-primary: var(--success-text);
    --current-primary-dark: var(--success-hover);
    --current-accent: var(--accent);
}

/* === LAYOUT === */
#content {
    display: flex;
    min-height: calc(100vh - 5rem);
    background-color: var(--bg-page);
    gap: 4px;
    align-items: flex-start; /* Wichtig fÃ¼r sticky sidebar */
    overflow: visible; /* Erlaubt sticky positioning */
}

.container, main {
    max-width: 50rem;
    margin: 0 auto;
    padding: var(--space-6);
}

.container.profile {
    max-width: 75rem;
}

/* === HEADER & NAVIGATION === */
header {
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    text-align: unset;
}

header h1 {
    font-size: clamp(var(--font-size-xl), 4vw, var(--font-size-3xl));
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: var(--space-2);
}

nav:not(.lang-nav) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
    justify-content: flex-start;
    margin-top: var(--space-4);
}

nav:not(.lang-nav) a, nav:not(.lang-nav) button {
    margin: 0;
    padding: 0.625rem 1.25rem;
    background: var(--bg-surface); /* S115: #FFFFFF â†’ semantic */
    color: var(--text-primary);    /* S115: #2B2B2B â†’ semantic */
    border: 1px solid transparent;
    border-radius: 0;
    font-weight: 700;
    text-decoration: none;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

nav:not(.lang-nav) a:hover, nav:not(.lang-nav) button:hover {
    background: var(--bg-surface); /* S115: semantic */
    color: var(--text-primary);    /* S115: semantic */
    border-color: transparent;
}

nav:not(.lang-nav) a.active, nav:not(.lang-nav) button.active {
    background: var(--bg-surface);         /* S115: semantic */
    color: var(--text-primary);            /* S115: semantic */
    border: 2px solid var(--text-primary); /* S115: semantic */
}

/* âœ… Navbar Scrollbar Styling fÃ¼r horizontales Scrollen */
nav:not(.lang-nav) > div:first-child {
    /* Scrollbar auf Webkit-Browsern verstecken aber scrollen erlauben */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

nav:not(.lang-nav) > div:first-child::-webkit-scrollbar {
    height: 4px;
}

nav:not(.lang-nav) > div:first-child::-webkit-scrollbar-track {
    background: transparent;
}

nav:not(.lang-nav) > div:first-child::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

nav:not(.lang-nav) > div:first-child::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* âœ… Navbar Buttons - Kompakteres Design */
nav:not(.lang-nav) a.primary-btn, nav:not(.lang-nav) button.primary-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* âœ… Responsive: Mobile View */
@media (max-width: 768px) {
    nav:not(.lang-nav) {
        gap: 6px;
        padding: 6px 8px !important;
    }

    nav:not(.lang-nav) a.primary-btn, nav:not(.lang-nav) button.primary-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

header #edit-profile-btn {
    display: inline-block;
    margin: var(--space-4) 0 0 0;
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
    background: #FFFFFF;
    color: #2B2B2B;
    border: 1px solid #2B2B2B;
    backdrop-filter: none;
    transition: all var(--transition-base);
    position: relative;
    left: calc(-50% + var(--space-6));
}

header #edit-profile-btn:hover {
    background: #2B2B2B;
    color: #FFFFFF;
    border-color: #2B2B2B;
    transform: translateY(-1px);
}

/* === HOMEPAGE === */
body.homepage {
    background: var(--neutral-50);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.homepage header {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    background: #FFFFFF;
    color: #2B2B2B;
}

.homepage header h1 {
    font-size: clamp(var(--font-size-4xl), 8vw, 5rem);
    font-weight: 800;
    margin-bottom: var(--space-4);
    text-shadow: none;
    color: #2B2B2B;
}

.homepage header p {
    font-size: clamp(var(--font-size-lg), 3vw, var(--font-size-2xl));
    font-weight: 400;
    opacity: 0.7;
    color: #616161;
}

.homepage main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12) var(--space-6);
    gap: var(--space-6);
    max-width: 40rem;
}

.homepage footer {
    text-align: center;
    padding: var(--space-8);
    color: var(--neutral-500);
    font-size: var(--font-size-sm);
}

/* === BUTTONS - Hierarchical Minimal Design === */

/* Base Button Styles */
button, .btn, .primary-btn, .secondary-btn, .tertiary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-base);
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-base);
    white-space: nowrap;
    user-select: none;
    position: relative;
    min-height: 44px;
    border-radius: 0;
}

/* Primary Buttons - Main Actions */
.primary-btn, button.primary-btn, button[type="submit"] {
    background: #2B2B2B;
    color: #FFFFFF;
    border: 2px solid #2B2B2B;
    font-weight: 600;
}

.primary-btn:hover, button.primary-btn:hover, button[type="submit"]:hover {
    background: #424242;
    border-color: #424242;
}

.primary-btn:active, button.primary-btn:active, button[type="submit"]:active {
    background: #1a1a1a;
    border-color: #1a1a1a;
}

/* Secondary Buttons - Secondary Actions */
.secondary-btn, button.secondary-btn {
    background: var(--bg-surface); /* S115: #FFFFFF â†’ semantic */
    color: var(--text-primary);    /* S115: #2B2B2B â†’ semantic */
    border: 1px solid var(--text-primary); /* S115: #2B2B2B â†’ semantic */
    font-weight: 500;
}

.secondary-btn:hover, button.secondary-btn:hover {
    background: var(--text-primary); /* S115: #2B2B2B â†’ semantic (invertiert) */
    color: var(--bg-surface);        /* S115: #FFFFFF â†’ semantic */
}

.secondary-btn:active, button.secondary-btn:active {
    background: #1a1a1a;
    color: #FFFFFF;
}

/* Tertiary Buttons - Minimal Actions */
.tertiary-btn, button.tertiary-btn {
    background: transparent;
    color: #616161;
    border: none;
    padding: 0.5rem 1rem;
    text-decoration: underline;
    font-weight: 400;
}

.tertiary-btn:hover, button.tertiary-btn:hover {
    color: #2B2B2B;
    text-decoration: none;
}

/* Disabled State */
button:disabled, .btn:disabled,
.primary-btn:disabled, .secondary-btn:disabled, .tertiary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Button with Icon */
.btn-with-icon {
    gap: 0.5rem;
}

.btn-with-icon svg {
    width: 16px;
    height: 16px;
}

/* === BUTTON STATES === */

/* Loading State */
.btn-loading, button.loading {
    color: transparent;
    pointer-events: none;
    position: relative;
}

.btn-loading::after, button.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(189, 189, 189, 0.3);
    border-top-color: #2B2B2B;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.primary-btn.btn-loading::after, button.primary-btn.loading::after {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #FFFFFF;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success State */
.btn-success, button.success {
    background: #A8C5B8;
    color: #2B2B2B;
    border-color: #A8C5B8;
}

.btn-success:hover, button.success:hover {
    background: #8FB0A1;
    border-color: #8FB0A1;
}

/* Error State */
.btn-error, button.error {
    background: #C5A8A8;
    color: #2B2B2B;
    border-color: #C5A8A8;
}

.btn-error:hover, button.error:hover {
    background: #B09090;
    border-color: #B09090;
}

/* Warning State */
.btn-warning, button.warning {
    background: #C5BDA8;
    color: #2B2B2B;
    border-color: #C5BDA8;
}

/* === SIDEBAR === */
#sidebar {
    width: 300px;
    min-width: 300px;
    padding: var(--space-4);
    background: var(--bg-surface); /* S114: neutral-0 â†’ semantic token (dark-mode-aware) */
    border-radius: 0;
    box-shadow: none;
    border: 1px solid var(--border-default); /* S115: #EEEEEE â†’ semantic (wk-sidebar Ã¼berschreibt mit none) */
    height: auto; /* Automatische HÃ¶he basierend auf Inhalt */
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 20px !important;
    align-self: flex-start !important;
    max-height: calc(100vh - 40px) !important;
    overflow-y: auto !important;
    z-index: 100 !important;
    font-size: 14px; /* S146: Sidebar-SchriftgrÃ¶ÃŸe erhÃ¶ht (war --font-size-sm=13px) */
}

#sidebar button:not(.button-standard-black):not(.cal-week-nav-btn):not(.tz-clock-btn) {
    width: 100%;
    min-height: 44px;
    padding: 10px 16px;
    margin-bottom: var(--space-2);
    border-radius: 5px;
    background: #a4d1ff; /*var(--bg-subtle);  S114: neutral-0 â†’ semantic token (dark-mode-aware) */
    color: var(--text-primary);   /* S114: neutral-800 â†’ semantic token (dark-mode-aware) */
    border: 3px solid var(--border-default); /* Premium: 2px neutral-600 â†’ 1px subtle border */
    font-size: 16px; /* S146: war --font-size-sm (13px) */
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

#sidebar button.active:not(.button-standard-black):not(.cal-week-nav-btn) {
    background: var(--neutral-900);
    color: var(--neutral-0);
    box-shadow: var(--shadow-sm);
}

#sidebar button:active:not(:disabled):not(.button-standard-black):not(.cal-week-nav-btn) {
    background: var(--neutral-200);
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

#sidebar button:focus-visible:not(.button-standard-black):not(.cal-week-nav-btn) {
    outline: none;
    box-shadow: 0 0 0 3px rgba(4, 170, 109, 0.3);
}

#sidebar button:disabled:not(.button-standard-black):not(.cal-week-nav-btn) {
    opacity: 0.4;
    cursor: not-allowed;
}

@media (hover: hover) and (pointer: fine) {
    #sidebar button:hover:not(.active):not(:disabled):not(.button-standard-black):not(.cal-week-nav-btn) {
        background: var(--neutral-100);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }
}
@media (hover: hover) and (pointer: fine) and (prefers-color-scheme: dark) {
    #sidebar button:hover:not(.active):not(:disabled):not(.button-standard-black):not(.cal-week-nav-btn) {
        background: #374151; /* S115: dark hover â€” 1 shade lighter than --bg-subtle (#1f2937) */
    }
}

#sidebar label {
    display: block;
    margin: var(--space-5) 0 var(--space-3) 0;
    font-weight: 600;
    font-size: 14px; /* S146: war --font-size-sm (13px) */
    color: var(--neutral-700);
}

/* Student list row labels must flex horizontally â€” override the block label above */
#sidebar .teacher-sidebar-student-label {
    display: flex;
    align-items: center;
    margin: 0;
    font-weight: normal;
    color: inherit;
}

/* === SIDEBAR: BOOKING SAVE BUTTON ===
   Legacy-Styling â€” wird umgangen wenn .button-standard-black gesetzt ist */
#btnSaveBooking:not(.button-standard-black) {
    background: var(--accent);
    color: var(--neutral-0);
    border-color: var(--accent);
}
@media (hover: hover) and (pointer: fine) {
    #btnSaveBooking:hover:not(:disabled):not(.button-standard-black) {
        background: var(--accent-hover);
        border-color: var(--accent-hover);
        color: var(--neutral-0);
        transform: translateY(-1px);
    }
}

/* === SIDEBAR: STATUS MODE BUTTONS (available / blocked / personal) ===
   Legacy-Styling â€” wird umgangen wenn .button-standard-black gesetzt ist */
#btn-available:not(.button-standard-black) {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
}
#btn-available.active:not(.button-standard-black) {
    background: var(--success-text);
    color: var(--neutral-0);
    border-color: var(--success-text);
}
@media (hover: hover) and (pointer: fine) {
    #btn-available:hover:not(.active):not(:disabled):not(.button-standard-black) {
        background: var(--success-text);
        color: var(--neutral-0);
        border-color: var(--success-text);
    }
}

#btn-blocked:not(.button-standard-black) {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-color: var(--warning-border);
}
#btn-blocked.active:not(.button-standard-black) {
    background: var(--warn);
    color: var(--neutral-0);
    border-color: var(--warn);
}
@media (hover: hover) and (pointer: fine) {
    #btn-blocked:hover:not(.active):not(:disabled):not(.button-standard-black) {
        background: var(--warn);
        color: var(--neutral-0);
        border-color: var(--warn);
    }
}

#btn-personal:not(.button-standard-black) {
    background: var(--cal-personal-bg);
    color: var(--cal-personal-text);
    border-color: var(--cal-personal-text);
}
#btn-personal.active:not(.button-standard-black) {
    background: var(--cal-personal-text);
    color: var(--neutral-0);
    border-color: var(--cal-personal-text);
}
@media (hover: hover) and (pointer: fine) {
    #btn-personal:hover:not(.active):not(:disabled):not(.button-standard-black) {
        background: var(--cal-personal-text);
        color: var(--neutral-0);
        border-color: var(--cal-personal-text);
    }
}

/* === SIDEBAR: WEEK NAV BUTTONS (Legacy â€” wird umgangen wenn .button-standard-black gesetzt ist) === */
#sidebar .cal-week-nav-btn:not(.button-standard-black) {
    width: auto;
    min-height: 32px;
    padding: 4px 8px;
    margin-bottom: 0;
    background: var(--bg-surface); /* S115: neutral-0 â†’ semantic (dark-mode-aware) */
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    box-shadow: none;
}
@media (hover: hover) and (pointer: fine) {
    #sidebar .cal-week-nav-btn:hover:not(:disabled):not(.button-standard-black) {
        background: var(--neutral-100);
        border-color: var(--text-muted);
        transform: none;
        box-shadow: none;
    }
}
@media (hover: hover) and (pointer: fine) and (prefers-color-scheme: dark) {
    #sidebar .cal-week-nav-btn:hover:not(:disabled):not(.button-standard-black) {
        background: #374151; /* S115: dark hover */
        border-color: var(--text-muted);
    }
}

/* === MAIN CONTENT === */
#main {
    flex: 1;
    padding-right: var(--space-8);
    padding-bottom: var(--space-8);
    padding-top: 0;
    padding-left: 0;
    background: var(--bg-surface); /* S114: neutral-0 â†’ semantic token (dark-mode-aware) */
    border-radius: var(--radius-normal);
    box-shadow: none;
    border: var(--border-thin, 0.5px) solid var(--neutral-200);
    margin: 0;
    min-width: 0;
    overflow-x: auto;
}

.container.profile #main,
.section #main {
    min-width: 53.125rem;
    overflow-x: auto;
    padding: var(--space-4);
}

/* === CALENDAR - Minimal Design === */
/* [3/4] 2026-05-22: Scroll-Verantwortung liegt jetzt bei .grid-scroll (week-view-layout.css).
   #calendar-container ist nur noch Positionierungs-Anker fuer Panels/Timeline. */
#calendar-container {
    position: relative;
}

/* Scrollbar-Styles jetzt auf .grid-scroll (in css/week-view-layout.css) */

/* === TABLES - Minimal Design === */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: var(--space-6);
    overflow: visible;
    font-size: var(--font-size-xs);
}

/* Calendar table: collapse required for position:sticky on th to work without gaps */
#calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    overflow: visible;  /* FIX: overflow:hidden verhindert sticky positioning! */
    border: none;
    margin-top: 0;
    font-size: var(--font-size-xs);
}

/* === CALENDAR TABLE HEADER + CELLS === */

/* thead selbst ist KEIN sticky-Element â€” table sections koennen
   nicht sticky sein. Sticky gilt nur auf th/td-Ebene. */
#calendar-table thead {
    background: var(--bg-subtle); /* S114: neutral-100 â†’ semantic token (dark-mode-aware) */
}
#calendar-table thead tr {
    background: var(--bg-subtle); /* S114: neutral-100 â†’ semantic token (dark-mode-aware) */
}

th, td {
    padding: var(--space-2);
    text-align: center;
    font-size: var(--font-size-xs);
    vertical-align: middle;
    border-bottom: 1px solid var(--neutral-200);
    transition: background-color var(--transition-fast);
    min-height: 1.5625rem;
}

/* Calendar: compact padding, no global border-bottom */
#calendar-table th,
#calendar-table td {
    padding: 2px;
    min-height: 0;
    border-bottom: none;
}

/* Body cells â€” empty slot baseline */
#calendar-table tbody td {
    height: 4px;
    background: var(--bg-subtle); /* S114: neutral-50 â†’ semantic token (dark-mode-aware) */
    border: 1px solid var(--border-default); /* S114: neutral-200 â†’ semantic token */
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
    cursor: pointer;
}

/* Time column: sticky anchor */
#calendar-table tbody td:first-child {
    background: var(--bg-surface); /* S114: neutral-50 â†’ semantic token, slightly different from cells */
    border-top: none;
    border-bottom: none;
    border-left: none;
    border-right: 1px solid var(--border-default); /* S114: semantic token */
    cursor: default;
    height: auto;
}

/* Sticky Header-Zeile: scoped auf #calendar-table, sticky auf th-Ebene */
#calendar-table thead tr th {
    background: var(--bg-subtle); /* S115: neutral-100 â†’ semantic (dark-mode-aware) */
    color: var(--text-primary);   /* S115: neutral-800 â†’ semantic */
    font-weight: 600;
    font-size: var(--font-size-xs);
    padding: var(--space-2) var(--space-1);
    position: sticky;
    top: 0;
    z-index: 3;
    box-shadow: 0 1px 0 var(--border-default); /* S115: neutral-200 â†’ semantic */
}

/* Sticky Zeitspalte: alle first-child in #calendar-table */
#calendar-table th:first-child,
#calendar-table td:first-child {
    position: sticky;
    left: 0;
    background: var(--bg-surface); /* S115: neutral-50 â†’ semantic (dark-mode-aware) */
    font-weight: 600;
    color: var(--text-primary);    /* S115: neutral-700 â†’ semantic */
    min-width: 3.75rem;
    border-right: 1px solid var(--border-default); /* S115: neutral-200 â†’ semantic */
    z-index: 2;
    box-shadow: 1px 0 0 var(--border-default); /* S115: neutral-200 â†’ semantic */
}

/* Eckzelle (oben-links): sticky top + left, hoechtster z-index */
#calendar-table thead tr th:first-child {
    z-index: 5;
    background: var(--bg-subtle); /* S115: neutral-100 â†’ semantic */
    box-shadow: 1px 0 0 var(--border-default), 0 1px 0 var(--border-default); /* S115: neutral-200 â†’ semantic */
}

/* Tageskopf: 2-zeilig (KÃ¼rzel + Datum) */
#calendar-table .grid-day-name {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-muted);    /* S115: neutral-500 â†’ semantic (dark-mode-aware) */
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
}
#calendar-table .grid-day-num {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);  /* S115: neutral-900 â†’ semantic (dark-mode-aware) */
    margin-top: 2px;
    line-height: 1.2;
}

/* Heute-Spalte: Tageszahl in Akzentfarbe */
#calendar-table th.is-today {
    background: var(--color-50);
}
#calendar-table th.is-today .grid-day-num {
    color: var(--color-400);
}

#calendar-table tbody td:not(:first-child):hover {
    border-color: var(--neutral-400);
}

/* === CALENDAR STATUS COLORS ===
   Scoped to #calendar-table tbody td to NOT affect .time-slot-panel elements
   (panels also receive these classes; their visuals are defined in panels.css) */

/* available: weiÃŸ â€” klar bookbar, kein Blau-Tint (blaue Buchungspanels sitzen darÃ¼ber) */
#calendar-table tbody td.available {
    background: var(--neutral-0, #ffffff) !important;
    color: var(--neutral-500, #6b7280);
    border-color: var(--neutral-200, #e5e7eb) !important;
    font-weight: 500;
}

/* unavailable: kein Teacher-Slot vorhanden â€” neutral grau */
#calendar-table tbody td.unavailable {
    background: #a5a5a5 !important;
    color:  "#b4b9bd" ; /* var(--neutral-400, #9e9e9e); */
    border-color: var(--neutral-200, #e0e0e0) !important;
    cursor: default;
}

#calendar-table tbody td.blocked {
    background: #fee2e2 !important;
    color: #991b1b;
    border-color: #fca5a5 !important;
    font-weight: 500;
}

#calendar-table tbody td.personal {
    background: var(--slot-timeout-bg, #fef9ec) !important;
    color: var(--slot-timeout-tx, #7a5c00);
    border-color: var(--slot-timeout-bd, #f5d97e) !important;
    font-weight: 500;
}

#calendar-table tbody td.timeout {
    background: var(--pending-amber-bg, #fef3cd) !important;
    color: var(--pending-amber-tx, #7a5c00);
    border-color: var(--pending-amber, #f5a623) !important;
    font-weight: 500;
}

/* booked: neutral bg since a panel overlay covers it visually */
#calendar-table tbody td.booked {
    background: var(--neutral-100, #f1f3f5) !important;
    border-color: var(--neutral-300, #dee2e6) !important;
    cursor: default;
}

/* readonly-*: keine opacity â€” Kalender darf keine Transparenz-Ebenen haben */
#calendar-table tbody td.readonly-available {
    background: var(--color-100, #e5eaf5) !important;
    border-color: var(--color-200, #c8d3ec) !important;
}

#calendar-table tbody td.readonly-blocked {
    background: #fee2e2 !important;
    border-color: #fca5a5 !important;
}

#calendar-table tbody td.readonly-timeout {
    background: var(--slot-timeout-bg, #fef9ec) !important;
    border-color: var(--slot-timeout-bd, #f5d97e) !important;
}

#calendar-table tbody td.readonly-personal {
    background: var(--slot-timeout-bg, #fef9ec) !important;
    border-color: var(--slot-timeout-bd, #f5d97e) !important;
}

/* === CALENDAR INTERACTION STATES â€” td cells only === */

#calendar-table tbody td.available:hover {
    background: var(--color-100, #e5eaf5) !important;   /* heller Blau-Tint als Hover-Feedback */
    border-color: var(--color-300, #99b0db) !important;
    cursor: pointer;
}

#calendar-table tbody td.booked:hover {
    background: var(--neutral-100, #f1f3f5) !important;
    cursor: default;
}

#calendar-table tbody td.personal:hover {
    background: var(--slot-timeout-hover-bg, #fdf0c0) !important;
    border-color: var(--pending-amber, #f5a623) !important;
    cursor: pointer;
}

#calendar-table tbody td.timeout:hover {
    background: var(--pending-amber-hover-bg, #fde68a) !important;
    border-color: var(--pending-amber, #f5a623) !important;
    cursor: pointer;
}

#calendar-table tbody td.blocked:hover {
    background: #fecaca !important;
    border-color: #f87171 !important;
    cursor: pointer;
}

/* === CALENDAR STATUS COLORS â€” DARK MODE OVERRIDES (2026-06-07)
   LÃ¼cken: blocked/timeout/personal hatten keinen Dark Override.
   Werte kommen ausschliesslich aus bereits definierten Dark-Tokens
   (combined-all.css ~Z.228-249: --color-red-light/dark/border etc.)
   ================================================================ */
@media (prefers-color-scheme: dark) {
    /* --- blocked: helles Rot â†’ dunkles transluzentes Rot --- */
    #calendar-table tbody td.blocked,
    #calendar-table tbody td.readonly-blocked {
        background: var(--color-red-light, rgba(239, 68, 68, 0.18)) !important;
        color: var(--color-red-dark, #fca5a5) !important;
        border-color: var(--color-red-border, rgba(239, 68, 68, 0.55)) !important;
    }
    #calendar-table tbody td.blocked:hover {
        background: rgba(239, 68, 68, 0.28) !important;
        border-color: rgba(239, 68, 68, 0.75) !important;
    }

    /* --- timeout: helles Gelb â†’ dunkles transluzentes Gelb --- */
    #calendar-table tbody td.timeout,
    #calendar-table tbody td.readonly-timeout {
        background: var(--color-yellow-light, rgba(245, 158, 11, 0.18)) !important;
        color: var(--color-yellow-dark, #fcd34d) !important;
        border-color: var(--color-yellow-border, rgba(245, 158, 11, 0.55)) !important;
    }
    #calendar-table tbody td.timeout:hover {
        background: rgba(245, 158, 11, 0.28) !important;
        border-color: rgba(245, 158, 11, 0.75) !important;
    }

    /* --- personal: helles Gelb â†’ dunkles Lila (korrekte Semantik) --- */
    #calendar-table tbody td.personal,
    #calendar-table tbody td.readonly-personal {
        background: var(--color-purple-light, rgba(168, 85, 247, 0.18)) !important;
        color: var(--color-purple-text, #d8b4fe) !important;
        border-color: var(--color-purple-border, rgba(168, 85, 247, 0.55)) !important;
    }
    #calendar-table tbody td.personal:hover {
        background: rgba(168, 85, 247, 0.28) !important;
        border-color: rgba(168, 85, 247, 0.75) !important;
    }

    /* --- unavailable: helles Grau â†’ dunkles transluzentes Grau --- */
    #calendar-table tbody td.unavailable {
       background: "#bcbebf"  !important;   /*rgba(120, 120, 120, 0.18)*/
        color: "#deeefd" !important; /* var(--neutral-500)*/
        border-color: rgba(120, 120, 120, 0.35) !important;
    }
}

/* Selected State */
.calendar-cell.selected,
.available.selected,
.booked.selected,
.personal.selected,
.timeout.selected {
    border: 2px solid #2B2B2B !important;
    box-shadow: 0 0 0 3px rgba(43, 43, 43, 0.1);
    z-index: 10;
    position: relative;
}

/* Marked for Action */
.marked-for-action {
    border: 3px solid var(--color-400, #5b87cc) !important;
    font-weight: bold !important;
    position: relative !important;
    z-index: 10;
    box-shadow: 0 0 0 3px rgba(91, 135, 204, 0.2);
}

/* Student Booked */
.student-booked {
    border: 2px solid #2B2B2B !important;
    box-shadow: 0 0 0 1px rgba(43, 43, 43, 0.2);
}

/* Selectable Hover */
.selectable:hover {
    border-color: var(--neutral-400, #9ca3af) !important;
    z-index: 10;
    position: relative;
}

/* Dragging */
.dragging {
    background: var(--color-200, #c8d3ec) !important;
    color: var(--color-900, #0f172a) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-color: var(--color-400, #5b87cc) !important;
}

/* === CARDS - Minimal Design === */
.teacher-card, .student-card {
    background: var(--bg-surface); /* S115: neutral-0 â†’ semantic */
    border: var(--border-thin, 0.5px) solid var(--border-default); /* S115: neutral-200 â†’ semantic */
    border-radius: var(--radius-normal);
    padding: var(--space-6);
    margin: var(--space-4) 0;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    box-shadow: none;
    cursor: pointer;
    overflow: visible;
    transition: all var(--transition-base);
}

.teacher-card:hover, .student-card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    border-color: var(--neutral-300);
}

.teacher-card img, .student-card img {
    width: 5rem;
    height: 5rem;
    object-fit: cover;
    border-radius: var(--radius-full);
    border: 3px solid var(--neutral-100);
    transition: transform var(--transition-base);
}

.teacher-card:hover img, .student-card:hover img {
    transform: scale(1.05);
    border-color: var(--color-primary-light);
}

/* Teacher Card Content */
.teacher-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.teacher-name {
    font-size: var(--font-lg);
    font-weight: var(--font-semibold);
    color: var(--neutral-900);
    margin-bottom: var(--space-1);
}

.teacher-price {
    font-size: var(--font-md);
    font-weight: var(--font-medium);
    color: var(--color-primary);
}

.teacher-subjects {
    font-size: var(--font-sm);
    color: var(--neutral-600);
    margin-bottom: var(--space-2);
}

.teacher-availability {
    font-size: var(--font-sm);
    color: var(--text-primary); /* S115: neutral-700 â†’ semantic */
    background: var(--bg-subtle); /* S115: neutral-50 â†’ semantic */
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--color-primary);
    margin: var(--space-2) 0;
}

.teacher-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    font-size: var(--font-xs);
    color: var(--neutral-600);
    margin-top: var(--space-2);
}

.teacher-meta span {
    padding: var(--space-1) var(--space-2);
    background: var(--bg-subtle); /* S115: neutral-100 â†’ semantic */
    border-radius: var(--radius-sm);
}

/* === PROFILE STYLES === */
.header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    gap: var(--space-8);
    margin-bottom: var(--space-12);
    text-align: center;
    padding: var(--space-8);
    background: var(--neutral-0);
    border-radius: var(--radius-normal);
    border: var(--border-thin, 0.5px) solid var(--neutral-200);
}

#photo {
    width: 8rem;
    height: 8rem;
    border-radius: var(--radius-full);
    object-fit: cover;
    transition: all var(--transition-base);
    border: 4px solid var(--neutral-0);
    box-shadow: var(--shadow-lg);
}

#photo:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

.header-content {
    flex-grow: 1;
    min-width: 20rem;
}

.header-content h1, .section-title {
    font-size: clamp(var(--font-size-xl), 3vw, var(--font-size-2xl));
    font-weight: 700;
    margin-bottom: var(--space-3);
    color: var(--neutral-900);
    letter-spacing: -0.025em;
}

.section-title {
    border-bottom: 2px solid var(--color-primary-light);
    padding-bottom: var(--space-2);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 3rem;
    height: 2px;
    background: var(--current-primary, var(--color-primary));
}

.price {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--current-primary, var(--color-primary));
}

.section {
    margin-bottom: var(--space-10);
    padding: var(--space-6);
    background: var(--bg-surface);              /* S115: neutral-0 â†’ semantic */
    border-radius: var(--radius-normal);
    border: var(--border-thin, 0.5px) solid var(--border-default); /* S115: neutral-200 â†’ semantic */
    box-shadow: none;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

.info-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--neutral-500);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    font-weight: 500;
    color: var(--neutral-900);
    font-size: var(--font-size-base);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.tag {
    background: var(--bg-subtle);   /* S115: neutral-100 â†’ semantic */
    color: var(--text-primary);     /* S115: neutral-700 â†’ semantic */
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
    border: var(--border-thin, 0.5px) solid var(--neutral-300);
    transition: all var(--transition-fast);
}

.tag:hover {
    background: var(--color-secondary);
    color: var(--neutral-0);
    border-color: var(--color-secondary);
    transform: none;
}

/* === PUBLIC ID DISPLAY === */
.public-id-container {
    text-align: center;
    margin: 15px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.public-id-display {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(4, 170, 109, 0.08);
    border: 1px solid rgba(4, 170, 109, 0.2);
    border-radius: 12px;
    padding: 10px 16px;
    font-family: var(--font-family-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--current-primary-dark, var(--color-primary-dark));
    box-shadow: 0 2px 8px rgba(4, 170, 109, 0.1);
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

body.student .public-id-display {
    background: rgba(4, 170, 109, 0.08);
    border: 1px solid rgba(4, 170, 109, 0.2);
    color: var(--color-student-primary-dark);
}

.public-id-display:hover {
    background: rgba(4, 170, 109, 0.12);
    border-color: rgba(4, 170, 109, 0.35);
    box-shadow: 0 4px 16px rgba(4, 170, 109, 0.15);
    transform: translateY(-1px);
}

body.student .public-id-display:hover {
    background: rgba(4, 170, 109, 0.12);
    border-color: rgba(4, 170, 109, 0.35);
    box-shadow: 0 4px 16px rgba(4, 170, 109, 0.15);
}

#public-id-text, .public-id-text {
    letter-spacing: 1px;
    color: var(--current-primary-dark, var(--color-primary-dark));
    font-weight: 700;
    user-select: all;
    cursor: text;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

#public-id-text:hover, .public-id-text:hover {
    background: rgba(99, 102, 241, 0.1);
}

body.student #public-id-text:hover, body.student .public-id-text:hover {
    background: rgba(59, 130, 246, 0.1);
}

#public-id-copy, .public-id-copy {
    background: rgba(4, 170, 109, 0.1) !important;
    border: 1px solid rgba(99, 102, 241, 0.25) !important;
    color: var(--color-primary) !important;
    cursor: pointer !important;
    padding: 8px 10px !important;
    border-radius: 8px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    width: 36px !important;
    height: 36px !important;
    backdrop-filter: blur(8px) !important;
}

#public-id-copy:hover, .public-id-copy:hover {
    background: rgba(4, 170, 109, 0.18) !important;
    border-color: rgba(4, 170, 109, 0.4) !important;
    transform: scale(1.05) translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(4, 170, 109, 0.2) !important;
}

body.student #public-id-copy, body.student .public-id-copy {
    background: rgba(4, 170, 109, 0.1) !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    color: var(--color-student-primary) !important;
}

body.student #public-id-copy:hover, body.student .public-id-copy:hover {
    background: rgba(4, 170, 109, 0.18) !important;
    border-color: rgba(4, 170, 109, 0.4) !important;
    box-shadow: 0 6px 16px rgba(4, 170, 109, 0.2) !important;
}

#public-id-copy.copied, .public-id-copy.copied {
    background: rgba(4, 170, 109, 0.15) !important;
    border-color: rgba(4, 170, 109, 0.4) !important;
    color: var(--color-accent) !important;
    transform: scale(1.1) !important;
    box-shadow: 0 8px 20px rgba(4, 170, 109, 0.25) !important;
}

/* === FORMS - Minimal Design === */
.form-container {
    max-width: 56rem;
    margin: 0 auto;
    padding: var(--space-6);
}

.form-section {
    background: var(--neutral-0);
    margin: var(--space-6) 0;
    padding: var(--space-8);
    border-radius: var(--radius-normal);
    box-shadow: none;
    border: var(--border-thin, 0.5px) solid var(--neutral-200);
}

.form-section h2 {
    margin-top: 0;
    color: var(--neutral-900);
    font-size: var(--font-size-xl);
    font-weight: 700;
    border-bottom: 2px solid var(--color-primary-light);
    padding-bottom: var(--space-3);
    margin-bottom: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

.form-row.single {
    grid-template-columns: 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--neutral-700);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
}

.form-group input, .form-group textarea, .form-group select {
    padding: var(--space-4);
    border: 1px solid var(--border-default); /* S115: neutral-200 â†’ semantic */
    border-radius: var(--radius-normal);
    font-size: var(--font-size-base);
    background: var(--bg-surface);           /* S115: neutral-0 â†’ semantic */
    color: var(--text-primary);              /* S115: explicit for dark mode */
    transition: all var(--transition-base);
    font-family: inherit;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--color-secondary);
    background: var(--bg-surface);           /* S115: neutral-0 â†’ semantic */
    box-shadow: none;
}

body.student .form-group input:focus,
body.student .form-group textarea:focus,
body.student .form-group select:focus {
    border-color: var(--color-student-primary);
    box-shadow: 0 0 0 3px rgba(4, 170, 109, 0.1);
}

.form-group textarea {
    min-height: 7.5rem;
    resize: vertical;
    line-height: 1.5;
}

/* === MODALS - Minimal Design === */
.modal {
    display: none;
    position: fixed;
    z-index: 50;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.modal-content {
    background: var(--bg-surface);              /* S115: neutral-0 â†’ semantic */
    margin: 5% auto;
    padding: var(--space-8);
    width: 90%;
    max-width: 32rem;
    border-radius: var(--radius-normal);
    box-shadow: var(--shadow-lg);
    border: var(--border-thin, 0.5px) solid var(--border-default); /* S115: neutral-200 â†’ semantic */
    position: relative;
}

.modal .close, .modal .close-modal {
    color: var(--neutral-400);
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    font-size: var(--font-size-2xl);
    font-weight: bold;
    cursor: pointer;
    z-index: 51;
    transition: opacity var(--transition-fast);
    background: none;
    border: none;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal .close:hover, .modal .close-modal:hover {
    opacity: 0.7;
}

/* === INTERACTIVE CONTROLS === */
#navigation-controls {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

#nav-prev-week:not(.button-standard-black),
#nav-next-week:not(.button-standard-black),
#prev-week:not(.button-standard-black),
#next-week:not(.button-standard-black) {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    background:(#b5d6d7, var(--color-primary));
    color: var(--neutral-0);
    border: none;
    border-radius: var(--radius-base);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--transition-base);
}

#nav-prev-week:not(.button-standard-black):hover,
#nav-next-week:not(.button-standard-black):hover,
#prev-week:not(.button-standard-black):hover,
#next-week:not(.button-standard-black):hover {
    background: var(--current-primary-dark, var(--color-primary-dark));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* === BOOKING CONTROLS === */
#booking-controls {
    margin: var(--space-4) 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Booking buttons â€” same shape as .favorites-btn in catalog-teachers */
.booking-btn {
    flex: 1 1 calc(50% - 3px);
    min-height: 40px;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.12s ease, background-color 0.12s ease, opacity 0.12s ease;
}

.booking-btn.book {
    background: var(--color-accent, #34A853);
    color: #fff;
}

.booking-btn.delete {
    background: var(--color-danger, #EA4335);
    color: #fff;
}

.booking-btn:active:not(:disabled) { opacity: 0.85; transform: scale(0.98); }

.booking-btn.active {
    box-shadow: 0 0 0 3px rgba(4, 170, 109, 0.3);
    transform: scale(1.02);
}

.booking-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(4, 170, 109, 0.3);
}

.booking-btn:disabled { opacity: 0.4; cursor: not-allowed; }

@media (hover: hover) and (pointer: fine) {
    .booking-btn:not(.active):not(:disabled):hover {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.save-btn:not(.button-standard-black) {
    width: 100%;
    min-height: 40px;
    padding: 8px 16px;
    background: var(--color-accent, #4285F4);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-top: var(--space-3, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.12s ease, background-color 0.12s ease, opacity 0.12s ease;
    box-shadow: var(--shadow-sm);
}

.save-btn:active:not(:disabled):not(.button-standard-black) { opacity: 0.85; transform: scale(0.98); }

.save-btn:focus-visible:not(.button-standard-black) {
    outline: none;
    box-shadow: 0 0 0 3px rgba(4, 170, 109, 0.3);
}

.save-btn:disabled:not(.button-standard-black) { opacity: 0.4; cursor: not-allowed; }

@media (hover: hover) and (pointer: fine) {
    .save-btn:not(:disabled):not(.button-standard-black):hover {
        transform: scale(1.02);
        opacity: 0.9;
    }
}

/* === LEGEND & INFO === */
.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-2);
    font-size: var(--font-size-xs);
}

.legend-color {
    width: 1.25rem;
    height: 0.9375rem;
    margin-right: var(--space-2);
    border: var(--border-thin, 0.5px) solid var(--neutral-300);
    border-radius: var(--radius-normal);
    flex-shrink: 0;
}

.legend-color.available { background: #4CAF50; }
.legend-color.selected { background: var(--warn); }
.legend-color.blocked { background: #F44336; }
.legend-color.booked { background: var(--color-400, #5b87cc); }
.legend-color.personal { background: #9C27B0; }
.legend-color.timeout { background: #FF9800; }

#calendar-info {
    padding: var(--space-4);
    border-radius: var(--radius-normal);
    margin-top: var(--space-4);
    border: var(--border-thin, 0.5px) solid;
}

body.teacher #calendar-info {
    background: #e8f5e8;
    color: #2e7d32;
    border-color: #a5d6a7;
}
@media (prefers-color-scheme: dark) {
    body.teacher #calendar-info {
        background: rgba(16, 185, 129, 0.12); /* S115: dark-safe green tint */
        color: #6ee7b7;
        border-color: rgba(16, 185, 129, 0.35);
    }
}

body.student #calendar-info {
    background: #e3f2fd;
    color: #1565c0;
    border-color: #90caf9;
}
@media (prefers-color-scheme: dark) {
    body.student #calendar-info {
        background: rgba(59, 130, 246, 0.12); /* S115: dark-safe blue tint */
        color: #93c5fd;
        border-color: rgba(59, 130, 246, 0.35);
    }
}

/* === REVIEWS - Minimal Design === */
.review {
    background: var(--bg-subtle);               /* S115: neutral-50 â†’ semantic */
    padding: var(--space-6);
    margin-bottom: var(--space-4);
    border-radius: var(--radius-normal);
    border: var(--border-thin, 0.5px) solid var(--border-default); /* S115: neutral-200 â†’ semantic */
    transition: all var(--transition-base);
}

.review:hover {
    background: var(--bg-surface);              /* S115: neutral-0 â†’ semantic */
    box-shadow: none;
    transform: none;
    border-color: var(--neutral-300);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
    font-weight: 600;
    color: var(--neutral-900);
}

.review-stars {
    color: #fbbf24;
    font-size: var(--font-size-lg);
}

.review-text {
    font-style: italic;
    color: var(--neutral-600);
    line-height: 1.6;
}

/* === FOCUS ACCESSIBILITY === */

/* Keyboard Navigation Focus */
button:focus-visible, .primary-btn:focus-visible, .secondary-btn:focus-visible, .tertiary-btn:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible,
nav a:focus-visible, a:focus-visible {
    outline: 2px solid #2B2B2B;
    outline-offset: 2px;
}

/* Active Navigation Item - Handled in nav section */

/* Focus for Calendar Cells */
.calendar-cell:focus-visible {
    outline: 2px solid #2B2B2B;
    outline-offset: -2px;
    z-index: 10;
}

/* Panel Focus */
.time-slot-panel:focus-visible {
    outline: 2px solid #2B2B2B;
    outline-offset: 2px;
}

/* === TOOLTIP SYSTEM === */

/* Tooltip Container */
.tooltip {
    position: relative;
    display: inline-block;
}

/* Tooltip Text */
.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: #2B2B2B;
    color: #FFFFFF;
    font-size: 0.875rem;
    font-weight: 400;
    white-space: nowrap;
    border-radius: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

/* Tooltip Arrow */
.tooltip::after {
    content: "";
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2B2B2B;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

/* Show Tooltip on Hover */
.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
}

/* Tooltip Positions */
.tooltip-top::before {
    bottom: calc(100% + 8px);
    top: auto;
}

.tooltip-bottom::before {
    top: calc(100% + 8px);
    bottom: auto;
}

.tooltip-bottom::after {
    top: calc(100% + 2px);
    bottom: auto;
    border-top-color: transparent;
    border-bottom-color: #2B2B2B;
}

.tooltip-left::before {
    left: auto;
    right: calc(100% + 8px);
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
}

.tooltip-right::before {
    right: auto;
    left: calc(100% + 8px);
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
}

/* Disabled Elements Tooltip */
button:disabled.tooltip::before,
.btn:disabled.tooltip::before {
    background: #616161;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    :root {
        --space-4: 0.75rem;
        --space-6: 1rem;
        --space-8: 1.5rem;
    }

    header #edit-profile-btn {
        left: 0;
        display: block;
        margin: var(--space-4) auto 0;
    }

    /* Mobile Navigation - Stacked Layout */
    nav:not(.lang-nav) {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-1);
        width: 100%;
    }

    nav:not(.lang-nav) a, nav:not(.lang-nav) button {
        width: 100%;
        justify-content: flex-start;
        padding: 0.875rem 1rem;
        min-height: 48px;
        text-align: left;
    }

    /* Mobile Buttons - Larger Touch Targets */
    button, .btn, .primary-btn, .secondary-btn {
        min-height: 48px;
        padding: 0.875rem 1.25rem;
    }

    /* Mobile Tooltip - Bottom Position */
    .tooltip::before {
        bottom: auto;
        top: calc(100% + 8px);
        white-space: normal;
        max-width: 200px;
    }

    .tooltip::after {
        bottom: auto;
        top: calc(100% + 2px);
        border-top-color: transparent;
        border-bottom-color: #2B2B2B;
    }

    #content {
        flex-direction: column;
        gap: var(--space-4);
    }

    #sidebar {
        width: 100%;
        position: static; /* Nur auf Mobile static */
        order: 2;
        height: auto !important;
    }
    
    #main {
        padding: var(--space-4);
        order: 1;
    }

    .container, main {
        padding: var(--space-4);
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .header {
        flex-direction: column;
        align-items: center;
        padding: var(--space-6);
    }

    #photo {
        width: 6rem;
        height: 6rem;
    }

    table, #calendar-table {
        font-size: var(--font-size-xs);
    }

    th, td {
        padding: var(--space-1);
        font-size: 10px;
        min-height: 1.25rem;
    }

    .teacher-card, .student-card {
        flex-direction: column;
        text-align: center;
        padding: var(--space-4);
    }

    .public-id-display {
        font-size: var(--text-caption); /* WP5 [8/8]: 12px â†’ token */
        padding: 8px 12px;
        gap: 8px;
        border-radius: 10px;
    }
    
    #public-id-copy, .public-id-copy {
        width: 32px !important;
        height: 32px !important;
        font-size: var(--text-caption) !important; /* WP5 [8/8]: 12px â†’ token */
        padding: 6px 8px !important;
    }
    
    .booking-btn {
        width: 100%;
        margin: var(--space-1) 0;
    }
    
    #navigation-controls {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .public-id-display {
        font-size: 11px;
        padding: 6px 10px;
        gap: 6px;
    }
    
    #public-id-copy, .public-id-copy {
        width: 28px !important;
        height: 28px !important;
        font-size: 11px !important;
    }
}

/* === UTILITY CLASSES === */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.hidden { display: none !important; }
.visible { display: block !important; }

.hover-lift { transition: transform var(--transition-base); }
.hover-lift:hover { transform: translateY(-2px); }

.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.loading {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--current-primary, var(--color-primary));
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease-out; }

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-6);
    margin-top: var(--space-6);
}

/* === OPTIMIZED TEACHER CARDS (nach Best Practices) === */
.teacher-card-optimized {
    background: var(--bg-surface); /* S115: white â†’ semantic (dark-mode-aware) */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

/* Card Header - Foto + Name + Rating + Preis */
.card-header {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-default); /* S115: #f0f0f0 â†’ semantic */
}

.card-photo-section {
    position: relative;
    flex-shrink: 0;
}

.card-photo {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid var(--border-default); /* S115: #e0e0e0 â†’ semantic */
}

.teacher-current-time {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #2196f3;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.card-header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-header-middle {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.card-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary); /* S115: #2c3e50 â†’ semantic */
    margin-bottom: 4px;
}

.card-rating {
    font-size: 14px;
    color: var(--text-muted);  /* S115: #666 â†’ semantic */
    margin-bottom: 8px;
}

.rating-stars {
    color: #ffa726;
    font-weight: 600;
    font-size: 15px;
}

.rating-count {
    color: var(--text-muted); /* S115: #999 â†’ semantic */
    font-size: 13px;
}

.card-price {
    font-size: var(--text-heading); /* WP5 [8/8]: 24px â†’ token */
    font-weight: 700;
    color: #27ae60;
}

/* Card Body - Details */
.card-body {
    padding: 16px;
}

.card-languages {
    font-size: 14px;
    color: var(--text-muted);            /* S115: #555 â†’ semantic */
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-default); /* S115: #f5f5f5 â†’ semantic */
}

/* Trust Indicators */
.card-stats {
    display: flex;
    justify-content: space-around;
    margin: 12px 0;
    padding: 12px 0;
    background: var(--bg-subtle); /* S115: #f8f9fa â†’ semantic */
    border-radius: 6px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.stat-icon {
    font-size: 18px;
}

.stat-value {
    font-size: var(--text-body); /* WP5 [8/8]: 16px â†’ token */
    font-weight: 700;
    color: var(--text-primary); /* S115: #2c3e50 â†’ semantic */
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);   /* S115: #999 â†’ semantic */
    text-transform: uppercase;
}

/* Vertical Stats (beside avatar) */
.card-stats-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    padding-left: 12px;
    border-left: 1px solid var(--border-default); /* S115: #f0f0f0 â†’ semantic */
}

.stat-item-compact {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-caption); /* WP5 [8/8]: 12px â†’ token */
    white-space: nowrap;
}

.stat-item-compact .stat-icon {
    font-size: 14px;
}

.stat-item-compact .stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary); /* S115: #2c3e50 â†’ semantic */
    min-width: 20px;
}

.stat-item-compact .stat-label {
    font-size: 11px;
    color: var(--text-muted);   /* S115: #666 â†’ semantic */
    text-transform: none;
}

/* Availability */
.card-availability {
    font-size: 13px;
    color: var(--text-muted);          /* S115: #666 â†’ semantic */
    padding: 8px;
    background: var(--warning-bg, #fff3e0); /* S115: #fff3e0 â†’ semantic fallback */
    border-left: 3px solid #ff9800;
    border-radius: 3px;
    margin-bottom: 12px;
}

.availability-icon {
    margin-right: 4px;
}

/* Action Buttons */
.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-default); /* S115: #f0f0f0 â†’ semantic */
}

.card-actions .favorites-btn,
.card-actions .accept-btn,
.card-actions .remove-from-list-btn {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

/* === NEW COMPACT CARD LAYOUT === */
.card-container-new {
    display: flex;
    gap: 12px;
    padding: 16px;
    min-height: 140px;
}

.card-main-section {
    display: flex;
    gap: 12px;
    flex: 1;
}

.card-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-top-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.card-details-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-tagline {
    font-size: 13px;
    color: var(--text-muted);          /* S115: #555 â†’ semantic */
    font-style: italic;
    padding: 6px 8px;
    background: var(--bg-subtle);      /* S115: #f5f5f5 â†’ semantic */
    border-left: 3px solid #9c27b0;
    border-radius: 3px;
}

/* Action Buttons Vertical (rechts) */
.card-actions-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: top;
    align-items: flex-end;
    padding-left: 12px;
    border-left: 1px solid var(--border-default); /* S115: #f0f0f0 â†’ semantic */
    min-width: 120px;
}

.card-actions-vertical .favorites-btn,
.card-actions-vertical .accept-btn,
.card-actions-vertical .contact-btn,
.card-actions-vertical .hide-teacher-btn {
    width: 100%;
    max-width: 120px;
}

/* Responsive */
@media (max-width: 768px) {
    .card-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .card-photo-section {
        margin-bottom: 8px;
    }

    .card-stats {
        flex-wrap: wrap;
        gap: 12px;
    }

    .card-container-new {
        flex-direction: column;
    }

    .card-top-row {
        flex-direction: column;
    }

    .card-actions-vertical {
        flex-direction: row;
        justify-content: center;
        border-left: none;
        border-top: 1px solid #f0f0f0;
        padding-left: 0;
        padding-top: 12px;
        min-width: auto;
    }

    .card-actions-vertical .favorites-btn,
    .card-actions-vertical .accept-btn,
    .card-actions-vertical .contact-btn,
    .card-actions-vertical .hide-teacher-btn {
        width: auto;
        flex: 1;
    }
}

/* === PRINT STYLES === */
@media print {
    body { background: white; color: black; }
    .modal, button, .btn { display: none !important; }
    .container { max-width: none; padding: 0; }
}

/* =========================== */
/* CURRENT TIME TIMELINE */
/* =========================== */
#calendar-current-time-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #dc3545;
    z-index: 20;
    pointer-events: none;
    display: none;
    box-shadow: 0 1px 3px rgba(220, 53, 69, 0.5);
}

#calendar-current-time-line::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #dc3545;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(220, 53, 69, 0.8);
}

.timeline-label {
    position: absolute;
    left: 12px;
    top: -10px;
    background: #dc3545;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    z-index: 21;
}

/* Calendar Container needs relative positioning for timeline */
#calendar-container {
    position: relative;
}

/* Timeline visibility animation */
#calendar-current-time-line {
    animation: timeline-pulse 2s ease-in-out infinite;
}

@keyframes timeline-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* â”€â”€ Chat FAB â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.chat-fab-anchor {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: 95;
}
.chat-fab {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--bg-card);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    transition: filter 0.15s ease, transform 0.15s ease;
}
@media (hover: hover) and (pointer: fine) {
    .chat-fab:hover { filter: brightness(0.96); transform: scale(1.06); }
}
.chat-fab:active { transform: scale(0.95); }

/* â”€â”€ Base action button (.btn-action) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   Structural base for all icon+label action buttons.
   Catalog (.favorites-btn etc.) and calendar (.booking-btn)
   both extend this. Override only colors / width per context. */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 3px solid black;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    box-sizing: border-box;
    transition: transform 0.12s ease, background-color 0.12s ease, opacity 0.12s ease;
}
@media (hover: hover) and (pointer: fine) {
    .btn-action:not(:disabled):hover { transform: scale(1.04); }
}
.btn-action:disabled,
.btn-action[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}
.btn-action .btn-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

/* Teacher-Auswahl: Preis-Badge (TODO-UI3, 2026-05-24) */
.teacher-price-badge {
    flex-shrink: 0;
    font-size: var(--text-caption); /* WP5 [8/8]: 12px â†’ token */
    font-weight: 600;
    color: var(--color-primary);
    background: var(--focus-ring-color, rgba(91, 135, 204, 0.12));
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
    margin-left: 8px;
}

/* â”€â”€ Dark Mode (S116) â€” #calendar-table cell status colors â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   All td.* status cells use hardcoded light colors with !important in light
   mode. These !important overrides are needed to beat them in dark mode.
   Applies to: teacher-calendar.html, teacher-profile.html, student-calendar.html
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (prefers-color-scheme: dark) {

    /* â”€â”€ Teacher calendar: available slots (--color-100 doesn't flip) â”€â”€ */

    #calendar-table tbody td.available {
        background: rgba(91, 135, 204, 0.18) !important;
        color: #93c5fd !important;
        border-color: rgba(91, 135, 204, 0.45) !important;
    }
    #calendar-table tbody td.available:hover {
        background: rgba(91, 135, 204, 0.30) !important;
        border-color: rgba(91, 135, 204, 0.65) !important;
    }

    /* â”€â”€ Teacher calendar: editable status cells â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

    #calendar-table tbody td.blocked {
        background: rgba(239, 68, 68, 0.18) !important;
        color: #fca5a5 !important;
        border-color: rgba(239, 68, 68, 0.45) !important;
    }
    #calendar-table tbody td.blocked:hover {
        background: rgba(239, 68, 68, 0.30) !important;
        border-color: rgba(239, 68, 68, 0.65) !important;
    }

    #calendar-table tbody td.personal {
        background: rgba(168, 85, 247, 0.18) !important;
        color: #d8b4fe !important;
        border-color: rgba(168, 85, 247, 0.45) !important;
    }
    #calendar-table tbody td.personal:hover {
        background: rgba(168, 85, 247, 0.28) !important;
        border-color: rgba(168, 85, 247, 0.65) !important;
    }

    #calendar-table tbody td.timeout {
        background: rgba(245, 158, 11, 0.18) !important;
        color: #fcd34d !important;
        border-color: rgba(245, 158, 11, 0.45) !important;
    }
    #calendar-table tbody td.timeout:hover {
        background: rgba(245, 158, 11, 0.28) !important;
        border-color: rgba(245, 158, 11, 0.65) !important;
    }

    /* booked: neutral â€” a booking panel overlaps it, grey is correct */
    #calendar-table tbody td.booked {
        background: rgba(120, 120, 120, 0.18) !important;
        border-color: rgba(120, 120, 120, 0.35) !important;
    }
    #calendar-table tbody td.booked:hover {
        background: rgba(120, 120, 120, 0.25) !important;
    }

    /* â”€â”€ Teacher-profile / read-only calendar cells â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

    #calendar-table tbody td.readonly-available {
        background: rgba(59, 130, 246, 0.18) !important;
        border-color: rgba(59, 130, 246, 0.45) !important;
    }

    #calendar-table tbody td.readonly-blocked {
        background: rgba(239, 68, 68, 0.18) !important;
        border-color: rgba(239, 68, 68, 0.40) !important;
    }

    #calendar-table tbody td.readonly-timeout {
        background: rgba(245, 158, 11, 0.18) !important;
        border-color: rgba(245, 158, 11, 0.40) !important;
    }

    #calendar-table tbody td.readonly-personal {
        background: rgba(168, 85, 247, 0.18) !important;
        border-color: rgba(168, 85, 247, 0.40) !important;
    }

    /* â”€â”€ selected / marked-for-action: visible on dark bg â”€â”€â”€â”€â”€â”€ */
    .calendar-cell.selected,
    .available.selected,
    .booked.selected,
    .personal.selected,
    .timeout.selected {
        border-color: var(--neutral-300) !important;
        box-shadow: 0 0 0 3px rgba(249, 250, 251, 0.15) !important;
    }
}



/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   BOOKING-PREVIEW-WIDGET  (S[T1] Â· booking-preview-widget.js)
   Schwebendes Pill unten rechts â€” zeigt Dauer + Preis der markierten Buchungen.
   Sichtbar via .is-hidden-Toggle (JS-gesteuert).
   z-index 200 â€” unter dem Save-FAB (350) und Modal-Backdrop (400).
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.booking-preview-widget {
    position:        fixed;
    bottom:          80px;
    right:           24px;
    display:         flex;
    align-items:     center;
    gap:             var(--sp-2, 8px);
    padding:         8px 16px;
    border-radius:   var(--radius-full, 999px);
    background:      var(--color-accent, #0f4c81);
    color:           var(--neutral-0, #ffffff);
    font-size:       var(--text-sm, 14px);
    font-weight:     600;
    box-shadow:      0 4px 12px rgba(0, 0, 0, 0.2);
    z-index:         200;
    transition:      opacity 0.2s ease, transform 0.2s ease;
    pointer-events:  none;   /* Widget ist nur Anzeige, kein Klick nÃ¶tig */
}

.booking-preview-widget.is-hidden {
    opacity:   0;
    transform: translateY(6px);
}

/* Trennpunkt zwischen Dauer und Preis */
.booking-preview-widget .bpw-sep.is-hidden {
    display: none;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   BUDGET-WIDGET  (S[T1] Â· budget-widget.js)
   Sidebar-Button + Dialog-Inhalt.
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â”€â”€ Budget-Button im Sidebar â”€â”€ */
.budget-btn {
    display:      flex;
    align-items:  center;
    gap:          var(--sp-1, 4px);
    width:        100%;
    margin-top:   var(--sp-3, 16px);
    padding:      8px 12px;
    border:       1px solid var(--border-default);
    border-radius: var(--radius-sm, 4px);
    background:   var(--bg-surface);
    color:        var(--text-default);
    font-size:    var(--text-sm, 13px);
    cursor:       pointer;
    transition:   background var(--transition-fast), border-color var(--transition-fast);
}

@media (hover: hover) and (pointer: fine) {
    .budget-btn:hover {
        background:   var(--neutral-100, #f3f4f6);
        border-color: var(--border-strong);
    }
}

.budget-btn svg {
    flex-shrink: 0;
    opacity:     0.7;
}

/* â”€â”€ Budget-Dialog (BaseDialog-Erweiterung) â”€â”€ */
.budget-dialog .base-dialog-container {
    width:     min(480px, 92vw);
    max-height: 70vh;
    overflow-y: auto;
}

/* Lade-Spinner im Dialog */
.budget-loading {
    display:         flex;
    justify-content: center;
    padding:         var(--sp-5, 32px) 0;
}

.budget-spinner {
    width:         32px;
    height:        32px;
    border:        3px solid var(--neutral-200, #e5e7eb);
    border-top-color: var(--color-accent, #0f4c81);
    border-radius: 50%;
    animation:     budget-spin 0.7s linear infinite;
}

@keyframes budget-spin {
    to { transform: rotate(360deg); }
}

/* â”€â”€ Zusammenfassung (Dialog-Body) â”€â”€ */
.budget-summary {
    padding: var(--sp-2, 8px) 0;
}

.budget-empty {
    color:      var(--text-muted);
    font-style: italic;
    text-align: center;
    padding:    var(--sp-4, 24px) 0;
}

/* Gesamt-Zeile */
.budget-total {
    display:         flex;
    justify-content: space-between;
    align-items:     baseline;
    padding:         0 0 var(--sp-3, 16px);
    margin-bottom:   var(--sp-3, 16px);
    border-bottom:   2px solid var(--border-default);
}

.budget-total-label {
    font-size:   var(--text-sm, 13px);
    color:       var(--text-muted);
    font-weight: 500;
}

.budget-total-value {
    font-size:   var(--text-base, 15px);
    font-weight: 700;
    color:       var(--text-default);
}

/* Einzel-Positionen */
.budget-list {
    list-style: none;
    margin:     0;
    padding:    0;
}

.budget-item {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    padding:         var(--sp-2, 8px) 0;
    border-bottom:   1px solid var(--neutral-100, #f3f4f6);
}

.budget-item:last-child {
    border-bottom: none;
}

.budget-name {
    font-size: var(--text-sm, 13px);
    color:     var(--text-default);
}

.budget-detail {
    font-size:   var(--text-sm, 13px);
    color:       var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

/* â”€â”€ Zeitraum-Tabs im Budget-Dialog â”€â”€ */
.budget-period-tabs {
    display:        flex;
    gap:            var(--sp-1, 4px);
    margin-bottom:  var(--sp-3, 16px);
    padding-bottom: var(--sp-2, 8px);
    border-bottom:  1px solid var(--border-default);
}

.budget-period-tab {
    padding:       4px 12px;
    border:        1px solid transparent;
    border-radius: var(--radius-sm, 4px);
    background:    transparent;
    color:         var(--text-muted);
    font-size:     var(--text-sm, 13px);
    cursor:        pointer;
    transition:    background var(--transition-fast),
                   color var(--transition-fast),
                   border-color var(--transition-fast);
}

@media (hover: hover) and (pointer: fine) {
    .budget-period-tab:hover {
        background: var(--neutral-100, #f3f4f6);
        color:      var(--text-default);
    }
}

.budget-period-tab.is-active {
    background:   var(--color-accent, #0f4c81);
    color:        var(--neutral-0);
    border-color: var(--color-accent, #0f4c81);
    font-weight:  600;
}

/* Wrapper fÃ¼r den austauschbaren Inhalt */
.budget-summary-wrap {
    min-height: 80px;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   FALLBACK-TOAST  (classroom-nav-dropdown.js)
   Wird nur gezeigt wenn window.CalendarUtils.showToast nicht verfÃ¼gbar.
   Kein Inline-CSS â€” alle Werte hier Ã¼ber CSS Custom Properties.
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.toast-fallback {
    position:      fixed;
    top:           80px;
    right:         20px;
    z-index:       10000;
    padding:       12px 20px;
    border-radius: var(--radius-md, 6px);
    color:         var(--neutral-0);
    font-weight:   500;
    font-size:     var(--text-sm, 14px);
    box-shadow:    0 4px 12px rgba(0, 0, 0, 0.15);
    opacity:       1;
    transition:    opacity 300ms ease;
    pointer-events: none;
}

.toast-fallback--info  { background: var(--color-accent, #3b82f6); }
.toast-fallback--error { background: var(--color-danger, #ef4444); }

.toast-fallback--hide { opacity: 0; }
