        body {
            font-family: 'Open Sans', sans-serif;
            background-color: #F8FAFC;
            color: #1E293B;
        }
        .card-light {
            background-color: #FFFFFF;
            border: 1px solid #E2E8F0;
        }
        /* Ausklappbare Einstellungs-Bereiche (details/summary) - kompaktes, sauberes Layout
           mit drehbarem Pfeil-Indikator, damit im zugeklappten Zustand kein "leerer" Eindruck
           entsteht. */
        details.settings-accordion > summary {
            list-style: none;
            position: relative;
            padding-right: 2.5rem;
        }
        details.settings-accordion > summary::-webkit-details-marker { display: none; }
        details.settings-accordion > summary::after {
            content: "\f078"; /* fa-chevron-down */
            font-family: "Font Awesome 6 Free";
            font-weight: 900;
            position: absolute;
            right: 1.5rem;
            top: 50%;
            transform: translateY(-50%);
            color: #94A3B8;
            font-size: 0.8rem;
            transition: transform 0.2s ease;
        }
        details.settings-accordion[open] > summary::after {
            transform: translateY(-50%) rotate(180deg);
        }
        details.settings-accordion[open] > summary {
            border-bottom: 1px solid #F1F5F9;
        }
        .custom-shadow {
            box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.05), 0 2px 6px -2px rgba(0, 0, 0, 0.03);
        }
        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }
        ::-webkit-scrollbar-track {
            background: #F1F5F9;
        }
        ::-webkit-scrollbar-thumb {
            background: #CBD5E1;
            border-radius: 3px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: #94A3B8;
        }
        /* Mobile-Menü: Desktop-Navigation bleibt exakt wie sie ist (ab md sichtbar über die
           normale Tailwind-Klasse). Auf kleinen Screens ist #headerNavBar per Default hidden;
           der Hamburger-Button togglet diese Klasse, um das Menü als Dropdown einzublenden. */
        @media (max-width: 767px) {
            #headerNavBar.mobile-open {
                display: flex !important;
            }
        }
        /* Platzhaltertext für leere contenteditable-Felder (Rich-Text-Editoren im Ticketcenter) */
        [contenteditable][data-placeholder]:empty:before {
            content: attr(data-placeholder);
            color: #94A3B8;
            pointer-events: none;
        }
        /* Eingebettete Bilder in Rich-Text-Inhalten (Beschreibung/Kommentare) nie breiter als der
           verfügbare Platz darstellen */
        .rich-content img, [contenteditable] img {
            max-width: 100%;
            height: auto;
            border-radius: 6px;
        }
        /* iOS-Safari-Fix: "position: sticky" kann bei Momentum-Scrolling auf iPhones zu einem
           Rendering-Fehler führen, bei dem der Header-Inhalt kurzzeitig doppelt/überlagert mit
           darunterliegendem Content gezeichnet wird ("Ghosting"). Erzwingt eine eigene
           Compositing-Ebene für den Header, was dieses bekannte WebKit-Problem zuverlässig behebt. */
        header.sticky {
            -webkit-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
            will-change: transform;
            isolation: isolate;
        }
        /* PDF-Export einer Wiki-Seite: nutzt den normalen Browser-Druckdialog ("Als PDF speichern"),
           kein externes JS/Bibliothek nötig. wikiPrintExportActive wird nur kurzzeitig per JS auf
           <body> gesetzt (siehe exportWikiPageAsPdf()) - blendet dabei ALLES außer dem eigentlichen
           Seiteninhalt aus, inkl. Navigation, Seitenleiste und Bearbeiten-Buttons. */
        body.wikiPrintExportActive > *:not(#wikiPrintExportRoot) {
            display: none !important;
        }
        #wikiPrintExportRoot {
            display: none;
        }
        body.wikiPrintExportActive #wikiPrintExportRoot {
            display: block !important;
            max-width: 800px;
            margin: 0 auto;
            padding: 24px;
            font-family: 'Open Sans', sans-serif;
            color: #1E293B;
        }
        @media print {
            body.wikiPrintExportActive #wikiPrintExportRoot img {
                max-width: 100% !important;
            }
        }
        /* Generisches Gegenstück für die Ticketabrechnung (PDF je Firma) - gleiches Muster wie beim
           Wiki-Export, nur mit eigener Aktivierungsklasse/eigenem Root, damit beide unabhängig
           voneinander funktionieren. */
        body.ticketabrechnungPrintActive > *:not(#ticketabrechnungPrintRoot) {
            display: none !important;
        }
        #ticketabrechnungPrintRoot {
            display: none;
        }
        body.ticketabrechnungPrintActive #ticketabrechnungPrintRoot {
            display: block !important;
            width: 100% !important;
            max-width: none !important;
            margin: 0 !important;
            box-sizing: border-box;
            padding: 24px;
            font-family: 'Open Sans', sans-serif;
            color: #1E293B;
        }
        /* Defensiv: falls <html>/<body> beim Drucken selbst noch irgendeine Breiten-Beschränkung
           mitbringen (z.B. durch Browser-Druckeinstellungen wie "Skalierung"), wird das hier
           zusätzlich explizit aufgehoben - verhindert, dass die Druck-Vorlage trotz eigenem
           width:100% nur einen schmalen mittigen Ausschnitt der Seite einnimmt. */
        body.ticketabrechnungPrintActive,
        body.ticketabrechnungPrintActive html {
            width: 100% !important;
            max-width: none !important;
            margin: 0 !important;
            padding: 0 !important;
        }
        @media print {
            @page {
                margin: 12mm;
                size: auto;
            }
            body.ticketabrechnungPrintActive #ticketabrechnungPrintRoot {
                width: 100% !important;
                max-width: none !important;
            }
        }

        /* Generisches Print-Root für Tabellen-PDFs (Zeiten/Fahrtenbuch) - identisches Muster wie die
           Ticketabrechnung, nur eigene Aktivierungsklasse/eigenes Root. */
        body.genericPdfPrintActive > *:not(#genericPdfPrintRoot) { display: none !important; }
        #genericPdfPrintRoot { display: none; }
        body.genericPdfPrintActive #genericPdfPrintRoot {
            display: block !important;
            width: 100% !important;
            max-width: none !important;
            margin: 0 !important;
            box-sizing: border-box;
            padding: 24px;
            font-family: 'Open Sans', sans-serif;
            font-size: 12px;
            line-height: 1.5;
            color: #1E293B;
        }
        /* Body-Text im PDF nicht zu groß (Fahrtenbuch/Zeitenexport nutzen normale <p>/<div>) */
        body.genericPdfPrintActive #genericPdfPrintRoot p,
        body.genericPdfPrintActive #genericPdfPrintRoot div,
        body.genericPdfPrintActive #genericPdfPrintRoot td,
        body.genericPdfPrintActive #genericPdfPrintRoot li { font-size: 12px; }
        body.genericPdfPrintActive,
        body.genericPdfPrintActive html {
            width: 100% !important;
            max-width: none !important;
            margin: 0 !important;
            padding: 0 !important;
        }
        @media print {
            body.genericPdfPrintActive #genericPdfPrintRoot { width: 100% !important; max-width: none !important; }
        }
        /* Tabelle im PDF-Export (ordentliche Rahmen wie bei der Ticketabrechnung). */
        .pdf-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 11px; }
        .pdf-table th, .pdf-table td { border: 1px solid #CBD5E1; padding: 6px 8px; text-align: left; vertical-align: top; }
        .pdf-table th { background: #F1F5F9; font-weight: 700; text-transform: uppercase; font-size: 9px; color: #475569; }
        .pdf-table td.num, .pdf-table th.num { text-align: right; white-space: nowrap; }
        .pdf-table tfoot td { font-weight: 700; background: #F8FAFC; }
        .pdf-table .pdf-sub { color: #64748B; font-size: 9px; }

/* Listen/Nummerierung in allen Rich-Text-Editoren (Wiki, Ticket-Beschreibung, Ticket-Kommentare,
   CRM-Interaktionen, Abrechnungs-Notiz). Normale Aufzählungen (Punkte/Striche/Buchstaben) nutzen
   das native CSS list-style-type - dafür reicht die JS-Zuweisung in richSetListStyle() bereits aus.
   Die hierarchische Zahlen-Nummerierung ("1, 1.1, 1.2, 2, 2.1, ...") braucht dagegen CSS counters(),
   da HTML/execCommand bei verschachtelten <ol>-Listen sonst jede Ebene wieder bei "1" neu beginnen
   würde, statt die Elternebene mit einzubeziehen. .rich-list-decimal wird von richSetListStyle()
   gesetzt (list-style-type:none, die eigentliche Zahl kommt komplett aus ::before/counters()). */
.rich-list-decimal,
.rich-list-decimal ol {
    counter-reset: rich-item;
    padding-left: 1.8em;
    list-style-type: none;
}
.rich-list-decimal > li {
    counter-increment: rich-item;
    position: relative;
}
.rich-list-decimal > li::before {
    content: counters(rich-item, ".") ". ";
    position: absolute;
    left: -1.8em;
    font-weight: 700;
    color: #64748B;
}
/* Verschachtelte Listen (jeder Ebene über "Einrücken" erzeugt) bekommen etwas Abstand nach links,
   damit die Hierarchie auch optisch erkennbar ist - unabhängig vom gewählten Listen-Stil. Bewusst
   GLOBAL (nicht an einen bestimmten Wrapper gebunden), damit dieselbe Formatierung auch dort greift,
   wo Inhalte nur ANGEZEIGT werden (Ticket-Beschreibung, Kommentare, Wiki-Seiten-Ansicht), nicht nur
   im Editor selbst - der gespeicherte HTML-Inhalt enthält Listen-Tags ja unabhängig vom Kontext.
   Tailwinds Basis-Reset entfernt list-style/padding von <ul>/<ol> normalerweise ohnehin komplett -
   diese Regel gilt daher nur dort, wo tatsächlich Listen-Inhalt aus einem der Editoren vorkommt. */
ul, ol {
    padding-left: 1.8em;
    margin: 4px 0;
}
li {
    margin: 2px 0;
}

/* ============================================================================
   Rich-Text-Editor: Einfüge-Funktionen (Code-Block/Infobox/Tabelle/Form)
   ============================================================================
   Ersetzt die früheren "style=..."-Attribute, die diese Funktionen direkt in den
   gespeicherten HTML-Inhalt (Wiki-Seiten/Tickets/Kommentare) eingebettet haben - nötig, damit die
   Content-Security-Policy irgendwann auch bei style-src ohne "unsafe-inline" auskommt. Bereits
   gespeicherte, ältere Inhalte wurden per einmaligem Migrationsskript (siehe
   migrate_rich_content_styles.php) auf dieselben Klassen umgestellt.
*/
.rich-code-generic {
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    overflow-x: auto;
    white-space: pre-wrap;
}
.rich-code-ps {
    background: #012456;
    color: #e5f2ff;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    overflow-x: auto;
    white-space: pre-wrap;
}
.rich-callout {
    border-radius: 8px;
    padding: 10px 14px;
    margin: 8px 0;
    border: 1px solid;
}
.rich-callout-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.rich-callout-warning { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.rich-callout-tip { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.rich-callout-note { background: #fefce8; border-color: #fef08a; color: #854d0e; }
.rich-table {
    border-collapse: collapse;
    width: 100%;
    margin: 8px 0;
}
.rich-table th {
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
    padding: 6px 10px;
    text-align: left;
}
.rich-table td {
    border: 1px solid #cbd5e1;
    padding: 6px 10px;
}
.rich-shape-svg {
    vertical-align: middle;
}

/* ============================================================================
   PDF-Export (Ticketabrechnung & Wiki-Seite) - rein für den Export gebaute,
   unsichtbare Container, keine dauerhaft gespeicherten Inhalte betroffen.
   ============================================================================ */
.pdf-entry-row { padding: 10px 0; border-bottom: 1px solid #E2E8F0; }
.pdf-entry-title { font-size: 13px; font-weight: 700; color: #1E293B; }
.pdf-entry-empty-note { font-size: 11px; color: #B45309; font-style: italic; margin-top: 2px; }
.pdf-entry-header-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pdf-entry-right { text-align: right; flex-shrink: 0; }
.pdf-entry-right-inline { display: flex; align-items: baseline; gap: 12px; white-space: nowrap; }
.pdf-entry-date { font-size: 11px; color: #94A3B8; }
.pdf-billing-type { font-size: 10px; color: #64748B; margin-top: 2px; }
.pdf-entry-note { font-size: 12px; color: #475569; margin-top: 4px; }
.pdf-courtesy-note { font-size: 11px; color: #059669; margin-top: 4px; }
.pdf-remote-row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; padding-top: 6px; border-top: 1px dashed #E2E8F0; }
.pdf-remote-label { font-size: 11px; color: #1D4ED8; }
.pdf-remote-amount { font-size: 12px; font-weight: 700; color: #1D4ED8; }
.pdf-header-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px solid #1E293B; }
.pdf-logo { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.pdf-brand-name { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; color: #1E293B; }
.pdf-brand-name .pdf-brand-one { color: #D70041; font-weight: 800; margin-left: 3px; }
.pdf-brand-badge { font-size: 9px; font-weight: 800; color: #D70041; background: #FFF0F3; border: 1px solid #FFD6E0; border-radius: 4px; padding: 1px 5px; margin-left: 4px; }
.pdf-brand-sub { font-size: 10px; color: #94A3B8; }
.pdf-h1-22 { font-size: 22px; font-weight: 900; margin-bottom: 4px; }
.pdf-h1-24 { font-size: 24px; font-weight: 900; margin-bottom: 4px; }
.pdf-address-line { font-size: 11px; color: #64748B; margin-bottom: 2px; }
.pdf-customer-number { font-size: 11px; color: #64748B; margin-bottom: 12px; }
.pdf-meta-line { font-size: 11px; color: #94A3B8; margin-bottom: 16px; }
.pdf-divider-top { border-top: 2px solid #1E293B; }
.pdf-totals-row { display: flex; justify-content: flex-end; gap: 16px; padding-top: 14px; align-items: baseline; }
.pdf-totals-label { font-size: 13px; font-weight: 900; }
.pdf-totals-amount { font-size: 16px; font-weight: 900; color: #D70041; }
.pdf-footer { margin-top: 32px; padding-top: 12px; border-top: 1px solid #E2E8F0; font-size: 10px; color: #94A3B8; line-height: 1.6; }
.pdf-footer-bold { font-weight: 700; margin-bottom: 4px; }
.pdf-wiki-meta { font-size: 11px; color: #94A3B8; margin-bottom: 8px; }
.pdf-wiki-tags { margin-bottom: 16px; }
.pdf-wiki-hr { border: none; border-top: 1px solid #E2E8F0; margin-bottom: 16px; }
.pdf-wiki-content { font-size: 14px; line-height: 1.6; }
.pdf-wiki-footer { font-size: 10px; color: #CBD5E1; margin-top: 32px; }

/* Diagramm-Legende (GuV-Ansicht) und Wiki-Baum-Einrückung */
.legend-swatch { height: 4px; border-radius: 2px; }
.legend-swatch-red { background: #D70041; }
.legend-swatch-green { background: #10B981; }
.legend-swatch-blue { background: #2563EB; }
.wiki-tree-depth-0 { padding-left: 8px; }
.wiki-tree-depth-1 { padding-left: 24px; }
.wiki-tree-depth-2 { padding-left: 40px; }
.wiki-tree-depth-3 { padding-left: 56px; }
.wiki-tree-depth-4 { padding-left: 72px; }
.wiki-tree-depth-5 { padding-left: 88px; }
/* ab Ebene 6 bleibt es bei derselben Einrückung wie Ebene 5 - realistisch nie so tief verschachtelt */
.editor-lh15 { line-height: 1.5; }
.editor-lh16 { line-height: 1.6; }
.min-h-70vh { min-height: 70vh; }

/* Sichtbare "ausgegraut"-Optik für Kommen/Gehen-Buttons - ersetzt frühere .style.opacity/.cursor
   JS-Zuweisungen (siehe app.js clock-in/out Logik). Bewusst eine eigene, klein umrissene Klasse
   statt einer globalen button:disabled-Regel, um keine anderen Buttons unbeabsichtigt zu verändern. */
.clock-btn-disabled-look { opacity: 0.35; cursor: not-allowed; }

.saved-flash-indicator { transition: opacity 0.6s ease; }
.saved-flash-indicator.fade-out { opacity: 0; }
.loading-opacity { opacity: 0.5; }
.chevron-rotated { transform: rotate(180deg); }
.rich-list-disc { list-style-type: disc; }
.rich-list-dash { list-style-type: "– "; }
.rich-list-lower-alpha { list-style-type: lower-alpha; }
.editor-img-selected { outline: 2px dashed #D70041; }
.editor-img-bordered { border: 2px solid #cbd5e1; border-radius: 6px; }
.rich-fs-10 { font-size: 10px; }
.rich-fs-12 { font-size: 12px; }
.rich-fs-14 { font-size: 14px; }
.rich-fs-16 { font-size: 16px; }
.rich-fs-20 { font-size: 20px; }
.rich-fs-24 { font-size: 24px; }
.rich-fs-32 { font-size: 32px; }



        /* ============================================================
           Kanban-Spaltenfarben (kein Inline-CSS, alles über Klassen).
           Für jede Farbe gibt es:
             .kancol-<farbe>          -> Rahmen + Hintergrund der Spalte
             .kancol-<farbe>-head     -> getönte Kopfzeile
             .kancol-<farbe>-text     -> Textfarbe der Kopfzeile
             .kanswatch-<farbe>       -> runde Farbkachel im Auswahl-Dialog
           ============================================================ */
        /* Vorschau-Kacheln: gemeinsame Grundform */
        .kanswatch { width: 2rem; height: 2rem; border-radius: 9999px; }
        .kanswatch-sm { width: 1.5rem; height: 1.5rem; }
        /* Diese Utility-Klassen fehlen im vorkompilierten Tailwind-Build - hier ergänzt, damit der
           kompakte Farbwähler korrekt umbricht und Klicks zuverlässig auf dem Button landen. */
        .pointer-events-none { pointer-events: none; }
        .grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
        .grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
        @media (min-width: 640px) { .sm\:grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); } }

        /* --- Neutral / Keine --- */
        .kanswatch-none { background:#FFFFFF; border:2px solid #CBD5E1; }

        /* --- Graustufen --- */
        .kancol-slate     { background:#F8FAFC; border-color:#E2E8F0; }
        .kancol-slate-head{ background:#F1F5F9; border-color:#E2E8F0; }
        .kancol-slate-text{ color:#334155; }
        .kanswatch-slate  { background:#CBD5E1; }
        .kancol-gray      { background:#FAFAFA; border-color:#E5E7EB; }
        .kancol-gray-head { background:#F3F4F6; border-color:#E5E7EB; }
        .kancol-gray-text { color:#374151; }
        .kanswatch-gray   { background:#D1D5DB; }

        /* --- Gelb / Quietschgelb (Standard für Neu/Offen) --- */
        .kancol-yellow      { background:#FEFCE8; border-color:#FDE047; }
        .kancol-yellow-head { background:#FDE047; border-color:#EAB308; }
        .kancol-yellow-text { color:#713F12; }
        .kanswatch-yellow   { background:#FACC15; }
        .kancol-amber      { background:#FFFBEB; border-color:#FDE68A; }
        .kancol-amber-head { background:#FEF3C7; border-color:#FCD34D; }
        .kancol-amber-text { color:#92400E; }
        .kanswatch-amber   { background:#FBBF24; }
        .kancol-orange      { background:#FFF7ED; border-color:#FED7AA; }
        .kancol-orange-head { background:#FFEDD5; border-color:#FDBA74; }
        .kancol-orange-text { color:#9A3412; }
        .kanswatch-orange   { background:#FB923C; }

        /* --- Rottöne --- */
        .kancol-red      { background:#FEF2F2; border-color:#FECACA; }
        .kancol-red-head { background:#FEE2E2; border-color:#FCA5A5; }
        .kancol-red-text { color:#991B1B; }
        .kanswatch-red   { background:#F87171; }
        .kancol-rose      { background:#FFF1F2; border-color:#FECDD3; }
        .kancol-rose-head { background:#FFE4E6; border-color:#FDA4AF; }
        .kancol-rose-text { color:#9F1239; }
        .kanswatch-rose   { background:#FB7185; }
        .kancol-pink      { background:#FDF2F8; border-color:#FBCFE8; }
        .kancol-pink-head { background:#FCE7F3; border-color:#F9A8D4; }
        .kancol-pink-text { color:#9D174D; }
        .kanswatch-pink   { background:#F472B6; }

        /* --- Lila / Violett --- */
        .kancol-purple      { background:#FAF5FF; border-color:#E9D5FF; }
        .kancol-purple-head { background:#F3E8FF; border-color:#D8B4FE; }
        .kancol-purple-text { color:#6B21A8; }
        .kanswatch-purple   { background:#C084FC; }
        .kancol-violet      { background:#F5F3FF; border-color:#DDD6FE; }
        .kancol-violet-head { background:#EDE9FE; border-color:#C4B5FD; }
        .kancol-violet-text { color:#5B21B6; }
        .kanswatch-violet   { background:#A78BFA; }
        .kancol-indigo      { background:#EEF2FF; border-color:#C7D2FE; }
        .kancol-indigo-head { background:#E0E7FF; border-color:#A5B4FC; }
        .kancol-indigo-text { color:#3730A3; }
        .kanswatch-indigo   { background:#818CF8; }

        /* --- Blau / Cyan --- */
        .kancol-blue      { background:#EFF6FF; border-color:#BFDBFE; }
        .kancol-blue-head { background:#DBEAFE; border-color:#93C5FD; }
        .kancol-blue-text { color:#1E40AF; }
        .kanswatch-blue   { background:#60A5FA; }
        .kancol-sky      { background:#F0F9FF; border-color:#BAE6FD; }
        .kancol-sky-head { background:#E0F2FE; border-color:#7DD3FC; }
        .kancol-sky-text { color:#075985; }
        .kanswatch-sky   { background:#38BDF8; }
        .kancol-cyan      { background:#ECFEFF; border-color:#A5F3FC; }
        .kancol-cyan-head { background:#CFFAFE; border-color:#67E8F9; }
        .kancol-cyan-text { color:#155E75; }
        .kanswatch-cyan   { background:#22D3EE; }

        /* --- Grün / Türkis --- */
        .kancol-teal      { background:#F0FDFA; border-color:#99F6E4; }
        .kancol-teal-head { background:#CCFBF1; border-color:#5EEAD4; }
        .kancol-teal-text { color:#115E59; }
        .kanswatch-teal   { background:#2DD4BF; }
        .kancol-emerald      { background:#ECFDF5; border-color:#A7F3D0; }
        .kancol-emerald-head { background:#D1FAE5; border-color:#6EE7B7; }
        .kancol-emerald-text { color:#065F46; }
        .kanswatch-emerald   { background:#34D399; }
        .kancol-green      { background:#F0FDF4; border-color:#BBF7D0; }
        .kancol-green-head { background:#DCFCE7; border-color:#86EFAC; }
        .kancol-green-text { color:#166534; }
        .kanswatch-green   { background:#4ADE80; }
        /* Dunkelgrün (Standard für Erledigt) - kräftiger Kopf mit hellem Text */
        .kancol-darkgreen      { background:#F0FDF4; border-color:#86EFAC; }
        .kancol-darkgreen-head { background:#15803D; border-color:#166534; }
        .kancol-darkgreen-text { color:#FFFFFF; }
        .kanswatch-darkgreen   { background:#15803D; }

        /* --- Braun --- */
        .kancol-brown      { background:#FAF5F0; border-color:#E7D3C0; }
        .kancol-brown-head { background:#EFE0D2; border-color:#D9BFA0; }
        .kancol-brown-text { color:#78350F; }
        .kanswatch-brown   { background:#B98A5E; }

        /* Kanban-Spalten: maximale Höhe begrenzen, damit bei vielen Tickets pro Spalte gescrollt
           wird (statt die ganze Seite in die Länge zu ziehen). Der Kartenbereich innen scrollt. */
        .kanban-col-maxh { max-height: var(--kanban-col-height, 520px); }

        /* Ticket-Ansichten: Umschaltbuttons + Diagramm-Balken-Farben (kein externes Chart-Lib) */
        .chart-bar-blue  { background-color: #3B82F6; }
        .chart-bar-green { background-color: #22C55E; }
        .chart-bar-amber { background-color: #F59E0B; }
        .chart-bar-red   { background-color: #EF4444; }

        /* Utility-Klassen, die im vorkompilierten Tailwind fehlen - für die Ticket-Ansichten ergänzt. */
        .grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
        .min-h-\[84px\] { min-height: 84px; }
        .w-fit { width: fit-content; }
        /* .pointer-events-none ist ggf. schon oben definiert - hier nur zur Sicherheit (idempotent). */
        .pointer-events-none { pointer-events: none; }

        /* Obere Scrollleiste am Kanban: schmaler Streifen, dessen Scrollbar sichtbar bleibt und
           mit dem Board darunter synchronisiert ist. */
        #ticketKanbanScrollTop { height: 14px; margin-bottom: 2px; }
        #ticketKanbanScrollTop::-webkit-scrollbar { height: 10px; }

        /* Ticket-Seite: frei verschiebbare Panels (Meine Tickets / Letzte Aktivität). */
        .ticket-drag-section.dragging { opacity: 0.4; }
        .ticket-drag-handle { touch-action: none; }

        /* ============================================================
           M365-STIL SIDE-NAVIGATION (Variante B: schmale Topbar + Sidebar)
           ============================================================ */
        /* App-Grundlayout: schmale Topbar oben, darunter Sidebar + Content nebeneinander. */
        .app-shell { display: flex; flex-direction: column; min-height: 100vh; }
        .app-topbar {
            display: flex; align-items: center; gap: 12px;
            height: 52px; padding: 0 16px;
            background: #fff; border-bottom: 1px solid #E2E8F0;
            position: sticky; top: 0; z-index: 50;
        }
        .app-body { display: flex; flex: 1; min-height: 0; }
        .app-sidebar {
            width: 232px; flex-shrink: 0;
            background: #F8FAFC; border-right: 1px solid #E2E8F0;
            padding: 12px 10px; overflow-y: auto;
            display: flex; flex-direction: column; gap: 2px;
            position: sticky; top: 52px; height: calc(100vh - 52px);
        }
        .app-content { flex: 1; min-width: 0; padding: 20px; }

        /* Gruppen-Überschrift in der Sidebar */
        .sidenav-group-label {
            font-size: 11px; font-weight: 700; text-transform: uppercase;
            letter-spacing: 0.04em; color: #94A3B8;
            padding: 14px 10px 4px;
        }
        /* Nav-Eintrag (nutzt weiterhin die tab-<id> Buttons + switchTab) */
        .sidenav-item {
            display: flex; align-items: center; gap: 12px;
            width: 100%; text-align: left;
            padding: 10px 12px; border-radius: 6px;
            font-size: 14px; font-weight: 500; color: #475569;
            background: transparent; border: none; cursor: pointer;
            transition: background 0.12s, color 0.12s;
        }
        .sidenav-item:hover { background: #EEF2F7; color: #1E293B; }
        .sidenav-item i { font-size: 19px; width: 22px; text-align: center; flex-shrink: 0; }
        /* WICHTIG: .hidden (display:none) muss gegen das .sidenav-item display:flex gewinnen -
           sonst bleiben rollenbedingt versteckte Nav-Einträge (z.B. Administration für normale
           Benutzer) sichtbar. Auch die Gruppen-Labels absichern. */
        .sidenav-item.hidden, .sidenav-group-label.hidden, .zeit-subtab.hidden { display: none !important; }
        /* Aktiver Eintrag: ROT als Firmenmerkmal (Marke/Highlight) */
        .sidenav-item.active {
            background: #FBEAF0; color: #991B1B; font-weight: 700;
            box-shadow: inset 3px 0 0 #D70041;
        }
        .sidenav-item.active i { color: #D70041; }

        /* Topbar-Elemente */
        .app-topbar .topbar-brand { display: flex; align-items: center; gap: 6px; }
        .app-topbar .topbar-spacer { margin-left: auto; }

        /* Mobile: Sidebar wird zum ausklappbaren Overlay */
        @media (max-width: 767px) {
            .app-sidebar {
                position: fixed; top: 52px; left: 0; height: calc(100vh - 52px);
                z-index: 45; transform: translateX(-100%);
                transition: transform 0.2s ease; box-shadow: 2px 0 12px rgba(0,0,0,0.12);
            }
            .app-sidebar.open { transform: translateX(0); }
            .app-content { padding: 14px; }
            .sidebar-backdrop {
                display: none; position: fixed; inset: 52px 0 0 0; z-index: 44;
                background: rgba(0,0,0,0.35);
            }
            .sidebar-backdrop.open { display: block; }
        }
        @media (min-width: 768px) {
            .app-mobile-only { display: none !important; }
        }

        /* ============================================================
           DARK MODE
           Aktiv, wenn <html data-theme="dark"> gesetzt ist. Statt tausende
           Tailwind-Klassen einzeln umzustellen, werden hier die verwendeten
           Farbklassen zentral umdefiniert. Firmen-Rot (okred) bleibt in beiden
           Modi gleich - es ist das Markenmerkmal.
           ============================================================ */
        html[data-theme="dark"] body { background: #1B1A19; color: #D6D6D6; }

        /* --- Flächen (Hintergründe) - M365-Palette: leicht wärmere Neutraltöne mit klaren Abstufungen --- */
        html[data-theme="dark"] .bg-white { background-color: #292827 !important; }
        html[data-theme="dark"] .bg-slate-50 { background-color: #201F1E !important; }
        html[data-theme="dark"] .bg-slate-100 { background-color: #323130 !important; }
        html[data-theme="dark"] .bg-slate-200 { background-color: #3B3A39 !important; }
        html[data-theme="dark"] .card-light { background-color: #292827 !important; }
        /* Transparente weiße Hintergründe (z.B. sticky Modal-Header bg-white/95, bg-white/60) */
        html[data-theme="dark"] [class*="bg-white/"] { background-color: rgba(41, 40, 39, 0.95) !important; }

        /* App-Grundlayout */
        html[data-theme="dark"] .app-topbar { background: #292827; border-bottom-color: #3B3A39; }
        html[data-theme="dark"] .app-sidebar { background: #201F1E; border-right-color: #3B3A39; }
        html[data-theme="dark"] .sidenav-item { color: #C8C6C4; }
        html[data-theme="dark"] .sidenav-item:hover { background: #323130; color: #FFFFFF; }
        html[data-theme="dark"] .sidenav-group-label { color: #797775; }
        /* Aktiver Nav-Eintrag: Rot bleibt, nur die Fläche dunkler */
        html[data-theme="dark"] .sidenav-item.active { background: #3D1620; color: #FCA5A5; }
        html[data-theme="dark"] .sidenav-item.active i { color: #F43F6E; }

        /* --- Texte - M365: höherer Kontrast für Haupttext, klar abgestufte Sekundärtöne --- */
        html[data-theme="dark"] .text-slate-900 { color: #FFFFFF !important; }
        html[data-theme="dark"] .text-slate-800 { color: #F3F2F1 !important; }
        html[data-theme="dark"] .text-slate-700 { color: #E1DFDD !important; }
        html[data-theme="dark"] .text-slate-600 { color: #C8C6C4 !important; }
        html[data-theme="dark"] .text-slate-500 { color: #A19F9D !important; }
        html[data-theme="dark"] .text-slate-400 { color: #8A8886 !important; }
        html[data-theme="dark"] .text-slate-300 { color: #6E6C6A !important; }
        html[data-theme="dark"] .text-okdark { color: #FFFFFF !important; }

        /* --- Ränder --- */
        html[data-theme="dark"] .border-slate-100 { border-color: #323130 !important; }
        html[data-theme="dark"] .border-slate-200 { border-color: #3B3A39 !important; }
        html[data-theme="dark"] .border-slate-300 { border-color: #484644 !important; }

        /* --- Eingabefelder / Selects --- */
        html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
        html[data-theme="dark"] select,
        html[data-theme="dark"] textarea {
            background-color: #323130 !important; color: #F3F2F1 !important; border-color: #484644 !important;
        }
        html[data-theme="dark"] input:focus, html[data-theme="dark"] select:focus, html[data-theme="dark"] textarea:focus {
            border-color: #2B88D8 !important; outline: none;
        }
        html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #8A8886 !important; }
        /* Datum-/Zeit-Picker-Icons im Dark Mode sichtbar machen */
        html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
        html[data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator,
        html[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(0.8); }

        /* --- Status-Farbflächen abdunkeln (Text bleibt lesbar) --- */
        html[data-theme="dark"] .bg-emerald-50 { background-color: #12261C !important; }
        html[data-theme="dark"] .bg-blue-50 { background-color: #14233A !important; }
        html[data-theme="dark"] .bg-amber-50 { background-color: #2C2410 !important; }
        html[data-theme="dark"] .bg-red-50 { background-color: #2E1414 !important; }
        html[data-theme="dark"] .bg-purple-50 { background-color: #241B36 !important; }
        html[data-theme="dark"] .bg-okred-50 { background-color: #331119 !important; }
        html[data-theme="dark"] .bg-cyan-50 { background-color: #0E2A2E !important; }
        /* Helle Rahmenfarben der farbigen Icon-Kästchen im Dark Mode abdunkeln */
        html[data-theme="dark"] .border-emerald-100 { border-color: #1E3D2C !important; }
        html[data-theme="dark"] .border-blue-100 { border-color: #1E3453 !important; }
        html[data-theme="dark"] .border-amber-100 { border-color: #40361A !important; }
        html[data-theme="dark"] .border-red-100 { border-color: #442020 !important; }
        html[data-theme="dark"] .border-purple-100 { border-color: #362A52 !important; }
        html[data-theme="dark"] .border-okred-100 { border-color: #4A1A26 !important; }
        html[data-theme="dark"] .border-cyan-100 { border-color: #164247 !important; }
        html[data-theme="dark"] .bg-slate-50\/50 { background-color: #1F1F1F !important; }

        /* Hover-Zustände auf hellen Flächen im Dark Mode */
        html[data-theme="dark"] .hover\:bg-slate-50:hover { background-color: #2E2E2E !important; }
        html[data-theme="dark"] .hover\:bg-slate-100:hover { background-color: #363636 !important; }

        /* Scrollbar im Dark Mode */
        html[data-theme="dark"] ::-webkit-scrollbar-track { background: #1F1F1F; }
        html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #4A4A4A; }
        html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #5A5A5A; }

        /* Umschalt-Button in der Topbar */
        .theme-toggle-btn {
            width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
            border-radius: 8px; border: 1px solid #E2E8F0; background: #fff; color: #64748B;
            cursor: pointer; transition: background 0.12s, color 0.12s;
        }
        .theme-toggle-btn:hover { background: #F1F5F9; color: #1E293B; }
        html[data-theme="dark"] .theme-toggle-btn { background: #303030; border-color: #4A4A4A; color: #C0C0C0; }
        html[data-theme="dark"] .theme-toggle-btn:hover { background: #3A3A3A; color: #F0F0F0; }

        /* ============================================================
           UNTER-TABS (z.B. Zeiterfassung: Meine Zeit / Team / Verwaltung)
           ============================================================ */
        .zeit-subtabs {
            display: flex; gap: 4px; flex-wrap: wrap;
            border-bottom: 1px solid #E2E8F0; padding-bottom: 0; margin-bottom: 4px;
        }
        .zeit-subtab {
            display: flex; align-items: center; gap: 7px;
            padding: 9px 16px; border: none; background: transparent; cursor: pointer;
            font-size: 13px; font-weight: 600; color: #64748B;
            border-bottom: 2px solid transparent; margin-bottom: -1px;
            transition: color 0.12s, border-color 0.12s;
        }
        .zeit-subtab:hover { color: #1E293B; }
        .zeit-subtab i { font-size: 15px; }
        /* Aktiver Unter-Tab: blaue Unterstreichung (M365-Aktionsfarbe) */
        .zeit-subtab.active { color: #0F6CBD; border-bottom-color: #0F6CBD; }

        html[data-theme="dark"] .zeit-subtabs { border-bottom-color: #3A3A3A; }
        html[data-theme="dark"] .zeit-subtab { color: #9A9A9A; }
        html[data-theme="dark"] .zeit-subtab:hover { color: #F0F0F0; }
        html[data-theme="dark"] .zeit-subtab.active { color: #4AA3E8; border-bottom-color: #4AA3E8; }

        /* ============================================================
           PROFIL-MENÜ (Dropdown beim Klick aufs Profilbild, M365-Stil)
           ============================================================ */
        .user-menu-dropdown {
            position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
            width: 232px; background: #fff; border: 1px solid #E2E8F0;
            border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,0.14); padding: 6px;
        }
        .user-menu-header {
            display: flex; align-items: center; gap: 10px;
            padding: 8px 8px 10px; border-bottom: 1px solid #F1F5F9; margin-bottom: 4px;
        }
        .user-menu-name { font-size: 13px; font-weight: 700; color: #1E293B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .user-menu-role { font-size: 11px; color: #94A3B8; }
        .user-menu-item {
            display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
            padding: 8px 8px; border: none; background: transparent; cursor: pointer;
            font-size: 13px; font-weight: 500; color: #475569; border-radius: 6px;
            transition: background 0.12s, color 0.12s;
        }
        .user-menu-item:hover { background: #F1F5F9; color: #1E293B; }
        .user-menu-item i { width: 18px; font-size: 15px; text-align: center; color: #64748B; }
        .user-menu-item:hover i { color: #1E293B; }
        .user-menu-divider { height: 1px; background: #F1F5F9; margin: 4px 0; }
        .user-menu-danger { color: #B91C1C; }
        .user-menu-danger i { color: #DC2626; }
        .user-menu-danger:hover { background: #FEF2F2; color: #991B1B; }

        html[data-theme="dark"] .user-menu-dropdown { background: #2A2A2A; border-color: #3A3A3A; box-shadow: 0 8px 28px rgba(0,0,0,0.5); }
        html[data-theme="dark"] .user-menu-header { border-bottom-color: #3A3A3A; }
        html[data-theme="dark"] .user-menu-name { color: #F0F0F0; }
        html[data-theme="dark"] .user-menu-item { color: #C0C0C0; }
        html[data-theme="dark"] .user-menu-item i { color: #9A9A9A; }
        html[data-theme="dark"] .user-menu-item:hover { background: #363636; color: #F0F0F0; }
        html[data-theme="dark"] .user-menu-item:hover i { color: #F0F0F0; }
        html[data-theme="dark"] .user-menu-divider { background: #3A3A3A; }
        html[data-theme="dark"] .user-menu-danger { color: #F87171; }
        html[data-theme="dark"] .user-menu-danger:hover { background: #3A1515; color: #FCA5A5; }

        /* ============================================================
           DICHTE: KOMPAKTE ANSICHT (umschaltbar über das Profil-Menü)
           Aktiv, wenn <html data-density="compact"> gesetzt ist.
           Reduziert Innenabstände von Karten und Zeilenhöhen.
           ============================================================ */
        /* Karten kompakter */
        html[data-density="compact"] .card-light.p-6 { padding: 14px 16px !important; }
        html[data-density="compact"] .card-light.p-5 { padding: 12px 14px !important; }
        html[data-density="compact"] .card-light.p-4 { padding: 10px 12px !important; }
        /* Vertikale Abstände zwischen Sektionen verringern */
        html[data-density="compact"] .space-y-6 > * + * { margin-top: 14px !important; }
        html[data-density="compact"] .space-y-5 > * + * { margin-top: 12px !important; }
        html[data-density="compact"] .space-y-4 > * + * { margin-top: 10px !important; }
        /* Tabellenzeilen kompakter */
        html[data-density="compact"] table td,
        html[data-density="compact"] table th { padding-top: 5px !important; padding-bottom: 5px !important; }
        /* Content-Bereich mit weniger Rand */
        html[data-density="compact"] .app-content { padding: 12px 16px; }

        /* ============================================================
           M365-ECKENRADIEN: Buttons/Eingabefelder/Bedienelemente eckiger
           ----------------------------------------------------------------
           Microsoft rundet Buttons & Felder nur leicht (~4px). Deshalb
           rounded-lg (8px) und rounded-md (6px) zentral auf 4px reduzieren.
           Karten/Kacheln (rounded-xl = 12px) und Avatare/Punkte (rounded-full)
           bleiben bewusst unberührt - die sind auch bei M365 leicht rund.
           ============================================================ */
        .rounded-lg { border-radius: 4px !important; }
        .rounded-md { border-radius: 4px !important; }
        /* rounded (Standard, 4px in Tailwind) bleibt wie es ist.
           rounded-xl (Karten) und rounded-full (Avatare) NICHT anfassen. */

        /* Eigene Bedien-Elemente ebenfalls auf M365-Radius bringen */
        .sidenav-item { border-radius: 4px; }
        .user-menu-item { border-radius: 4px; }
        .theme-toggle-btn { border-radius: 4px; }

        /* Kompakte Ansicht: auch Sidebar/Menü kompakter (schmaler, engere Zeilen, kleinere Schrift) */
        html[data-density="compact"] .app-sidebar { width: 200px; padding: 8px 8px; gap: 1px; }
        html[data-density="compact"] .sidenav-item { padding: 7px 10px; font-size: 13px; gap: 10px; }
        html[data-density="compact"] .sidenav-item i { font-size: 17px; width: 20px; }
        html[data-density="compact"] .sidenav-group-label { font-size: 10px; padding: 9px 10px 3px; }
        /* Topbar minimal niedriger */
        html[data-density="compact"] .app-topbar { height: 46px; }
        html[data-density="compact"] .app-sidebar { top: 46px; height: calc(100vh - 46px); }
        /* Unter-Tabs (Zeiterfassung) enger */
        html[data-density="compact"] .zeit-subtab { padding: 7px 13px; font-size: 12px; }

        /* ============================================================
           M365-STIL DETAIL-PANEL (fährt rechts ein, z.B. Gruppen-Details)
           ============================================================ */
        .detail-panel-overlay {
            position: fixed; inset: 0; z-index: 65;
            background: rgba(15, 23, 42, 0.35);
        }
        .detail-panel {
            position: fixed; top: 0; right: 0; bottom: 0; z-index: 66;
            width: 640px; max-width: 92vw;
            background: #fff; box-shadow: -4px 0 24px rgba(0,0,0,0.18);
            transform: translateX(100%); transition: transform 0.22s ease;
            display: flex; flex-direction: column; overflow: hidden;
        }
        .detail-panel.open { transform: translateX(0); }
        html[data-theme="dark"] .detail-panel { background: #292827; box-shadow: -4px 0 24px rgba(0,0,0,0.5); }

        /* Kopf */
        .dp-header { display: flex; align-items: center; gap: 12px; padding: 16px 18px 12px; }
        .dp-header-icon { width: 36px; height: 36px; border-radius: 8px; background: #E6F1FB; color: #0F6CBD; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .dp-header-icon i { font-size: 20px; }
        html[data-theme="dark"] .dp-header-icon { background: #14233A; color: #4AA3E8; }
        .dp-title { font-size: 16px; font-weight: 700; color: #1E293B; }
        .dp-subtitle { font-size: 12px; color: #94A3B8; }
        html[data-theme="dark"] .dp-title { color: #F3F2F1; }
        .dp-close { width: 32px; height: 32px; border: none; background: transparent; color: #64748B; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-left: auto; }
        .dp-close:hover { background: #F1F5F9; color: #1E293B; }
        html[data-theme="dark"] .dp-close:hover { background: #3B3A39; color: #F3F2F1; }

        /* Befehlsleiste (Speichern / Löschen) */
        .dp-commandbar { display: flex; align-items: center; gap: 4px; padding: 0 14px 12px; border-bottom: 1px solid #E2E8F0; }
        html[data-theme="dark"] .dp-commandbar { border-bottom-color: #3B3A39; }
        .dp-cmd { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; background: transparent; border: none; border-radius: 4px; padding: 7px 12px; cursor: pointer; transition: background 0.12s; }
        .dp-cmd i { font-size: 18px; }
        .dp-cmd-save { color: #0F6CBD; }
        .dp-cmd-save:hover { background: #E6F1FB; }
        .dp-cmd-delete { color: #B91C1C; }
        .dp-cmd-delete:hover { background: #FEF2F2; }
        html[data-theme="dark"] .dp-cmd-save { color: #4AA3E8; }
        html[data-theme="dark"] .dp-cmd-save:hover { background: #14233A; }
        html[data-theme="dark"] .dp-cmd-delete { color: #F87171; }
        html[data-theme="dark"] .dp-cmd-delete:hover { background: #3A1515; }
        .dp-cmd:disabled { opacity: 0.4; cursor: default; }

        /* Glatte Tab-Reiter (KEINE Rundung - M365-Look) */
        .dp-tabs { display: flex; padding: 0 18px; border-bottom: 1px solid #E2E8F0; }
        html[data-theme="dark"] .dp-tabs { border-bottom-color: #3B3A39; }
        .dp-tab { padding: 12px 4px; margin-right: 18px; border: none; border-radius: 0 !important; background: transparent; font-size: 13.5px; font-weight: 600; color: #64748B; cursor: pointer; box-shadow: inset 0 -2px 0 transparent; transition: color 0.12s, box-shadow 0.12s; white-space: nowrap; flex-shrink: 0; }
        .dp-tab:hover { color: #1E293B; }
        .dp-tab.active { color: #0F6CBD; box-shadow: inset 0 -2px 0 #0F6CBD; }
        html[data-theme="dark"] .dp-tab:hover { color: #F3F2F1; }
        html[data-theme="dark"] .dp-tab.active { color: #4AA3E8; box-shadow: inset 0 -2px 0 #4AA3E8; }

        /* Inhaltsbereich (scrollbar) */
        .dp-body { flex: 1; overflow-y: auto; padding: 18px; }
        .dp-field-label { font-size: 12px; font-weight: 700; color: #94A3B8; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 6px; }
        /* Checkboxen im Panel: feste Größe + garantierter Abstand zum Text (nicht quetschen). */
        .dp-body input[type="checkbox"], .wiz-body input[type="checkbox"] { width: 16px; height: 16px; flex-shrink: 0; margin-right: 10px; accent-color: #D70041; cursor: pointer; }
        .wiz-body label { align-items: flex-start; }
        .dp-body label { align-items: flex-start; }

        @media (max-width: 767px) {
            .detail-panel { width: 100%; max-width: 100%; }
        }

        /* ============================================================
           M365-BEFEHLSLEISTE (Benutzer-Übersicht)
           ============================================================ */
        .user-cmd { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: #475569; background: transparent; border: none; border-radius: 4px; padding: 7px 12px; cursor: pointer; transition: background 0.12s, color 0.12s; }
        .user-cmd i { font-size: 16px; }
        .user-cmd:hover:not(:disabled) { background: #F1F5F9; color: #1E293B; }
        .user-cmd-primary { color: #0F6CBD; }
        .user-cmd-primary:hover:not(:disabled) { background: #E6F1FB; }
        .user-cmd-danger { color: #B91C1C; }
        .user-cmd-danger:hover:not(:disabled) { background: #FEF2F2; }
        .user-cmd:disabled { color: #CBD5E1; cursor: default; }
        html[data-theme="dark"] .user-cmd { color: #C8C6C4; }
        html[data-theme="dark"] .user-cmd:hover:not(:disabled) { background: #3B3A39; color: #F3F2F1; }
        html[data-theme="dark"] .user-cmd-primary { color: #4AA3E8; }
        html[data-theme="dark"] .user-cmd-primary:hover:not(:disabled) { background: #14233A; }
        html[data-theme="dark"] .user-cmd-danger { color: #F87171; }
        html[data-theme="dark"] .user-cmd-danger:hover:not(:disabled) { background: #3A1515; }
        html[data-theme="dark"] .user-cmd:disabled { color: #5A5856; }
        /* ausgewählte Zeile hervorheben */
        #userList tr.user-row-selected { background: #E6F1FB !important; }
        html[data-theme="dark"] #userList tr.user-row-selected { background: #14233A !important; }

        /* ============================================================
           ASSISTENTEN-PANEL (breiter) + WIZARD-SCHRITTE + EXCEL-TABELLE
           ============================================================ */
        .wizard-panel { width: 620px; max-width: 96vw; z-index: 68; }
        #wizardPanelOverlay { z-index: 67; }
        .wiz-body { flex: 1; overflow-y: auto; padding: 20px 22px; }
        .wiz-footer { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; border-top: 1px solid #E2E8F0; }
        html[data-theme="dark"] .wiz-footer { border-top-color: #3B3A39; }
        .wiz-btn-primary { font-size: 14px; font-weight: 600; background: #0F6CBD; color: #fff; border: none; border-radius: 4px; padding: 9px 20px; cursor: pointer; }
        .wiz-btn-primary:hover { background: #0C447C; }
        .wiz-btn-ghost { font-size: 14px; background: transparent; border: none; color: #64748B; cursor: pointer; padding: 9px 12px; }
        .wiz-btn-ghost:hover { color: #1E293B; }
        html[data-theme="dark"] .wiz-btn-ghost:hover { color: #F3F2F1; }
        .wiz-btn-secondary { font-size: 13px; background: transparent; border: 1px solid #94A3B8; border-radius: 4px; padding: 8px 14px; cursor: pointer; color: #475569; }
        .wiz-btn-secondary:hover { background: #F1F5F9; }
        html[data-theme="dark"] .wiz-btn-secondary { border-color: #5A5856; color: #C8C6C4; }
        html[data-theme="dark"] .wiz-btn-secondary:hover { background: #3B3A39; }

        /* Schritt-Anzeige */
        .wiz-steps { display: flex; padding: 16px 22px 4px; }
        .wiz-step { flex: 1; text-align: center; position: relative; }
        .wiz-step-num { width: 28px; height: 28px; border-radius: 50%; background: #E2E8F0; color: #64748B; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
        .wiz-step.active .wiz-step-num { background: #0F6CBD; color: #fff; }
        .wiz-step.done .wiz-step-num { background: #16A34A; color: #fff; }
        .wiz-step-label { font-size: 11px; color: #94A3B8; margin-top: 4px; }
        .wiz-step.active .wiz-step-label { color: #0F6CBD; font-weight: 600; }
        html[data-theme="dark"] .wiz-step-num { background: #3B3A39; color: #A19F9D; }
        html[data-theme="dark"] .wiz-step-label { color: #797775; }

        /* Excel-artige Tabelle */
        .xls-table { border: 1px solid #94A3B8; border-radius: 6px; overflow: hidden; }
        html[data-theme="dark"] .xls-table { border-color: #5A5856; }
        .xls-row { display: grid; grid-template-columns: 34px 1.4fr 1.2fr 1.3fr; }
        .xls-row + .xls-row { border-top: 1px solid #E2E8F0; }
        html[data-theme="dark"] .xls-row + .xls-row { border-top-color: #3B3A39; }
        .xls-head { background: #F8FAFC; font-size: 11px; font-weight: 700; text-transform: uppercase; color: #64748B; }
        html[data-theme="dark"] .xls-head { background: #201F1E; color: #A19F9D; }
        .xls-cell { border-right: 1px solid #E2E8F0; }
        html[data-theme="dark"] .xls-cell { border-right-color: #3B3A39; }
        .xls-cell:last-child { border-right: none; }
        .xls-num { padding: 9px 6px; text-align: center; color: #94A3B8; font-size: 12px; background: #F8FAFC; }
        html[data-theme="dark"] .xls-num { background: #201F1E; }
        .xls-cell input, .xls-cell select { width: 100%; box-sizing: border-box; border: none; padding: 9px 10px; font-size: 13px; background: transparent; color: inherit; }
        .xls-cell input:focus, .xls-cell select:focus { outline: 2px solid #0F6CBD; outline-offset: -2px; border-radius: 2px; }

        /* ============================================================
           EINHEITLICHE ADMIN-LISTEN (Benutzer / Gruppen / Abteilungen)
           Höhere Zeilen + konsistente Optik.
           ============================================================ */
        .admin-list-table { width: 100%; font-size: 13px; border-collapse: collapse; }
        .admin-list-table thead th {
            text-align: left; font-size: 11px; font-weight: 700; color: #64748B;
            text-transform: uppercase; letter-spacing: 0.03em;
            padding: 10px 12px; border-bottom: 1px solid #E2E8F0; white-space: nowrap;
        }
        .admin-list-table tbody td { padding: 13px 12px; border-bottom: 1px solid #F1F5F9; vertical-align: middle; }
        .admin-list-table tbody tr { cursor: pointer; transition: background 0.1s; }
        .admin-list-table tbody tr:hover { background: #F8FAFC; }
        /* Nur-Lese-Listen (z.B. Berechtigungs-Übersicht): kein Zeiger, aber gleiche Optik/Zeilenhöhe */
        .admin-list-table.readonly tbody tr { cursor: default; }
        .admin-list-table tbody tr.row-selected { background: #E6F1FB; }
        .admin-list-table tbody tr.row-selected:hover { background: #DCEAF9; }
        html[data-theme="dark"] .admin-list-table thead th { color: #A19F9D; border-bottom-color: #3B3A39; }
        html[data-theme="dark"] .admin-list-table tbody td { border-bottom-color: #333230; }
        html[data-theme="dark"] .admin-list-table tbody tr:hover { background: #2E2D2B; }
        html[data-theme="dark"] .admin-list-table tbody tr.row-selected { background: #14233A; }
        html[data-theme="dark"] .admin-list-table tbody tr.row-selected:hover { background: #1A2E4A; }
        /* Kompakte Ansicht: etwas niedrigere Zeilen, aber immer noch luftiger als vorher */
        html[data-density="compact"] .admin-list-table tbody td { padding: 9px 10px; }
        html[data-density="compact"] .admin-list-table thead th { padding: 8px 10px; }

        /* ============================================================
           M365-MODUL-LISTE (Gesellschafts-Panel): Zeilen mit Toggle-Switch
           ============================================================ */
        .module-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid #F1F5F9; }
        .module-row:last-of-type { border-bottom: none; }
        html[data-theme="dark"] .module-row { border-bottom-color: #333230; }
        .module-row-icon { width: 34px; height: 34px; border-radius: 8px; background: #F1F5F9; color: #475569; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; }
        html[data-theme="dark"] .module-row-icon { background: #333230; color: #C8C6C4; }
        .module-row-text { flex: 1; min-width: 0; }
        .module-row-name { font-size: 13px; font-weight: 600; color: #1E293B; }
        .module-row-desc { font-size: 11px; color: #94A3B8; }
        html[data-theme="dark"] .module-row-name { color: #F3F2F1; }
        /* Toggle-Switch */
        .m-toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
        .m-toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
        .m-toggle-track { position: absolute; inset: 0; background: #CBD5E1; border-radius: 11px; transition: background 0.15s; pointer-events: none; }
        .m-toggle-knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0,0,0,0.2); pointer-events: none; }
        .m-toggle input:checked ~ .m-toggle-track { background: #16A34A; }
        .m-toggle input:checked ~ .m-toggle-knob { transform: translateX(18px); }
        .m-toggle input:disabled { cursor: default; }
        .m-toggle input:disabled ~ .m-toggle-track { opacity: 0.5; }
        html[data-theme="dark"] .m-toggle-track { background: #5A5856; }
        html[data-theme="dark"] .m-toggle input:checked ~ .m-toggle-track { background: #16A34A; }

        /* ============================================================
           MAIL-BEREICH (orandke ONE Mail) - M365-Optik
           ============================================================ */
        .mail-topbar { min-height: 52px; }
        .mail-search { height: 36px; }

        /* M365-Befehlsleiste */
        .mail-commandbar { min-height: 46px; }
        .mail-cmd {
            display: inline-flex; align-items: center; gap: 7px;
            font-size: 13px; font-weight: 500; color: #444441;
            background: transparent; border: none; border-radius: 6px;
            padding: 8px 11px; cursor: pointer; transition: background 0.12s;
        }
        .mail-cmd i { font-size: 16px; }
        .mail-cmd:hover:not(:disabled) { background: #F1EFE8; }
        .mail-cmd:disabled { color: #B4B2A9; cursor: default; }
        .mail-cmd-primary { color: #fff; background: #0F6CBD; font-weight: 500; padding: 8px 16px; }
        .mail-cmd-primary:hover { background: #0d5aa0; }
        .mail-cmd-danger:not(:disabled) { color: #993c1d; }
        .mail-cmd-danger:not(:disabled):hover { background: #FAECE7; }
        .mail-cmd-sep { width: 1px; height: 22px; background: #E2E0D9; margin: 0 7px; }
        html[data-theme="dark"] .mail-cmd { color: #C8C6C4; }
        html[data-theme="dark"] .mail-cmd:hover:not(:disabled) { background: #3A3937; }
        html[data-theme="dark"] .mail-cmd-sep { background: #444441; }

        /* Linke Spalte (Postfächer + Ordner) - großzügig, folgt der Dichte */
        .mail-sidebar-col { padding: 12px 10px; }
        .mail-folder-group-label {
            font-size: 11px; font-weight: 700; text-transform: uppercase;
            color: #94A3B8; letter-spacing: 0.04em; padding: 6px 8px 4px;
        }
        .mail-nav-item {
            display: flex; align-items: center; gap: 10px;
            width: 100%; text-align: left;
            font-size: 14px; color: #475569;
            padding: 9px 10px; border-radius: 8px;
            transition: background 0.1s; cursor: pointer; border: none; background: transparent;
        }
        .mail-nav-item i { font-size: 16px; width: 18px; text-align: center; }
        .mail-nav-item:hover { background: #F8FAFC; }
        .mail-nav-item.active { background: #E6F1FB; color: #185FA5; font-weight: 600; }
        .mail-nav-count { margin-left: auto; font-size: 11px; font-weight: 700; }
        .mail-nav-count.unread { background: #D70041; color: #fff; padding: 1px 7px; border-radius: 9px; }
        html[data-theme="dark"] .mail-nav-item { color: #C8C6C4; }
        html[data-theme="dark"] .mail-nav-item:hover { background: #333230; }
        html[data-theme="dark"] .mail-nav-item.active { background: #12354f; color: #85B7EB; }

        /* Kompakte Dichte: enger + kleinere Schrift */
        html[data-density="compact"] .mail-sidebar-col { padding: 8px 6px; }
        html[data-density="compact"] .mail-nav-item { font-size: 12px; padding: 6px 8px; gap: 8px; }
        html[data-density="compact"] .mail-nav-item i { font-size: 14px; width: 16px; }
        html[data-density="compact"] .mail-folder-group-label { font-size: 10px; padding: 4px 6px 2px; }
        html[data-density="compact"] .mail-cmd { font-size: 12px; padding: 6px 9px; }
        html[data-density="compact"] .mail-cmd i { font-size: 14px; }
        html[data-density="compact"] .mail-topbar { min-height: 44px; }
        html[data-density="compact"] .mail-commandbar { min-height: 40px; }

        /* Mail 3-Spalten-Grid: robust gegen überschreibende Regeln + min-width-Probleme.
           minmax(0,...) verhindert, dass Grid-Kinder ihre Spalte über die Breite hinausdrücken
           (Standard-min-width:auto war die Ursache dafür, dass die Vorschau nach unten rutschte). */
        .mail-grid {
            display: grid !important;
            grid-template-columns: 210px 340px minmax(0, 1fr) !important;
        }
        html[data-density="compact"] .mail-grid {
            grid-template-columns: 190px 300px minmax(0, 1fr) !important;
        }
        /* Nur auf wirklich schmalen Viewports (Tablet quer / schmale Fenster) untereinander. */
        @media (max-width: 900px) {
            .mail-grid { grid-template-columns: 1fr !important; grid-auto-rows: min-content; }
        }

        /* Mail: klarere Trennlinien (OWA-Stil) */
        /* Spalten-Trenner (Postfach | Liste | Vorschau) - dünn aber deutlich, über die VOLLE Höhe.
           Die Spalten müssen sich auf volle Grid-Höhe strecken, sonst endet der rechte Rand mit
           dem Inhalt (kurze Mailliste -> Linie hört mittendrin auf). */
        .mail-grid { align-items: stretch; min-height: 0; }
        #mailColumns > div { border-color: #E2E0D9 !important; min-height: 0; max-height: 100%; }
        html[data-theme="dark"] #mailColumns > div { border-color: #3A3937 !important; }
        /* Mail-Zeilen-Trenner - das slate-100 war zu hell, jetzt gut lesbar */
        #mailList [data-mail-open] { border-bottom-color: #E2E0D9 !important; }
        html[data-theme="dark"] #mailList [data-mail-open] { border-bottom-color: #3A3937 !important; }

        /* Nutzereinstellungen-Modal: linke Navigation */
        .us-nav-item { transition: background 0.1s; cursor: pointer; border: none; background: transparent; }
        .us-nav-item:hover { background: #F1F5F9; }
        .us-nav-item.active { background: #E6F1FB; color: #185FA5; }
        .us-nav-item.active i { color: #185FA5; }
        html[data-theme="dark"] .us-nav-item:hover { background: #3A3937; }
        html[data-theme="dark"] .us-nav-item.active { background: #14233A; color: #6BA5E0; }

        /* Nutzereinstellungen-Modal: FESTE Höhe, unabhängig vom Tab-Inhalt. */
        .user-settings-box {
            display: flex;
            flex-direction: column;
            height: 600px;
            max-height: 88vh;
        }
        .user-settings-box > .flex.flex-1 { flex: 1 1 auto; min-height: 0; }
        #userSettingsContent { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
