




/* ── GrapesJS editor-state class suppression — belt-and-suspenders ──────────
   PHP strips these classes server-side (FrontendMenuTrait::stripGjsClasses)
   but this CSS guard prevents any edge-case leakage from making UI artefacts
   visible to end users. Never applies inside .gjs-frame (the real canvas). */
[class*="gjs-"]:not(.gjs-frame *) {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.m-iframe-preview { width:700px; min-height:500px; border:none; background:#fff; display:block; }
.m-progress-w { transition:width .3s; }
.m-badge-conn { background:#3a0ca3; color:#fff; padding:2px 8px; border-radius:4px; }
.m-badge-disc { background:#dc3545; color:#fff; padding:2px 8px; border-radius:4px; }
.m-badge-2fa-on { background:#198754; color:#fff; padding:4px 10px; border-radius:4px; }
.m-badge-2fa-off { background:#6c757d; color:#fff; padding:4px 10px; border-radius:4px; }
.m-row-crit { background:#fff5f5; }
.m-row-warn { background:#fffbe6; }
.m-row-ok { background:#fff; }
.m-bal-pos { color:#2d6a4f; }
.m-bal-neg { color:#c0392b; }
.m-bal-bo-pos { border-color:#2d6a4f; }
.m-bal-bo-neg { border-color:#c0392b; }
.m-bal-fs16 { font-size:16px; }
.m-alert-ok { color:#10b981; }
.m-alert-err { color:#ef4444; }
.m-swatch { display:inline-block; border-radius:3px; }
.m-swatch-35 { width:35px; height:35px; }
.m-swatch-30 { width:30px; height:30px; }
.m-icon-xl { font-size:64px; margin:12px 0; }
.m-branding-btn { color: var(--bs-body-color, #212529); padding:8px 15px; border-radius:4px; }
.m-btn-primary { border:none; padding:10px 20px; border-radius:6px; color:#fff; }
.m-sticky-nav { position:sticky; top:0; z-index:1000; width:100%; box-shadow:0 2px 4px rgba(0,0,0,.1); }
.m-dynamic-alert { padding:12px; border-radius:6px; margin-bottom:20px; font-size:14px; }
.m-meta-icon { width:120px; height:120px; }
.m-loading-overlay { position:absolute; top:0; left:0; width:100%; height:600px; background:rgba(0,0,0,.8); display:none; z-index:100; }

/* ── Admin Guest Page (Login) ── */
.m-admin-guest-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f172a;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Full-page centering wrapper */
.m-page-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    padding: 2rem;
}

/* Login card container */
.m-s-066 {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

/* Login page heading */
.m-s-067 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.25rem;
    text-align: center;
}

/* Login submit button */
.m-s-068 {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: var(--color-primary, #1a1a1a);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.m-s-068:hover { opacity: 0.88; }

/* Form label */
.m-label-block {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
}

/* Full-width text/password inputs */
.m-input-full {
    display: block;
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.m-input-full:focus {
    outline: none;
    border-color: var(--color-primary, #1a1a1a);
    box-shadow: 0 0 0 3px rgba(0,0,0,.12);
}

/* Error message in forms */
.m-alert-error {
    padding: 0.75rem 1rem;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    color: #c0392b;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Small muted text (login sub-title) */
.m-text-muted-sm {
    color: #767676; /* BUILD 222: #888 → #767676, Kontrast 4.54:1 (WCAG AA) */
    font-size: 0.875rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Navbar dropdown section header */
.m-s-194 { font-weight: 600; font-size: 0.8rem; }

/* Navbar dropdown muted info item */
.m-s-195 { font-size: 0.8rem; }

/* Navbar avatar images */
.m-s-196,
.m-s-197 { width: 32px; height: 32px; object-fit: cover; }

/* Navbar login button */
.m-s-198 { white-space: nowrap; }

/* Footer — dark background with top divider */
.m-s-199 {
    background: #1a1a2e;
    color: #fff;
}

/* Footer logo */
.m-s-200 { max-height: 48px; width: auto; }

/* ── Login portal: navigation links below the submit button ──────────────── */
.login-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 1.25rem;
    text-align: center;
}
.login-link {
    font-size: 0.875rem;
    color: var(--color-primary, #1a1a1a);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.15s ease;
}
.login-link:hover {
    opacity: 1;
    text-decoration: underline;
}
.login-link--back {
    margin-top: 0.35rem;
    color: #555;
    font-size: 0.82rem;
}

/* ── Google OAuth login button (admin login page) ────────────────────────── */
.login-divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0 1rem;
    gap: 0.75rem;
    color: #767676; /* BUILD 222: #888 → #767676, Kontrast 4.54:1 (WCAG AA) */
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid #ddd;
}
.btn-google-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid #dadce0;
    border-radius: 6px;
    background: #fff;
    color: #3c4043;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
.btn-google-login:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
    color: #3c4043;
    text-decoration: none;
}

/* ── Frontend Homepage Sections (m-s-001 … m-s-028) ──────────────────────── */

/* Hero banner — full-width gradient background */
.m-s-001 {
    background: linear-gradient(135deg, var(--color-primary, #1a1a2e) 0%, var(--color-secondary, #16213e) 100%);
    color: #fff;
    padding: 5rem 1rem;
    text-align: center;
}

/* Hero icon wrapper — rounded circle */
.m-s-002 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    margin-bottom: 1.5rem;
}

/* Hero icon size */
.m-s-003 {
    font-size: 2.5rem;
    color: #fff;
}

/* Hero heading */
.m-s-004 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.2;
}

/* Hero subtitle */
.m-s-005 {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero button group */
.m-s-006 {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Hero button — primary (inherits Bootstrap btn btn-light) */
.m-s-007 {
    min-width: 180px;
}

/* Hero button — secondary outline (inherits Bootstrap btn btn-outline-light) */
.m-s-008 {
    min-width: 180px;
}

/* Features section vertical spacing */
.m-s-009 {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

/* Features section heading */
.m-s-010 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-primary, #1a1a2e);
}

/* Features section subtitle */
.m-s-011 {
    text-align: center;
    color: var(--bs-secondary-color, #6c757d);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

/* Feature card */
.m-s-012 {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    padding: 2rem;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.m-s-012:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Feature card icon circle */
.m-s-013 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.1);
    margin: 0 auto 1.25rem;
}

/* Feature card icon */
.m-s-014 {
    font-size: 1.75rem;
    color: var(--color-primary, var(--bs-primary, #0d6efd));
}

/* Feature card title */
.m-s-015 {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--color-primary, #1a1a2e);
}

/* Feature card body text */
.m-s-016 {
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Alternating background section */
.m-s-017 {
    background-color: var(--bs-tertiary-bg, #f8f9fa);
    padding-top: 4rem;
    padding-bottom: 4rem;
}

/* Info card (hours / contact) */
.m-s-018 {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    padding: 1.75rem;
    height: 100%;
}

/* Info card heading */
.m-s-019 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary, #1a1a2e);
    border-bottom: 2px solid var(--bs-border-color, #dee2e6);
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
}

/* Info card heading icon */
.m-s-020 {
    color: var(--color-primary, var(--bs-primary, #0d6efd));
}

/* Hours list container */
.m-s-021 {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Hours list row */
.m-s-022 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,.08));
    font-size: 0.95rem;
}

/* Day name label */
.m-s-023 {
    font-weight: 500;
}

/* Last hours row (e.g. Sunday — Geschlossen) */
.m-s-024 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    font-size: 0.95rem;
    color: var(--bs-secondary-color, #6c757d);
}

/* Contact info container */
.m-s-025 {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Contact paragraph */
.m-s-026 {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* Contact links */
.m-s-027 {
    color: var(--color-primary, var(--bs-primary, #0d6efd));
    text-decoration: none;
    transition: opacity 0.15s ease;
}
.m-s-027:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Last contact paragraph (e-mail, no extra bottom margin) */
.m-s-028 {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 0;
}

/* ── Brand colour bridge ───────────────────────────────────────────────────────
   GrapesJS-generated page CSS (gjs_css) uses var(--brand-primary) for buttons.
   --brand-primary is never written by any loader, so it resolves to transparent
   → button appears white/light with invisible white text.
   Fix: alias --brand-primary → --color-primary (set by ThemeDesigner /
        root-vars <style> block) so template CSS gets the correct theme colour.
   ──────────────────────────────────────────────────────────────────────────── */
:root {
    --brand-primary:   var(--color-primary,   #0d6efd);
    --brand-secondary: var(--color-secondary, #6c757d);
    --brand-accent:    var(--color-accent,    #ffc107);
}

/* ── Primary button — Bootstrap 5.3 scoped-variable override ─────────────────
   Bootstrap 5.3 .btn-primary uses component-scoped CSS vars (--bs-btn-bg etc.)
   that are NEVER affected by :root { --bs-primary: … } overrides.
   This block re-binds those scoped vars to the active theme primary colour.
   Text colour uses --td-btn-text (ThemeDesigner) with a safe #fff fallback
   — all current theme primaries are dark, so white text is always readable.
   Dark-mode override: when --color-primary flips to near-white (#e0e0e0) the
   button background is light → force dark text for readable contrast.
   ──────────────────────────────────────────────────────────────────────────── */
.btn-primary {
    --bs-btn-bg:                  var(--color-primary, #0d6efd);
    --bs-btn-border-color:        var(--color-primary, #0d6efd);
    --bs-btn-hover-bg:            var(--color-primary, #0d6efd);
    --bs-btn-hover-border-color:  var(--color-primary, #0d6efd);
    --bs-btn-active-bg:           var(--color-primary, #0d6efd);
    --bs-btn-active-border-color: var(--color-primary, #0d6efd);
    --bs-btn-disabled-bg:         var(--color-primary, #0d6efd);
    --bs-btn-disabled-border-color: var(--color-primary, #0d6efd);
    --bs-btn-color:               var(--td-btn-text, #fff);
    --bs-btn-hover-color:         var(--td-btn-text, #fff);
    --bs-btn-active-color:        var(--td-btn-text, #fff);
    --bs-btn-disabled-color:      var(--td-btn-text, #fff);
}
/* Dark / system-dark: defer to YIQ-computed --td-btn-text (set by BrandingInjector/ThemeFactory).
   No hardcoded colour here — the variable already holds the correct contrast value. */
@media (prefers-color-scheme: dark) {
    .btn-primary {
        --bs-btn-color:          var(--td-btn-text, #fff);
        --bs-btn-hover-color:    var(--td-btn-text, #fff);
        --bs-btn-active-color:   var(--td-btn-text, #fff);
        --bs-btn-disabled-color: var(--td-btn-text, #fff);
    }
}
[data-bs-theme="dark"] .btn-primary {
    --bs-btn-color:          var(--td-btn-text, #fff);
    --bs-btn-hover-color:    var(--td-btn-text, #fff);
    --bs-btn-active-color:   var(--td-btn-text, #fff);
    --bs-btn-disabled-color: var(--td-btn-text, #fff);
}
/* Light buttons — always dark text regardless of colour-mode */
.btn-light,
.btn-light:hover,
.btn-light:focus,
.btn-light:active,
.btn-white,
.btn-white:hover {
    color: var(--bs-gray-900, #212529) !important;
}
/* btn-teal — custom teal variant (not defined in Bootstrap/AdminLTE by default) */
.btn-teal {
    background-color: var(--bs-teal, #20c997);
    border-color: var(--bs-teal, #20c997);
    color: #fff !important;
}
.btn-teal.text-white {
    color: #fff !important;
}
.btn-teal:hover,
.btn-teal:focus {
    background-color: color-mix(in srgb, var(--bs-teal, #20c997) 82%, #000);
    border-color: color-mix(in srgb, var(--bs-teal, #20c997) 82%, #000);
    color: #fff;
}
/* Handbook chapter buttons — inline CSS-var backgrounds keep white text in all modes */
.btn[style*="background:var(--bs-"] {
    color: #fff !important;
}
/* NUKLEAR-OVERRIDE FUER HELLE BUTTONS
   Kills all dark-mode / helper-class overrides on light-coloured buttons.
   Must be at end of file to win the cascade. */
.btn-light,
.bg-light.btn,
.btn-outline-light,
.btn-white,
button.bg-light,
a.bg-light {
    color: #212529 !important;
}
[data-bs-theme="dark"] .btn-light,
[data-bs-theme="dark"] .bg-light.btn,
[data-theme="dark"] .btn-light {
    color: #212529 !important;
}
/* BUILD 27 — .btn-tool always visible (not just on hover)
   AdminLTE default: color:#adb5bd (near-invisible) → visible only on hover.
   Override: always use the hover color so card-header tool buttons are readable. */
.btn-tool {
    color: #495057 !important;
}
.btn-tool:hover,
.btn-tool:focus {
    color: #212529 !important;
}

/* BUILD 38: FINAL SHADOW KILL */
html body .btn-secondary,
html body .btn-secondary:not(:disabled):not(.disabled) {
    color: #ffffff !important;
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
    /* Kill the white inset layer from Bootstrap/AdminLTE */
    box-shadow: none !important;
    background-image: none !important; /* Sicherungskopie gegen Gradients */
}

html body .btn-secondary:hover {
    background-color: #5a6268 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

/* ── BUILD 40: CLEAN TOPBAR BUTTONS ─────────────────────────────────────────
   Replaces the unscoped .btn-primary {var(--topbar-bg)} blocks that were
   living inside inline <style> in header.php and header.view.php.
   Those global rules made ALL primary buttons invisible whenever --topbar-bg
   was a light/white colour (the "heller Schleier" bug, tracked for months).
   Now: only buttons that are actual nav-link descendants inside .main-header
   inherit the topbar colour. Everything else is protected by the RECOVERY rule.
   ────────────────────────────────────────────────────────────────────────── */
.main-header .navbar-nav .nav-link .btn-primary,
.main-header .btn-primary.nav-btn {
    background-color: var(--topbar-bg) !important;
    border-color:     var(--topbar-bg) !important;
}
.main-header .navbar-nav .nav-link .btn-primary:hover,
.main-header .btn-primary.nav-btn:hover {
    background-color: color-mix(in srgb, var(--topbar-bg) 85%, black) !important;
    border-color:     color-mix(in srgb, var(--topbar-bg) 85%, black) !important;
}

/* RECOVERY: Alle anderen Primary-Buttons bekommen ihre Standard-Farbe zurück */
body:not(.main-header) .btn-primary {
    background-color: var(--color-primary, #007bff) !important;
    color: #ffffff !important;
}

/* ── BUILD 211: Heading utility classes (.h1–.h6) — Safety Net ───────────────
   Bootstrap 5 defines these natively (bundled via /assets/plugins/bootstrap/).
   These rules duplicate Bootstrap's values as an explicit safety net so that
   the visual style is preserved even on pages that render without the full
   Bootstrap bundle (e.g. GrapesJS gjs_html output, print views).
   Used by patch218: <h3 class="accordion-header h2"> keeps the h2 appearance. */
.h1 { font-size: calc(1.375rem + 1.5vw); font-weight: 500; line-height: 1.2; }
.h2 { font-size: calc(1.325rem + 0.9vw);  font-weight: 500; line-height: 1.2; }
.h3 { font-size: calc(1.3rem + 0.6vw);    font-weight: 500; line-height: 1.2; }
.h4 { font-size: calc(1.275rem + 0.3vw);  font-weight: 500; line-height: 1.2; }
.h5 { font-size: 1.25rem;                 font-weight: 500; line-height: 1.2; }
.h6 { font-size: 1rem;                    font-weight: 500; line-height: 1.2; }
@media (min-width: 1200px) {
    .h1 { font-size: 2.5rem; }
    .h2 { font-size: 2rem; }
    .h3 { font-size: 1.75rem; }
    .h4 { font-size: 1.5rem; }
}

/* ── Homepage gradient hero (standard.view.php / enterprise tech template) ──
   Replaces inline style="background: linear-gradient(...)" violations.
   Use together with text-white for full hero appearance. */
.m-hero-gradient {
    background: linear-gradient(135deg, #1e293b 0%, #3b82f6 100%);
}

/* Feature card border — primary-coloured outline with subtle shadow.
   Replaces inline style="border: 2px solid #3B82F6; box-shadow: ..." violations. */
.m-card-feature {
    border: 2px solid var(--bs-primary, #3b82f6) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}
