/* ============================================================
   DATEEX Corporate Theme — Modern Responsive Design
   Colors: Red #e3001a | Dark Teal #032b38 | Navy #01171e
   Font:   Open Sans (loaded via App.razor)
   ============================================================ */

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
    /* Brand */
    --dx-red:          var(--theme-akzent, #e3001a);
    --dx-red-dark:     var(--theme-akzent, #c4001a);
    --dx-teal:         #032b38;
    --dx-teal-dark:    #01171e;
    --dx-teal-light:   #054a62;
    --dx-blue-link:    #2ea3f2;

    /* Neutrals */
    --dx-white:        #ffffff;
    --dx-bg:           #f6f7f3;
    --dx-border:       #dedfd9;
    --dx-text:         #666666;
    --dx-text-dark:    var(--theme-grundfarbe, #101110);
    --dx-text-muted:   #6d716a;

    --portal-ink:      var(--theme-grundfarbe, #101110);
    --portal-muted:    #6d716a;
    --portal-line:     #dedfd9;
    --portal-paper:    #ffffff;
    --portal-bg:       #f6f7f3;
    --portal-accent:   var(--theme-akzent, #e3001a);
    --portal-accent-dark: var(--theme-akzent, #9f0012);

    /* Elevation (box-shadows) */
    --dx-shadow-xs:    0 1px 3px rgba(1,23,30,.06), 0 1px 2px rgba(1,23,30,.04);
    --dx-shadow-sm:    0 2px 6px rgba(1,23,30,.08), 0 1px 3px rgba(1,23,30,.05);
    --dx-shadow-md:    0 4px 14px rgba(1,23,30,.10), 0 2px 6px rgba(1,23,30,.06);
    --dx-shadow-lg:    0 8px 28px rgba(1,23,30,.14), 0 4px 10px rgba(1,23,30,.07);

    /* Transitions */
    --dx-ease:         cubic-bezier(.25,.46,.45,.94);
    --dx-duration:     200ms;

    /* Radius */
    --dx-radius-sm:    4px;
    --dx-radius-md:    8px;
    --dx-radius-lg:    12px;
    --dx-radius-xl:    16px;

    /* Seitenlayout */
    --page-max-width:      1440px;
    --page-wide-width:     1680px;
    --page-form-width:     1040px;
    --page-readable-width: 960px;
    --page-gutter:         clamp(0.875rem, 2.4vw, 2rem);

    /* Schriftart für DevExpress-Komponenten — bleibt als einziges DX-Token gesetzt,
       damit die App-Schrift konsistent ist. Accent-Farben werden über die
       Fluent-Theme-API (SetCustomAccentColor) gesteuert, nicht hier. */
    --dxds-font-family-base: "Open Sans", Helvetica, Arial, Lucida, sans-serif;
}

/* ── Reset / Base ───────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    font-family: "Open Sans", Helvetica, Arial, Lucida, sans-serif;
}

html {
    height: 100%;
    font-size: var(--global-size, 16px);
}

body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-size: inherit;
    line-height: 1.6;
    color: var(--dx-text);
    background-color: var(--dx-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    color: var(--dx-text-dark);
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.5rem;
}

h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.6rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.3rem); }

a {
    color: var(--dx-blue-link);
    text-decoration: none;
    transition: color var(--dx-duration) var(--dx-ease);
}
a:hover { color: #1a8fd4; }

/* ── Sidebar-Navigation (NavMenu, AdminNavMenu) ─────────────── */
.dax-sidenav {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0;
    margin: 0;
}

.dax-sidenav-section-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--portal-muted);
    padding: 1.15rem 1rem .35rem;
}

.dax-sidenav-item {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .62rem .9rem;
    font-size: .875rem;
    font-weight: 650;
    color: var(--portal-ink);
    text-decoration: none;
    border-left: 3px solid transparent;
    border-radius: 10px;
    margin: 2px 8px;
    transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.dax-sidenav-item:hover {
    background: #f6f7f3;
    color: var(--portal-ink);
    text-decoration: none;
}

.dax-sidenav-item.active {
    background: color-mix(in srgb, var(--portal-accent) 10%, #fff);
    border-left-color: var(--portal-accent);
    color: var(--portal-ink);
    font-weight: 780;
}

.dax-sidenav-icon {
    font-size: 1rem;
    flex-shrink: 0;
    opacity: .85;
    color: var(--portal-accent);
}

/* ── Login-Popup ────────────────────────────────────────────── */
.login-popup-backdrop {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #032b38 0%, #01171e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-popup-card {
    background: #fff;
    border-radius: var(--dx-radius-xl);
    box-shadow: var(--dx-shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2rem 2rem;
}

.login-popup-logo {
    display: block;
    height: 2rem;
    margin: 0 auto 1.75rem;
}

.login-popup-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dx-text-dark);
    text-align: center;
    margin-bottom: 0.25rem;
}

.login-popup-subtitle {
    font-size: 13px;
    color: var(--dx-text-muted);
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.login-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--dx-text-dark);
    margin-bottom: 0.375rem;
}

.login-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 14px;
    border: 1px solid var(--dx-border);
    border-radius: var(--dx-radius-sm);
    outline: none;
    transition: border-color var(--dx-duration) var(--dx-ease),
                box-shadow var(--dx-duration) var(--dx-ease);
}
.login-input:focus {
    border-color: var(--dx-red);
    box-shadow: 0 0 0 3px rgba(227,0,26,.15);
}

.login-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 13px;
    color: var(--dx-text);
}

.btn-login {
    width: 100%;
    padding: 0.625rem 1rem;
    background-color: var(--dx-red);
    color: #fff;
    border: none;
    border-radius: var(--dx-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--dx-duration) var(--dx-ease);
}
.btn-login:hover { background-color: var(--dx-red-dark); }

/* ── Cards / panels (generic) ───────────────────────────────── */
.dx-card {
    background: var(--dx-white);
    border: 1px solid var(--dx-border);
    border-radius: var(--dx-radius-lg);
    box-shadow: var(--dx-shadow-sm);
    transition: box-shadow var(--dx-duration) var(--dx-ease),
                transform var(--dx-duration) var(--dx-ease);
}
.dx-card:hover {
    box-shadow: var(--dx-shadow-md);
    transform: translateY(-2px);
}

/* DevExpress-Buttons + Inputs erben die DATEEX-rote Akzentfarbe automatisch
   aus dem Fluent-Theme (siehe AppThemeCatalog.cs → SetCustomAccentColor).
   Keine manuellen Overrides mehr nötig — die hier früher stehenden
   .dxbl-btn-primary / .dxbl-input:focus-within-Hacks sind raus, weil sie
   im Dark-Mode rosa Ränder erzeugt haben. */

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar        { width: 5px; height: 5px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: #c9d0d5; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--dx-teal); }

/* ── Bootstrap utility overrides ───────────────────────────── */
.text-danger   { color: var(--dx-red) !important; }
.btn-primary   { background-color: var(--dx-red); border-color: var(--dx-red); }
.btn-primary:hover { background-color: var(--dx-red-dark); border-color: var(--dx-red-dark); }

.alert-danger  { border-left: 3px solid var(--dx-red); }
.alert-success { border-left: 3px solid var(--dx-teal); }

.validation-message { color: var(--dx-red); font-size: 12px; margin-top: 2px; }

/* ── Account / Auth pages ───────────────────────────────────── */
.card {
    border: 1px solid var(--dx-border);
    border-radius: var(--dx-radius-lg);
    box-shadow: var(--dx-shadow-sm);
}
.card-header {
    background-color: var(--dx-teal);
    color: var(--dx-white);
    font-weight: 600;
    border-radius: var(--dx-radius-lg) var(--dx-radius-lg) 0 0;
    padding: 1rem 1.25rem;
}

/* ── Responsive visibility helpers ─────────────────────────── */
@media (max-width: 768px) {
    .display-desktop { display: none !important; }
}
@media (min-width: 769px) {
    .display-mobile { display: none !important; }
}

/* ── Admin-Bereich ──────────────────────────────────────────── */
/* Einheitliche Seitenbreiten */
.admin-card,
.ticket-list-container,
.ticket-detail-container,
.community-container,
.dashboard-container,
.dashboard-page,
.kanban-page,
.notizen-layout {
    width: min(100%, var(--page-max-width));
    margin-inline: auto;
}

.ticket-form-card,
.welcome-container {
    width: min(100%, var(--page-form-width));
    margin-inline: auto;
}

.page-readable,
.dsgvo-card {
    width: min(100%, var(--page-readable-width));
    margin-inline: auto;
}

.admin-card {
    background: #fff;
    border: 1px solid #e2e5e9;
    border-radius: 10px;
    padding: clamp(1rem, 2vw, 1.5rem);
    margin: 0 auto 1.5rem;
}
.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 1rem;
    min-width: 0;
    flex-wrap: wrap;
}
.admin-card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #01171e;
    margin: 0;
}
.admin-hint {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 1rem;
}
.farb-chip {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
    border: 1px solid rgba(0,0,0,.1);
}
.ticket-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.5;
}
.admin-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #01171e;
    margin-bottom: 1.5rem;
}
.admin-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}
.admin-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: #fff;
    border: 1px solid #e2e5e9;
    border-radius: 10px;
    text-decoration: none;
    color: #01171e;
    font-size: 0.875rem;
    font-weight: 600;
    transition: box-shadow 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.admin-tile:hover {
    border-color: #e3001a;
    box-shadow: 0 4px 16px rgba(227,0,26,.12);
    transform: translateY(-2px);
    color: #e3001a;
}
.admin-tile-icon { font-size: 1.75rem; color: #e3001a; }


/* ── Ticket-Seiten ─────────────────────────────────── */
.ticket-list-container { padding: 0; }
.ticket-list-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.ticket-dashboard-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin: -0.5rem 0 1rem;
    padding: .75rem .875rem;
    border: 1px solid color-mix(in srgb, var(--accent, #e3001a) 22%, var(--border, #dedfd9));
    border-left: 4px solid var(--accent, #e3001a);
    border-radius: var(--radius-card, 8px);
    background: color-mix(in srgb, var(--accent, #e3001a) 7%, var(--surface, #fff));
    color: var(--ink, #101110);
    font-size: .875rem;
    font-weight: 650;
}
.ticket-dashboard-filter a {
    color: var(--accent, #e3001a);
    font-size: .8rem;
    font-weight: 700;
}
.ticket-filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(190px, 1fr) minmax(190px, 1fr) minmax(210px, 1fr) auto;
    gap: .75rem;
    align-items: end;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 1rem;
}
.ticket-filter-modus { grid-column: 1 / -1; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ticket-filter-feld { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.ticket-filter-feld--wide { min-width: min(320px, 100%); }
.ticket-filter-label { color: var(--ink-subtle); font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.ticket-filter-bar .ticket-search { min-width: 0; width: 100%; }
.ticket-filter-aktionen { display: flex; align-items: center; justify-content: flex-end; gap: .65rem; flex-wrap: wrap; min-width: 220px; }
.ticket-filter-button { white-space: nowrap; }
.ticket-grid { cursor: pointer; }
.ticket-grid .dxbl-grid-cell { vertical-align: middle; }
.ticket-empty { padding: 2rem; text-align: center; color: var(--dxbl-text-muted, #6c757d); }
.ticket-ungelesen-dot { display: inline-block; width: 8px; height: 8px; background: var(--bs-primary, #0d6efd); border-radius: 50%; margin-right: 6px; flex-shrink: 0; vertical-align: middle; }
.ticket-betreff-cell { display: flex; align-items: flex-start; flex-direction: column; gap: .3rem; min-width: 0; }
.ticket-betreff-hauptzeile { display: flex; align-items: center; min-width: 0; max-width: 100%; }
.ticket-betreff-hauptzeile span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-betreff-cell.ungelesen { font-weight: 600; }
.ticket-gelesen-button { width: 30px; height: 30px; border: 1px solid var(--border-soft); border-radius: 6px; background: var(--surface); color: var(--accent, #e3001a); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ticket-gelesen-button:hover { background: color-mix(in srgb, var(--accent, #e3001a) 10%, transparent); border-color: var(--accent, #e3001a); }
.ticket-liste-fortschritt { height: 6px; width: 100%; min-width: 74px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--ink-subtle) 32%, transparent); }
.ticket-liste-fortschritt span { display: block; height: 100%; border-radius: inherit; background: var(--accent, #e3001a); }
.ticket-liste-fortschritt-wert { display: block; margin-top: .25rem; font-size: .78rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.ticket-liste-zustaendig { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.ticket-zustaendig-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink, #111827); font-size: .86rem; }
.ticket-zustaendig-name.ist-haupt { font-weight: 650; }
.ticket-zustaendig-mehr { flex: 0 0 auto; border-radius: 999px; background: #eef2f7; color: #475569; padding: 1px 7px; font-size: .72rem; font-weight: 700; }
.ticket-liste-keine-zuweisung { display: inline-flex; align-items: center; border-radius: 999px; background: #fff7ed; color: #9a3412; padding: 2px 8px; font-size: .78rem; font-weight: 700; }
.ticket-datum-cell { display: flex; flex-direction: column; gap: .15rem; white-space: nowrap; }
.ticket-datum-cell small { color: var(--ink-subtle, #6c757d); font-size: .72rem; }
.ticket-signal-chip { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; padding: 2px 8px; font-size: .72rem; font-weight: 750; line-height: 1.35; }
.ticket-signal-chip.ist-ueberfaellig { background: #fee2e2; color: #991b1b; }
.ticket-signal-chip.ist-heute { background: #fff7ed; color: #9a3412; }
.ticket-signal-chip.ist-morgen { background: #fef9c3; color: #854d0e; }

@media (max-width: 1100px) {
    .ticket-filter-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ticket-filter-aktionen {
        justify-content: flex-start;
        grid-column: 1 / -1;
    }
}

.ticket-form-card { max-width: var(--page-form-width); margin-block: 0 1.5rem; }
.ticket-form { padding: .75rem clamp(.25rem, 1vw, 1.5rem); }
.ticket-form-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1.5rem; padding-top: 1.125rem; border-top: 1px solid #e9ecef; flex-wrap: wrap; position: relative; z-index: 10; }
.portal-html-editor { display: flex; flex-direction: column; gap: 0; overflow: hidden; border: 0; border-radius: 0; background: transparent; box-shadow: none; outline: none; }
.portal-html-editor:focus,
.portal-html-editor:focus-within { outline: none; box-shadow: none; }
.portal-html-editor-control { width: 100%; margin: 0; font-size: 1rem; }
.portal-html-editor-toolbar { display: flex; justify-content: flex-end; padding: 8px 10px; border-top: 1px solid #eef0f3; background: #f1f3f6; }
.ticket-neu-card {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    overflow: hidden;
    border-radius: 8px;
}
.ticket-neu-body { position: relative; padding: 28px 28px 0; }
.ticket-neu-form { margin: 0; padding: 0; }
.ticket-neu-form .dxbl-fl-item { margin-bottom: .75rem; }
.ticket-neu-formular { display: flex; flex-direction: column; gap: 18px; }
.ticket-neu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.ticket-neu-feld { min-width: 0; }
.ticket-neu-feld .dxbl-text-edit { width: 100%; max-width: 100%; }
.ticket-neu-voll { grid-column: 1 / -1; }
.ticket-neu-label { display: block; margin-bottom: 6px; color: var(--ink-muted, #4b5563); font-size: 13px; font-weight: 650; line-height: 1.25; }
.ticket-neu-label .required { color: var(--accent, #e3001a); }
.ticket-editor-panel { display: contents; }
.ticket-editor-toolbar { display: none; }
.ticket-erstellen-editor { width: 100%; margin: 0; font-size: 1rem; }
.ticket-neu-anhaenge { margin: .25rem 0 0; padding: 0; border-top: 0; }
.ticket-neu-section-title { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; color: var(--ink, #111827); font-size: 13px; font-weight: 700; line-height: 1.25; }
.ticket-neu-section-title span { color: var(--ink-faint, #9ca3af); font-size: 11.5px; font-weight: 500; }
.ticket-neu-anhaenge-aktionen { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ticket-neu-anhaenge .anhaenge-liste { margin: .75rem 0 0; padding: 0; list-style: none; }
.ticket-neu-anhaenge .ticket-anhaenge-fehler { margin: .5rem 0 0; }
.ticket-upload-hidden { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; opacity: 0 !important; pointer-events: none !important; }
.ticket-upload-select-button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; border: 1px solid #cfd5dd; border-radius: 6px; background: #fff; color: var(--ink, #111827); padding: .5rem .9rem; font-size: .9rem; font-weight: 650; line-height: 1.2; cursor: pointer; }
.ticket-upload-select-button:hover { border-color: var(--accent, #e3001a); color: var(--accent, #e3001a); background: #fff7f8; }
.ticket-neu-footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1rem -28px 0; padding: 1rem 28px; border-top: 1px solid #e5e7eb; background: #f1f3f6; }
.ticket-neu-footer-left,
.ticket-neu-footer-right { display: flex; align-items: center; gap: .75rem; }
.ticket-upload-select-button,
.kamera-upload-button { min-height: 32px; }
.news-edit-card { width: 100%; overflow: hidden; border-radius: 8px; }
.news-edit-body { padding: 28px 28px 0; }
.news-edit-form { margin: 0; padding: 0; }
.news-edit-footer { display: flex; justify-content: flex-end; align-items: center; gap: .75rem; margin: 1rem -28px 0; padding: 1rem 28px; border-top: 1px solid #e5e7eb; background: #f1f3f6; }

.ticket-detail-container { padding: 0; }
.ticket-detail-header { background: #fff; border: 1px solid #e0e4ea; border-radius: 8px; padding: 1.25rem 1.5rem; margin-bottom: 1rem; }
.ticket-kopf-zeile { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.ticket-kopf-links { min-width: 0; }
.ticket-kopf-meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .4rem; }
.ticket-zurueck-link { font-size: 12px; color: var(--ink-subtle); text-decoration: none; }
.ticket-detail-betreff { font-family: 'Open Sans Condensed', sans-serif; font-size: clamp(1.08rem, 1.6vw, 1.35rem); font-weight: 700; color: var(--ink); margin: 0; line-height: 1.2; overflow-wrap: anywhere; }
.ticket-header-actions { display: flex; justify-content: flex-end; margin-bottom: .6rem; }
.ticket-beobachten-button { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 1px solid #cfd5dd; border-radius: 8px; background: #fff; color: #6c757d; cursor: pointer; transition: border-color .15s ease, background-color .15s ease, color .15s ease; }
.ticket-beobachten-button .icon { width: 1.05rem; height: 1.05rem; }
.ticket-beobachten-button.ticket-beobachten-aktiv { color: var(--accent, #e3001a); border-color: color-mix(in srgb, var(--accent, #e3001a) 42%, #fff); background: color-mix(in srgb, var(--accent, #e3001a) 8%, #fff); }
.ticket-beobachten-button.ticket-beobachten-inaktiv { color: #6c757d; border-color: #cfd5dd; background: #fff; }
.ticket-beobachten-button:hover { border-color: currentcolor; background: #f8f9fa; }
.ticket-beobachten-button:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent, #e3001a) 35%, transparent); outline-offset: 2px; }
.ticket-detail-title-row { display: flex; align-items: baseline; gap: .75rem; margin-bottom: .6rem; min-width: 0; flex-wrap: wrap; }
.ticket-nummer { font-size: .85rem; font-weight: 600; color: #6c757d; white-space: nowrap; }
.ticket-betreff { margin: 0; font-size: 1.25rem; font-weight: 600; }
.ticket-detail-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.ticket-meta-tag { background: #f0f2f5; border-radius: 4px; padding: 2px 8px; font-size: .8rem; }
.ticket-meta-datum, .ticket-meta-autor { font-size: .8rem; color: #6c757d; white-space: nowrap; }

/* Status + Projekt + Zeit – kombinierte Gruppe */
.ticket-aktionen-gruppe { background: var(--bg-secondary, #f8f9fa); border: 1px solid var(--border-color, #dee2e6); border-radius: 8px; padding: .6rem 1rem; margin-bottom: .75rem; display: flex; flex-direction: column; gap: .5rem; }
.aktionen-felder-row { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.aktionen-feld { display: flex; align-items: center; gap: .5rem; }
.ticket-bearbeitung-section .aktionen-felder-row { align-items: flex-end; gap: .75rem 1rem; }
.ticket-bearbeitung-section .aktionen-feld { align-items: flex-start; flex-direction: column; gap: .3rem; min-width: min(240px, 100%); }
.ticket-bearbeitung-section .aktionen-feld--kunde { flex: 2 1 420px; min-width: min(420px, 100%); }
.ticket-bearbeitung-section .aktionen-feld--full { min-width: min(360px, 100%); }
.aktionen-label { font-size: .85rem; color: var(--text-secondary, #666); white-space: nowrap; font-weight: 500; }
.aktionen-feld .status-select { min-width: 200px; }
.aktionen-feld .ticket-projekt-select { min-width: 220px; }
.aktionen-feld .ticket-kunde-select { width: 100%; min-width: min(420px, 100%); }
.ticket-fortschritt-editor { display: flex; flex-direction: column; gap: .45rem; width: min(280px, 100%); min-width: 240px; }
.ticket-fortschritt-slider-row { display: flex; align-items: center; gap: .65rem; width: 100%; }
.ticket-fortschritt-slider { flex: 1 1 auto; accent-color: var(--brand-red, #e30613); cursor: pointer; min-width: 0; }
.ticket-fortschritt-wert { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 700; min-width: 42px; text-align: right; }
.zeit-arbeitsgang-select { min-width: 180px; }
.zeit-datum-cell { white-space: nowrap; }

/* Kompakte Zeiterfassung-Buttons */
.zeit-kompakt-row { display: flex; align-items: center; gap: .4rem; }
.ticket-aktionen-gruppe .zeit-kompakt-row { margin-left: 0; }
.zeit-stop-btn { background: #ef4444; color: #fff; border: none; border-radius: 6px;
                 padding: 5px 14px; cursor: pointer; font-size: .88rem; font-weight: 600;
                 font-variant-numeric: tabular-nums; transition: background 150ms; }
.zeit-stop-btn:hover { background: #dc2626; }

.ticket-section { background: #fff; border: 1px solid #e0e4ea; border-radius: 8px; padding: 1.25rem 1.5rem; margin-bottom: 1rem; }
.ticket-arbeit-section { padding: 1rem 1.25rem; }
.ticket-arbeit-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.ticket-arbeit-layout { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(320px, 1.4fr); gap: 1rem; align-items: start; }
.ticket-arbeit-panel { min-width: 0; }
.ticket-arbeit-label { display: block; font-size: .75rem; color: #6c757d; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .45rem; }
.ticket-zeit-panel .zeit-kompakt-row { align-items: stretch; flex-wrap: wrap; }
.ticket-optional-card { padding: 1rem 1.25rem; margin-bottom: .75rem; }
.ticket-section-label { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--dx-text-muted, #6c757d); margin-bottom: .75rem; }
.ticket-section-label-row .ticket-section-label { margin-bottom: 0; }
.ticket-beschreibung-html { line-height: 1.65; }
.ticket-beschreibung-html img, .kommentar-inhalt img { max-width: 100%; height: auto; cursor: zoom-in; border-radius: 4px; }

/* Lightbox */
.lightbox-popup-img { max-width: 100%; max-height: 80vh; display: block; margin: 0 auto; border-radius: 4px; }

/* Anhänge */
.anhaenge-liste { list-style: none; padding: 0; margin: 0 0 1rem; }
.anhang-item { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid #f0f2f5; font-size: .88rem; }
.anhang-item:last-child { border-bottom: none; }
.anhang-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anhang-groesse { font-size: .78rem; color: #6c757d; white-space: nowrap; }
.anhang-upload-bereich { display: flex; align-items: flex-start; gap: .75rem; flex-wrap: wrap; margin-top: .75rem; padding: .75rem 0 0; border-top: 1px solid #e9ecef; }
.ticket-upload { flex: 0 0 auto; width: fit-content; max-width: 100%; }
.ticket-upload .dxbl-upload { display: inline-flex; width: auto !important; min-width: 0; padding: .5rem !important; border: 0 !important; background: transparent !important; }
.ticket-upload .dxbl-upload,
.ticket-upload .dxbl-upload-file-list,
.ticket-upload .dxbl-upload-drop-zone { min-height: 0; }
.ticket-upload .dxbl-upload-drop-zone { width: auto !important; padding: 0 !important; background: transparent !important; }
.anhang-thumbnail { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; flex-shrink: 0; cursor: zoom-in; }
.kamera-upload-wrapper { display: none; }
.kamera-upload-button { min-height: 38px; font-weight: 700; }
@media (pointer: coarse) { .kamera-upload-wrapper { display: flex; gap: .5rem; align-items: center; } }
.kamera-input-hidden { display: none; }

.ticket-kommentar { border-left: 3px solid #dee2e6; padding: .75rem 1rem; margin-bottom: .75rem; border-radius: 0 6px 6px 0; background: #f9fafb; }
.ticket-verlauf-section { padding-bottom: .75rem; }
.ticket-verlauf-kopf-aktionen { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.ticket-beschreibung-eintrag { border-left-color: #6c757d; background: #f8f9fa; }
.kommentar-intern { border-left-color: #ffc107; background: #fffdf0; }
.kommentar-staff   { border-left-color: #0d6efd; background: #f0f5ff; }
.kommentar-eingeklappt { padding-top: .55rem; padding-bottom: .55rem; }
.kommentar-eingeklappt .kommentar-header { margin-bottom: 0; }
.kommentar-header  { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .4rem; }
.kommentar-autor   { font-weight: 600; font-size: .88rem; }
.kommentar-autor-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--av-bg, #6b7280); color: #fff;
    font-size: .7rem; font-weight: 700; flex-shrink: 0; user-select: none;
    line-height: 1;
}
.kommentar-datum   { font-size: .78rem; color: #6c757d; }
.kommentar-badge   { font-size: .72rem; font-weight: 600; padding: 1px 7px; border-radius: 12px; }
.kommentar-badge.intern { background: #fff3cd; color: #856404; }
.kommentar-badge.staff  { background: #cfe2ff; color: #084298; }
.kommentar-inhalt  { font-size: .92rem; line-height: 1.6; }
.kommentar-einklapp-button { margin-left: auto; }

.kommentar-optionen { display: flex; gap: 1.5rem; margin-top: .75rem; }
.ticket-antwort-section {
    border-top: 3px solid var(--dx-red, #e3001a) !important;
    border-radius: 8px;
}

/* Kommentar-Adressaten (Chips im Header) */
.kommentar-adressaten-label { font-size: .75rem; color: #6c757d; font-weight: 500; }
.kommentar-adressat-chip    { font-size: .72rem; font-weight: 600; padding: 1px 8px; border-radius: 12px;
                               background: #e9d8fd; color: #5b21b6; white-space: nowrap; }
.ressourcen-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.ressourcen-chip { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 8px; border-radius: 12px; border: 1px solid #c8d9e3; background: #eef6fb; color: #032b38; font-size: .75rem; font-weight: 600; line-height: 1.25; }
.ressourcen-leer { color: #6c757d; font-size: .86rem; }

/* Sichtbarkeits-Radio im Kommentar-Formular */
.kommentar-sichtbarkeit       { display: flex; align-items: center; gap: 1rem; margin-top: .75rem; flex-wrap: wrap; }
.kommentar-sichtbarkeit-label { font-size: .82rem; color: #6c757d; font-weight: 500; white-space: nowrap; }
.kommentar-radio-option       { display: flex; align-items: center; gap: .35rem; cursor: pointer;
                                 font-size: .85rem; padding: 5px 14px; border-radius: 20px;
                                 border: 1.5px solid var(--dx-border, #dee2e6);
                                 color: var(--dx-text, #666);
                                 transition: border-color .15s, background .15s, color .15s; user-select: none; }
.kommentar-radio-option input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.kommentar-radio-option.active { border-color: #2ea3f2; background: #e7f3ff; color: #0d5a9e; font-weight: 600; }
.kommentar-radio-option:hover:not(.active)  { border-color: #9ca3af; background: #f8f9fa; }

/* Adressaten-TagBox im Kommentar-Formular */
.kommentar-adressaten-row    { display: flex; align-items: center; gap: 1rem; margin-top: .6rem; flex-wrap: wrap; }
.kommentar-adressaten-tagbox { flex: 1; min-width: 200px; }
.kommentar-popup-body { display: flex; flex-direction: column; gap: .85rem; padding: 1rem 1.25rem 0; }
.kommentar-popup-topbar { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.kommentar-popup-label { font-size: .78rem; font-weight: 700; color: #6c757d; text-transform: uppercase; letter-spacing: .05em; }
.kommentar-editor-wrap { border: 1px solid #d9dee6; border-radius: 8px; overflow: hidden; background: #fff; }
.kommentar-editor { font-size: 1rem; }
.kommentar-popup-footer { display: flex; justify-content: flex-end; gap: .5rem; width: 100%; padding: .85rem 1rem 1rem; border-top: 1px solid #edf0f4; background: #fff; }
.kommentar-popup-optionen { display: grid; grid-template-columns: minmax(240px, auto) minmax(280px, 1fr); gap: .85rem 1.25rem; align-items: end; }
.kommentar-optionengruppe { min-width: 0; }
.kommentar-optionengruppe--breit { min-width: 0; }
.kommentar-popup .kommentar-sichtbarkeit,
.kommentar-popup .kommentar-adressaten-row { margin-top: 0; padding: .75rem .85rem; border: 1px solid #edf0f4; border-radius: 8px; background: #fafbfc; }
.kommentar-popup .kommentar-adressaten-row { align-items: center; }
.ticket-optional-section { background: #fff; border: 1px solid #e0e4ea; border-radius: 8px; margin-bottom: 1rem; overflow: hidden; }
.ticket-optional-section > summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .95rem 1.25rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--dx-text-muted, #6c757d); list-style: none; }
.ticket-optional-section > summary::-webkit-details-marker { display: none; }
.ticket-optional-section > summary::after { content: "+"; color: #6c757d; font-size: 1rem; line-height: 1; }
.ticket-optional-section[open] > summary { border-bottom: 1px solid #edf0f4; }
.ticket-optional-section[open] > summary::after { content: "-"; }
.ticket-optional-hint { font-size: .72rem; font-weight: 500; text-transform: none; letter-spacing: 0; margin-left: auto; }
.ticket-optional-content { padding: 1rem 1.25rem; }
.ticket-optional-actions { justify-content: flex-end; margin-bottom: .75rem; }
.ticket-optional-actions:empty { display: none; }
.anhang-datei-symbol { font-size: .75rem; font-weight: 700; color: #6c757d; }

/* ── Zeiterfassung ─────────────────────────────────── */
.zeiterfassung-section { }
.zeit-tabelle { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: .88rem; }
.zeit-tabelle th { text-align: left; padding: 4px 8px; border-bottom: 2px solid #dee2e6; font-weight: 600; color: #495057; }
.zeit-tabelle td { padding: 5px 8px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
.zeit-tabelle tfoot td { border-top: 2px solid #dee2e6; border-bottom: none; }
.zeit-tabelle .text-end { text-align: right; }
.zeit-laufend td { background: #f0fff4; }
.zeit-stunden { font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 60px; }
.zeit-notiz { color: #6c757d; font-style: italic; }
.zeit-badge-laufend { background: #d1fae5; color: #065f46; font-size: .72rem; font-weight: 700;
                       padding: 1px 7px; border-radius: 12px; margin-left: 4px; }
.farb-chip-sm { font-size: .76rem; padding: 1px 7px; }

.zeit-tabs { display: flex; gap: 0; margin: .75rem 0 0; border-bottom: 2px solid #dee2e6; }
.zeit-tab { background: none; border: none; padding: 6px 16px; cursor: pointer; font-size: .88rem;
             color: #6c757d; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.zeit-tab.aktiv { color: var(--bs-primary, #0d6efd); border-bottom-color: var(--bs-primary, #0d6efd); font-weight: 600; }

.zeit-panel { padding: .75rem 0 0; }
.stempel-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.stempel-arbeitsgang { min-width: 200px; }
.stempel-laufend { background: #f0fff4; padding: .5rem .75rem; border-radius: 6px; border: 1px solid #d1fae5; }
.stempel-uhr { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 90px; color: #065f46; }
.stempel-info { font-size: .85rem; color: #374151; flex: 1; }
.stempel-notiz { min-width: 180px; }

.manuell-form-grid { display: grid; grid-template-columns: auto 1fr; gap: .65rem 1rem; align-items: center; padding: 1rem 1.5rem; }
.manuell-grid-label { font-size: .88rem; color: var(--text-secondary, #666); font-weight: 500; text-align: right; white-space: nowrap; }

/* ── Textbaustein-Insert ───────────────────────────── */
.textbaustein-bar { margin-bottom: .5rem; }
.textbaustein-select { min-width: 260px; }

/* ── Automatisierungs-Regeleditor ─────────────────── */
.regel-editor { padding: .5rem 0; }
.regel-abschnitt { border: 1px solid #e0e4ea; border-radius: 8px; padding: 1rem; margin-top: 1rem; }
.regel-abschnitt-header { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; font-weight: 600; }
.regel-zeile { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; flex-wrap: wrap; }
.regel-feld  { min-width: 180px; }
.regel-op    { min-width: 110px; }
.regel-wert  { min-width: 180px; flex: 1; }

/* ── Benachrichtigungs-Glocke ──────────────────────── */
.benachrichtigung-glocke { position: relative; display: inline-flex; align-items: center; }
.glocke-btn { background: none; border: none; cursor: pointer; padding: 4px 8px; position: relative;
              display: flex; align-items: center; color: inherit; }
.glocke-icon { font-size: 1.1rem; }
.glocke-badge { position: absolute; top: 0; right: 0; background: #dc3545; color: #fff;
                font-size: .65rem; font-weight: 700; min-width: 16px; height: 16px;
                border-radius: 8px; display: flex; align-items: center; justify-content: center;
                padding: 0 3px; line-height: 1; }

.glocke-dropdown { position: absolute; top: calc(100% + 4px); right: 0; width: 340px;
                   background: #fff; border: 1px solid #e0e4ea; border-radius: 8px;
                   box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 1050; overflow: hidden; }
.glocke-dropdown-header { display: flex; justify-content: space-between; align-items: center;
                           padding: .6rem 1rem; border-bottom: 1px solid #e0e4ea;
                           font-weight: 600; font-size: .88rem; }
.glocke-alle-lesen { background: none; border: none; cursor: pointer; color: var(--bs-primary, #0d6efd);
                     font-size: .8rem; padding: 0; }
.glocke-leer { padding: 1.5rem; text-align: center; color: #6c757d; font-size: .88rem; }
.glocke-item { padding: .6rem 1rem; cursor: pointer; border-bottom: 1px solid #f0f2f5;
               transition: background .15s; }
.glocke-item:hover { background: #f8f9fa; }
.glocke-item.ungelesen { background: #eff6ff; }
.glocke-item.ungelesen:hover { background: #dbeafe; }
.glocke-item-titel { font-weight: 600; font-size: .85rem; }
.glocke-item-nachricht { font-size: .8rem; color: #374151; margin: 2px 0; }
.glocke-item-zeit { font-size: .75rem; color: #9ca3af; }
/* Unsichtbarer Klickfänger: schließt das Dropdown bei Klick außerhalb */
.glocke-backdrop { position: fixed; inset: 0; z-index: 1040; background: transparent; }

/* ── Eingehende E-Mails ────────────────────────────── */
.email-status-badge { font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 12px; }
.email-status-empfangen       { background: #dbeafe; color: #1d4ed8; }
.email-status-verarbeitet     { background: #d1fae5; color: #065f46; }
.email-status-alsSpammarkiert { background: #fef9c3; color: #854d0e; }
.email-status-fehler          { background: #fee2e2; color: #991b1b; }
.email-fehler { font-size: .8rem; color: #6c757d; font-style: italic; }
.ticket-link { color: var(--bs-primary, #0d6efd); text-decoration: none; }
.ticket-link:hover { text-decoration: underline; }

/* ── API-Keys ──────────────────────────────────────── */
.apikey-neu-box { background: #f0fff4; border: 2px solid #86efac; border-radius: 8px;
                  padding: 1rem 1.25rem; margin-bottom: 1rem; display: flex;
                  align-items: center; gap: 1rem; flex-wrap: wrap; }
.apikey-code { font-size: .88rem; background: #fff; border: 1px solid #ccc;
               padding: 4px 10px; border-radius: 4px; word-break: break-all; flex: 1; }
.apikey-perms { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ── Community & News ──────────────────────────────── */
.community-container {
    max-width: var(--page-max-width);
    margin: 0 auto 1.5rem;
    padding: 0;
}
.community-header { margin-bottom: 1.25rem; }
.community-lead { color: #6c757d; margin: 0; }
.community-back { margin-bottom: .75rem; }
.back-link { color: var(--bs-primary, #0d6efd); text-decoration: none; font-size: .9rem; }
.back-link:hover { text-decoration: underline; }

.community-liste { display: flex; flex-direction: column; gap: .75rem; }
.community-card { display: flex; justify-content: space-between; align-items: center;
                  background: #fff; border: 1px solid #e0e4ea; border-radius: 8px;
                  padding: 1rem 1.25rem; cursor: pointer; transition: box-shadow .15s; gap: 1rem; }
.community-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.community-card-main { flex: 1; min-width: 0; }
.community-card-titel { font-weight: 600; font-size: 1rem; margin-bottom: .3rem; }
.community-card-meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.community-card-stats { display: flex; gap: 1rem; flex-shrink: 0; }
.community-stat { display: flex; flex-direction: column; align-items: center;
                  cursor: pointer; padding: .4rem .6rem; border-radius: 6px;
                  border: 1px solid #e0e4ea; min-width: 56px; transition: background .15s; }
.community-stat:hover { background: #f0f4ff; }
.community-stat.upvote-aktiv { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.community-stat-zahl { font-weight: 700; font-size: 1.1rem; line-height: 1.2; }
.community-stat-label { font-size: .7rem; color: #6c757d; }
.community-upvote-inline { cursor: pointer; padding: 2px 10px; border-radius: 12px;
                            border: 1px solid #e0e4ea; font-size: .85rem; }
.community-upvote-inline.upvote-aktiv { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }

/* News */
.news-liste { display: flex; flex-direction: column; gap: 1rem; }
.news-card { background: #fff; border: 1px solid #e0e4ea; border-radius: 8px;
             padding: 1.25rem 1.5rem; cursor: pointer; transition: box-shadow .15s; }
.news-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.news-card-datum { font-size: .8rem; color: #6c757d; margin-bottom: .3rem; }
.news-card-titel { margin: 0 0 .5rem; font-size: 1.15rem; }
.news-card-auszug { color: #4b5563; font-size: .9rem; margin: 0 0 .5rem; line-height: 1.55; }
.news-card-link { font-size: .85rem; color: var(--bs-primary, #0d6efd); }
.news-detail-header { background: #fff; border: 1px solid #e0e4ea; border-radius: 8px;
                      padding: 1.25rem 1.5rem; margin-bottom: 1rem; }
.news-detail-datum { font-size: .85rem; color: #6c757d; margin-bottom: .4rem; }
.news-detail-titel { margin: 0 0 .5rem; font-size: 1.5rem; font-weight: 700; }
.news-inhalt { font-size: .95rem; line-height: 1.7; }

/* ── Dashboard ─────────────────────────────────────── */
.dashboard-container { max-width: var(--page-max-width); margin: 0 auto 1.5rem; padding: 0; }
.dashboard-titel { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.25rem; }

.dashboard-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
                  gap: .75rem; margin-bottom: 1.25rem; }
.kpi-card { background: #fff; border: 1px solid #e0e4ea; border-radius: 10px;
            padding: 1.1rem 1rem; cursor: pointer; transition: box-shadow .15s;
            text-align: center; }
.kpi-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.kpi-card.kpi-warn   { border-left: 4px solid #ef4444; }
.kpi-card.kpi-info   { border-left: 4px solid #3b82f6; }
.kpi-card.kpi-success{ border-left: 4px solid #10b981; }
.kpi-zahl { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.kpi-label { font-size: .78rem; color: #6c757d; margin-top: .2rem; }

.dashboard-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }
@media (max-width: 700px) { .dashboard-charts { grid-template-columns: 1fr; } }
.dashboard-chart-card { background: #fff; border: 1px solid #e0e4ea; border-radius: 8px;
                         padding: 1rem 1.25rem; }

.recent-ticket-row { display: flex; align-items: center; gap: .75rem; padding: .55rem .5rem;
                      border-bottom: 1px solid #f0f2f5; cursor: pointer; border-radius: 4px; }
.recent-ticket-row:hover { background: #f8f9fa; }
.recent-ticket-betreff { flex: 1; min-width: 0; font-size: .9rem; overflow: hidden;
                           white-space: nowrap; text-overflow: ellipsis; }

/* Welcome */
.welcome-container { max-width: 560px; margin: 6rem auto; text-align: center; padding: 0 1rem; }
.welcome-logo { height: 56px; margin-bottom: 1.5rem; }
.welcome-titel { font-size: 1.8rem; font-weight: 800; margin-bottom: .75rem; }
.welcome-text { color: #6c757d; line-height: 1.65; margin-bottom: 1.5rem; }
.welcome-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.ms-2 { margin-left: .5rem; }

/* SLA */
.sla-leiste { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.sla-badge { font-size: .78rem; padding: .2rem .55rem; border-radius: 4px; font-weight: 500; }
.sla-ok { background: #d1fae5; color: #065f46; }
.sla-verletzt { background: #fee2e2; color: #991b1b; font-weight: 700; }
.sla-erfuellt { background: #dbeafe; color: #1e40af; }

/* Kanban */
.kanban-page {
    width: min(100%, var(--page-wide-width));
    margin: 0 auto;
    padding: 0;
}

.kanban-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 180px)) minmax(260px, 1fr);
    gap: 1px;
    margin-bottom: 1.25rem;
    overflow: hidden;
    background: var(--portal-line, #dedfd9);
    border: 1px solid var(--portal-line, #dedfd9);
    border-radius: 16px;
}

.kanban-summary-item,
.kanban-search {
    background: #fff;
    padding: 1rem 1.1rem;
}

.kanban-summary-item span {
    display: block;
    color: var(--portal-muted, #6d716a);
    font-size: .75rem;
}

.kanban-summary-item strong {
    display: block;
    margin-top: .25rem;
    color: var(--portal-ink, #101110);
    font-size: 1.55rem;
    line-height: 1;
}

.kanban-summary-item.danger strong {
    color: var(--portal-accent, #e3001a);
}

.kanban-search {
    display: flex;
    align-items: center;
}

.kanban-search > * {
    width: 100%;
}

.kanban-board {
    display: flex;
    gap: 1rem;
    width: 100%;
    min-height: 60vh;
    margin: 0 auto;
    padding: 0 0 1.25rem;
    overflow-x: auto;
    align-items: flex-start;
    scroll-snap-type: x proximity;
}

.kanban-spalte {
    min-width: 310px;
    width: 310px;
    max-height: calc(100vh - 260px);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: color-mix(in srgb, var(--portal-paper, #fff) 75%, var(--portal-bg, #f6f7f3));
    border: 1px solid var(--portal-line, #dedfd9);
    border-radius: 16px;
    scroll-snap-align: start;
}

.kanban-spalten-header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .8rem;
    padding: .95rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--portal-line, #dedfd9);
    border-top: 4px solid var(--status-farbe, var(--portal-accent, #e3001a));
}

.kanban-spalten-header small {
    display: block;
    margin-top: .15rem;
    color: var(--portal-muted, #6d716a);
    font-size: .72rem;
}

.kanban-spalten-titel {
    display: block;
    color: var(--portal-ink, #101110);
    font-size: .94rem;
    font-weight: 800;
}

.kanban-badge {
    min-width: 28px;
    padding: .18rem .55rem;
    color: var(--portal-ink, #101110);
    background: #f6f7f3;
    border: 1px solid var(--portal-line, #dedfd9);
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 760;
    text-align: center;
}

.kanban-karten {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    min-height: 110px;
    padding: .8rem;
    overflow-y: auto;
}

.kanban-karte {
    position: relative;
    padding: .85rem;
    cursor: pointer;
    background: #fff;
    border: 1px solid var(--portal-line, #dedfd9);
    border-radius: 14px;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.kanban-karte:hover {
    border-color: color-mix(in srgb, var(--portal-accent, #e3001a) 45%, var(--portal-line, #dedfd9));
    transform: translateY(-1px);
}

.kanban-karte:active {
    cursor: grabbing;
}

.kanban-karte-sla {
    border-left: 4px solid #ef4444;
}

.kanban-karte-top,
.kanban-karte-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
}

.kanban-karte-nummer {
    color: var(--portal-accent, #e3001a);
    font-size: .74rem;
    font-weight: 820;
    white-space: nowrap;
}

.kanban-karte-alter,
.kanban-karte-footer {
    color: var(--portal-muted, #6d716a);
    font-size: .72rem;
}

.kanban-karte-betreff {
    margin: .55rem 0 .45rem;
    color: var(--portal-ink, #101110);
    font-size: .93rem;
    font-weight: 760;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.kanban-karte-kontext {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-bottom: .55rem;
}

.kanban-karte-kontext span {
    max-width: 100%;
    padding: .16rem .45rem;
    overflow: hidden;
    color: var(--portal-muted, #6d716a);
    background: #f6f7f3;
    border-radius: 999px;
    font-size: .72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kanban-karte-meta {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: .65rem;
}

.kanban-progress {
    height: 6px;
    overflow: hidden;
    background: #eef0ea;
    border-radius: 999px;
}

.kanban-progress span {
    display: block;
    height: 100%;
    background: var(--portal-accent, #e3001a);
    border-radius: inherit;
}

.kanban-karte-footer {
    margin-top: .7rem;
    padding-top: .65rem;
    border-top: 1px solid var(--portal-line, #dedfd9);
}

.kanban-avatar-stack {
    display: flex;
    align-items: center;
}

.kanban-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-left: -6px;
    color: var(--portal-ink, #101110);
    background: #f6f7f3;
    border: 2px solid #fff;
    border-radius: 50%;
    font-size: .65rem;
    font-weight: 800;
}

.kanban-avatar:first-child {
    margin-left: 0;
}

.kanban-avatar.haupt {
    color: #fff;
    background: var(--portal-accent, #e3001a);
}

.kanban-empty {
    display: grid;
    min-height: 80px;
    place-items: center;
    color: var(--portal-muted, #6d716a);
    border: 1px dashed var(--portal-line, #dedfd9);
    border-radius: 14px;
    font-size: .82rem;
    text-align: center;
}

/* CSAT */
.csat-sterne { display:flex; gap:.4rem; justify-content:center; margin:1rem 0 .25rem; }
.csat-stern { font-size:2rem; background:none; border:none; cursor:pointer;
               color:#d1d5db; transition:color .1s; line-height:1; }
.csat-stern-aktiv { color:#f59e0b; }
.csat-label { text-align:center; font-size:.85rem; color:#6c757d; margin-bottom:.5rem; }

/* Modernes Portal-Flaechenbild */
.admin-card,
.ticket-detail-header,
.ticket-section,
.ticket-aktionen-gruppe,
.community-card,
.news-card,
.news-detail-header,
.dashboard-chart-card,
.kpi-card,
.kanban-spalte,
.kanban-spalten-header,
.kanban-karte,
.notizen-layout,
.card,
.dx-card {
    background: var(--portal-paper, #fff);
    border-color: var(--portal-line, #dedfd9);
    border-radius: 16px;
    box-shadow: none;
}

.admin-card,
.ticket-detail-header,
.ticket-section,
.news-detail-header {
    padding: clamp(1.1rem, 2vw, 1.6rem);
}

.admin-card-header,
.ticket-list-header,
.notizen-sidebar-header,
.notizen-inhalt-header {
    border-color: var(--portal-line, #dedfd9);
}

.admin-card-header h3,
.admin-page-title,
.dashboard-titel,
.ticket-betreff,
.community-card-titel,
.news-card-titel,
.kanban-spalten-titel,
.notiz-listeneintrag-titel,
.notizen-sidebar-header h3,
.notizen-inhalt-header h2 {
    color: var(--portal-ink, #101110);
    font-weight: 780;
}

.admin-hint,
.ticket-meta-datum,
.ticket-meta-autor,
.community-card-meta,
.news-card-datum,
.news-card-auszug,
.notizen-meta {
    color: var(--portal-muted, #6d716a);
}

.admin-tile,
.community-card,
.news-card,
.kanban-karte {
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.admin-tile:hover,
.community-card:hover,
.news-card:hover,
.kanban-karte:hover {
    border-color: color-mix(in srgb, var(--portal-accent, #e3001a) 45%, var(--portal-line, #dedfd9));
    background: #fff;
    box-shadow: none;
    transform: translateY(-1px);
}

.admin-tile-icon,
.admin-tile:hover,
.news-card-link,
.ticket-number,
.ticket-nummer {
    color: var(--portal-accent, #e3001a);
}

.ticket-meta-tag,
.kanban-badge,
.notiz-projekt-badge,
.verknuepfung-item {
    background: #f6f7f3;
    border-color: var(--portal-line, #dedfd9);
    color: var(--portal-ink, #101110);
}

.notiz-listeneintrag.aktiv,
.ticket-antwort-section {
    background: color-mix(in srgb, var(--portal-accent, #e3001a) 8%, #fff);
    border-left-color: var(--portal-accent, #e3001a);
}

.theme-vorschau {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
    gap: 1.5rem;
    align-items: stretch;
    margin-top: 1.5rem;
    padding: 1.4rem;
    color: var(--preview-ink, #101110);
    background: #fff;
    border: 1px solid var(--portal-line, #dedfd9);
    border-radius: 16px;
}

.theme-vorschau-label,
.theme-vorschau small {
    display: block;
    color: var(--portal-muted, #6d716a);
    font-size: .78rem;
}

.theme-vorschau-label {
    margin-bottom: .5rem;
    color: var(--preview-accent, #e3001a);
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.theme-vorschau strong {
    display: block;
    margin-bottom: .25rem;
    font-size: clamp(1.5rem, 3vw, 2.3rem);
    line-height: 1.05;
}

.theme-vorschau-menue {
    display: grid;
    gap: .4rem;
    padding: .55rem;
    background: #f6f7f3;
    border: 1px solid var(--portal-line, #dedfd9);
    border-radius: 14px;
}

.theme-vorschau-menue span {
    padding: .55rem .7rem;
    border-left: 3px solid transparent;
    border-radius: 10px;
    font-size: .86rem;
    font-weight: 700;
}

.theme-vorschau-menue .aktiv {
    background: color-mix(in srgb, var(--preview-accent, #e3001a) 10%, #fff);
    border-left-color: var(--preview-accent, #e3001a);
}

@media (max-width: 720px) {
    .theme-vorschau {
        grid-template-columns: 1fr;
    }

    .kanban-page,
    .kanban-board {
        padding-inline: 0;
    }

    .kanban-summary {
        grid-template-columns: 1fr;
    }

    .kanban-spalte {
        min-width: min(86vw, 330px);
        width: min(86vw, 330px);
        max-height: none;
    }

    .admin-card,
    .ticket-detail-header,
    .ticket-section,
    .news-detail-header,
    .community-card,
    .news-card {
        border-radius: 12px;
        padding: 1rem;
    }

    .ticket-kopf-zeile {
        align-items: flex-start;
    }

    .ticket-beobachten-button {
        flex: 0 0 34px;
    }

    .ticket-header-actions,
    .ticket-header-actions .dxbl-btn,
    .ticket-section-label-row .dxbl-btn {
        width: 100%;
    }

    .ticket-verlauf-actions .dxbl-btn {
        width: 100%;
    }

    .kommentar-sortierung-select {
        width: 100%;
    }

    .ticket-verlauf-kopf-aktionen {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .ticket-arbeit-actions,
    .ticket-arbeit-actions .dxbl-btn {
        width: 100%;
    }

    .ticket-arbeit-layout {
        grid-template-columns: 1fr;
        gap: .85rem;
    }

    .ticket-section-label-row {
        align-items: stretch;
        flex-direction: column;
        gap: .65rem;
    }

    .ticket-optional-section > summary,
    .ticket-optional-content {
        padding: .85rem 1rem;
    }

    .ticket-optional-section > summary {
        align-items: flex-start;
        flex-direction: column;
        gap: .25rem;
    }

    .ticket-optional-hint {
        margin-left: 0;
    }

    .kommentar-popup-footer {
        flex-direction: column-reverse;
    }

    .kommentar-popup-footer .dxbl-btn {
        width: 100%;
    }

    .kommentar-popup-body {
        padding: .85rem 1rem 0;
    }

    .kommentar-popup-optionen {
        grid-template-columns: 1fr;
    }

    .ticket-neu-body {
        padding: 1rem 1rem 0;
    }

    .ticket-neu-grid {
        grid-template-columns: 1fr;
    }

    .ticket-neu-anhaenge {
        margin-top: .25rem;
        padding-top: 0;
    }

    .ticket-neu-anhaenge-aktionen {
        align-items: stretch;
        flex-direction: column;
    }

    .ticket-upload-select-button,
    .ticket-neu-anhaenge-aktionen .dxbl-btn,
    .ticket-neu-footer .dxbl-btn {
        width: 100%;
    }

    .ticket-neu-footer {
        align-items: stretch;
        flex-direction: column-reverse;
        margin-inline: -1rem;
        padding-inline: 1rem;
    }

    .ticket-neu-footer-left,
    .ticket-neu-footer-right {
        width: 100%;
        flex-wrap: wrap;
    }

    .ticket-neu-footer-right {
        justify-content: flex-end;
    }

    .news-edit-body {
        padding: 1rem 1rem 0;
    }

    .news-edit-footer {
        align-items: stretch;
        flex-direction: column-reverse;
        margin-inline: -1rem;
        padding-inline: 1rem;
    }

    .news-edit-footer .dxbl-btn {
        width: 100%;
    }

    .admin-card-header,
    .ticket-list-header,
    .ticket-detail-title-row,
    .notizen-inhalt-header,
    .page-header.portal-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .ticket-filter-bar > *,
    .ticket-filter-bar .ticket-search,
    .ticket-filter-feld,
    .ticket-filter-aktionen,
    .aktionen-feld,
    .aktionen-feld .status-select,
    .aktionen-feld .ticket-projekt-select,
    .zeit-arbeitsgang-select {
        width: 100%;
        min-width: 0;
    }

    .ticket-filter-bar {
        grid-template-columns: minmax(0, 1fr);
    }

    .ticket-filter-aktionen {
        align-items: flex-start;
        flex-direction: column;
    }

    .aktionen-felder-row {
        align-items: stretch;
        flex-direction: column;
        gap: .75rem;
    }

    .ticket-bearbeitung-section .aktionen-feld,
    .ticket-bearbeitung-section .aktionen-feld--kunde,
    .ticket-bearbeitung-section .aktionen-feld--full {
        width: 100%;
        min-width: 0;
    }

    .ticket-zeit-panel .zeit-kompakt-row,
    .ticket-zeit-panel .zeit-kompakt-row .dxbl-btn {
        width: 100%;
    }

    .ticket-form-actions {
        justify-content: stretch;
    }

    .ticket-form-actions .dxbl-btn {
        flex: 1 1 180px;
    }

    .community-card {
        align-items: stretch;
        flex-direction: column;
    }

    .community-card-stats {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

/* ── Dark Mode ──────────────────────────────────────────────── */

/* Globale CSS-Tokens für Dark Mode überschreiben */
[data-theme="dark"] {
    --dx-bg:         #1a1d23;
    --dx-white:      #242831;
    --dx-border:     #363b47;
    --dx-text:       #c4c9d4;
    --dx-text-dark:  #e2e8f0;
    --dx-text-muted: #7c8490;
    --dx-shadow-xs:  0 1px 3px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.25);
    --dx-shadow-sm:  0 2px 6px rgba(0,0,0,.4),  0 1px 3px rgba(0,0,0,.3);
    --dx-shadow-md:  0 4px 14px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.35);
    --dx-shadow-lg:  0 8px 28px rgba(0,0,0,.6), 0 4px 10px rgba(0,0,0,.4);
}

/* Layout-Container */
[data-theme="dark"] body,
[data-theme="dark"] .drawer-content { background-color: #1a1d23; color: #e2e8f0; }

/* Topbar-Dark-Mode in layout.css */

/* Cards */
[data-theme="dark"] .dx-card,
[data-theme="dark"] .admin-card,
[data-theme="dark"] .ticket-section,
[data-theme="dark"] .ticket-optional-section,
[data-theme="dark"] .ticket-detail-header,
[data-theme="dark"] .news-detail-header { background: #242831; border-color: #363b47; color: #e2e8f0; }

[data-theme="dark"] .card { background: #242831; border-color: #363b47; }

/* Ticket-Bereiche */
[data-theme="dark"] .ticket-detail-container { background: #1a1d23; }
[data-theme="dark"] .ticket-beobachten-button { background: #242831; border-color: #363b47; }
[data-theme="dark"] .ticket-beobachten-button.ticket-beobachten-aktiv { background: color-mix(in srgb, var(--accent, #e3001a) 16%, #242831); border-color: var(--accent, #e3001a); }
[data-theme="dark"] .ticket-beobachten-button.ticket-beobachten-inaktiv { color: #7c8490; }
[data-theme="dark"] .ticket-kommentar { background: #2d3340; border-left-color: #4b5563; }
[data-theme="dark"] .ticket-beschreibung-eintrag { background: #252b36; border-left-color: #6b7280; }
[data-theme="dark"] .ticket-optional-section[open] > summary { border-bottom-color: #2d3748; }
[data-theme="dark"] .ticket-optional-section > summary,
[data-theme="dark"] .ticket-optional-section > summary::after,
[data-theme="dark"] .ticket-optional-hint,
[data-theme="dark"] .anhang-datei-symbol { color: #7c8490; }
[data-theme="dark"] .kommentar-editor-wrap { background: #1a1d23; border-color: #363b47; }
[data-theme="dark"] .kommentar-popup-footer { background: #242831; border-top-color: #363b47; }
[data-theme="dark"] .kommentar-popup-label { color: #7c8490; }
[data-theme="dark"] .kommentar-popup .kommentar-sichtbarkeit,
[data-theme="dark"] .kommentar-popup .kommentar-adressaten-row { background: #1e2430; border-color: #363b47; }
[data-theme="dark"] .ticket-neu-label { color: #a7afbd; }
[data-theme="dark"] .ticket-editor-panel { background: #1a1d23; border-color: #363b47; }
[data-theme="dark"] .ticket-editor-toolbar,
[data-theme="dark"] .ticket-neu-footer { background: #242831; border-color: #363b47; }
[data-theme="dark"] .ticket-neu-anhaenge { border-top-color: #363b47; }
[data-theme="dark"] .ticket-upload-select-button { background: #242831; border-color: #4b5563; color: #e2e8f0; }
[data-theme="dark"] .ticket-upload-select-button:hover { background: #2d3340; border-color: var(--accent, #e3001a); color: #fff; }
[data-theme="dark"] .kommentar-intern { background: #2d2a1a; border-left-color: #ca8a04; }
[data-theme="dark"] .kommentar-staff  { background: #1a2342; border-left-color: #3b82f6; }
[data-theme="dark"] .ticket-meta-tag  { background: #2d3340; color: #c4c9d4; }
[data-theme="dark"] .ticket-detail-betreff { color: #e2e8f0; }
[data-theme="dark"] .ticket-zurueck-link { color: #7c8490; }
[data-theme="dark"] .ticket-arbeit-label { color: #7c8490; }

/* Ticket-Detail: Ergänzungen */
[data-theme="dark"] .ticket-betreff { color: #e2e8f0; }
[data-theme="dark"] .ticket-meta-datum,
[data-theme="dark"] .ticket-meta-autor { color: #7c8490; }
[data-theme="dark"] .ticket-section-label { color: #7c8490; }
[data-theme="dark"] .ticket-antwort-section { border-top-color: var(--dx-red, #e3001a) !important; }
[data-theme="dark"] .ticket-form-actions { border-top-color: #363b47; }

/* Kommentare */
[data-theme="dark"] .kommentar-autor  { color: #e2e8f0; }
[data-theme="dark"] .kommentar-datum  { color: #7c8490; }
[data-theme="dark"] .kommentar-inhalt { color: #c4c9d4; }
[data-theme="dark"] .kommentar-inhalt :where(
    [style*="color:black" i],
    [style*="color: black" i],
    [style*="color:#000" i],
    [style*="color: #000" i],
    [style*="color:#111" i],
    [style*="color: #111" i],
    [style*="color:#1f1f1f" i],
    [style*="color: #1f1f1f" i],
    [style*="color:#222" i],
    [style*="color: #222" i],
    [style*="color:#333" i],
    [style*="color: #333" i],
    [style*="color:rgb(0" i],
    [style*="color: rgb(0" i],
    [style*="color:rgba(0" i],
    [style*="color: rgba(0" i],
    [style*="color:windowtext" i],
    [style*="color: windowtext" i],
    font[color="black" i],
    font[color="#000" i],
    font[color="#000000" i]
) { color: #e8edf5 !important; }
[data-theme="dark"] .kommentar-inhalt :where(
    [style*="background:white" i],
    [style*="background: white" i],
    [style*="background-color:white" i],
    [style*="background-color: white" i],
    [style*="background:#fff" i],
    [style*="background: #fff" i],
    [style*="background-color:#fff" i],
    [style*="background-color: #fff" i],
    [style*="background:rgb(255" i],
    [style*="background: rgb(255" i],
    [style*="background-color:rgb(255" i],
    [style*="background-color: rgb(255" i],
    [bgcolor="white" i],
    [bgcolor="#fff" i],
    [bgcolor="#ffffff" i]
) { background: transparent !important; }
[data-theme="dark"] .kommentar-sichtbarkeit-label,
[data-theme="dark"] .kommentar-adressaten-label { color: #7c8490; }
[data-theme="dark"] .ressourcen-chip { background: #1e3040; color: #a8c8dc; border-color: #2e4a5f; }
[data-theme="dark"] .ressourcen-leer { color: #7c8490; }
[data-theme="dark"] .kommentar-badge.intern { background: #3a2900; color: #fcd34d; }
[data-theme="dark"] .kommentar-badge.staff  { background: #0f1f40; color: #93c5fd; }
[data-theme="dark"] .kommentar-radio-option { border-color: #363b47; color: #c4c9d4; }
[data-theme="dark"] .kommentar-radio-option:hover:not(.active) { border-color: #4b5563; background: #2d3340; }
[data-theme="dark"] .kommentar-radio-option.active { border-color: #3b82f6; background: #0f1f40; color: #93c5fd; }
[data-theme="dark"] .kommentar-adressat-chip    { background: #241740; color: #c4b5fd; }
[data-theme="dark"] .kommentar-adressaten-label { color: #7c8490; }

/* Anhänge */
[data-theme="dark"] .anhang-item            { border-bottom-color: #2d3340; }
[data-theme="dark"] .anhang-groesse         { color: #7c8490; }
[data-theme="dark"] .anhang-upload-bereich  { border-top-color: #363b47; }

/* Aktionen & Popups */
[data-theme="dark"] .aktionen-label         { color: #a0aec0; }
[data-theme="dark"] .manuell-grid-label     { color: #a0aec0; }
[data-theme="dark"] .zuweisung-popup-label  { color: #c4c9d4; }

/* Zeiterfassung */
[data-theme="dark"] .zeit-badge-laufend { background: #14532d; color: #86efac; }
[data-theme="dark"] .zeit-notiz         { color: #7c8490; }
[data-theme="dark"] .zeit-stunden       { color: #e2e8f0; }

/* Verknüpfungen */
[data-theme="dark"] .verknuepfung-betreff  { color: #c4c9d4; }
[data-theme="dark"] .verknuepfung-nummer   { color: #7c8490; }
[data-theme="dark"] .verknuepfung-richtung { color: #6b7280; }
[data-theme="dark"] .verknuepfung-link:hover .verknuepfung-betreff { color: var(--dx-blue-link, #60a5fa); }

/* Sonstiges */
[data-theme="dark"] .admin-hint            { color: #7c8490; }
[data-theme="dark"] .dashboard-page .ticket-section-label,
[data-theme="dark"] .dashboard-card .ticket-section-label { color: #9ca3af; }

/* Dashboard */
[data-theme="dark"] .dashboard-container { background: #1a1d23; }
[data-theme="dark"] .kpi-card { background: #242831; border-color: #363b47; color: #e2e8f0; }
[data-theme="dark"] .kpi-zahl { color: #e2e8f0; }
[data-theme="dark"] .dashboard-chart-card { background: #242831; border-color: #363b47; }
[data-theme="dark"] .recent-ticket-row:hover { background: #2d3340; }

/* Kanban */
[data-theme="dark"] .kanban-spalte { background: #2d3340; }
[data-theme="dark"] .kanban-spalten-header,
[data-theme="dark"] .kanban-karte { background: #1a1d23; border-color: #363b47; color: #e2e8f0; }
[data-theme="dark"] .kanban-karte:hover { box-shadow: 0 2px 8px rgba(0,0,0,.4); }
[data-theme="dark"] .kanban-karte-footer { border-top-color: #363b47; }
[data-theme="dark"] .kanban-karte-nummer,
[data-theme="dark"] .kanban-karte-kunde { color: #7c8490; }
[data-theme="dark"] .kanban-summary { background: #363b47; border-color: #363b47; }
[data-theme="dark"] .kanban-summary-item,
[data-theme="dark"] .kanban-search,
[data-theme="dark"] .kanban-spalten-header { background: #242831; }
[data-theme="dark"] .kanban-karte-betreff,
[data-theme="dark"] .kanban-spalten-titel,
[data-theme="dark"] .kanban-summary-item strong { color: #e2e8f0; }
[data-theme="dark"] .kanban-badge,
[data-theme="dark"] .kanban-karte-kontext span,
[data-theme="dark"] .kanban-progress,
[data-theme="dark"] .kanban-empty { background: #2d3340; border-color: #363b47; }
[data-theme="dark"] .kanban-avatar { background: #2d3340; border-color: #1a1d23; color: #e2e8f0; }

/* Community / News */
[data-theme="dark"] .community-card,
[data-theme="dark"] .news-card,
[data-theme="dark"] .news-detail-header { background: #242831; border-color: #363b47; }

/* Glocke / Benachrichtigungen */
[data-theme="dark"] .glocke-dropdown { background: #242831; border-color: #363b47; }
[data-theme="dark"] .glocke-dropdown-header { border-bottom-color: #363b47; color: #e2e8f0; }
[data-theme="dark"] .glocke-item { border-bottom-color: #2d3340; }
[data-theme="dark"] .glocke-item:hover { background: #2d3340; }
[data-theme="dark"] .glocke-item.ungelesen { background: #1a2342; }
[data-theme="dark"] .glocke-item.ungelesen:hover { background: #1e2a50; }
[data-theme="dark"] .glocke-item-nachricht { color: #c4c9d4; }

[data-theme="dark"] .ticket-aktionen-gruppe { background: #1e2433; border-color: #363b47; }

/* Dokument-Scanner */
.dokument-scan-button-wrap {
    display: none;
}

.dokument-scan-fehler {
    margin: .5rem 0 0;
}

.document-scanner-file {
    display: none;
}

body.document-scanner-open {
    overflow: hidden;
}

.document-scanner-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    background: rgba(8, 15, 24, .72);
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.document-scanner-overlay.is-open {
    display: flex;
}

.document-scanner-panel {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
    background: #fff;
    color: #01171e;
}

.document-scanner-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1rem;
    border-bottom: 1px solid #e2e5e9;
}

.document-scanner-title {
    font-size: 1.1rem;
    font-weight: 800;
}

.document-scanner-subtitle {
    margin-top: .15rem;
    color: #5f6b7a;
    font-size: .82rem;
    line-height: 1.3;
}

.document-scanner-icon {
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid #d6dce3;
    border-radius: 8px;
    background: #fff;
    color: #01171e;
    font-size: 1.6rem;
    line-height: 1;
}

.document-scanner-stage {
    position: relative;
    min-height: 260px;
    overflow: hidden;
    background: #10151d;
}

.document-scanner-canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}

.document-scanner-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: #dbe3ee;
    font-weight: 700;
}

.document-scanner-camera {
    border: 1px solid #e3001a;
    border-radius: 8px;
    padding: .75rem 1.25rem;
    background: #e3001a;
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.document-scanner-preview {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding: .55rem .75rem;
    border-top: 1px solid #e2e5e9;
    min-height: 0;
}

.document-scanner-page {
    flex: 0 0 auto;
    width: 4.5rem;
    color: #5f6b7a;
    font-size: .72rem;
    text-align: center;
}

.document-scanner-page img {
    display: block;
    width: 4.5rem;
    height: 5.7rem;
    object-fit: cover;
    border: 1px solid #d6dce3;
    border-radius: 6px;
    margin-bottom: .25rem;
    background: #f3f5f7;
}

.document-scanner-status {
    min-height: 2.2rem;
    padding: .45rem .9rem;
    color: #5f6b7a;
    font-size: .84rem;
    border-top: 1px solid #eef1f4;
}

.document-scanner-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    padding: .75rem;
    border-top: 1px solid #e2e5e9;
    background: #f3f5f7;
}

.document-scanner-actions button {
    min-height: 2.75rem;
    border-radius: 8px;
    font-weight: 800;
}

.document-scanner-actions button:disabled {
    opacity: .45;
}

.document-scanner-overlay.is-busy .document-scanner-actions button {
    cursor: wait;
}

.document-scanner-status.is-error {
    color: #b42318;
    background: #fff1f2;
    border-top-color: #fecdd3;
    font-weight: 700;
}

.document-scanner-primary {
    border: 1px solid #e3001a;
    background: #e3001a;
    color: #fff;
}

.document-scanner-secondary {
    border: 1px solid #d6dce3;
    background: #fff;
    color: #01171e;
}

[data-theme="dark"] .document-scanner-panel {
    background: #1a1d23;
    color: #e2e8f0;
}

[data-theme="dark"] .document-scanner-header,
[data-theme="dark"] .document-scanner-preview,
[data-theme="dark"] .document-scanner-status,
[data-theme="dark"] .document-scanner-actions {
    border-color: #363b47;
}

[data-theme="dark"] .document-scanner-subtitle,
[data-theme="dark"] .document-scanner-status,
[data-theme="dark"] .document-scanner-page {
    color: #a7afbd;
}

[data-theme="dark"] .document-scanner-status.is-error {
    color: #fecaca;
    background: #451a1a;
    border-top-color: #7f1d1d;
}

[data-theme="dark"] .document-scanner-icon,
[data-theme="dark"] .document-scanner-secondary {
    background: #242831;
    border-color: #4b5563;
    color: #e2e8f0;
}

[data-theme="dark"] .document-scanner-actions {
    background: #242831;
}

@media (max-width: 768px) {
    .dokument-scan-button-wrap {
        display: block;
    }
}

/* Zeiterfassung */
[data-theme="dark"] .zeit-tabelle th { color: #c4c9d4; border-bottom-color: #363b47; }
[data-theme="dark"] .zeit-tabelle td { border-bottom-color: #2d3340; }
[data-theme="dark"] .zeit-tabelle tfoot td { border-top-color: #363b47; }
[data-theme="dark"] .zeit-laufend td { background: #1a2a20; }
[data-theme="dark"] .stempel-laufend { background: #1a2a20; border-color: #16532b; }

/* Admin */
[data-theme="dark"] .admin-tile { background: #242831; border-color: #363b47; color: #e2e8f0; }
[data-theme="dark"] .admin-tile:hover { border-color: #e3001a; }
[data-theme="dark"] .admin-card-header h3 { color: #e2e8f0; }

/* Login */
[data-theme="dark"] .login-popup-card { background: #242831; }
[data-theme="dark"] .login-input { background: #1a1d23; border-color: #363b47; color: #e2e8f0; }
[data-theme="dark"] .login-label { color: #e2e8f0; }
[data-theme="dark"] .login-popup-title { color: #e2e8f0; }

/* SLA */
[data-theme="dark"] .sla-ok { background: #14532d; color: #86efac; }
[data-theme="dark"] .sla-verletzt { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .sla-erfuellt { background: #1e3a5f; color: #93c5fd; }

/* ── Notizen ─────────────────────────────────────────────────── */
.notizen-layout {
    display: flex;
    gap: 0;
    height: calc(100vh - 80px);
    background: #fff;
    border: 1px solid #e2e5e9;
    border-radius: 10px;
    overflow: hidden;
}
.notizen-sidebar {
    width: 300px;
    min-width: 260px;
    border-right: 1px solid #e2e5e9;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.notizen-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .875rem 1rem;
    border-bottom: 1px solid #e2e5e9;
}
.notizen-sidebar-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #01171e;
    margin: 0;
}
.notizen-suche {
    padding: .5rem .75rem;
    border-bottom: 1px solid #e2e5e9;
}
.notizen-liste {
    flex: 1;
    overflow-y: auto;
}
.notiz-listeneintrag {
    padding: .75rem 1rem;
    border-bottom: 1px solid #f0f2f4;
    cursor: pointer;
    transition: background .15s;
}
.notiz-listeneintrag:hover { background: #f7f9fb; }
.notiz-listeneintrag.aktiv { background: #fde8ea; border-left: 3px solid #e3001a; }
.notiz-listeneintrag-titel {
    font-size: .9rem;
    font-weight: 600;
    color: #01171e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notiz-listeneintrag-meta {
    font-size: .75rem;
    color: #6c757d;
    margin-top: .2rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.notiz-projekt-badge {
    background: #eaf0ff;
    color: #2563eb;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: .7rem;
}
.notizen-leer {
    padding: 1.5rem 1rem;
    color: #6c757d;
    font-size: .875rem;
    text-align: center;
}
.notizen-inhalt {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.notizen-inhalt-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e5e9;
    gap: 1rem;
}
.notizen-inhalt-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #01171e;
    margin: 0 0 .25rem;
}
.notizen-meta {
    font-size: .8rem;
    color: #6c757d;
}
.notizen-aktionen {
    display: flex;
    gap: .5rem;
    flex-shrink: 0;
}
.notizen-inhalt-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}
.notizen-leer-rechts {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: .9rem;
}

/* Dark mode – Notizen */
@media (max-width: 900px) {
    .notizen-layout {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 130px);
    }

    .notizen-sidebar {
        width: 100%;
        min-width: 0;
        max-height: 320px;
        border-right: 0;
        border-bottom: 1px solid #e2e5e9;
    }

    .notizen-inhalt {
        min-height: 420px;
    }
}

@media (max-width: 640px) {
    .notizen-aktionen {
        width: 100%;
        flex-wrap: wrap;
    }

    .notizen-aktionen .dxbl-btn {
        flex: 1 1 140px;
    }

    .notizen-inhalt-body {
        padding: 1rem;
    }
}

[data-theme="dark"] .notizen-layout { background: #242831; border-color: #363b47; }
[data-theme="dark"] .notizen-sidebar { border-right-color: #363b47; border-bottom-color: #363b47; }
[data-theme="dark"] .notizen-sidebar-header { border-bottom-color: #363b47; }
[data-theme="dark"] .notizen-sidebar-header h3 { color: #e2e8f0; }
[data-theme="dark"] .notizen-suche { border-bottom-color: #363b47; }
[data-theme="dark"] .notiz-listeneintrag { border-bottom-color: #2d3340; }
[data-theme="dark"] .notiz-listeneintrag:hover { background: #2d3340; }
[data-theme="dark"] .notiz-listeneintrag.aktiv { background: #3a1a1d; border-left-color: #e3001a; }
[data-theme="dark"] .notiz-listeneintrag-titel { color: #e2e8f0; }
[data-theme="dark"] .notizen-inhalt-header { border-bottom-color: #363b47; }
[data-theme="dark"] .notizen-inhalt-header h2 { color: #e2e8f0; }
[data-theme="dark"] .notiz-projekt-badge { background: #1e2a50; color: #93c5fd; }



/* Dashboard DATEEX-Portal */

.dashboard-page,
.welcome-page {
    --portal-ink: var(--theme-grundfarbe, #101110);
    --portal-muted: #6d716a;
    --portal-line: #dedfd9;
    --portal-paper: #fff;
    --portal-bg: #f6f7f3;
    --portal-accent: var(--theme-akzent, #e3001a);
    --portal-accent-dark: var(--theme-akzent, #9f0012);
    color: var(--portal-ink);
}

.dashboard-page {
    width: min(100%, var(--page-max-width));
    margin: 0 auto;
    padding: 0 0 2.5rem;
}

.dashboard-page h1,
.welcome-page h1 {
    margin: 0 0 8px;
    font-size: clamp(30px, 4vw, 49px);
    line-height: 1.03;
    font-weight: 780;
    letter-spacing: 0;
}

.dashboard-page h2,
.welcome-page h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 760;
}

.dashboard-page .muted,
.welcome-page .muted {
    color: var(--portal-muted);
}

.dashboard-page .eyebrow,
.welcome-page .eyebrow {
    margin-bottom: 10px;
    color: var(--portal-accent);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 1.8px;
}

.page-header.portal-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 34px;
}

.header-actions,
.accent-actions,
.welcome-actions,
.popup-footer-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.popup-footer-actions {
    justify-content: flex-end;
}

.dashboard-page .button,
.welcome-page .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 760;
    text-decoration: none;
    cursor: pointer;
}

.dashboard-page .button-primary,
.welcome-page .button-primary {
    color: #fff;
    background: var(--portal-accent);
}

.dashboard-page .button-primary:hover,
.welcome-page .button-primary:hover {
    background: var(--portal-accent-dark);
}

.dashboard-page .button-secondary,
.welcome-page .button-secondary,
.dashboard-page .button-light {
    color: #222;
    background: #fff;
    border: 1px solid var(--portal-line);
}

.dashboard-page .button-dark {
    color: #fff;
    background: #101110;
}

.hero-value {
    padding: 28px 0 38px;
    border-top: 1px solid var(--portal-line);
}

.hero-value span,
.hero-value small {
    display: block;
    color: var(--portal-muted);
    font-size: 12px;
}

.hero-value strong {
    display: block;
    margin: 10px 0 5px;
    font-size: clamp(42px, 7vw, 70px);
    line-height: 1;
    letter-spacing: 0;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 28px;
    overflow: hidden;
    background: var(--portal-paper);
    border: 1px solid var(--portal-line);
    border-radius: 16px;
}

.metric-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric {
    min-height: 118px;
    padding: 24px;
    border-right: 1px solid var(--portal-line);
}

.metric:last-child {
    border-right: 0;
}

.metric span {
    display: block;
    margin-bottom: 20px;
    color: var(--portal-muted);
    font-size: 11px;
}

.metric strong {
    font-size: 24px;
    font-weight: 780;
    letter-spacing: 0;
}

.metric-danger strong {
    color: var(--portal-accent);
}

.metric-clickable {
    cursor: pointer;
    transition: background .15s ease;
}

.metric-clickable:hover {
    background: #fafbf8;
}

.split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

.dashboard-analytics {
    align-items: stretch;
}

.panel {
    padding: 28px;
    background: var(--portal-paper);
    border: 1px solid var(--portal-line);
    border-radius: 16px;
}

.table-panel {
    padding: 0;
    overflow: hidden;
}

.panel-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.table-panel .panel-heading {
    padding: 26px 28px 0;
}

.panel-heading a,
.panel-heading span {
    color: var(--portal-muted);
    font-size: 11px;
    text-decoration: none;
}

.accent-panel {
    background: var(--portal-accent);
    border-color: var(--portal-accent);
    color: #fff;
}

.accent-panel .eyebrow,
.accent-panel p {
    color: rgba(255,255,255,.78);
}

.accent-panel h2 {
    margin-bottom: 10px;
    font-size: clamp(22px, 3vw, 34px);
    line-height: 1.05;
    letter-spacing: 0;
}

.accent-panel p {
    max-width: 520px;
    margin-bottom: 24px;
    line-height: 1.55;
}

.ticket-table {
    display: grid;
}

.ticket-row {
    display: grid;
    grid-template-columns: 130px minmax(180px, 1fr) 105px auto;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 15px 18px;
    color: inherit;
    text-align: left;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--portal-line);
    cursor: pointer;
}

.ticket-row:hover {
    background: var(--bg-soft, #fafbf8);
}

.ticket-number,
.ticket-nummer {
    color: var(--portal-accent);
    font-weight: 820;
    white-space: nowrap;
}

.ticket-title {
    min-width: 0;
    overflow: hidden;
    color: var(--portal-ink);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-date,
.ticket-meta-datum {
    color: var(--portal-muted);
    font-size: 12px;
    white-space: nowrap;
}

.compact-list {
    display: grid;
    border-top: 1px solid var(--portal-line);
}

.compact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 0;
    color: inherit;
    border-bottom: 1px solid var(--portal-line);
    text-decoration: none;
    font-size: 13px;
}

.compact-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-row strong {
    color: var(--portal-muted);
    font-size: 11px;
    white-space: nowrap;
}

.empty {
    padding: 32px;
    color: var(--portal-muted);
    text-align: center;
}

.loading {
    padding: 50px;
    color: var(--portal-muted);
    text-align: center;
}

.welcome-page {
    min-height: calc(100vh - 160px);
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}

.welcome-card {
    width: min(100%, 720px);
    padding: 42px;
    text-align: center;
    background: #fff;
    border: 1px solid var(--portal-line);
    border-radius: 18px;
    box-shadow: 0 28px 90px rgba(16,17,16,.12);
}

.welcome-page .welcome-logo {
    max-width: 190px;
    margin-bottom: 34px;
}

.welcome-actions {
    justify-content: center;
    margin-top: 24px;
}

.zeit-ticket-title {
    margin-left: .4rem;
    color: #6c757d;
    font-size: .85rem;
}

.zeit-popup .dxbl-popup-body {
    padding: 1rem 1.25rem 1.25rem;
}

.zeit-popup .dxbl-popup-footer {
    padding: 1rem 1.25rem;
}

.zeit-popup .zeit-tabelle {
    margin-bottom: 0;
}

.zeit-popup .zeit-tabelle th {
    padding: .6rem .75rem;
}

.zeit-popup .zeit-tabelle td {
    padding: .7rem .75rem;
    vertical-align: top;
}

.zeit-popup .zeit-tabelle tfoot td {
    padding-top: .85rem;
}

.zeit-ticket-link {
    display: inline-flex;
    align-items: baseline;
    gap: .4rem;
    max-width: 100%;
    color: inherit;
    text-decoration: none;
}

.zeit-ticket-link:hover .ticket-number,
.zeit-ticket-link:focus-visible .ticket-number {
    text-decoration: underline;
}

.zeit-ticket-link .zeit-ticket-title {
    margin-left: 0;
}

.zeit-popup-toolbar {
    display: flex;
    align-items: flex-end;
    gap: .85rem;
    padding: .9rem 1rem 1rem;
    margin: -.25rem -.25rem 1rem;
    border-bottom: 1px solid #edf0f4;
    background: #fafbfc;
}

.zeit-popup-filter {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-width: 0;
}

.zeit-popup-filter--mitarbeiter {
    flex: 1 1 320px;
}

.zeit-popup-filter--datum {
    flex: 0 0 170px;
}

.zeit-popup-label {
    color: #495057;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.zeit-mitarbeiter-select,
.zeit-datum-select {
    width: 100%;
}

[data-theme="dark"] .zeit-popup-toolbar {
    border-bottom-color: #2d3340;
    background: #1e2430;
}

[data-theme="dark"] .zeit-popup-label {
    color: #c4c9d4;
}

@media (max-width: 640px) {
    .zeit-popup-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .zeit-popup-filter--mitarbeiter,
    .zeit-popup-filter--datum {
        flex-basis: auto;
    }
}

/* ── Ticket-Zuweisungen ──────────────────────────────────────── */
.ticket-section-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.ticket-verlauf-actions { display: flex; justify-content: flex-end; margin-top: .75rem; }
.ticket-verlauf-actions-top { margin-top: 0; margin-bottom: .75rem; }
.kommentar-sortierung-select { min-width: 180px; }
.zuweisung-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.zuweisung-chip { display: inline-flex; align-items: center; gap: .2rem; font-size: .82rem; font-weight: 500; padding: .2rem .65rem; border-radius: 20px; background: #e8f0f5; color: #032b38; border: 1px solid #c8d9e3; }
.zuweisung-haupt { background: #fff8e1; color: #7a5700; border-color: #f0d060; font-weight: 700; }
.zuweisung-popup-label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: .3rem; color: #374151; }
[data-theme="dark"] .zuweisung-chip { background: #1e3040; color: #a8c8dc; border-color: #2e4a5f; }
[data-theme="dark"] .zuweisung-haupt { background: #3d2e00; color: #f5d060; border-color: #7a5700; }

/* ── Ticket-Checkliste ────────────────────────────────────── */
.checkliste-progress-wrap { height: 6px; background: #e9ecef; border-radius: 3px; margin-bottom: .75rem; overflow: hidden; }
.checkliste-progress { height: 100%; background: #198754; border-radius: 3px; transition: width .3s ease; }
.checkliste-liste { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .6rem; }
.checkliste-item { display: flex; align-items: center; gap: .6rem; padding: .3rem .4rem; border-radius: 6px; transition: background .15s; }
.checkliste-item:hover { background: #f8f9fa; }
.checkliste-text { flex: 1; font-size: .92rem; line-height: 1.4; }
.checkliste-item-erledigt .checkliste-text { text-decoration: line-through; color: #9ca3af; }
.checkliste-neu-row { display: flex; gap: .5rem; align-items: center; margin-top: .25rem; }
.checkliste-input { flex: 1; }
.checkliste-vorlage-select { width: 180px; }
[data-theme="dark"] .checkliste-progress-wrap { background: #2d3748; }
[data-theme="dark"] .checkliste-progress { background: #22c55e; }
[data-theme="dark"] .checkliste-item:hover { background: #1e2530; }
[data-theme="dark"] .checkliste-item-erledigt .checkliste-text { color: #6b7280; }

/* ── Ticket-Verknüpfungen ──────────────────────────────────── */
.verknuepfung-liste { display: flex; flex-direction: column; gap: .4rem; }
.verknuepfung-item { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .35rem .6rem; border-radius: 6px; background: #f8f9fa; border: 1px solid #e9ecef; }
.verknuepfung-link { display: flex; align-items: center; gap: .45rem; text-decoration: none; color: inherit; flex: 1; min-width: 0; }
.verknuepfung-link:hover .verknuepfung-betreff { text-decoration: underline; color: var(--bs-primary, #0d6efd); }
.verknuepfung-nummer { font-size: .8rem; font-weight: 600; color: #6c757d; white-space: nowrap; }
.verknuepfung-betreff { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.verknuepfung-richtung { font-size: .85rem; color: #9ca3af; flex-shrink: 0; }
.verknuepfung-art-badge { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 12px; white-space: nowrap; flex-shrink: 0; }
.verknuepfung-art-badge.art-verweis    { background: #e0f2fe; color: #075985; }
.verknuepfung-art-badge.art-duplikat   { background: #fef9c3; color: #713f12; }
.verknuepfung-art-badge.art-zusammen   { background: #f0fdf4; color: #166534; }
.verknuepfung-art-badge.art-blockiert  { background: #fee2e2; color: #991b1b; }
[data-theme="dark"] .verknuepfung-item { background: #1e2530; border-color: #2d3748; }
[data-theme="dark"] .verknuepfung-art-badge.art-verweis   { background: #0c3047; color: #7dd3fc; }
[data-theme="dark"] .verknuepfung-art-badge.art-duplikat  { background: #3d2e00; color: #fde68a; }
[data-theme="dark"] .verknuepfung-art-badge.art-zusammen  { background: #052e16; color: #86efac; }
[data-theme="dark"] .verknuepfung-art-badge.art-blockiert { background: #450a0a; color: #fca5a5; }

@media (max-width: 1180px) {
    .metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .metric:nth-child(3) {
        border-right: 0;
    }

    .metric:nth-child(-n+3) {
        border-bottom: 1px solid var(--portal-line);
    }

    .split-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .dashboard-page {
        padding: 0 0 2rem;
    }

    .dashboard-page h1,
    .welcome-page h1 {
        letter-spacing: 0;
    }

    .page-header.portal-header {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 26px;
    }

    .hero-value strong {
        letter-spacing: 0;
    }

    .metric-grid,
    .metric-grid.compact {
        grid-template-columns: 1fr;
    }

    .metric {
        border-right: 0;
        border-bottom: 1px solid var(--portal-line);
    }

    .metric:last-child {
        border-bottom: 0;
    }

    .ticket-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .panel,
    .welcome-card {
        padding: 24px;
    }

    .table-panel {
        padding: 0;
    }
}
.ticket-grid-kontextbereich {
    position: relative;
}

.ticket-grid-kontextmenue {
    position: fixed;
    z-index: 1100;
    min-width: 220px;
    padding: 6px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: var(--surface, #fff);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
}

.ticket-grid-kontext-hintergrund {
    position: fixed;
    inset: 0;
    z-index: 1099;
}

.ticket-grid-kontextmenue button {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.ticket-grid-kontextmenue button:hover {
    background: var(--surface-subtle, #f3f4f6);
}

.ticket-grid-kontexttrenner {
    height: 1px;
    margin: 5px 4px;
    background: var(--border-soft);
}
