/* ═══════════════════════════════════════════════════════════
   NSL PSA — Design System v3  "Command Center"
   Dark, professional, enterprise-grade
═══════════════════════════════════════════════════════════ */

:root {
    /* ── Backgrounds ──────────────────────────────────────── */
    --bg:            #060710;
    --surface:       #0b0c1a;
    --surface2:      #0f1020;
    --surface3:      #141527;
    --surface4:      #1a1b2e;
    --surface5:      #21223a;

    /* ── Borders ──────────────────────────────────────── */
    --border:        #1a1b2f;
    --border-light:  #252640;

    /* ── Brand — NSL Blue (exakt aus Logo extrahiert) ──────── */
    --primary:       #2B62B2;
    --primary-light: #4B82D2;
    --primary-dark:  #1E4682;
    --primary-dim:   #0A1A30;
    --primary-glow:  rgba(43,98,178,.3);

    /* ── Semantic ─────────────────────────────────────────── */
    --success:       #10d988;
    --success-dim:   #021610;
    --warning:       #f59e0b;
    --warning-dim:   #1c1002;
    --danger:        #f05252;
    --danger-dim:    #1e0505;
    --info:          #38b2f8;
    --info-dim:      #040e1e;
    --purple:        #b06ef7;
    --purple-dim:    #160826;
    --cyan:          #22d3ee;

    /* ── Text ─────────────────────────────────────────────── */
    --text:          #dde1f3;
    --text-muted:    #7076a0;
    --text-subtle:   #363755;

    /* ── Layout ───────────────────────────────────────────── */
    --sidebar-w:     252px;
    --topbar-h:      60px;
    --radius:        8px;
    --radius-lg:     12px;
    --radius-xl:     16px;
    --radius-2xl:    24px;

    /* ── Shadows ──────────────────────────────────────────── */
    --shadow:         0 24px 64px rgba(0,0,0,.9), 0 4px 24px rgba(0,0,0,.6);
    --shadow-sm:      0 4px 24px rgba(0,0,0,.5);
    --shadow-card:    0 2px 12px rgba(0,0,0,.35);
    --shadow-primary: 0 4px 24px rgba(43,98,178,.35);
}

/* ═══════════════════════════════════════════════════════════
   Reset & Base
═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

body {
    font-family: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    zoom: 0.8;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { color: #c4b8ff; text-decoration: none; }
code {
    font-family: ui-monospace, 'Cascadia Code', 'JetBrains Mono', monospace;
    font-size: .85em;
    background: var(--surface3);
    padding: .1em .35em;
    border-radius: 4px;
    color: var(--primary-light);
}

/* ═══════════════════════════════════════════════════════════
   Auth Pages
═══════════════════════════════════════════════════════════ */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 90% 60% at 50% -10%, rgba(43,98,178,.12), transparent),
        radial-gradient(ellipse 60% 80% at 90% 110%, rgba(43,98,178,.06), transparent);
}

.auth-box {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem 2.25rem;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -.03em;
    background: linear-gradient(135deg, var(--primary-light), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-title    { font-size: 1.1rem; font-weight: 700; text-align: center; margin-bottom: .2rem; letter-spacing: -.02em; }
.auth-subtitle { font-size: .84rem; color: var(--text-muted); text-align: center; margin-bottom: 1.75rem; }

/* ═══════════════════════════════════════════════════════════
   App Shell
═══════════════════════════════════════════════════════════ */
.app { display: flex; width: 100%; height: 100%; overflow: hidden; }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 0 1.1rem;
    height: var(--topbar-h);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.logo-mark {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 16px var(--primary-glow);
}
.logo-mark svg { width: 16px; height: 16px; color: #fff; }

.logo-text {
    font-size: .95rem;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--text);
}
.logo-badge {
    font-size: .62rem;
    font-weight: 700;
    background: var(--primary-dim);
    color: var(--primary-light);
    border: 1px solid rgba(43,98,178,.3);
    padding: .1rem .42rem;
    border-radius: 4px;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-left: auto;
}

.sidebar-nav { flex: 1; padding: 1rem .75rem; display: flex; flex-direction: column; gap: 2px; }

.nav-section {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-subtle);
    padding: .5rem .5rem .3rem;
    margin-top: .5rem;
}
.nav-section:first-child { margin-top: 0; }

.nav-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .58rem .75rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: .855rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, color .15s;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}
.nav-item::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
    opacity: 0;
    transition: opacity .15s;
}
.nav-item:hover {
    background: var(--surface3);
    color: var(--text);
    text-decoration: none;
}
.nav-item.active {
    background: var(--primary-dim);
    color: var(--primary-light);
    font-weight: 600;
}
.nav-item.active::before { opacity: 1; }

.nav-icon {
    width: 32px; height: 32px;
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: var(--surface3);
    transition: background .15s;
}
.nav-icon svg { width: 15px; height: 15px; }
.nav-item.active .nav-icon {
    background: rgba(43,98,178,.18);
    color: var(--primary-light);
    box-shadow: 0 0 10px rgba(43,98,178,.15);
}
.nav-item:hover .nav-icon { background: var(--surface4); }

.nav-label { white-space: nowrap; flex: 1; }

.nav-badge {
    font-size: .68rem;
    font-weight: 700;
    background: var(--danger);
    color: #fff;
    padding: .1rem .4rem;
    border-radius: 99px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: .85rem .75rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: var(--text);
    border-radius: var(--radius);
    padding: .45rem .5rem;
    transition: background .15s;
}
.sidebar-user:hover { background: var(--surface3); }
.user-avatar {
    width: 32px; height: 32px;
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
/* Hochgeladenes Profilbild füllt jede Avatar-Kachel (Größe/Radius kommt von der
   jeweiligen Avatar-Klasse: user-/mini-/activity-/profile-avatar). */
.avatar-photo { padding: 0; overflow: hidden; }
.avatar-photo > img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.user-role { font-size: .7rem; color: var(--text-muted); line-height: 1.3; }

.btn-logout {
    background: none; border: none; color: var(--text-subtle); cursor: pointer;
    padding: .45rem; border-radius: var(--radius); display: flex;
    transition: color .15s, background .15s;
}
.btn-logout:hover { color: var(--danger); background: var(--danger-dim); }
.btn-logout svg { width: 16px; height: 16px; }

/* ── Main content ─────────────────────────────────────── */
.main-content {
    flex: 1;
    min-width: 0; /* verhindert dass Flex-Kind breiter als Container wird */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}

/* ── Topbar ───────────────────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    height: var(--topbar-h);
    border-bottom: 1px solid var(--border);
    background: rgba(11,12,26,.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-shrink: 0;
    gap: 1rem;
    position: relative;
    z-index: 900;   /* Topbar-Stapel (inkl. Dropdowns) über den Seiteninhalt heben */
}

.page-title {
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex-shrink: 1; /* darf schrumpfen statt andere Elemente rauszuschieben */
    color: var(--text);
}

.topbar-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: .35rem;
    flex: 1;
    max-width: 440px;
}
.search-input-wrap { position: relative; display: flex; align-items: center; flex: 1; }
.search-icon {
    position: absolute; left: .65rem;
    width: 13px; height: 13px;
    color: var(--text-subtle); pointer-events: none;
}
.search-input {
    width: 100%;
    background: var(--surface3);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text); font-size: .85rem;
    padding: .46rem .85rem .46rem 2.55rem;
    outline: none; transition: all .2s;
    font-family: inherit;
}
/* Höhere Spezifität nötig: die generische input[type=text]-Regel (Zeile ~625) hat
   Spezifität 0,1,1 und überschreibt sonst lautlos das padding-left von .search-input (0,1,0) —
   das war die eigentliche Ursache, warum das Icon stets über dem Text lag. */
input#global-search.search-input {
    padding: .46rem .85rem .46rem 2.55rem;
}
.search-input::placeholder { color: var(--text-subtle); }
.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(43,98,178,.15);
    background: var(--surface4);
}
.search-kbd {
    position: absolute; right: .55rem;
    background: var(--surface4); border: 1px solid var(--border-light);
    border-radius: 5px; padding: .1rem .38rem;
    font-size: .66rem; color: var(--text-muted); pointer-events: none; font-family: inherit;
}
.search-input:focus ~ .search-kbd { display: none; }

.topbar-right {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
    margin-left: auto;
}
.topbar-actions { display: flex; gap: .5rem; align-items: center; }
.topbar-divider { width: 1px; height: 22px; background: var(--border-light); margin: 0 .25rem; flex-shrink: 0; }

/* Ticket stat chips in topbar */
.topbar-ticket-stats { display: flex; gap: .4rem; align-items: center; }
.tstat-chip {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .32rem .75rem; border-radius: var(--radius);
    text-decoration: none; font-size: .8rem; font-weight: 600;
    border: 1px solid var(--border-light); background: var(--surface2);
    color: var(--text-muted); transition: all .15s; white-space: nowrap;
}
.tstat-chip:hover { border-color: var(--border-light); background: var(--surface3); color: var(--text); text-decoration: none; }
.tstat-num { font-size: .9rem; font-weight: 800; color: var(--text); }
.tstat-lbl { font-size: .75rem; font-weight: 500; color: var(--text-muted); }
.tstat-dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
    background: var(--success); box-shadow: 0 0 6px var(--success);
}
.tstat-open { border-color: rgba(16,217,136,.2); }
.tstat-open:hover { border-color: rgba(16,217,136,.4); background: rgba(16,217,136,.06); }
.tstat-open .tstat-num { color: var(--success); }

.topbar-icon-btn {
    width: 36px; height: 36px;
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
    position: relative;
}
.topbar-icon-btn:hover { background: var(--surface4); color: var(--text); border-color: var(--border-light); }
.topbar-icon-btn svg { width: 16px; height: 16px; }

.topbar-user-pill {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: .35rem .65rem .35rem .4rem;
    text-decoration: none;
    color: var(--text);
    transition: all .15s;
    cursor: pointer;
}
.topbar-user-pill:hover { background: var(--surface4); border-color: var(--border-light); }
.topbar-user-pill .user-avatar { width: 26px; height: 26px; border-radius: 6px; font-size: .75rem; }
.topbar-user-pill .pill-name { font-size: .82rem; font-weight: 600; white-space: nowrap; }

/* Single scrollable content wrapper */
.page-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    min-height: 0; /* critical: allows flex child to shrink & scroll */
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}


/* ── Search Dropdown ─────────────────────────────────── */
.search-dropdown {
    position: fixed;
    background: var(--surface2); border: 1px solid var(--border-light);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-card); z-index: 9999;
    overflow: hidden; max-height: 500px; overflow-y: auto;
    /* top/left/width set by JS based on input bounding rect */
}

/* Schnellzugriff: zuletzt bearbeitete Tickets (Button neben der Suche) */
.recent-btn {
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    background: var(--surface3); border: 1px solid var(--border-light);
    border-radius: var(--radius); color: var(--text-muted);
    cursor: pointer; transition: background .1s, color .1s;
}
.recent-btn:hover { background: var(--surface4); color: var(--text); }
.recent-btn svg { width: 16px; height: 16px; }
.recent-dropdown {
    position: fixed;   /* wie das Such-Dropdown: JS setzt top/right, damit nichts es verdeckt */
    width: 340px; max-width: 92vw; max-height: 460px; overflow-y: auto;
    background: var(--surface2); border: 1px solid var(--border-light);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-card); z-index: 9999;
    padding: .3rem;
}
.recent-head { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-subtle); padding: .5rem .6rem .35rem; }
.recent-item {
    display: flex; align-items: center; gap: .55rem;
    padding: .5rem .6rem; border-radius: var(--radius);
    color: var(--text); text-decoration: none; font-size: .85rem;
}
.recent-item:hover { background: var(--surface3); text-decoration: none; }
.recent-nr    { font-family: ui-monospace, monospace; font-size: .73rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.recent-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-cust  { font-size: .75rem; color: var(--text-subtle); white-space: nowrap; flex-shrink: 0; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.recent-empty { padding: .8rem .7rem; color: var(--text-subtle); font-size: .82rem; text-align: center; }
.sr-section { border-bottom: 1px solid var(--border); }
.sr-section:last-of-type { border-bottom: none; }
.sr-group {
    display: flex; align-items: center; gap: .4rem;
    padding: .55rem .9rem .3rem;
    font-size: .67rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: var(--text-subtle);
}
.sr-group svg { width: 12px; height: 12px; flex-shrink: 0; opacity: .7; }
.sr-item {
    display: flex; align-items: center; gap: .55rem;
    padding: .5rem .9rem; color: var(--text); text-decoration: none;
    font-size: .85rem; transition: background .1s; cursor: pointer;
}
.sr-item:hover, .sr-item.is-active { background: var(--surface3); text-decoration: none; }
.sr-item-icon { font-size: .85rem; width: 20px; text-align: center; flex-shrink: 0; }
.sr-item-main { flex: 1; display: flex; align-items: center; gap: .45rem; min-width: 0; overflow: hidden; }
.sr-item-side { display: flex; align-items: center; gap: .45rem; flex-shrink: 0; margin-left: auto; }
.sr-nr    { font-family: ui-monospace,monospace; font-size: .73rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.sr-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-sub   { font-size: .75rem; color: var(--text-subtle); white-space: nowrap; flex-shrink: 0; }
.sr-title mark { background: rgba(248,167,35,.18); color: var(--warning); border-radius: 3px; padding: 0 2px; }
.sr-meta  { font-size: .77rem; color: var(--text-muted); white-space: nowrap; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.sr-badge { font-size: .68rem; font-weight: 700; padding: .1rem .4rem; border-radius: 99px; white-space: nowrap; flex-shrink: 0; }
/* Ticket statuses */
.sr-open        { background: rgba(43,98,178,.15); color: var(--primary-light); }
.sr-in_progress { background: rgba(245,158,11,.12);  color: var(--warning); }
.sr-waiting     { background: rgba(176,110,247,.12); color: var(--purple,#b06ef7); }
.sr-resolved    { background: rgba(16,217,136,.1);   color: var(--success); }
.sr-closed      { background: var(--surface4); color: var(--text-subtle); }
/* Task statuses */
.sr-task-open        { background: rgba(100,181,246,.12); color: #64b5f6; }
.sr-task-in_progress { background: rgba(255,183,77,.12);  color: #ffb74d; }
.sr-task-done        { background: rgba(129,199,132,.12); color: #81c784; }
/* Footer link */
.sr-footer {
    display: flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .6rem .9rem; border-top: 1px solid var(--border);
    font-size: .81rem; color: var(--primary-light); text-decoration: none;
    transition: background .1s;
}
.sr-footer svg { width: 13px; height: 13px; opacity: .7; }
.sr-footer:hover { background: var(--surface3); }
.sr-empty { padding: 1.2rem .9rem; font-size: .85rem; color: var(--text-muted); text-align: center; }
/* Loading dots */
.sr-loading { display: flex; align-items: center; justify-content: center; gap: .35rem; padding: 1rem; }
.sr-loading span {
    width: 6px; height: 6px; border-radius: 50%; background: var(--primary-dim);
    animation: sr-pulse 1.2s ease-in-out infinite;
}
.sr-loading span:nth-child(2) { animation-delay: .2s; }
.sr-loading span:nth-child(3) { animation-delay: .4s; }
@keyframes sr-pulse { 0%,80%,100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

/* ═══════════════════════════════════════════════════════════
   Cards
═══════════════════════════════════════════════════════════ */
.content-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: .875rem;
    transition: border-color .2s;
}
.content-card:hover { border-color: var(--border-light); }

.card-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.card-title  { font-size: .9rem; font-weight: 700; flex: 1; letter-spacing: -.02em; }
.card-stat   { font-size: .82rem; color: var(--text-muted); }
.card-actions { display: flex; gap: .5rem; align-items: center; }

/* Page section header */
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.25rem; gap: 1rem; flex-wrap: wrap;
}
.section-title { font-size: 1.15rem; font-weight: 800; letter-spacing: -.03em; }
.section-subtitle { font-size: .83rem; color: var(--text-muted); margin-top: .15rem; }

/* ═══════════════════════════════════════════════════════════
   Buttons
═══════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    background: var(--surface3);
    color: var(--text);
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    text-decoration: none;
    font-family: inherit;
    letter-spacing: -.01em;
    line-height: 1;
}
.btn:hover {
    background: var(--surface4);
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
    text-decoration: none;
}
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: transparent;
    color: #fff;
    box-shadow: var(--shadow-primary);
}
.btn-primary:hover {
    box-shadow: 0 6px 24px rgba(43,98,178,.5), 0 0 0 1px rgba(43,98,178,.35);
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-color: transparent;
}

.btn-success { background: linear-gradient(135deg, var(--success), #0ba870); border-color: transparent; color: #fff; box-shadow: 0 4px 16px rgba(16,217,136,.25); }
.btn-success:hover { box-shadow: 0 4px 24px rgba(16,217,136,.4); }

.btn-danger  { background: var(--danger-dim); border-color: rgba(240,82,82,.3); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: transparent; box-shadow: 0 4px 16px rgba(240,82,82,.3); }

.btn-ghost   { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover  { background: var(--surface3); color: var(--text); box-shadow: none; transform: none; border-color: transparent; }

.btn-outline { background: transparent; border-color: var(--border-light); color: var(--text-muted); }
.btn-outline:hover { background: var(--surface3); color: var(--text); }

.btn-sm   { padding: .35rem .75rem; font-size: .8rem; }
.btn-lg   { padding: .65rem 1.4rem; font-size: .92rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { padding: .45rem; }

/* ═══════════════════════════════════════════════════════════
   Forms
═══════════════════════════════════════════════════════════ */
.form-group  { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .875rem; }
.form-row    { display: flex; gap: .75rem; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 120px; }
.form-check  { display: flex; gap: .45rem; align-items: center; margin-bottom: .875rem; cursor: pointer; }
.form-check-inline { display: flex; gap: .4rem; align-items: center; cursor: pointer; font-size: .84rem; }

label {
    font-size: .75rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], input[type=search], textarea, select {
    background: var(--surface3);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text);
    font-size: .875rem;
    padding: .52rem .85rem;
    width: 100%;
    font-family: inherit;
    transition: border-color .18s, box-shadow .18s;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(43,98,178,.14);
    background: var(--surface4);
}
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237076a0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    padding-right: 2.2rem;
}
select option { background: var(--surface2); color: var(--text); }
textarea { resize: vertical; min-height: 80px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; border-radius: 4px; flex-shrink: 0; }
input:disabled, select:disabled, textarea:disabled { opacity: .4; cursor: not-allowed; }
input::placeholder, textarea::placeholder { color: var(--text-subtle); }

.input-wrap { position: relative; }
.input-prefix {
    position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: .85rem; pointer-events: none;
}
.input-wrap input { padding-left: 2rem; }

.inline-form {
    display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
    padding: .875rem 1rem;
    background: var(--surface2);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.inline-form input, .inline-form select { width: auto; flex: 1; min-width: 100px; }

/* ═══════════════════════════════════════════════════════════
   Tables
═══════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .855rem; }
.data-table thead { border-bottom: 1px solid var(--border-light); }
.data-table th {
    text-align: left;
    padding: .6rem .9rem;
    color: var(--text-subtle);
    font-weight: 700;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    white-space: nowrap;
    background: var(--surface2);
}
.data-table th:first-child { border-radius: var(--radius) 0 0 0; }
.data-table th:last-child  { border-radius: 0 var(--radius) 0 0; }
.data-table td {
    padding: .72rem .9rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: var(--surface2); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table-compact th, .data-table-compact td { padding: .45rem .65rem; }
.td-title { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clickable-row { cursor: pointer; }
.td-mono { font-family: ui-monospace,monospace; font-size: .82rem; }

/* ═══════════════════════════════════════════════════════════
   Badges
═══════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .22rem .65rem;
    border-radius: 99px;
    font-size: .7rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: .02em;
    border: 1px solid transparent;
}
.badge::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: .75;
    flex-shrink: 0;
}

.badge-status.badge-open         { background: rgba(43,98,178,.12); color: var(--primary-light); border-color: rgba(43,98,178,.22); }
.badge-status.badge-in_progress  { background: rgba(245,158,11,.1);   color: var(--warning);       border-color: rgba(245,158,11,.22); }
.badge-status.badge-waiting      { background: rgba(176,110,247,.1);  color: var(--purple);        border-color: rgba(176,110,247,.22); }
.badge-status.badge-resolved     { background: rgba(16,217,136,.08);  color: var(--success);       border-color: rgba(16,217,136,.2); }
.badge-status.badge-closed       { background: var(--surface4);       color: var(--text-subtle);   border-color: var(--border-light); }

.badge-prio-low      { background: var(--surface4);               color: var(--text-subtle); border-color: var(--border); }
.badge-prio-medium   { background: rgba(56,178,248,.08);           color: var(--info);        border-color: rgba(56,178,248,.2); }
.badge-prio-high     { background: rgba(245,158,11,.1);            color: var(--warning);     border-color: rgba(245,158,11,.22); }
.badge-prio-critical { background: rgba(240,82,82,.1);             color: var(--danger);      border-color: rgba(240,82,82,.22); }

.badge-internal { background: var(--surface4); color: var(--text-muted); font-size: .68rem; border-color: var(--border); }

/* ═══════════════════════════════════════════════════════════
   Alerts
═══════════════════════════════════════════════════════════ */
.alert {
    padding: .85rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .875rem;
    border: 1px solid transparent;
    display: flex; align-items: flex-start; gap: .65rem;
}
.alert-error   { background: var(--danger-dim);  border-color: rgba(240,82,82,.25);    color: var(--danger); }
.alert-success { background: var(--success-dim); border-color: rgba(16,217,136,.22);   color: var(--success); }
.alert-info    { background: var(--primary-dim); border-color: rgba(43,98,178,.22);  color: var(--primary-light); }
.alert-warning { background: var(--warning-dim); border-color: rgba(245,158,11,.22);   color: var(--warning); }

/* ═══════════════════════════════════════════════════════════
   Toast Notifications
═══════════════════════════════════════════════════════════ */
#toast-container {
    position: fixed;
    bottom: 1.5rem; right: 1.5rem;
    z-index: 9999;
    display: flex; flex-direction: column;
    gap: .5rem;
    pointer-events: none;
}
.toast {
    background: var(--surface4);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: .8rem 1.1rem .8rem .9rem;
    font-size: .85rem;
    font-weight: 500;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateX(16px);
    transition: opacity .25s, transform .25s;
    pointer-events: auto;
    max-width: 340px;
    display: flex; align-items: center; gap: .6rem;
}
.toast-visible  { opacity: 1; transform: translateX(0); }
.toast::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-success::before { background: var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-error::before { background: var(--danger); }
.toast-info    { border-left: 3px solid var(--primary); }
.toast-info::before { background: var(--primary); }

/* ═══════════════════════════════════════════════════════════
   Modal
═══════════════════════════════════════════════════════════ */
.modal {
    position: fixed; inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.8);
    backdrop-filter: blur(6px);
}
.modal-box {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    width: 90%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}
.modal-lg { max-width: 800px; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.5rem; padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 700; letter-spacing: -.02em; }
.modal-close {
    background: var(--surface3); border: 1px solid var(--border); color: var(--text-muted);
    cursor: pointer; padding: .3rem .6rem; border-radius: var(--radius);
    transition: all .15s; font-size: .85rem; line-height: 1;
}
.modal-close:hover { color: var(--text); background: var(--surface4); border-color: var(--border-light); }
.modal-footer {
    display: flex; justify-content: flex-end; gap: .5rem;
    margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.modal-body  { padding: 0; }

/* ── NSL Doc (IT-Dokumentation) ──────────────────────────── */
.nd-breadcrumb { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; font-size: .9rem; color: var(--text-muted); }
.nd-breadcrumb a { color: var(--primary-light); text-decoration: none; }
.nd-breadcrumb a:hover { text-decoration: underline; }
.nd-breadcrumb strong { color: var(--text); font-weight: 600; }
.nd-breadcrumb .sep { color: var(--text-subtle); }
.nd-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .6rem 1.25rem; }
.nd-meta .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.nd-meta .val { font-size: .9rem; color: var(--text); font-weight: 500; }
.nd-cat-badge { font-size: .7rem; padding: .1rem .5rem; border-radius: 99px; font-weight: 600; }
.nd-cat-server  { background: var(--primary-dim); color: var(--primary-light); }
.nd-cat-client  { background: var(--success-dim, rgba(16,185,129,.15)); color: var(--success); }
.nd-cat-network { background: rgba(245,158,11,.15); color: var(--warning); }

/* ── Overlay + box convention (used by checklists, dashboard) ──
   Markup: <div class="modal-overlay"><div class="modal">…</div></div> */
.modal-overlay {
    position: fixed; inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,.8);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay .modal {
    position: relative;
    inset: auto;
    z-index: auto;
    align-items: stretch;
    justify-content: flex-start;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

/* ═══════════════════════════════════════════════════════════
   Pagination
═══════════════════════════════════════════════════════════ */
.pagination { display: flex; gap: .3rem; justify-content: center; margin-top: 1.25rem; align-items: center; }
.pagination a {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 .55rem;
    background: var(--surface2); border: 1px solid var(--border-light);
    border-radius: var(--radius); color: var(--text-muted); font-size: .83rem;
    text-decoration: none; transition: all .15s; font-weight: 500;
}
.pagination a:hover  { background: var(--surface3); color: var(--text); }
.pagination a.active {
    background: var(--primary); border-color: transparent; color: #fff;
    box-shadow: 0 0 16px var(--primary-glow); font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════
   Dashboard — Free-Position Grid Builder
   12 columns × N rows, each row = 72px, gap = 14px
═══════════════════════════════════════════════════════════ */
:root {
    --dash-row-h: 72px;
    --dash-gap:   14px;
    --dash-cols:  12;
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: var(--dash-row-h);
    gap: var(--dash-gap);
    position: relative;
    min-height: 400px;
    padding-bottom: 40px; /* drop zone at bottom */
}

/* Edit-mode grid overlay — dots exactly at widget corner positions */
.dash-grid.edit-mode {
    background-color: var(--surface2);
    /* Dots land exactly where grid cells start (col+gap units) */
    background-image: radial-gradient(circle, rgba(43,98,178,.45) 1.5px, transparent 1.5px);
    background-size:
        calc((100% + 14px) / 12)   /* (containerW + gap) / cols = colW + gap */
        calc(72px + 14px);          /* rowH + gap */
    background-position: 0 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

/* Span classes (kept for fallback/responsive) */
.w-1  { grid-column: span 1; }  .w-2  { grid-column: span 2; }
.w-3  { grid-column: span 3; }  .w-4  { grid-column: span 4; }
.w-5  { grid-column: span 5; }  .w-6  { grid-column: span 6; }
.w-7  { grid-column: span 7; }  .w-8  { grid-column: span 8; }
.w-9  { grid-column: span 9; }  .w-10 { grid-column: span 10; }
.w-11 { grid-column: span 11; } .w-12 { grid-column: span 12; }

/* Widget base */
.dash-widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    position: relative;
    transition: border-color .2s, box-shadow .2s;
    min-width: 0;
    overflow: hidden;      /* clip content to grid cell */
    display: flex;
    flex-direction: column;
}
.dash-widget:hover { border-color: var(--border-light); }

/* While dragging */
.dash-widget.is-dragging {
    opacity: .25;
    z-index: 1;
    pointer-events: none;
}
/* While resizing */
.dash-widget.is-resizing {
    box-shadow: 0 0 0 2px var(--primary), var(--shadow-sm);
    border-color: var(--primary) !important;
    z-index: 100;
}

/* Ghost / drop-preview */
.dash-ghost {
    background: rgba(43,98,178,.1);
    border: 2px dashed var(--primary);
    border-radius: var(--radius-lg);
    pointer-events: none;
    z-index: 50;
    transition: grid-column .06s, grid-row .06s;
    box-shadow: 0 0 0 4px rgba(43,98,178,.08);
}
.dash-ghost.ghost-invalid {
    background: rgba(240,82,82,.1);
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(240,82,82,.08);
}

/* Drag handle (widget header area) */
.widget-drag-handle {
    display: none;
    position: absolute;
    top: .55rem; left: 50%;
    transform: translateX(-50%);
    color: var(--text-subtle);
    cursor: grab;
    z-index: 20;
    padding: .22rem .55rem;
    border-radius: var(--radius);
    background: var(--surface3);
    border: 1px solid var(--border-light);
    transition: all .15s;
    user-select: none;
}
.widget-drag-handle svg { width: 12px; height: 12px; display: block; }
.widget-drag-handle:hover { color: var(--text); background: var(--surface4); }
.widget-drag-handle:active { cursor: grabbing; }
.edit-mode .widget-drag-handle { display: block; }

/* ── 8 Resize Handles ───────────────────────────────────── */
.rh {
    position: absolute;
    z-index: 30;
    display: none;
    background: var(--primary);
    opacity: 0;
    transition: opacity .15s, transform .15s;
    border-radius: 99px;
}
.edit-mode .rh { display: block; opacity: .45; }
.edit-mode .dash-widget:hover .rh { opacity: .85; }
.rh:hover { opacity: 1 !important; transform: scale(1.3); }

/* Edge handles */
.rh-n  { top: -3px; left: 28%; right: 28%; height: 5px; cursor: n-resize; }
.rh-s  { bottom: -3px; left: 28%; right: 28%; height: 5px; cursor: s-resize; }
.rh-e  { right: -3px; top: 28%; bottom: 28%; width: 5px; cursor: e-resize; }
.rh-w  { left: -3px; top: 28%; bottom: 28%; width: 5px; cursor: w-resize; }

/* Corner handles */
.rh-ne { top: -4px; right: -4px; width: 10px; height: 10px; cursor: ne-resize; border-radius: 2px; }
.rh-se { bottom: -4px; right: -4px; width: 10px; height: 10px; cursor: se-resize; border-radius: 2px; }
.rh-sw { bottom: -4px; left: -4px; width: 10px; height: 10px; cursor: sw-resize; border-radius: 2px; }
.rh-nw { top: -4px; left: -4px; width: 10px; height: 10px; cursor: nw-resize; border-radius: 2px; }

/* Resize size indicator */
.resize-indicator {
    position: absolute;
    bottom: .4rem; right: .5rem;
    font-size: .68rem; font-weight: 700;
    color: var(--primary-light);
    background: var(--primary-dim);
    border: 1px solid rgba(43,98,178,.3);
    border-radius: 4px;
    padding: .1rem .35rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    z-index: 40;
}
.is-resizing .resize-indicator { opacity: 1; }

/* Edit mode widget visual */
.edit-mode .dash-widget {
    border-style: dashed;
    border-color: var(--border-light);
    padding-top: 2.1rem;
}
.edit-mode .dash-widget:hover { border-color: rgba(43,98,178,.45); }

/* Widget header */
.widget-header {
    display: flex; align-items: center; gap: .5rem;
    padding: 1rem 1.1rem .75rem;
    border-bottom: 1px solid var(--border);
}
.widget-title {
    display: flex; align-items: center; gap: .5rem;
    font-size: .86rem; font-weight: 700; flex: 1; letter-spacing: -.015em;
}
.widget-title-icon {
    width: 26px; height: 26px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.widget-title-icon svg { width: 13px; height: 13px; }

.widget-meta { font-size: .78rem; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.widget-settings-btn {
    background: none; border: none; color: var(--text-subtle); cursor: pointer;
    padding: .3rem; border-radius: 6px; display: flex;
    transition: color .15s, background .15s;
}
.widget-settings-btn:hover { color: var(--text); background: var(--surface3); }
.widget-settings-btn svg { width: 14px; height: 14px; }

.widget-settings-panel {
    position: absolute; top: calc(100% + 6px); right: .75rem;
    background: var(--surface2); border: 1px solid var(--border-light);
    border-radius: var(--radius-lg); box-shadow: var(--shadow); z-index: 100;
    min-width: 220px; padding: 1rem;
}
.ws-form { display: flex; flex-direction: column; gap: .65rem; }
.ws-row  { display: flex; align-items: center; justify-content: space-between; gap: .75rem; font-size: .83rem; }
.ws-row label  { color: var(--text-muted); flex-shrink: 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.ws-row select { width: auto; flex: 1; }

.widget-body { padding: 1rem 1.1rem; flex: 1; overflow-y: auto; min-height: 0; }

/* ── Dashboard Stat Cards (Redesigned) ─────────────────── */
.widget-stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.wsc-item {
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.1rem;
    position: relative;
    border-right: 1px solid var(--border);
    transition: background .15s;
}
.wsc-item:last-child { border-right: none; }
.wsc-item:hover { background: var(--surface2); }

.wsc-top {
    display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: .85rem;
}
.wsc-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.wsc-icon svg { width: 18px; height: 18px; }

/* Icon color variants */
.wsc-icon.wsc-blue   { background: rgba(43,98,178,.14); color: var(--primary-light); }
.wsc-icon.wsc-orange { background: rgba(245,158,11,.12);  color: var(--warning); }
.wsc-icon.wsc-purple { background: rgba(176,110,247,.14); color: var(--purple); }
.wsc-icon.wsc-red    { background: rgba(240,82,82,.12);   color: var(--danger); }
.wsc-icon.wsc-green  { background: rgba(16,217,136,.12);  color: var(--success); }
.wsc-icon.wsc-cyan   { background: rgba(34,211,238,.12);  color: var(--cyan); }

/* Accent bar colors (based on item class) */
.wsc-item.wsc-blue   .wsc-accent { background: var(--primary); opacity: 1; }
.wsc-item.wsc-orange .wsc-accent { background: var(--warning); opacity: 1; }
.wsc-item.wsc-purple .wsc-accent { background: var(--purple);  opacity: 1; }
.wsc-item.wsc-red    .wsc-accent { background: var(--danger);  opacity: 1; }
.wsc-item.wsc-green  .wsc-accent { background: var(--success); opacity: 1; }
.wsc-item.wsc-cyan   .wsc-accent { background: var(--cyan);    opacity: 1; }

.wsc-val {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.04em;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.wsc-lbl {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: .3rem;
    font-weight: 500;
    letter-spacing: .01em;
}

.wsc-accent {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Widget ticket list */
.wt-list { display: flex; flex-direction: column; gap: .25rem; }
.wt-row {
    display: flex; align-items: center; gap: .55rem;
    padding: .55rem .65rem; border-radius: var(--radius);
    background: var(--surface2); text-decoration: none; color: var(--text);
    font-size: .84rem; transition: background .12s;
    overflow: hidden; border-left: 2px solid transparent;
    border: 1px solid var(--border);
}
.wt-row:hover { background: var(--surface3); border-color: var(--border-light); text-decoration: none; }
.prio-critical .wt-row { border-left: 2px solid var(--danger); }
.prio-high .wt-row     { border-left: 2px solid var(--warning); }
.prio-medium .wt-row   { border-left: 2px solid var(--primary-light); }
.prio-low .wt-row      { border-left: 2px solid var(--text-subtle); }
.wt-body  { flex: 1; min-width: 0; }
.wt-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .84rem; }
.wt-meta  { font-size: .74rem; color: var(--text-muted); display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; margin-top: .1rem; }
.wt-time-row { border-left: 2px solid var(--warning) !important; }
.widget-empty { text-align: center; padding: 2rem .5rem; color: var(--text-muted); font-size: .85rem; }

/* Quick ticket form */
.quick-ticket-form .form-group { margin-bottom: .65rem; }

/* Edit bar */
.dash-edit-bar {
    position: fixed; bottom: 1.5rem; left: 50%;
    transform: translateX(-50%);
    background: var(--surface2);
    border: 1px solid rgba(43,98,178,.4);
    box-shadow: 0 0 30px var(--primary-glow), var(--shadow);
    border-radius: var(--radius-xl);
    padding: .8rem 1.35rem;
    display: flex; align-items: center; gap: 1rem;
    font-size: .84rem; z-index: 200; white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   Page Sub-Nav (sticky second-row nav, e.g. ticket tabs)
═══════════════════════════════════════════════════════════ */
.page-sub-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    margin: -1.5rem -1.5rem 1.25rem;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

/* Page header with title + action */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.page-h1 {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -.025em;
    color: var(--text);
}
.page-h1-sub {
    font-size: .8rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: .5rem;
}

/* ═══════════════════════════════════════════════════════════
   Ticket Tabs & Filters
═══════════════════════════════════════════════════════════ */
/* When inside .page-sub-nav the sub-nav provides the border — remove the duplicate */
.page-sub-nav .ticket-tabs {
    margin-bottom: 0;
    border-bottom: none;
}
.ticket-tabs {
    display: flex; align-items: center; gap: 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.ticket-tab {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .7rem 1.05rem; font-size: .84rem; color: var(--text-muted);
    text-decoration: none; border-bottom: 2px solid transparent;
    margin-bottom: -1px; transition: color .15s, background .15s; white-space: nowrap; font-weight: 500;
    border-radius: var(--radius) var(--radius) 0 0;
}
.ticket-tab:hover  { color: var(--text); text-decoration: none; background: var(--surface2); }
.ticket-tab.active { color: var(--primary-light); border-bottom-color: var(--primary); font-weight: 700; background: transparent; }
.ticket-tab.tab-danger { color: var(--danger); }
.ticket-tab.tab-danger.active { border-bottom-color: var(--danger); }
.tab-badge {
    background: var(--surface4); color: var(--text-muted);
    font-size: .69rem; font-weight: 700; padding: .06rem .45rem;
    border-radius: 99px; min-width: 20px; text-align: center;
    border: 1px solid var(--border-light);
}
.ticket-tab.active .tab-badge  { background: var(--primary-dim); color: var(--primary-light); border-color: rgba(43,98,178,.3); }
.ticket-tab.tab-danger .tab-badge { background: rgba(240,82,82,.15); color: var(--danger); border-color: rgba(240,82,82,.3); }
.tab-spacer { flex: 1; }

/* Quick-access pill buttons (Offene Tickets, Alle Tickets, Meine Tickets) */
.ticket-quick-btn {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .3rem .75rem; margin: auto 0;
    font-size: .78rem; font-weight: 600; white-space: nowrap;
    color: var(--text-muted); text-decoration: none;
    background: var(--surface3); border: 1px solid var(--border-light);
    border-radius: var(--radius); transition: all .15s;
}
.ticket-quick-btn:hover { color: var(--text); background: var(--surface4); text-decoration: none; }
.ticket-quick-btn.tqb-active {
    background: var(--primary-dim); color: var(--primary-light);
    border-color: rgba(43,98,178,.35);
}
.ticket-quick-btn.tqb-active .tab-badge {
    background: rgba(43,98,178,.25); color: var(--primary-light);
    border-color: rgba(43,98,178,.3);
}
.tqb-dot {
    width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
    background: var(--success); box-shadow: 0 0 5px var(--success);
}
.tqb-divider { width: 1px; height: 18px; background: var(--border-light); margin: auto .1rem; flex-shrink: 0; }

.ticket-filters {
    display: flex; align-items: center; gap: .6rem;
    margin-bottom: 1rem; flex-wrap: wrap;
    padding: .75rem 1rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    flex-shrink: 0;
}
.filter-form    { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; flex: 1; }
.filter-input   { flex: 1; min-width: 180px; max-width: 280px; }
.filter-select  { width: auto; min-width: 140px; }
.filter-count   { color: var(--text-muted); font-size: .82rem; white-space: nowrap; background: var(--surface2); border: 1px solid var(--border); padding: .35rem .75rem; border-radius: var(--radius); font-weight: 600; margin-left: auto; }

/* ── Export Modal ────────────────────────────────────────── */
.export-fmt-btn {
    display: flex; align-items: center; gap: .6rem;
    flex: 1; padding: .65rem .875rem;
    background: var(--surface3); border: 1.5px solid var(--border-light);
    border-radius: var(--radius-lg); cursor: pointer; transition: all .15s;
}
.export-fmt-btn:hover   { border-color: var(--primary-dark); background: var(--surface4); }
.export-fmt-btn.selected { border-color: var(--primary); background: var(--primary-dim); }

.export-cols-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem;
}
.export-col-check {
    display: flex; align-items: center; gap: .45rem;
    padding: .35rem .6rem; border-radius: var(--radius);
    font-size: .82rem; cursor: pointer; transition: background .12s;
    color: var(--text-muted); border: 1px solid transparent;
    user-select: none;
}
.export-col-check:hover  { background: var(--surface3); color: var(--text); }
.export-col-check.checked { color: var(--text); background: var(--surface3); border-color: var(--border-light); }
.ecl-check {
    width: 14px; height: 14px; flex-shrink: 0;
    border: 1.5px solid var(--border-light); border-radius: 3px;
    display: flex; align-items: center; justify-content: center;
    transition: all .12s; color: transparent;
}
.export-col-check.checked .ecl-check {
    background: var(--primary); border-color: var(--primary); color: #fff;
}
@media (max-width: 520px) {
    .export-cols-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Import/Export Page ──────────────────────────────────── */
.ie-section-label {
    font-size: .78rem; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .04em; margin-bottom: .55rem;
}
.ie-cols-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    max-height: 320px; overflow-y: auto; padding-right: .25rem;
}
.ie-cols-grid::-webkit-scrollbar { width: 4px; }
.ie-cols-grid::-webkit-scrollbar-track { background: transparent; }
.ie-cols-grid::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

.ie-placeholder-card {
    display: flex; align-items: center; gap: .875rem;
    opacity: .65; transition: opacity .2s;
}
.ie-placeholder-card:hover { opacity: 1; }
.ie-ph-icon {
    width: 36px; height: 36px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface3); border-radius: var(--radius);
    color: var(--text-muted);
}

/* Dropzone */
.ie-dropzone {
    border: 2px dashed var(--border-light); border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem; text-align: center; cursor: pointer;
    transition: all .2s; background: var(--surface2);
}
.ie-dropzone:hover, .ie-dropzone-hover {
    border-color: var(--primary); background: var(--primary-dim);
}
.ie-dropzone-icon {
    width: 56px; height: 56px; margin: 0 auto .5rem;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface3); border-radius: var(--radius-lg);
}

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

@media (max-width: 900px) {
    .ie-cols-grid { grid-template-columns: 1fr !important; }
}

/* ═══════════════════════════════════════════════════════════
   Ticket List Rows
═══════════════════════════════════════════════════════════ */
.ticket-list {
    display: flex; flex-direction: column; gap: 0;
    border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
    flex-shrink: 0; /* sonst quetscht der Flex-Parent (.page-body) die ganze Liste
                        zusammen statt zu scrollen, sobald der Inhalt überläuft */
}
.tl-row {
    display: flex; align-items: stretch;
    background: var(--surface); border-bottom: 1px solid var(--border);
    text-decoration: none; color: var(--text);
    overflow: hidden; flex-shrink: 0; transition: background .12s, border-color .12s; position: relative;
}
.tl-row:last-child { border-bottom: none; }
.tl-row:hover {
    background: var(--surface2);
    text-decoration: none;
}

.tl-prio-bar { width: 3px; flex-shrink: 0; min-height: 100%; }
.prio-critical .tl-prio-bar { background: linear-gradient(180deg, var(--danger), rgba(240,82,82,.4)); }
.prio-high     .tl-prio-bar { background: linear-gradient(180deg, var(--warning), rgba(245,158,11,.4)); }
.prio-medium   .tl-prio-bar { background: linear-gradient(180deg, var(--primary), rgba(43,98,178,.4)); }
.prio-low      .tl-prio-bar { background: linear-gradient(180deg, var(--text-subtle), transparent); }

.tl-main { flex: 1; padding: .85rem 1.1rem; min-width: 0; }
.tl-top  { display: flex; align-items: center; gap: .6rem; margin-bottom: .35rem; flex-wrap: wrap; }
.tl-row.tl-has-new { background: var(--primary-dim); }
.tl-row.tl-has-new:hover { background: var(--primary-dim); filter: brightness(1.08); }
.tl-new-badge {
    font-size: .72rem; font-weight: 700; color: var(--primary-light);
    display: flex; align-items: center; gap: .25rem; flex-shrink: 0;
    animation: tl-new-pulse 1.8s ease-in-out infinite;
}
@keyframes tl-new-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.tl-nr    { font-family: ui-monospace,monospace; font-size: .74rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; background: var(--surface3); padding: .1rem .45rem; border-radius: 4px; border: 1px solid var(--border-light); }
.tl-title { font-weight: 600; font-size: .88rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tl-cat {
    display: inline-flex; align-items: center;
    padding: .1rem .5rem;
    font-size: .68rem; font-weight: 600;
    border-radius: 99px;
    background: var(--surface4);
    color: var(--text-muted);
    border: 1px solid var(--border);
    white-space: nowrap; flex-shrink: 0;
    max-width: 150px; overflow: hidden; text-overflow: ellipsis;
}
.tl-meta  { display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--text-muted); flex-wrap: wrap; }
.tl-sep   { color: var(--text-subtle); }
.tl-customer, .tl-assignee { display: flex; align-items: center; gap: .3rem; }
.tl-unassigned { color: var(--warning); font-size: .76rem; font-weight: 600; }
.tl-time  { color: var(--text-subtle); white-space: nowrap; }
.tl-stat  { display: flex; align-items: center; gap: .25rem; }
.tl-arrow { padding: 0 1rem; color: var(--text-subtle); flex-shrink: 0; transition: color .15s; display: flex; align-items: center; }
.tl-row:hover .tl-arrow { color: var(--primary-light); }

.mini-avatar {
    width: 18px; height: 18px; border-radius: 5px;
    font-size: .62rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   Ticket Detail
═══════════════════════════════════════════════════════════ */
.ticket-nr { font-family: ui-monospace,monospace; font-size: .78rem; color: var(--text-muted); }

.td-header {
    display: flex; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); margin-bottom: 1rem; overflow: hidden;
    flex-shrink: 0;
}
.td-header-bar { width: 4px; flex-shrink: 0; }
.prio-critical .td-header-bar { background: linear-gradient(180deg, var(--danger), rgba(240,82,82,.3)); }
.prio-high     .td-header-bar { background: linear-gradient(180deg, var(--warning), rgba(245,158,11,.3)); }
.prio-medium   .td-header-bar { background: linear-gradient(180deg, var(--primary), rgba(43,98,178,.3)); }
.prio-low      .td-header-bar { background: linear-gradient(180deg, var(--text-subtle), transparent); }
.td-header-body { padding: 1.25rem 1.5rem; flex: 1; min-width: 0; }
.td-header-top  { display: flex; align-items: center; gap: .65rem; margin-bottom: .65rem; flex-wrap: wrap; }
.td-nr     { font-family: ui-monospace,monospace; font-size: .78rem; color: var(--text-muted); background: var(--surface3); padding: .15rem .55rem; border-radius: 5px; border: 1px solid var(--border-light); }
.td-source { font-size: 1rem; }
.td-age    { font-size: .77rem; color: var(--text-muted); margin-left: auto; }
.td-title  { font-size: 1.25rem; font-weight: 800; margin-bottom: .65rem; word-break: break-word; letter-spacing: -.025em; color: var(--text); }
.td-badges { display: flex; gap: .4rem; flex-wrap: wrap; }
.td-description { line-height: 1.78; white-space: pre-wrap; word-break: break-word; color: var(--text-muted); font-size: .9rem; }

.td-layout { display: grid; grid-template-columns: 1fr 280px; gap: 1rem; align-items: start; }
.td-left   { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.td-right  { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 1.5rem; }
.td-info-card { padding: 1rem 1.1rem; }

/* Activity */
.activity-feed { display: flex; flex-direction: column; gap: .9rem; margin-bottom: 1rem; }
.activity-item { display: flex; gap: .8rem; align-items: flex-start; }
.activity-avatar {
    width: 32px; height: 32px; border-radius: 8px;
    font-size: .78rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.activity-body { flex: 1; min-width: 0; }
.activity-meta { display: flex; align-items: center; gap: .5rem; margin-bottom: .3rem; font-size: .81rem; flex-wrap: wrap; }
.activity-time { color: var(--text-muted); margin-left: auto; font-size: .76rem; }
.activity-text { font-size: .875rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.activity-internal .activity-body {
    background: rgba(176,110,247,.06);
    border: 1px solid rgba(176,110,247,.15);
    border-radius: var(--radius);
    padding: .7rem .9rem;
}

.comment-form-wrap { display: flex; gap: .8rem; align-items: flex-start; padding-top: 1rem; border-top: 1px solid var(--border); }
.comment-input-form { flex: 1; }
.comment-input-form textarea { width: 100%; resize: none; min-height: 72px; }
.comment-form-actions { display: flex; justify-content: space-between; align-items: center; margin-top: .5rem; flex-wrap: wrap; gap: .5rem; }

/* Time list */
.time-list { display: flex; flex-direction: column; gap: .3rem; }
.time-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: .6rem .8rem; border-radius: var(--radius);
    background: var(--surface2); border: 1px solid var(--border);
    gap: 1rem; font-size: .84rem; transition: border-color .12s;
}
.time-row:hover { border-color: var(--border-light); }
.time-row-main { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; flex: 1; min-width: 0; }
.time-date  { color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.time-range {
    font-family: ui-monospace,monospace; font-size: .74rem;
    color: var(--primary-light); background: var(--primary-dim);
    padding: .12rem .45rem; border-radius: 5px; white-space: nowrap;
    border: 1px solid rgba(43,98,178,.2);
}
.time-who   { font-weight: 600; white-space: nowrap; }
.time-desc  { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time-row-right  { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; flex-shrink: 0; }
.time-duration   { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; color: var(--text); }
.time-bar-wrap   { width: 60px; height: 3px; background: var(--surface4); border-radius: 99px; }
.time-bar        { height: 100%; background: linear-gradient(90deg, var(--primary), var(--cyan)); border-radius: 99px; }

/* Info rows */
.info-rows { display: flex; flex-direction: column; }
.info-row  { display: flex; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--border); font-size: .84rem; align-items: flex-start; }
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); flex-shrink: 0; width: 85px; padding-top: .05rem; font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.info-val   { flex: 1; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; word-break: break-word; }

.td-mini-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: .5rem; }
.td-mini-stat  {
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: .8rem .6rem; text-align: center;
    transition: border-color .15s;
}
.td-mini-stat:hover { border-color: var(--border-light); }
.td-ms-val   { font-size: 1.05rem; font-weight: 800; letter-spacing: -.03em; color: var(--text); }
.td-ms-label { font-size: .7rem; color: var(--text-muted); margin-top: .2rem; font-weight: 500; }

/* ═══════════════════════════════════════════════════════════
   Article Search
═══════════════════════════════════════════════════════════ */
.article-search-wrap { position: relative; }
.article-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: var(--surface2); border: 1px solid var(--border-light);
    border-radius: var(--radius-lg); box-shadow: var(--shadow); z-index: 200;
    max-height: 280px; overflow-y: auto;
}
.art-item { display: flex; align-items: center; gap: .6rem; padding: .65rem .9rem; cursor: pointer; font-size: .84rem; transition: background .1s; }
.art-item:hover { background: var(--surface3); }
.art-nr    { font-family: ui-monospace,monospace; font-size: .74rem; color: var(--text-muted); min-width: 70px; flex-shrink: 0; }
.art-name  { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.art-price { font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: .81rem; white-space: nowrap; }
.art-stock { font-size: .73rem; padding: .1rem .42rem; border-radius: 99px; background: rgba(16,217,136,.1); color: var(--success); white-space: nowrap; border: 1px solid rgba(16,217,136,.2); }
.art-stock-low { background: rgba(240,82,82,.1); color: var(--danger); border-color: rgba(240,82,82,.2); }
.art-empty { padding: .8rem .9rem; font-size: .85rem; color: var(--text-muted); }
.article-selected { margin-top: .4rem; }
.art-tag {
    display: inline-flex; align-items: center; gap: .35rem;
    background: var(--primary-dim); border: 1px solid rgba(43,98,178,.3);
    border-radius: var(--radius); padding: .35rem .75rem; font-size: .82rem; font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════
   Time Entry Form
═══════════════════════════════════════════════════════════ */
.time-entry-form {
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: .9rem;
}
.te-hint { margin-top: .4rem; font-size: .8rem; color: var(--primary-light); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════
   Profile Page
═══════════════════════════════════════════════════════════ */
.profile-layout { display: grid; grid-template-columns: 230px 1fr; gap: 1.25rem; align-items: start; }
.profile-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1.75rem 1.25rem;
    text-align: center; position: sticky; top: 1rem;
}
.profile-avatar {
    width: 78px; height: 78px; border-radius: 14px;
    font-size: 1.9rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
}
.profile-name { font-size: 1rem; font-weight: 800; margin-bottom: .2rem; letter-spacing: -.02em; }
.profile-role { font-size: .8rem; color: var(--text-muted); margin-bottom: 1.25rem; font-weight: 500; }
.profile-meta { text-align: left; border-top: 1px solid var(--border); padding-top: .875rem; }
.pm-row { display: flex; justify-content: space-between; align-items: baseline; padding: .38rem 0; border-bottom: 1px solid var(--border); font-size: .8rem; gap: .5rem; }
.pm-row:last-child { border-bottom: none; }
.pm-row span { color: var(--text-muted); flex-shrink: 0; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.pm-row strong { text-align: right; word-break: break-all; }
.profile-content { min-width: 0; }

.profile-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.profile-tab { padding: .6rem 1rem; font-size: .85rem; color: var(--text-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s; white-space: nowrap; font-weight: 500; }
.profile-tab:hover  { color: var(--text); text-decoration: none; background: var(--surface2); }
.profile-tab.active { color: var(--primary-light); border-bottom-color: var(--primary); font-weight: 700; }

.pref-rows { display: flex; flex-direction: column; }
.pref-row  { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; gap: 1.5rem; border-bottom: 1px solid var(--border); }
.pref-row:last-child { border-bottom: none; }
.pref-row-disabled { opacity: .4; }
.pref-info  { flex: 1; min-width: 0; }
.pref-label { font-size: .88rem; font-weight: 600; margin-bottom: .2rem; display: flex; align-items: center; gap: .5rem; }
.pref-desc  { font-size: .78rem; color: var(--text-muted); }

.toggle-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex-shrink: 0; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track { width: 44px; height: 24px; background: var(--surface4); border: 1px solid var(--border-light); border-radius: 99px; position: relative; transition: background .2s, border-color .2s; }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: var(--text-muted); border-radius: 50%; transition: transform .2s, background .2s; }
.toggle-switch input:checked ~ .toggle-track { background: var(--primary); border-color: var(--primary-dark); box-shadow: 0 0 10px var(--primary-glow); }
.toggle-switch input:checked ~ .toggle-track .toggle-thumb { transform: translateX(20px); background: #fff; }

/* ═══════════════════════════════════════════════════════════
   Admin Tabs
═══════════════════════════════════════════════════════════ */
.admin-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.admin-tab  { padding: .65rem 1.1rem; font-size: .85rem; color: var(--text-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s; white-space: nowrap; font-weight: 500; }
.admin-tab:hover  { color: var(--text); text-decoration: none; background: var(--surface2); }
.admin-tab.active { color: var(--primary-light); border-bottom-color: var(--primary); font-weight: 700; }

/* ═══════════════════════════════════════════════════════════
   Stat Row (horizontal KPI row)
═══════════════════════════════════════════════════════════ */
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.stat-cell {
    background: var(--surface);
    padding: 1.1rem 1.25rem;
    display: flex; flex-direction: column; gap: .3rem;
    transition: background .15s;
}
.stat-cell:hover { background: var(--surface2); }
.stat-cell-val { font-size: 1.65rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-cell-label { font-size: .75rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }

/* ═══════════════════════════════════════════════════════════
   KPI Cards (standalone)
═══════════════════════════════════════════════════════════ */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .875rem; margin-bottom: 1rem; }
.kpi-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1.1rem 1.25rem;
    display: flex; align-items: center; gap: 1rem; transition: all .15s;
    position: relative; overflow: hidden;
}
.kpi-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: currentColor; opacity: .4;
}
.kpi-card:hover { border-color: var(--border-light); transform: translateY(-1px); box-shadow: var(--shadow-card); }
.kpi-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi-icon svg { width: 20px; height: 20px; }
.kpi-body { flex: 1; min-width: 0; }
.kpi-val { font-size: 1.8rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; font-weight: 500; }

/* ═══════════════════════════════════════════════════════════
   Empty State
═══════════════════════════════════════════════════════════ */
.empty-state {
    text-align: center; padding: 4rem 1.5rem; color: var(--text-muted);
    display: flex; flex-direction: column; align-items: center; gap: .75rem;
    background: var(--surface); border-radius: var(--radius-lg);
}
.ticket-list > .empty-state {
    border-radius: 0; /* parent .ticket-list already has border-radius */
    background: transparent;
}
.empty-icon { opacity: .25; margin-bottom: .25rem; }
.empty-title { font-size: .95rem; font-weight: 700; color: var(--text); }
.empty-desc  { font-size: .85rem; max-width: 320px; line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════
   Misc Utilities
═══════════════════════════════════════════════════════════ */
.text-muted    { color: var(--text-muted); }
.text-danger   { color: var(--danger); }
.text-success  { color: var(--success); }
.text-warning  { color: var(--warning); }
.text-primary  { color: var(--primary-light); }
td.text-muted  { text-align: center; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fs-mono { font-family: ui-monospace,monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex   { display: flex; }
.flex-1 { flex: 1; }
.gap-2  { gap: .5rem; }
.gap-4  { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; } .mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: .25rem; } .mb-2 { margin-bottom: .5rem; } .mb-4 { margin-bottom: 1rem; }
.p-0 { padding: 0 !important; }

hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* Filter bar (customers page alias) */
.filter-bar {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.filter-bar .filter-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; flex: 1; }
.filter-bar .filter-count {
    color: var(--text-muted); font-size: .82rem; white-space: nowrap;
    background: var(--surface2); border: 1px solid var(--border);
    padding: .35rem .75rem; border-radius: var(--radius); font-weight: 600;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

/* ═══════════════════════════════════════════════════════════
   Responsive
═══════════════════════════════════════════════════════════ */
/* ── 1280px: Ticket-Detail-Grid schrumpft etwas ─────────── */
@media (max-width: 1280px) {
    .td-layout { grid-template-columns: 1fr 240px; }
}

/* ── 1100px: Sidebar geht nach unten ────────────────────── */
@media (max-width: 1100px) {
    .td-layout { grid-template-columns: 1fr; }
    .td-right  { position: static; max-height: none; overflow-y: visible; } /* kein sticky mehr — scrollt mit */
    .profile-layout { grid-template-columns: 1fr; }
    .profile-card   { position: static; }
}

/* ── 960px: weitere Anpassungen ──────────────────────────── */
@media (max-width: 960px) {
    .widget-stat-cards { grid-template-columns: repeat(2,1fr); }
    .wsc-item:nth-child(2) { border-right: none; }
    .wsc-item:nth-child(3) { border-top: 1px solid var(--border); }
    .wsc-item:nth-child(4) { border-top: 1px solid var(--border); border-right: none; }
    /* Tab-Leiste: kleinere Tabs */
    .ticket-tab  { padding: .6rem .65rem; font-size: .8rem; }
    .ticket-quick-btn { padding: .28rem .55rem; font-size: .75rem; }
    /* Topbar-Suche schrumpft */
    .topbar-search { max-width: 260px; }
}

/* ── 768px: Mobile ───────────────────────────────────────── */
@media (max-width: 768px) {
    .dash-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
    .dash-widget { grid-column: 1 / -1 !important; grid-row: auto !important; height: auto !important; }
    .widget-stat-cards { grid-template-columns: repeat(2,1fr); }
    :root { --topbar-h: 54px; }
    /* Topbar-Suche ausblenden auf kleinen Screens */
    .topbar-search { display: none; }
}

/* ── 580px: Sehr klein — Sidebar auf Icons reduzieren ────── */
@media (max-width: 580px) {
    :root { --sidebar-w: 60px; }
    .nav-label, .logo-text, .logo-badge, .user-info, .nav-section { display: none; }
    .sidebar-logo { justify-content: center; padding: 0 .85rem; }
    .nav-item { justify-content: center; padding: .55rem; }
    .nav-icon { width: 36px; height: 36px; }
    .sidebar-user { padding: .25rem; }
    .dash-grid { grid-template-columns: 1fr; }
    [class*="w-"] { grid-column: span 1 !important; }
    .widget-stat-cards { grid-template-columns: repeat(2,1fr); }
    .topbar-user-pill .pill-name { display: none; }
    .page-body { padding: 1rem; }
}

/* ═══════════════════════════════════════════════════════════════════
   DASHBOARD v2 — Widget Colors, Number Widgets, Charts, Edit Overlay,
                  Add-Widget Panel
═══════════════════════════════════════════════════════════════════ */

/* ── Widget color palette ─────────────────────────────────────── */
:root {
    --wc-blue:   #3b82f6;  --wc-blue-bg:   rgba(59,130,246,.12);
    --wc-purple: #7c6af7;  --wc-purple-bg: rgba(124,106,247,.12);
    --wc-orange: #f97316;  --wc-orange-bg: rgba(249,115,22,.12);
    --wc-yellow: #f59e0b;  --wc-yellow-bg: rgba(245,158,11,.12);
    --wc-red:    #ef4444;  --wc-red-bg:    rgba(239,68,68,.12);
    --wc-green:  #22c55e;  --wc-green-bg:  rgba(34,197,94,.12);
    --wc-teal:   #14b8a6;  --wc-teal-bg:   rgba(20,184,166,.12);
}

/* ── Number widget ────────────────────────────────────────────── */
.wn-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 1rem;
    gap: .35rem;
    text-align: center;
    position: relative;
}
.wn-icon-wrap {
    width: 40px; height: 40px;
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: .25rem;
    transition: transform .2s;
}
.dash-widget:hover .wn-icon-wrap { transform: scale(1.08); }

/* Color variants for icon bg */
.wn-clr-blue   .wn-icon-wrap { background: var(--wc-blue-bg);   color: var(--wc-blue);   }
.wn-clr-purple .wn-icon-wrap { background: var(--wc-purple-bg); color: var(--wc-purple); }
.wn-clr-orange .wn-icon-wrap { background: var(--wc-orange-bg); color: var(--wc-orange); }
.wn-clr-yellow .wn-icon-wrap { background: var(--wc-yellow-bg); color: var(--wc-yellow); }
.wn-clr-red    .wn-icon-wrap { background: var(--wc-red-bg);    color: var(--wc-red);    }
.wn-clr-green  .wn-icon-wrap { background: var(--wc-green-bg);  color: var(--wc-green);  }
.wn-clr-teal   .wn-icon-wrap { background: var(--wc-teal-bg);   color: var(--wc-teal);   }

/* Number & accent line */
.wn-clr-blue::before   { background: var(--wc-blue);   }
.wn-clr-purple::before { background: var(--wc-purple); }
.wn-clr-orange::before { background: var(--wc-orange); }
.wn-clr-yellow::before { background: var(--wc-yellow); }
.wn-clr-red::before    { background: var(--wc-red);    }
.wn-clr-green::before  { background: var(--wc-green);  }
.wn-clr-teal::before   { background: var(--wc-teal);   }
.wn-body::before {
    content: '';
    position: absolute;
    bottom: 0; left: 1.5rem; right: 1.5rem;
    height: 2px;
    border-radius: 2px;
    opacity: .4;
}

.wn-val {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.02em;
    color: var(--text);
    transition: transform .15s;
}
.dash-widget:hover .wn-val { transform: scale(1.04); }
.wn-val.wn-urgent { color: var(--wc-red) !important; }
.wn-val.wn-clock  { font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.wn-unit { font-size: 1.1rem; font-weight: 600; color: var(--text-muted); margin-left: .25rem; }
.wn-label { font-size: .82rem; font-weight: 600; color: var(--text); }
.wn-sub   { font-size: .74rem; color: var(--text-muted); }
.wn-link-overlay {
    position: absolute; inset: 0;
    border-radius: var(--radius-lg);
    z-index: 1;
}
.wn-link-overlay:hover ~ .wn-body,
.wn-body:has(+ .wn-link-overlay:hover) { /* noop – handled via parent :hover */ }

/* ── Note widget body ─────────────────────────────────────────── */
.wn-note-text {
    padding: .5rem .75rem;
    font-size: .84rem;
    color: var(--text-muted);
    line-height: 1.6;
    overflow-y: auto;
    height: 100%;
}

/* ── Chart widget ─────────────────────────────────────────────── */
.wc-chart {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* ── Edit mode overlay ────────────────────────────────────────── */
.widget-edit-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(6,7,16,.82);
    border-radius: var(--radius-lg);
    z-index: 20;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: 1rem;
    backdrop-filter: blur(2px);
}
.edit-mode .dash-widget:hover .widget-edit-overlay { display: flex; }

.weo-top {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    justify-content: space-between;
}
.weo-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    text-align: center;
}
.weo-del {
    width: 24px; height: 24px;
    border-radius: var(--radius);
    border: 1px solid rgba(239,68,68,.4);
    background: rgba(239,68,68,.12);
    color: var(--wc-red);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: all .15s;
}
.weo-del:hover { background: rgba(239,68,68,.25); border-color: var(--wc-red); }

.weo-modes {
    display: flex;
    gap: .35rem;
}
.weo-mode-btn {
    padding: .3rem .7rem;
    border-radius: 20px;
    border: 1.5px solid var(--border-light);
    background: var(--surface3);
    color: var(--text-muted);
    font-size: .76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.weo-mode-btn:hover   { border-color: var(--primary-light); color: var(--text); }
.weo-mode-btn.active  { border-color: var(--primary); background: var(--primary-dim); color: var(--primary-light); }

.weo-cfg-btn {
    display: flex; align-items: center; gap: .35rem;
    padding: .3rem .75rem;
    border-radius: 20px;
    border: 1.5px solid var(--border-light);
    background: var(--surface3);
    color: var(--text-muted);
    font-size: .76rem; font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.weo-cfg-btn:hover { border-color: var(--primary); color: var(--primary-light); background: var(--primary-dim); }

/* ── License expiring list row ────────────────────────────────── */
.wt-lic-row {
    display: flex; align-items: center;
    padding: .5rem .75rem;
    gap: .75rem;
    border-bottom: 1px solid var(--border);
    cursor: default;
}
.wt-lic-row:last-child { border-bottom: none; }

/* ── Add-Widget Modal ─────────────────────────────────────────── */
.awp-overlay {
    position: fixed; inset: 0;
    background: rgba(6,7,16,.75);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.awp-modal {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    width: min(680px, 94vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,.5);
}
.awp-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.awp-title { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.awp-sub   { font-size: .8rem;   color: var(--text-muted); margin-top: .15rem; }

.awp-tabs {
    display: flex;
    gap: .35rem;
    padding: .75rem 1.5rem .5rem;
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.awp-tabs::-webkit-scrollbar { display: none; }
.awp-tab {
    padding: .3rem .8rem;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    background: transparent;
    color: var(--text-muted);
    font-size: .78rem; font-weight: 600;
    cursor: pointer; white-space: nowrap;
    transition: all .15s;
}
.awp-tab:hover  { color: var(--text); border-color: var(--border-light); }
.awp-tab.active { background: var(--primary-dim); border-color: var(--primary); color: var(--primary-light); }

.awp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: .6rem;
    padding: .75rem 1.5rem 1.25rem;
    overflow-y: auto;
}
.awp-card {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem .8rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--surface2);
    cursor: pointer;
    transition: all .15s;
    position: relative;
}
.awp-card:hover { border-color: var(--primary); background: var(--surface3); }
.awp-card:hover .awp-add-btn { opacity: 1; }

.awp-card-icon {
    width: 34px; height: 34px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.awp-clr-blue   { background: var(--wc-blue-bg);   color: var(--wc-blue);   }
.awp-clr-purple { background: var(--wc-purple-bg); color: var(--wc-purple); }
.awp-clr-orange { background: var(--wc-orange-bg); color: var(--wc-orange); }
.awp-clr-yellow { background: var(--wc-yellow-bg); color: var(--wc-yellow); }
.awp-clr-red    { background: var(--wc-red-bg);    color: var(--wc-red);    }
.awp-clr-green  { background: var(--wc-green-bg);  color: var(--wc-green);  }
.awp-clr-teal   { background: var(--wc-teal-bg);   color: var(--wc-teal);   }

.awp-card-body { flex: 1; min-width: 0; }
.awp-card-name { font-size: .8rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.awp-card-desc { font-size: .72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.awp-add-btn {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity .15s;
    pointer-events: none;
}
.awp-card:hover .awp-add-btn { opacity: 1; pointer-events: auto; }

/* ═══════════════════════════════════════════════════════
   Checklists page — modern redesign
   ═══════════════════════════════════════════════════════ */
/* ── Kleiner Farbpunkt (Dashboard-Widget, Ticket-Suche) ── */
.cl-color-tag {
    display: inline-block;
    width: 9px; height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Karten-Raster (Übersicht) ─────────────────────── */
.cl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
}
.cl-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.1rem;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.cl-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card);
    border-color: var(--border-light);
}
.cl-card:active { transform: translateY(-1px); }
.cl-card-top { display: flex; align-items: center; gap: .9rem; }
.cl-card-title {
    font-size: .95rem; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cl-card-meta { font-size: .78rem; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

.cl-add-card {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-xl);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .5rem;
    min-height: 96px;
    cursor: pointer;
    color: var(--text-muted);
    transition: border-color .15s, color .15s, background .15s;
}
.cl-add-card:hover { border-color: var(--primary); color: var(--primary-light); background: var(--primary-dim); }
.cl-add-card span { font-size: .85rem; font-weight: 600; }

.cl-empty-overview {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 4rem 1rem;
}

/* ── Fortschritts-Ring (Donut via conic-gradient) ──── */
.cl-ring {
    width: 52px; height: 52px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    position: relative;
    transition: background .4s ease;
}
.cl-ring::before {
    content: '';
    position: absolute; inset: 5px;
    border-radius: 50%;
    background: var(--surface);
}
.cl-ring-label {
    position: relative; z-index: 1;
    font-size: .72rem; font-weight: 800; color: var(--text);
}
.cl-ring-lg { width: 60px; height: 60px; }
.cl-ring-lg::before { inset: 6px; background: var(--surface); }
.cl-ring-lg .cl-ring-label { font-size: .8rem; }

/* ── Fokus-Ansicht (eine Liste) ────────────────────── */
.cl-focus-back {
    display: inline-flex; align-items: center; gap: .4rem;
    color: var(--text-muted); font-size: .85rem; font-weight: 600;
    cursor: pointer; margin-bottom: 1rem; background: none; border: none; padding: 0;
    transition: color .15s;
}
.cl-focus-back:hover { color: var(--primary-light); }
.cl-focus-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 230px);
}
.cl-detail-header {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.cl-detail-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--text);
}
.cl-detail-meta { font-size: .82rem; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

/* Basis für Fortschrittsbalken (genutzt von Ticket-Checklisten, .tcl-progress-row) */
.cl-progress-track {
    height: 7px;
    background: var(--surface4);
    border-radius: 99px;
    overflow: hidden;
}
.cl-progress-fill {
    display: block;
    height: 100%;
    border-radius: 99px;
    transition: width .4s ease;
}

.cl-items-empty {
    padding: 2rem 1.4rem;
    font-size: .88rem;
    color: var(--text-muted);
    text-align: center;
}

/* ── Items list ───────────────────────────────────── */
.cl-items {
    flex: 1;
    overflow-y: auto;
    padding: .5rem .9rem;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.cl-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .75rem;
    border-radius: var(--radius-lg);
    transition: background .15s;
}
.cl-item:hover { background: var(--surface3); }
.cl-item.is-done .cl-item-text,
.cl-item.cl-item-done .cl-item-text {
    text-decoration: line-through;
    opacity: .5;
}
.cl-checkbox {
    width: 21px; height: 21px;
    border-radius: 6px;
    border: 2px solid var(--border-light);
    background: var(--surface2);
    cursor: pointer;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, border-color .15s, transform .12s;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
}
.cl-checkbox:hover { border-color: var(--primary); transform: scale(1.06); }
.cl-checkbox:checked,
.cl-checkbox.checked,
.cl-checkbox.cl-checked {
    border-color: currentColor;
    background: currentColor;
}
/* Das Häkchen kommt als CHECK_SVG aus dem Markup (renderItems/patchItemDom).
   KEIN zusätzlicher ::after-Haken – sonst erscheint ein Doppel-Häkchen. */
.cl-item-text {
    flex: 1;
    font-size: .89rem;
    color: var(--text);
    cursor: pointer;
    word-break: break-word;
    line-height: 1.45;
    transition: opacity .2s;
}
.cl-item-edit-input {
    flex: 1;
    font-size: .89rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 3px 8px;
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.cl-item-del {
    opacity: 0;
    transition: opacity .15s, background .15s, color .15s;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.cl-item-del:hover { color: #fff; background: var(--danger); }
.cl-item:hover .cl-item-del { opacity: 1; }

/* ── Add item bar ─────────────────────────────────── */
.cl-add-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .85rem 1.1rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.cl-add-input {
    flex: 1;
    border: 1px solid var(--border-light);
    border-radius: 99px;
    padding: .55rem 1rem;
    font-size: .88rem;
    background: var(--surface2);
    color: var(--text);
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.cl-add-input:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-glow); }
.cl-add-input::placeholder { color: var(--text-muted); }
.cl-add-item .btn { border-radius: 99px; }

/* ── Color picker ─────────────────────────────────── */
.cl-color-picker {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: .4rem;
}
.cl-color-dot {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 2px solid transparent;
    box-shadow: 0 0 0 2px transparent;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    position: relative;
}
.cl-color-dot:hover { transform: scale(1.15); }
.cl-color-dot.active,
.cl-color-dot.selected {
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text);
    transform: scale(1.05);
}
.cl-color-dot.active::after,
.cl-color-dot.selected::after {
    content: '';
    position: absolute; inset: 0;
    margin: auto;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.95);
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
}

/* ── Color CSS vars ───────────────────────────────── */
.cl-color-blue   { background: var(--wc-blue);   }
.cl-color-purple { background: var(--wc-purple); }
.cl-color-green  { background: var(--wc-green);  }
.cl-color-teal   { background: var(--wc-teal);   }
.cl-color-orange { background: var(--wc-orange); }
.cl-color-red    { background: var(--wc-red);    }
.cl-color-yellow { background: var(--wc-yellow); }

/* ── Sidebar inner / empty state ──────────────────── */
.cl-sidebar-inner {
    flex: 1;
    overflow-y: auto;
    padding: .4rem 0;
    display: flex;
    flex-direction: column;
}
.cl-empty-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .6rem;
    padding: 2.5rem 1.25rem;
    margin: auto;
}
.cl-empty-side svg { margin: 0 !important; }
.cl-empty-side p {
    font-size: .85rem;
    color: var(--text-muted);
    margin: 0;
}

/* ── Main welcome / empty state ───────────────────── */
.cl-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: .35rem;
    height: 100%;
}
.cl-welcome svg { margin: 0 0 .5rem !important; }

/* ── Small checkbox for dashboard widget ─────────── */
.cl-checkbox-sm {
    width: 16px; height: 16px;
    border-radius: 3px;
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    transition: background .15s, border-color .15s;
    position: relative;
}
.cl-checkbox-sm:hover {
    border-color: var(--primary);
    background: var(--primary-dim);
}

/* ── Ticket-attached checklists ───────────────────── */
.tcl-block {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem;
    margin-bottom: .9rem;
    transition: border-color .15s, box-shadow .15s;
}
.tcl-block:hover { border-color: var(--border-light); box-shadow: var(--shadow-card); }
.tcl-block:last-child { margin-bottom: 0; }
.tcl-block-header {
    display: flex;
    align-items: center;
    gap: .65rem;
}
.tcl-block-dot {
    width: 28px; height: 28px;
    border-radius: 9px;
    flex-shrink: 0;
    box-shadow: 0 3px 10px -2px rgba(0,0,0,.3);
}
.tcl-block-title {
    font-size: .92rem;
    font-weight: 700;
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tcl-block-meta {
    font-size: .73rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    background: var(--surface4);
    padding: .15rem .55rem;
    border-radius: 99px;
}
.tcl-progress-row { display: flex; align-items: center; gap: .6rem; margin: .65rem 0 .5rem; }
.tcl-progress-row .cl-progress-track { flex: 1; height: 6px; border-radius: 99px; background: var(--surface4); }
.tcl-progress-row .cl-progress-fill { border-radius: 99px; }
.tcl-progress-label { font-size: .71rem; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }
/* Ein-/Ausklappen: Kopf klickbar, Chevron dreht, Inhalt versteckt wenn eingeklappt */
.tcl-block-header { cursor: pointer; }
.tcl-block-chevron { flex-shrink: 0; font-size: .6rem; line-height: 1; color: var(--text-subtle); transition: transform .15s; transform: rotate(90deg); }
.tcl-block.is-collapsed .tcl-block-chevron { transform: rotate(0deg); }
.tcl-block.is-collapsed .tcl-progress-row,
.tcl-block.is-collapsed .cl-items,
.tcl-block.is-collapsed .cl-add-item { display: none; }

/* ── Checklist widget rows ────────────────────────── */
.wt-cl-list { display: flex; flex-direction: column; gap: 0; }
.wt-cl-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .3rem .1rem;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.wt-cl-row:last-child { border-bottom: none; }
.wt-cl-row .wt-body { min-width: 0; flex: 1; }
.wt-cl-row .wt-title {
    font-size: .82rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wt-cl-row .wt-meta {
    font-size: .72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ══════════════════════════════════════════════════════════
   Tagesrapport
══════════════════════════════════════════════════════════ */

/* ── Toolbar ─────────────────────────────────────────── */
.rp-toolbar {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.rp-quick-ticket {
    flex: 1;
    min-width: 0;
    padding: .85rem 1.1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.rp-qt-label {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}
.rp-qt-fields {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}
.rp-qt-customer-wrap { position: relative; flex: 1; min-width: 140px; }
.rp-qt-input {
    width: 100%;
    background: var(--surface3);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text);
    font-size: .82rem;
    padding: .38rem .65rem;
    outline: none;
    transition: border-color .15s;
}
.rp-qt-input:focus { border-color: var(--primary); }

/* ── Date block ──────────────────────────────────────── */
.rp-date-wrap {
    display: flex;
    align-items: center;
    gap: .4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: .6rem .85rem;
}
.rp-date-field { display: flex; flex-direction: column; gap: .15rem; }
.rp-date-field label { font-size: .68rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.rp-date-field input[type=date] {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: .9rem;
    font-weight: 700;
    outline: none;
    cursor: pointer;
}
.rp-date-nav { padding: .3rem .55rem !important; }

/* ── Card ────────────────────────────────────────────── */
/* overflow:visible, damit die aufklappenden Zeilen-Dropdowns (searchable-select)
   nicht am Karten-/Tabellenrand abgeschnitten werden. */
.rp-card { padding: 0; overflow: visible; }
.rp-card-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--border);
}
.rp-total-badge {
    font-size: .8rem;
    font-weight: 700;
    color: var(--primary-light);
    background: var(--primary-dim);
    padding: .2rem .65rem;
    border-radius: 20px;
}

/* ── Table ───────────────────────────────────────────── */
/* overflow:visible (statt overflow-x:auto): overflow-x:auto würde overflow-y
   implizit auf auto zwingen und die aufklappenden Dropdowns vertikal abschneiden. */
.rp-table-wrap { overflow: visible; }
.rp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}
.rp-table thead th {
    padding: .5rem .6rem;
    background: var(--surface3);
    color: var(--text-muted);
    font-weight: 600;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.rp-table tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
.rp-table tbody tr:last-child { border-bottom: none; }
.rp-table tbody tr:hover { background: var(--surface3); }
.rp-table tbody td { padding: .4rem .5rem; vertical-align: middle; }

/* ── Column widths ───────────────────────────────────── */
.rp-col-time   { width: 82px; }
.rp-col-dur    { width: 60px; text-align: center; }
.rp-col-desc   { min-width: 160px; }
.rp-col-rt     { width: 130px; }
.rp-col-cust   { width: 240px; }
.rp-col-ticket { min-width: 200px; }
.rp-col-bill   { width: 42px; text-align: center; }
.rp-col-act    { width: 80px; white-space: nowrap; }

/* ── Inputs inside table ─────────────────────────────── */
.rp-input {
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text);
    font-size: .82rem;
    padding: .3rem .45rem;
    outline: none;
    transition: border-color .12s, background .12s;
    box-sizing: border-box;
}
.rp-input:hover  { border-color: var(--border-light); background: var(--surface3); }
.rp-input:focus  { border-color: var(--primary); background: var(--surface2); }
.rp-input:disabled { opacity: .5; cursor: not-allowed; }
/* Zeitfelder: normal tabbar; natives Picker-Icon weg, eigenes Uhr-Icon (NICHT tabbar, öffnet den Picker). */
.rp-time-wrap { position: relative; display: block; }
.rp-time-wrap .rp-input { width: 100%; padding-right: 1.7rem; }
.rp-input[type="time"]::-webkit-calendar-picker-indicator { display: none; -webkit-appearance: none; }
.rp-clock {
    position: absolute; top: 50%; right: .35rem; transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; padding: 0;
    background: none; border: none; cursor: pointer; color: var(--text-subtle);
}
.rp-clock:hover { color: var(--text); }
.rp-clock svg { width: 14px; height: 14px; }
.rp-clock:disabled { display: none; }

.rp-dur-badge {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    color: var(--primary-light);
    white-space: nowrap;
}

.rp-bill-chk { cursor: pointer; accent-color: var(--primary); width: 15px; height: 15px; }

.rp-save-btn { padding: .25rem .55rem !important; font-size: .78rem !important; }
.rp-del-btn  { padding: .25rem .45rem !important; font-size: .78rem !important; }

.rp-invoiced td { opacity: .65; }
.rp-locked-badge { font-size: .9rem; }

.rp-empty {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 2.5rem 1rem !important;
    font-size: .88rem;
}

/* ── Dropdown ────────────────────────────────────────── */
.rp-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
    z-index: 200;
    max-height: 220px;
    overflow-y: auto;
}
.rp-drop-item {
    padding: .5rem .75rem;
    cursor: pointer;
    font-size: .82rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: .5rem;
    transition: background .1s;
}
.rp-drop-item:hover { background: var(--surface4); }
.rp-drop-nr {
    font-size: .72rem;
    color: var(--text-muted);
    font-family: ui-monospace, monospace;
    background: var(--surface3);
    padding: .1rem .3rem;
    border-radius: 3px;
}

/* ── Summary bar ─────────────────────────────────────── */
.rp-summary {
    display: flex;
    align-items: stretch;
    border-top: 2px solid var(--border-light);
    background: var(--surface3);
    /* runde Unterkanten behalten, da .rp-card nicht mehr clippt */
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.rp-summary-item {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: .75rem 1.25rem;
    border-right: 1px solid var(--border);
}
.rp-summary-item:last-child { border-right: none; }
.rp-summary-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
}
.rp-summary-val {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.02em;
}
.rp-summary-chf .rp-summary-val { color: var(--success); }

/* ── Customer filter autocomplete (tickets.php) ──────────── */
.fc-wrap {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 190px;
}
.fc-input { width: 190px; }
.fc-chip {
    display: flex;
    align-items: center;
    gap: .35rem;
    background: var(--primary-dim);
    border: 1px solid var(--primary-dark);
    border-radius: var(--radius);
    padding: .3rem .55rem .3rem .75rem;
    font-size: .82rem;
    color: var(--primary-light);
    font-weight: 600;
    white-space: nowrap;
    max-width: 220px;
}
.fc-chip span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fc-chip-clear {
    background: none;
    border: none;
    color: var(--primary-light);
    cursor: pointer;
    padding: 0 .1rem;
    opacity: .7;
    font-size: .85rem;
    line-height: 1;
    flex-shrink: 0;
}
.fc-chip-clear:hover { opacity: 1; }
.fc-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    background: var(--surface2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
    z-index: 300;
    max-height: 260px;
    overflow-y: auto;
}
.fc-item {
    padding: .5rem .8rem;
    cursor: pointer;
    font-size: .83rem;
    color: var(--text);
    transition: background .1s;
}
.fc-item:hover, .fc-item.fc-active { background: var(--surface4); color: var(--primary-light); }


/* ── Print (Dev-Panel Lizenz-Abrechnung) ──────────────────── */
@media print {
    .sidebar, .topbar, .profile-tabs, .btn, button, select,
    .sidebar-footer, #toast-container, input[type="month"],
    input[type="number"] { display: none !important; }
    body { background: #fff !important; color: #000 !important; }
    .app { display: block !important; }
    .main-content { margin: 0 !important; padding: 0 !important; }
    .page-body { padding: 0 !important; }
    .content-card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
    .data-table th, .data-table td { border-color: #ddd !important; color: #000 !important; }
    .data-table thead { background: #f5f5f5 !important; }
    a { text-decoration: none !important; color: #000 !important; }
}


/* ── Aufgaben / Tasks ────────────────────────────────────────────────────── */
.task-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: none; }

.task-status-dot {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border-strong, #aaa);
    margin-top: 3px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.task-status-in_progress .task-status-dot {
    background: #2196F3;
    border-color: #2196F3;
}
.task-status-done .task-status-dot {
    background: #4CAF50;
    border-color: #4CAF50;
}
.task-status-done .task-title {
    text-decoration: line-through;
    color: var(--text-muted, #888);
}

.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 500; word-break: break-word; }
.task-desc { font-size: .85rem; color: var(--text-muted, #888); margin-top: 2px; }
.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: 5px;
    font-size: .78rem;
    color: var(--text-muted, #888);
    align-items: center;
}
.task-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    font-weight: 600;
    font-size: .75rem;
}
.task-badge-open        { background: rgba(33,150,243,.12); color: #1565C0; }
.task-badge-in_progress { background: rgba(255,152,0,.15);  color: #E65100; }
.task-badge-done        { background: rgba(76,175,80,.15);  color: #2E7D32; }

.task-actions {
    display: flex;
    gap: .2rem;
    flex-shrink: 0;
}
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 4px;
    font-size: 1rem;
    line-height: 1;
    opacity: .6;
    transition: opacity .15s, background .15s;
}
.btn-icon:hover { opacity: 1; background: var(--hover-bg, rgba(0,0,0,.06)); }

/* ═══════════════════════════════════════════════════════════
   THEMES
   data-theme="dark"  → Standard (dunkel blau, wie aktuell)
   data-theme="black" → Schwarz
   data-theme="light" → Weiss
═══════════════════════════════════════════════════════════ */

/* ── Schwarzes Theme ────────────────────────────────────── */
[data-theme="black"] {
    --bg:            #000000;
    --surface:       #0a0a0a;
    --surface2:      #111111;
    --surface3:      #181818;
    --surface4:      #202020;
    --surface5:      #282828;
    --border:        #1c1c1c;
    --border-light:  #2a2a2a;
    --primary:       #2B62B2;
    --primary-light: #4B82D2;
    --primary-dark:  #1E4682;
    --primary-dim:   #0A1A30;
    --primary-glow:  rgba(43,98,178,.35);
    --success:       #10d988; --success-dim: #011008;
    --warning:       #f59e0b; --warning-dim: #110900;
    --danger:        #f05252; --danger-dim:  #110202;
    --info:          #38b2f8; --info-dim:    #020a12;
    --purple:        #b06ef7; --purple-dim:  #0d0418;
    --cyan:          #22d3ee;
    --text:          #e8eaf0;
    --text-muted:    #555;
    --text-subtle:   #6b6b6b;
    --shadow:         0 24px 64px rgba(0,0,0,1), 0 4px 24px rgba(0,0,0,.9);
    --shadow-sm:      0 4px 24px rgba(0,0,0,.8);
    --shadow-card:    0 2px 12px rgba(0,0,0,.6);
    --shadow-primary: 0 4px 24px rgba(43,98,178,.4);
}

/* ── Helles Theme (Weiss) ───────────────────────────────── */
[data-theme="light"] {
    --bg:            #f0f2f7;
    --surface:       #ffffff;
    --surface2:      #f8f9fc;
    --surface3:      #f0f2f7;
    --surface4:      #e6e9f2;
    --surface5:      #dde1ed;
    --border:        #dde1ed;
    --border-light:  #c8cedd;
    --primary:       #2B62B2;
    --primary-light: #2B62B2;
    --primary-dark:  #1E4682;
    --primary-dim:   #e3eafa;
    --primary-glow:  rgba(43,98,178,.2);
    --success:       #0a9e64; --success-dim: #e8f9f3;
    --warning:       #c97d00; --warning-dim: #fef6e4;
    --danger:        #d93030; --danger-dim:  #fdeaea;
    --info:          #0e82c0; --info-dim:    #e3f3fc;
    --purple:        #7c3aed; --purple-dim:  #f0ebfd;
    --cyan:          #0891b2;
    --text:          #1a1d2e;
    --text-muted:    #5a6280;
    --text-subtle:   #8b92ab;
    --shadow:         0 4px 24px rgba(0,0,0,.07), 0 1px 4px rgba(0,0,0,.04);
    --shadow-sm:      0 2px 12px rgba(0,0,0,.05);
    --shadow-card:    0 1px 6px rgba(0,0,0,.07);
    --shadow-primary: 0 4px 16px rgba(43,98,178,.25);
}

/* Light theme — spezifische Overrides ─────────────────── */
[data-theme="light"] body { background: var(--bg); color: var(--text); }
[data-theme="light"] .auth-body {
    background-image:
        radial-gradient(ellipse 90% 60% at 50% -10%, rgba(43,98,178,.08), transparent),
        radial-gradient(ellipse 60% 80% at 90% 110%, rgba(43,98,178,.05), transparent);
}
[data-theme="light"] .sidebar     { background: #fff; border-color: var(--border); }
[data-theme="light"] .topbar      { background: rgba(255,255,255,.9); border-color: var(--border); }
[data-theme="light"] .nav-item    { color: var(--text-muted); }
[data-theme="light"] .nav-item:hover,
[data-theme="light"] .nav-item.active { background: var(--primary-dim); color: var(--primary); }
[data-theme="light"] .nav-item.active .nav-icon { color: var(--primary); }
[data-theme="light"] .search-input { background: var(--surface3); color: var(--text); border-color: var(--border); }
[data-theme="light"] .search-input:focus { border-color: var(--primary); }
[data-theme="light"] .card,
[data-theme="light"] .modal-box,
[data-theme="light"] .auth-box    { box-shadow: 0 2px 16px rgba(0,0,0,.08); }
[data-theme="light"] a            { color: var(--primary); }
[data-theme="light"] a:hover      { color: var(--primary-dark); }
/* Buttons, die als <a>-Link gerendert werden (z.B. "Neues Ticket"), dürfen die obige
   Link-Textfarbe NICHT erben — sonst wird der Text praktisch unsichtbar (blau auf blau). */
[data-theme="light"] a.btn-primary { color: #fff; }
[data-theme="light"] a.btn-primary:hover { color: #fff; }
[data-theme="light"] a.btn-ghost,
[data-theme="light"] a.btn-outline { color: var(--text-muted); }
[data-theme="light"] a.btn-ghost:hover,
[data-theme="light"] a.btn-outline:hover { color: var(--text); }
[data-theme="light"] .auth-logo   { background: none; -webkit-text-fill-color: var(--primary); color: var(--primary); }
/* Heller, lebendigerer Verlauf statt dunklem Navy-Ton — der dunkle Gradient-Endpunkt
   (--primary-dark) wirkt im Hellmodus zu schwer/dunkel für einen Primär-Button. */
[data-theme="light"] .btn-primary {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    box-shadow: 0 2px 10px -1px rgba(43,98,178,.4);
}
[data-theme="light"] .btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    box-shadow: 0 4px 14px -1px rgba(43,98,178,.5);
}

/* ── Theme-Switcher ─────────────────────────────────────── */
.theme-switcher {
    display: flex;
    align-items: center;
    gap: 3px;
    background: var(--surface2);
    border: 1px solid var(--border-light);
    border-radius: 99px;
    padding: 3px 4px;
    flex-shrink: 0;
}
.theme-btn {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .15s, transform .1s;
    font-size: 11px;
    line-height: 1;
}
.theme-btn:hover  { transform: scale(1.15); }
.theme-btn.active { border-color: var(--primary-light); }
.theme-btn-dark  { background: #0b0c1a; }
.theme-btn-black { background: #000; }
.theme-btn-light { background: #f0f2f7; border: 2px solid #dde1ed; }

/* ── Benachrichtigungs-Glocke (neue Kommentare) ─────────────────────────── */
.notif-bell {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: var(--surface2);
    color: var(--text-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: border-color .15s, color .15s, background .15s;
}
.notif-bell:hover  { color: var(--text); }
.notif-bell.active { border-color: var(--primary-light); color: var(--primary-light); background: var(--primary-dim); }

/* NSL Logo ─────────────────────────────────────────────── */
.nsl-logo-img {
    height: 32px;
    width: auto;
    display: block;
    flex-shrink: 0;
}
.sidebar-logo .nsl-logo-img { height: 28px; }

/* Weisser Logo-Hintergrund auf dunklen Themes transparent machen */
[data-theme="dark"]  .nsl-logo-img,
[data-theme="black"] .nsl-logo-img {
    mix-blend-mode: screen;
    filter: brightness(1.1);
}

/* ═══════════════════════════════════════════════════════════
   Searchable Select — durchsuchbare Dropdowns (searchable-select.js)
   Das native <select> bleibt versteckt als Datenquelle; .ss-trigger
   ersetzt es optisch, .ss-panel (am <body>) zeigt Suche + Optionen.
═══════════════════════════════════════════════════════════ */
.ss { position: relative; display: inline-block; width: 100%; max-width: 100%; vertical-align: middle; }
.ss-native { display: none !important; }
/* Das Eingabefeld sieht aus wie ein <select>; man klickt rein und tippt direkt. */
.ss-input {
    width: 100%;
    background: var(--surface3); border: 1px solid var(--border-light);
    border-radius: var(--radius); color: var(--text); font-family: inherit;
    font-size: .875rem; padding: .52rem 2.2rem .52rem .85rem;
    cursor: pointer; outline: none;
    text-overflow: ellipsis; white-space: nowrap;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.ss-input:hover { border-color: var(--border); }
.ss.ss-open .ss-input,
.ss-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(43,98,178,.14); background: var(--surface4); cursor: text; }
.ss-input:disabled { opacity: .4; cursor: not-allowed; }
.ss-input.ss-ph { color: var(--text-subtle); }
.ss-input::placeholder { color: var(--text-subtle); }
/* Pfeil (dekorativ, klick geht durch aufs Feld) */
.ss-arrow {
    position: absolute; right: .8rem; top: 50%; margin-top: -2px;
    width: 0; height: 0; pointer-events: none;
    border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 5px solid var(--text-subtle); transition: transform .18s;
}
.ss.ss-open .ss-arrow { transform: rotate(180deg); }

.ss-panel {
    position: absolute; left: 0; width: 100%; top: calc(100% + 3px); z-index: 9998;
    background: var(--surface2); border: 1px solid var(--border-light);
    border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.35);
    max-height: 280px; overflow: hidden;
}
.ss-panel.ss-up { top: auto; bottom: calc(100% + 3px); }
.ss-options { overflow-y: auto; max-height: 280px; padding: .3rem; }
.ss-option { padding: .45rem .6rem; border-radius: 6px; cursor: pointer; font-size: .875rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-option:hover, .ss-option.ss-active { background: var(--surface4); }
.ss-option.ss-selected { color: var(--primary-light); font-weight: 600; }
.ss-option.ss-disabled { opacity: .4; cursor: not-allowed; }
.ss-empty { padding: .6rem; text-align: center; color: var(--text-muted); font-size: .82rem; }
