/* ============================================================
   TimeTracking – modernes Design-System (eigenständig, kein AdminLTE)
   Light/Dark-Mode, weiche Schatten, Gradient-Akzente
   ============================================================ */

:root {
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Flächen & Text (Light) */
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #f1f4fa;
    --surface-hover: #eef2fb;
    --border: #e6e9f2;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-soft: #94a3b8;

    /* Marke */
    --primary: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --accent: #8b5cf6;
    --primary-soft: rgba(99, 102, 241, .12);
    /* Verläufe folgen den Token-Farben – so greift auch das Firmen-CI (TT_AppSettings) */
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    --gradient-2: linear-gradient(135deg, #0ea5e9 0%, var(--primary) 100%);

    /* Statusfarben */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;

    /* Sidebar (immer dunkel) */
    --sidebar-bg: linear-gradient(180deg, #1e213a 0%, #171a2e 100%);
    --sidebar-text: #b8bfd6;
    --sidebar-text-active: #ffffff;
    --sidebar-muted: #6b7396;

    /* Form */
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
    --shadow: 0 4px 12px rgba(15, 23, 42, .06), 0 2px 4px rgba(15, 23, 42, .04);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12), 0 4px 8px rgba(15, 23, 42, .05);
    --shadow-primary: 0 8px 20px color-mix(in srgb, var(--primary) 35%, transparent);

    --sidebar-w: 264px;
    --sidebar-w-collapsed: 76px;
    --topbar-h: 66px;
}

:root[data-theme="dark"] {
    --bg: #0b0f1c;
    --surface: #151a2b;
    --surface-2: #1b2236;
    --surface-hover: #212a42;
    --border: #262f47;
    --text: #e7ecf6;
    --text-muted: #94a3b8;
    --text-soft: #64748b;
    --primary-soft: rgba(99, 102, 241, .18);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 4px 14px rgba(0, 0, 0, .35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .5);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0b0f1c;
        --surface: #151a2b;
        --surface-2: #1b2236;
        --surface-hover: #212a42;
        --border: #262f47;
        --text: #e7ecf6;
        --text-muted: #94a3b8;
        --text-soft: #64748b;
        --primary-soft: rgba(99, 102, 241, .18);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
        --shadow: 0 4px 14px rgba(0, 0, 0, .35);
        --shadow-lg: 0 16px 40px rgba(0, 0, 0, .5);
    }
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
    line-height: 1.55;
    overflow-x: hidden;
    width: 100%;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4 { color: var(--text); font-weight: 700; letter-spacing: -.01em; }
a { color: var(--primary-600); text-decoration: none; }
a:hover { color: var(--primary-700); }

::selection { background: var(--primary-soft); }

/* --- App-Shell --- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: width .22s ease, transform .22s ease;
}

.main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    transition: margin-left .22s ease;
}

.app.collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.app.collapsed .main { margin-left: var(--sidebar-w-collapsed); }

/* --- Sidebar-Inhalt --- */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--topbar-h);
    padding: 0 20px;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
}

.brand-logo {
    flex: 0 0 auto;
    width: 38px; height: 38px;
    border-radius: 11px;
    background: var(--gradient);
    display: grid; place-items: center;
    color: #fff; font-size: 1.05rem;
    box-shadow: var(--shadow-primary);
}

.app.collapsed .brand-text { opacity: 0; width: 0; }
.brand-text { transition: opacity .15s; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 12px 20px; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

.nav-section {
    color: var(--sidebar-muted);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    padding: 18px 14px 8px;
    white-space: nowrap;
}
.app.collapsed .nav-section { text-align: center; padding: 14px 0 6px; font-size: 0; }
.app.collapsed .nav-section::after { content: "•"; font-size: .8rem; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 14px;
    margin: 2px 0;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: .92rem;
    white-space: nowrap;
    position: relative;
    transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item .nav-ico { flex: 0 0 auto; width: 22px; text-align: center; font-size: 1rem; }
.nav-item .nav-label { transition: opacity .15s; }

.nav-item.active {
    background: var(--gradient);
    color: #fff;
    box-shadow: var(--shadow-primary);
}
.nav-item.active:hover { color: #fff; }

.app.collapsed .nav-item { justify-content: center; padding: 12px 0; }
.app.collapsed .nav-label { display: none; }

.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,.07);
    color: var(--sidebar-muted);
    font-size: .74rem;
    white-space: nowrap;
    overflow: hidden;
}
.app.collapsed .sidebar-footer { text-align: center; padding: 14px 0; }

/* --- Topbar --- */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 24px;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 30;
}

.icon-btn {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 11px;
    cursor: pointer;
    font-size: 1.05rem;
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.topbar-spacer { flex: 1; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-weight: 600;
    font-size: .88rem;
}
.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    display: grid; place-items: center;
    font-size: .82rem; font-weight: 700;
}
.user-chip .user-role { color: var(--text-soft); font-weight: 500; font-size: .76rem; }

/* --- Content --- */
.content { flex: 1; padding: 28px; }
.container-page { max-width: 2400px; margin: 0 auto; }

.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 1.6rem; margin: 0 0 4px; }
.page-head .subtitle { color: var(--text-muted); margin: 0; }

/* --- Cards --- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px;
}
.card-lg { border-radius: var(--radius-lg); padding: 28px; }

.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* --- Stat-Cards --- */
.stat {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease;
    text-align: center;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-ico {
    width: 46px; height: 46px;
    border-radius: 13px;
    display: grid; place-items: center;
    color: #fff; font-size: 1.15rem;
    margin: 0 auto 14px;
}
.stat-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.stat-label { color: var(--text-muted); font-size: .86rem; margin-top: 6px; }
.stat-link {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 14px; font-size: .82rem; font-weight: 600; color: var(--primary-600);
}
.stat-link:hover { gap: 9px; }
.stat-link i { transition: transform .15s; }

.bg-grad-1 { background: var(--gradient); }
.bg-grad-2 { background: var(--gradient-2); }
.bg-grad-3 { background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%); }
.bg-grad-4 { background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%); }

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit; font-size: .92rem; font-weight: 600;
    cursor: pointer;
    transition: transform .12s, box-shadow .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: var(--shadow-primary); }
.btn-primary:hover { color: #fff; filter: brightness(1.05); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-block { width: 100%; }

/* --- Auswertung / Charts (einreihig, Indigo) --- */
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.month-nav .m-label { font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; min-width: 150px; text-align: center; }
/* Monatsnavigation innerhalb einer Filterleiste */
.month-inline { display: flex; align-items: center; gap: 6px; }
.month-inline .m-label { font-weight: 700; font-size: .95rem; min-width: 140px; text-align: center; font-variant-numeric: tabular-nums; }

.chart-title { font-size: .92rem; font-weight: 700; margin: 0 0 16px; }

/* Buchungsmatrix (Mitarbeiter × Tage) */
.matrix-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); -webkit-overflow-scrolling: touch; }
.matrix { border-collapse: collapse; font-size: .8rem; white-space: nowrap; font-variant-numeric: tabular-nums; width: 100%; }
.matrix th, .matrix td { padding: 7px 10px; text-align: center; border-bottom: 1px solid var(--border); }
.matrix thead th { position: sticky; top: 0; background: var(--surface); font-weight: 700; font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; z-index: 2; }
.matrix .name { text-align: left; position: sticky; left: 0; background: var(--surface); font-weight: 600; min-width: 185px; z-index: 1; }
.matrix thead th.name { z-index: 3; }
.matrix .wknd, .matrix thead th.wknd { background: var(--surface-2); }
.matrix td.total, .matrix th.total { font-weight: 800; border-left: 2px solid var(--border); }
.matrix .cell { display: inline-block; padding: 2px 7px; border-radius: 6px; min-width: 40px; }
/* Drilldown-Links in der Matrix behalten die Zellfarbe */
.matrix a.cell { color: inherit; text-decoration: none; }
.matrix a.cell:hover { outline: 2px solid var(--primary); outline-offset: 1px; }
.matrix .name a { color: inherit; text-decoration: none; }
.matrix .name a:hover { color: var(--primary-600); text-decoration: underline; }
.day-chip { color: var(--primary-600); font-weight: 700; }
.mc-over { color: #d97706; font-weight: 800; }
.mc-holiday { background: #1e213a; color: #fff; }
.mc-missing { background: #ef4444; color: #fff; }
.mc-pending { font-style: italic; color: var(--text-soft); }
.matrix-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; font-size: .82rem; color: var(--text-muted); }
.matrix-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-swatch { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }

/* Buchungsmatrix – Von/Bis-Filterleiste */
.matrix-filter { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.matrix-filter .mf-range { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.matrix-filter .mf-field { display: flex; flex-direction: column; gap: 5px; }
.matrix-filter .mf-field label { font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.matrix-filter .mf-quick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.matrix-caption { margin: 2px 0 10px; font-size: .82rem; color: var(--text-muted); font-weight: 600; }
@media (max-width: 820px) {
    .matrix-filter { flex-direction: column; align-items: stretch; }
    .matrix-filter .mf-range, .matrix-filter .mf-quick { justify-content: space-between; }
}

/* Monatsübersicht – Tageszeilen */
.day-list { display: flex; flex-direction: column; gap: 6px; }
.day-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; }
.day-row.weekend { opacity: .55; }
.day-row.gap { border-color: rgba(245,158,11,.55); background: rgba(245,158,11,.07); }
.day-row.today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.day-date { min-width: 118px; font-weight: 600; font-size: .9rem; }
.day-date .dow { color: var(--text-muted); font-weight: 500; margin-right: 4px; }
.day-hours { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; }
.day-hours.empty { color: var(--text-soft); font-weight: 500; }

/* Segment-Umschalter (Monat/Woche) */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 3px; }
.seg-btn { border: none; background: transparent; color: var(--text-muted); padding: 8px 20px; border-radius: 8px; font-family: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; transition: background .15s, color .15s; }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Säulen (Stunden pro Tag) */
.col-chart { display: flex; align-items: flex-end; gap: 2px; height: 150px; border-bottom: 1.5px solid var(--border); }
.col { flex: 1 1 0; min-width: 0; background: var(--primary); border-radius: 3px 3px 0 0; min-height: 2px; }
.col.max { background: var(--accent); }
.col-labels { display: flex; gap: 2px; margin-top: 6px; }
.col-label { flex: 1 1 0; min-width: 0; text-align: center; font-size: .58rem; color: var(--text-soft); font-variant-numeric: tabular-nums; }

/* SMS-Monatsdiagramm */
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.sms-chart { display: flex; align-items: flex-end; gap: 6px; min-height: 190px; padding-top: 8px; }
.sms-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.sms-col-val { font-size: .72rem; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; min-height: 1em; }
.sms-col-bar { width: 72%; max-width: 38px; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; transition: height .2s ease; }
.sms-col-bar.max { background: var(--accent); }
.sms-col-label { font-size: .62rem; color: var(--text-soft); white-space: nowrap; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* Horizontale Balken (Stunden pro Projekt) */
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.hbar-head .name { color: var(--text); font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-head .val { color: var(--text-muted); font-size: .82rem; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.hbar-track { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.hbar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 6px; min-width: 4px; }

/* --- Badges --- */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: .74rem; font-weight: 700;
    background: var(--primary-soft); color: var(--primary-600);
}
.badge-success { background: rgba(16,185,129,.14); color: #059669; }
.badge-warning { background: rgba(245,158,11,.16); color: #d97706; }
.badge-danger { background: rgba(239,68,68,.14); color: #dc2626; }
.badge-neutral { background: var(--surface-hover); color: var(--text-muted); }

/* --- Formfelder --- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .84rem; font-weight: 600; margin-bottom: 7px; color: var(--text); }
.input {
    width: 100%;
    padding: 12px 14px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit; font-size: .95rem;
    transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--text-soft); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }

.checkbox-row { display: flex; align-items: center; gap: 9px; font-size: .88rem; color: var(--text-muted); }
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--primary); }

.validation-message, .field-validation-error { color: var(--danger); font-size: .82rem; margin-top: 5px; display: block; }
.invalid { border-color: var(--danger) !important; }
.valid.modified:not([type=checkbox]) { border-color: var(--success); }

/* --- Alert --- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 16px; }
.alert-danger { background: rgba(239,68,68,.12); color: #dc2626; border: 1px solid rgba(239,68,68,.25); }
.alert-success { background: rgba(34,197,94,.12); color: #16a34a; border: 1px solid rgba(34,197,94,.25); }

/* Datensynchronisation */
.sync-tile { display: flex; flex-direction: column; }
.sync-tile .tile-ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-size: 1.15rem; margin-bottom: 14px; background: var(--gradient); }
.sync-tile h3 { margin: 0 0 6px; font-size: 1.02rem; }
.sync-tile p { margin: 0 0 16px; color: var(--text-muted); font-size: .86rem; flex: 1; }
.sync-err { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .74rem; word-break: break-word; white-space: pre-wrap; }

/* --- Empty state (ComingSoon) --- */
.empty-state {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 56px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.empty-ico {
    width: 84px; height: 84px; border-radius: 24px;
    background: var(--primary-soft); color: var(--primary);
    display: grid; place-items: center; font-size: 2rem;
    margin-bottom: 20px;
}
.empty-state h2 { margin: 0 0 8px; font-size: 1.4rem; }
.empty-state p { color: var(--text-muted); max-width: 440px; margin: 0 0 18px; }

/* --- Login --- */
.login-shell {
    min-height: 100vh;
    display: grid; place-items: center;
    padding: 24px;
    background:
        radial-gradient(1200px 600px at 15% -10%, rgba(99,102,241,.28), transparent 60%),
        radial-gradient(900px 500px at 110% 110%, rgba(139,92,246,.26), transparent 55%),
        var(--bg);
}
.login-card {
    width: 100%; max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 36px 32px;
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-logo .brand-logo { width: 44px; height: 44px; font-size: 1.2rem; }
.login-logo b { font-size: 1.3rem; letter-spacing: -.02em; }
.login-sub { color: var(--text-muted); margin: 0 0 26px; font-size: .92rem; }
.input-group { position: relative; }
.input-group .in-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-soft); }
.input-group .input { padding-left: 42px; }

/* --- Blazor Fehler-UI --- */
#blazor-error-ui {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #1e213a; color: #fff;
    padding: 14px 24px; z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0,0,0,.3);
}
#blazor-error-ui .reload { color: #a5b4fc; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 18px; top: 12px; }

.blazor-error-boundary { background: var(--danger); padding: 1rem; color: #fff; border-radius: var(--radius-sm); }
.blazor-error-boundary::after { content: "Ein Fehler ist aufgetreten."; }

/* ============================================================
   Telerik / Kendo an das Design-System angleichen
   (Kendo-Default-Theme wird vor app.css geladen -> hier gewinnen)
   ============================================================ */
:root {
    --kendo-color-primary: #6366f1;
    --kendo-color-primary-hover: #4f46e5;
    --kendo-color-primary-active: #4338ca;
    /* Abgeleitete Primär-Tokens (Pager, flache Buttons, Auswahl-Chips):
       im Kendo-Theme fest einkompiliertes Korallrot -> komplett auf Indigo umbiegen */
    --kendo-color-primary-subtle: #eef2ff;
    --kendo-color-primary-subtle-hover: #e0e7ff;
    --kendo-color-primary-subtle-active: #c7d2fe;
    --kendo-color-primary-emphasis: #818cf8;
    --kendo-color-primary-on-subtle: #3730a3;
    --kendo-color-primary-on-surface: #4f46e5;
    --kendo-color-on-primary: #ffffff;
    --kendo-border-radius-md: 10px;
}

/* Pager: Seitenzahlen in Akzentfarbe statt Kendo-Default-Rot (Fallback, falls
   eine Theme-Version andere Tokens nutzt) */
.k-pager .k-button-flat-primary,
.k-pager .k-button-flat.k-button-primary { color: var(--kendo-color-primary-on-surface); }
.k-pager .k-button-flat-primary.k-selected,
.k-pager .k-button-flat.k-button-primary.k-selected {
    color: var(--kendo-color-primary-on-subtle);
    background-color: var(--kendo-color-primary-subtle);
}
.k-grid, .k-toolbar, .k-window, .k-popup { font-family: var(--font-sans); }
.k-grid { border-radius: var(--radius); overflow: hidden; }

:root[data-theme="dark"] {
    --kendo-color-app-surface: var(--bg);
    --kendo-color-on-app-surface: var(--text);
    --kendo-color-surface: var(--surface-2);
    --kendo-color-surface-alt: var(--surface);
    --kendo-color-base: var(--surface);
    --kendo-color-base-hover: var(--surface-hover);
    --kendo-color-base-active: var(--surface-hover);
    --kendo-color-on-base: var(--text);
    --kendo-color-border: var(--border);
    --kendo-color-border-alt: #303b57;
    --kendo-color-primary-subtle: color-mix(in srgb, #6366f1 22%, var(--surface));
    --kendo-color-primary-subtle-hover: color-mix(in srgb, #6366f1 30%, var(--surface));
    --kendo-color-primary-subtle-active: color-mix(in srgb, #6366f1 38%, var(--surface));
    --kendo-color-primary-on-subtle: #c7d2fe;
    --kendo-color-primary-on-surface: #a5b4fc;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --kendo-color-app-surface: var(--bg);
        --kendo-color-on-app-surface: var(--text);
        --kendo-color-surface: var(--surface-2);
        --kendo-color-surface-alt: var(--surface);
        --kendo-color-base: var(--surface);
        --kendo-color-base-hover: var(--surface-hover);
        --kendo-color-base-active: var(--surface-hover);
        --kendo-color-on-base: var(--text);
        --kendo-color-border: var(--border);
        --kendo-color-border-alt: #303b57;
        --kendo-color-primary-subtle: color-mix(in srgb, #6366f1 22%, var(--surface));
        --kendo-color-primary-subtle-hover: color-mix(in srgb, #6366f1 30%, var(--surface));
        --kendo-color-primary-subtle-active: color-mix(in srgb, #6366f1 38%, var(--surface));
        --kendo-color-primary-on-subtle: #c7d2fe;
        --kendo-color-primary-on-surface: #a5b4fc;
    }
}

/* Toolbar über dem Grid */
.toolbar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-row .spacer { flex: 1; }

/* --- Responsive Helpers --- */
.sidebar-backdrop { display: none; }
.mobile-only { display: none !important; }

/* Mobile-Kartenliste (ersetzt breite Tabellen auf dem Smartphone) */
.m-list { display: flex; flex-direction: column; gap: 12px; }
.m-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 14px 16px;
}
.m-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.m-card-title { font-weight: 700; font-size: 1rem; letter-spacing: -.01em; }
.m-card-sub { color: var(--text-muted); font-size: .84rem; margin-top: 3px; }
.m-card-row { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; padding: 4px 0; }
.m-card-row .lbl { color: var(--text-muted); }
.m-card-row .val { font-weight: 600; text-align: right; }
.m-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.m-card-actions { display: flex; gap: 8px; margin-top: 12px; }
.m-card-actions .btn { flex: 1; padding: 10px; }
.m-fab-row { position: sticky; top: 0; z-index: 5; padding-bottom: 12px; }

.btn-danger { background: rgba(239,68,68,.12); color: #dc2626; border-color: rgba(239,68,68,.28); }
.btn-danger:hover { background: rgba(239,68,68,.18); }
.btn-sm { padding: 8px 12px; font-size: .85rem; }
.act-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

/* Admin-Hub-Kacheln */
.admin-tile { display: block; text-decoration: none; color: inherit; position: relative; transition: transform .16s, box-shadow .16s; }
a.admin-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.admin-tile .tile-ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-size: 1.15rem; margin-bottom: 14px; background: var(--gradient); }
.admin-tile h3 { margin: 0 0 4px; font-size: 1.05rem; }
.admin-tile p { margin: 0; color: var(--text-muted); font-size: .86rem; }
.admin-tile.disabled { opacity: .6; }
.admin-tile.disabled .tile-ico { background: var(--surface-hover); color: var(--text-soft); }
.tile-soon { position: absolute; top: 16px; right: 16px; }

/* --- Daumenfreundliche Dauer-Eingabe --- */
.dur-display { text-align: center; font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 14px; font-variant-numeric: tabular-nums; }
.dur-steppers { display: flex; gap: 12px; margin-bottom: 14px; }
.dur-stepper { flex: 1; display: flex; align-items: center; justify-content: space-between; background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 6px; }
.dur-stepper .lbl { font-weight: 700; color: var(--text-muted); font-size: .82rem; }
.dur-btn { width: 50px; height: 50px; border: none; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 1.5rem; font-weight: 700; color: var(--primary); cursor: pointer; display: grid; place-items: center; }
.dur-btn:active { transform: scale(.93); }
.dur-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dur-chip { padding: 11px 16px; border: 1.5px solid var(--border); border-radius: 999px; background: var(--surface); font-weight: 600; font-size: .92rem; cursor: pointer; font-variant-numeric: tabular-nums; }
.dur-chip.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-600); }

/* --- Änderungsprotokoll: Feld-Diff --- */
.audit-diff { display: flex; flex-direction: column; gap: 8px; }
.audit-diff-row { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.audit-diff-field { font-weight: 700; font-size: .82rem; margin-bottom: 6px; }
.audit-diff-vals { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .88rem; }
.audit-old { color: var(--danger); text-decoration: line-through; word-break: break-word; }
.audit-new { color: var(--success); font-weight: 600; word-break: break-word; }

/* --- Sprachauswahl auf der Konto-Seite --- */
.lang-switch-account { display: flex; flex-direction: column; gap: 8px; }
.lang-switch-account .lang-opt {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px;
    font-weight: 600; color: var(--text);
}
.lang-switch-account .lang-opt:hover { border-color: var(--primary); }
.lang-switch-account .lang-opt.active {
    border-color: var(--primary); background: var(--primary-soft); color: var(--primary-600);
}

/* --- Firmenlogo (CI) --- */
.brand-img { max-height: 34px; max-width: 170px; object-fit: contain; }
.brand-img-login { max-height: 54px; max-width: 240px; }

/* --- KI-Schnellbuchung --- */
.ai-quick { margin-bottom: 16px; padding: 14px 16px; }
.ai-quick-head { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.ai-quick-head > .fa-magic { color: var(--primary); }
.ai-quick-sub { color: var(--text-muted); font-size: .85rem; }
.ai-quick-row { display: flex; gap: 10px; margin-top: 12px; align-items: stretch; }
.ai-quick-text { flex: 1; resize: vertical; min-height: 56px; }
.ai-quick-btns { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.ai-mic { width: 48px; height: 48px; border-radius: 12px; font-size: 1.1rem; }
.ai-wand i { color: var(--primary); }
.ai-wand:hover i { color: var(--primary-600); }
.ai-wand-lg { flex: 0 0 auto; width: 52px; display: grid; place-items: center; font-size: 1.05rem; }
.ai-mic.listening { background: #d33; color: #fff; animation: ai-pulse 1.2s infinite; }
@keyframes ai-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.ai-quick-hint { margin-top: 10px; color: var(--text-muted); font-size: .9rem; }
.ai-draft { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; margin-top: 8px; }
.ai-draft-txt { flex: 1; min-width: 0; font-size: .92rem; }
@media (max-width: 820px) {
    .ai-quick-row { flex-direction: column; }
    .ai-quick-btns { flex-direction: row; }
    .ai-quick-btns .btn { flex: 1; }
}

/* --- Von-Bis-Eingabemodus --- */
.fromto-row { display: flex; gap: 10px; margin-bottom: 12px; }
.fromto-field { flex: 1; min-width: 0; }
.fromto-field label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }

/* Größere Touch-Ziele in Sheets */
.sheet-body .field label { font-size: .9rem; margin-bottom: 8px; }
.sheet-body .k-input, .sheet-body .k-picker, .sheet-body .input { min-height: 48px; }
.sheet-body .field { margin-bottom: 18px; }

.hidden { display: none !important; }

/* Favoriten-Stern in Dropdowns (zuletzt verwendete Einträge oben) */
.fav-star { color: #f5b301; margin-right: 7px; font-size: .82em; }

/* --- Gruppen-Auswahl (Tags) & aktive Tage --- */
.group-picker, .day-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.group-empty { color: var(--text-muted); font-size: .85rem; margin: 0; }
.group-chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 13px; border: 1.5px solid var(--border); border-radius: 999px;
    background: var(--surface); cursor: pointer; font-weight: 600; font-size: .88rem;
    user-select: none; min-height: 42px;
}
.group-chip input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
.group-chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-600); }
.day-picker .group-chip { min-width: 52px; justify-content: center; }
/* Mehrfachauswahl (z. B. Abwesenheiten löschen) */
.bulk-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.bulk-check { width: 18px; height: 18px; accent-color: var(--primary); margin-top: 3px; flex: 0 0 auto; }
.m-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* SMS-Empfängerliste */
.recipient-list { display: flex; flex-wrap: wrap; gap: 8px; max-height: 260px; overflow-y: auto; }
.recipient {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px;
    background: var(--surface-2); font-size: .84rem;
}
.recipient.invalid { border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.07); }
.recipient .rc-name { font-weight: 600; }
.recipient .rc-num { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.recipient .rc-bad { color: #dc2626; }

/* Mitgliederliste in der Rollenverwaltung */
.member-list { display: flex; flex-direction: column; gap: 6px; max-height: 380px; overflow-y: auto; padding-right: 4px; }

.date-row { display: flex; gap: 8px; align-items: center; }
.date-row .btn { flex: 0 0 auto; }

/* Gruppen-Badges in Grids/Karten */
.group-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.group-badges .badge { font-size: .72rem; padding: 2px 8px; }
.group-badges-empty { color: var(--text-soft); }

/* --- Sheet-Tab-Navigation --- */
.sheet-tabs {
    display: flex; gap: 5px; margin: 0 0 18px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 14px; padding: 5px;
    position: sticky; top: -4px; z-index: 2;
}
.sheet-tab {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 54px; padding: 8px 4px;
    border: none; border-radius: 10px; background: transparent;
    color: var(--text-muted); font-weight: 600; font-size: .74rem; cursor: pointer;
    white-space: nowrap;
}
.sheet-tab i { font-size: 1.1rem; }
.sheet-tab.active { background: var(--surface); color: var(--primary-600); box-shadow: var(--shadow-sm); }
.sheet-tab:active { transform: scale(.96); }

/* --- Geräte-Zeilen (daumenfreundlich) --- */
.equip-card {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 18px; padding: 12px 12px 14px; margin-bottom: 14px;
}
.equip-card-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.equip-idx {
    flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px;
    display: grid; place-items: center;
    background: var(--primary-soft); color: var(--primary-600);
    font-weight: 800; font-size: .82rem;
}
.equip-del {
    flex: 0 0 auto; width: 44px; height: 44px; color: var(--danger);
}
.equip-dur-val {
    text-align: center; font-size: 1.55rem; font-weight: 800;
    letter-spacing: -.02em; margin: 2px 0 12px; font-variant-numeric: tabular-nums;
}

/* Bedingt eingeblendete Unterfelder */
.field-indent {
    border-left: 3px solid var(--primary-soft);
    padding-left: 12px; margin-left: 2px;
    animation: field-in .18s ease;
}
@keyframes field-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* Leerzustand in Sheet-Tabs */
.sheet-empty {
    text-align: center; color: var(--text-soft);
    padding: 26px 12px; margin-bottom: 12px;
}
.sheet-empty i { font-size: 2rem; opacity: .5; margin-bottom: 8px; display: block; }
.sheet-empty p { margin: 0; font-size: .9rem; }

/* --- Bottom-Sheet (mobiles Erfassen/Bearbeiten) --- */
.sheet-overlay {
    position: fixed; inset: 0; z-index: 60;
    background: rgba(0,0,0,.5); backdrop-filter: blur(2px);
    animation: sheet-fade .15s ease;
}
.sheet-panel {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
    display: flex; flex-direction: column;
    max-height: 92vh;
    background: var(--surface);
    border-radius: 22px 22px 0 0;
    box-shadow: var(--shadow-lg);
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(0);   /* Ruheposition unabhängig von der Animation */
    animation: sheet-fade .2s ease;
}
.sheet-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px 12px; border-bottom: 1px solid var(--border);
}
.sheet-head h3 { margin: 0; font-size: 1.12rem; }
.sheet-body { padding: 16px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-foot {
    display: flex; gap: 10px; padding: 12px 18px 16px; border-top: 1px solid var(--border);
}
.sheet-foot .btn { flex: 1; padding: 13px; }

@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet-panel, .sheet-overlay { animation: none; } }

/* Auf großen Screens als zentrierter Dialog (falls doch geöffnet) */
@media (min-width: 821px) {
    .sheet-panel {
        left: 50%; right: auto; bottom: auto; top: 50%;
        transform: translate(-50%, -50%);
        width: 540px; max-height: 88vh;
        border-radius: var(--radius-lg); animation: none;
    }
}

/* Bottom-Navigation (nur mobil sichtbar) */
.bottom-nav { display: none; }

/* --- Mobile (<= 820px) --- */
@media (max-width: 820px) {
    :root { --topbar-h: 58px; }

    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }

    /* Sidebar als Off-Canvas-Drawer */
    .sidebar {
        transform: translateX(-100%);
        width: min(84vw, var(--sidebar-w));
        padding-top: env(safe-area-inset-top);
    }
    .main { margin-left: 0; }
    .app.mobile-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .app.collapsed .main { margin-left: 0; }
    .app.mobile-open .sidebar-backdrop {
        display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 39;
        backdrop-filter: blur(2px);
    }

    /* Topbar mit Notch-Safe-Area + größere Touch-Ziele */
    .topbar {
        height: calc(var(--topbar-h) + env(safe-area-inset-top));
        padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
    }
    .icon-btn { width: 44px; height: 44px; }
    .user-chip { padding: 4px 10px 4px 5px; }
    .user-chip .user-role { display: none; }
    .user-chip > span:not(.user-avatar) { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* Inhalt: Safe-Area + Platz für die Bottom-Navigation */
    .content {
        padding: 16px max(14px, env(safe-area-inset-left)) calc(80px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-right));
    }
    .page-head h1 { font-size: 1.35rem; }
    .page-head { margin-bottom: 16px; }

    .card-lg { padding: 20px; }
    .stat { padding: 16px; }
    .stat-value { font-size: 1.6rem; }
    .btn { padding: 12px 18px; }   /* fingerfreundlich */

    /* Telerik-Grid darf die Seite nie horizontal schieben */
    .k-grid { border: none; max-width: 100%; }
    .k-grid-content { -webkit-overflow-scrolling: touch; }
    /* Telerik-Popup fast im Vollbild */
    .k-window, .k-dialog { width: 96vw !important; max-width: 96vw !important; }

    /* Login mittig, volle Breite */
    .login-card { padding: 28px 22px; }

    /* Bottom-Navigation */
    .bottom-nav {
        display: flex;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 38;
        background: color-mix(in srgb, var(--surface) 92%, transparent);
        backdrop-filter: blur(14px);
        border-top: 1px solid var(--border);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .bottom-nav a {
        flex: 1;
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        padding: 9px 4px 7px;
        color: var(--text-soft);
        font-size: .64rem; font-weight: 600;
        min-height: 54px;
        text-decoration: none;
    }
    .bottom-nav a i { font-size: 1.15rem; }
    .bottom-nav a.active { color: var(--primary-600); }
    .bottom-nav a.active i { transform: translateY(-1px); }
}

/* Sehr schmale Geräte */
@media (max-width: 380px) {
    .stat-value { font-size: 1.45rem; }
    .page-head h1 { font-size: 1.25rem; }
}

/* ============================================================
   Grafische Politur (Feinschliff-Ebene, 2026-07-08)
   Nur Verfeinerungen – überschreibt bewusst per Kaskade.
   ============================================================ */

/* Sanftere Typografie mit Inter-Features */
body { font-feature-settings: "cv02","cv03","cv04","cv11"; letter-spacing: -.006em; }
h1 { letter-spacing: -.022em; }
.subtitle { color: var(--text-muted); }

/* Globale, dezente Übergänge für Interaktives */
.btn, .card, .stat, .admin-tile, .m-card, .badge, .seg-btn, .nav-item,
.group-chip, .sheet-tab, .icon-btn, input.input, .recipient {
    transition: background-color .16s ease, border-color .16s ease, color .16s ease,
                box-shadow .18s ease, transform .12s ease;
}

/* Einheitlicher, gut sichtbarer Fokusring (Barrierefreiheit + Wertigkeit) */
:where(a, button, .btn, input, textarea, select, .group-chip, .seg-btn):focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-soft), 0 0 0 1px var(--primary);
    border-radius: var(--radius-sm);
}

/* Karten: weicher Rahmen + Hebe-Effekt bei klickbaren Kacheln */
.card { border: 1px solid var(--border); }
.admin-tile, a.stat, a.card { cursor: pointer; }
.admin-tile:hover, a.stat:hover, a.card.card-lg:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}

/* Statistikkacheln: Zahl kräftiger, Icon leicht angehoben */
.stat-value { letter-spacing: -.03em; }
.stat-ico { box-shadow: var(--shadow-sm); }

/* Buttons: klarer Druck-Feedback + weicher Primär-Schatten */
.btn { font-weight: 600; }
.btn:active { transform: translateY(1px); }
.btn-primary { box-shadow: 0 6px 16px -6px var(--primary); }
.btn-primary:hover { box-shadow: 0 10px 22px -8px var(--primary); }
.btn-ghost:hover { background: var(--surface-hover); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

/* Badges: etwas kompakter und ausgewogener */
.badge { font-weight: 600; letter-spacing: .01em; }

/* Eingaben: ruhigerer Grundzustand, klarer Fokus */
.input { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: border-color .16s ease, box-shadow .16s ease; }
.input:hover { border-color: color-mix(in srgb, var(--primary) 25%, var(--border)); }

/* Seitenkopf: mehr Luft und feine Trennung */
.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 0 0 2px; }

/* Sidebar: aktiver Punkt bekommt einen Akzentbalken */
.nav-item { position: relative; border-radius: 11px; }
.nav-item.active::before, .nav-item[aria-current]::before {
    content: ""; position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px; border-radius: 3px; background: var(--accent);
}

/* Telerik-Grid harmonisieren (Kopf ruhiger, Zeilen-Hover, Rahmen weg) */
.k-grid { border: none; border-radius: var(--radius); overflow: hidden; font-family: var(--font-sans); }
.k-grid .k-grid-header, .k-grid th.k-header {
    background: var(--surface-2); border-color: var(--border);
    text-transform: uppercase; font-size: .72rem; letter-spacing: .04em; color: var(--text-muted); font-weight: 700;
}
.k-grid td { border-color: var(--border); }
.k-grid tbody tr:hover, .k-grid .k-table-row:hover { background: var(--surface-hover); }
.k-grid .k-grid-toolbar { background: var(--surface); border-color: var(--border); }

/* Dezente, moderne Scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--text-soft) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text-soft) 55%, transparent); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-soft); background-clip: content-box; }

/* Bottom-Sheet: etwas mehr Tiefe */
.sheet-panel { box-shadow: 0 -12px 40px rgba(15,23,42,.18); }

/* Segmentierte Umschalter: aktiver Zustand klarer */
.seg-btn.active { box-shadow: var(--shadow-sm); }

/* Leerzustände etwas freundlicher */
.empty-state .empty-ico { color: var(--text-soft); }

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) { .admin-tile, a.stat, .btn { animation: none !important; transition: none !important; } }

/* ---- Sprachumschalter (Topbar) ---- */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); }
.lang-opt { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 26px; padding: 0 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; color: var(--text-muted); text-decoration: none; transition: background .15s ease, color .15s ease; }
.lang-opt:hover { color: var(--text); }
.lang-opt.active { background: var(--primary); color: #fff; }

/* ---- Impersonation-Hinweis (Admin ist als anderer Benutzer angemeldet) ---- */
.impersonation-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 16px;
    background: linear-gradient(135deg, #b45309, #d97706);
    color: #fff;
    font-size: .86rem;
    font-weight: 500;
}
.impersonation-bar strong { font-weight: 700; }
.impersonation-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 999px;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font: 600 .82rem 'Inter', sans-serif;
    cursor: pointer;
}
.impersonation-back:hover { background: rgba(255, 255, 255, .28); }
