/* ==========================================================================
   LAI·MEN Mitarbeiter-App – Design System
   ========================================================================== */

:root {
    --bg: #060B18;
    --bg-elev: #0B1328;
    --bg-elev-2: #101a35;
    --surface: rgba(255, 255, 255, 0.035);
    --surface-2: rgba(255, 255, 255, 0.06);
    --surface-3: rgba(255, 255, 255, 0.09);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);
    --text: #E8EEF7;
    --text-soft: #C4CEDD;
    --muted: #8593AD;

    --green: #5BB55A;
    --green-hi: #82D681;
    --green-deep: #3E8F3D;
    --green-glow: rgba(91, 181, 90, 0.35);
    --sun: #F5ED30;
    --zt: #F5D63D;
    --zt-glow: rgba(245, 214, 61, 0.30);
    --danger: #F87171;
    --danger-bg: rgba(248, 113, 113, 0.12);
    --info: #60A5FA;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;

    --shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.75);

    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Outfit', 'Inter', system-ui, sans-serif;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    --tabbar-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0; }
a { color: var(--green-hi); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

::selection { background: var(--green); color: var(--bg); }

:focus-visible {
    outline: 2px solid var(--green-hi);
    outline-offset: 2px;
}

/* ---------- Hintergrund ---------- */

.bg-decor { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; animation: float 22s var(--ease) infinite alternate; }
.orb-1 { width: 520px; height: 520px; background: radial-gradient(circle, rgba(91, 181, 90, 0.45), transparent 70%); top: -180px; right: -160px; }
.orb-2 { width: 460px; height: 460px; background: radial-gradient(circle, rgba(56, 89, 189, 0.45), transparent 70%); bottom: -160px; left: -160px; animation-delay: -8s; }
.orb-3 { width: 300px; height: 300px; background: radial-gradient(circle, rgba(245, 237, 48, 0.16), transparent 70%); top: 40%; left: 55%; animation-delay: -14s; }
.grid-overlay {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
}
@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-40px, 30px) scale(1.08); }
}

/* ---------- Splash ---------- */

.splash { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 28px; }
.splash-logo { width: 220px; height: auto; animation: pulse 2s ease-in-out infinite; }
.spinner {
    width: 30px; height: 30px; border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.1); border-top-color: var(--green);
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.7; transform: scale(0.98); } }

/* ---------- Buttons ---------- */

.btn {
    --btn-bg: var(--surface-2);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 0 18px;
    border-radius: 14px; border: 1px solid var(--border);
    background: var(--btn-bg); color: var(--text);
    font-weight: 600; font-size: 14.5px; letter-spacing: 0.01em;
    transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.25s, opacity 0.2s;
    white-space: nowrap; user-select: none;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-primary {
    background: linear-gradient(135deg, var(--green-hi), var(--green) 55%, var(--green-deep));
    border-color: transparent; color: #04140a;
    box-shadow: 0 10px 30px -10px var(--green-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover { background: linear-gradient(135deg, #95e294, var(--green-hi) 55%, var(--green)); box-shadow: 0 14px 36px -10px var(--green-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35); border-color: transparent; }
.btn-danger { background: var(--danger-bg); color: #fecaca; border-color: rgba(248, 113, 113, 0.25); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); border-color: rgba(248, 113, 113, 0.4); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-block { width: 100%; }
.btn-lg { min-height: 54px; font-size: 16px; border-radius: 16px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 11px; }
.btn-icon { width: 42px; min-height: 42px; padding: 0; border-radius: 12px; }
.btn-icon.btn-sm { width: 36px; min-height: 36px; }

.btn .spinner { width: 18px; height: 18px; border-width: 2px; border-top-color: currentColor; }

/* ---------- Auth (Login / Setup) ---------- */

.auth {
    min-height: 100dvh; display: grid; place-items: center; grid-template-columns: minmax(0, 1fr);
    padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
}
.auth-card {
    width: 100%; max-width: 420px;
    padding: 36px 28px 28px;
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(16, 26, 53, 0.82), rgba(8, 14, 30, 0.88));
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    animation: rise 0.6s var(--ease) both;
}
.auth-logo { width: 210px; height: auto; margin: 0 auto 26px; }
.auth-card h1 { font-size: 26px; text-align: center; }
.auth-sub { text-align: center; color: var(--muted); margin: 8px 0 28px; font-size: 14px; }
.auth-form { display: grid; gap: 16px; }
.auth-foot { margin-top: 22px; text-align: center; font-size: 12.5px; color: var(--muted); }
.auth-foot a { color: var(--text-soft); }
.install-hint {
    margin-top: 18px; display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: 14px;
    background: rgba(91, 181, 90, 0.08); border: 1px dashed rgba(91, 181, 90, 0.35);
    font-size: 13px; color: var(--text-soft);
}
.install-hint .btn { margin-left: auto; }
.install-hint > svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--green-hi); }

@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------- Formularfelder ---------- */

.field { display: grid; gap: 7px; }
.field > .label, .field > label {
    font-size: 12.5px; font-weight: 600; color: var(--text-soft);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.field .hint { font-size: 12.5px; color: var(--muted); }
.req { color: var(--green-hi); }

.input, .select {
    width: 100%; min-height: 52px; padding: 0 16px;
    border-radius: 14px; border: 1px solid var(--border-strong);
    background: rgba(3, 7, 18, 0.55); color: var(--text);
    font: inherit; font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: #5b6882; }
.input:hover, .select:hover { border-color: rgba(255, 255, 255, 0.22); }
.input:focus, .select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(91, 181, 90, 0.18); background: rgba(3, 7, 18, 0.75); }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.15); }
.input[type="date"] { color-scheme: dark; }
.input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.8); cursor: pointer; }
.select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238593AD' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px;
}
.select option { background: var(--bg-elev); }

.input-wrap { position: relative; }
.input-wrap .input { padding-right: 52px; }
.input-wrap .suffix {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    min-width: 40px; height: 40px; display: grid; place-items: center;
    border-radius: 10px; color: var(--muted); font-weight: 700;
}
.input-wrap .suffix.btn-ghost { cursor: pointer; border: 0; background: transparent; }
.input-wrap .suffix.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.input-wrap .suffix svg { width: 20px; height: 20px; }

.form-error {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px 14px; border-radius: 12px;
    background: var(--danger-bg); border: 1px solid rgba(248, 113, 113, 0.3);
    color: #fecaca; font-size: 14px;
    animation: shake 0.4s;
}
.form-error svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* Segmented AC / ZT */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg {
    position: relative; overflow: hidden;
    display: grid; gap: 4px; justify-items: start; text-align: left;
    padding: 16px 16px 14px; border-radius: 18px;
    border: 1.5px solid var(--border-strong); background: rgba(3, 7, 18, 0.45);
    transition: border-color 0.25s, background 0.25s, transform 0.15s var(--ease), box-shadow 0.3s;
}
.seg:active { transform: scale(0.97); }
.seg .seg-code { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: 0.02em; }
.seg .seg-desc { font-size: 12.5px; color: var(--muted); }
.seg .seg-check {
    position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; border-radius: 50%;
    border: 1.5px solid var(--border-strong); display: grid; place-items: center;
    transition: all 0.25s var(--ease);
}
.seg .seg-check svg { width: 14px; height: 14px; opacity: 0; transform: scale(0.5); transition: all 0.25s var(--ease); }
.seg[aria-checked="true"] .seg-check svg { opacity: 1; transform: none; }
.seg-ac[aria-checked="true"] { border-color: var(--green); background: linear-gradient(160deg, rgba(91, 181, 90, 0.22), rgba(91, 181, 90, 0.04)); box-shadow: 0 12px 30px -14px var(--green-glow); }
.seg-ac[aria-checked="true"] .seg-code { color: var(--green-hi); }
.seg-ac[aria-checked="true"] .seg-check { background: var(--green); border-color: var(--green); color: #04140a; }
.seg-zt[aria-checked="true"] { border-color: var(--zt); background: linear-gradient(160deg, rgba(245, 214, 61, 0.2), rgba(245, 214, 61, 0.03)); box-shadow: 0 12px 30px -14px var(--zt-glow); }
.seg-zt[aria-checked="true"] .seg-code { color: var(--zt); }
.seg-zt[aria-checked="true"] .seg-check { background: var(--zt); border-color: var(--zt); color: #1a1500; }

/* Aufklapp-Bereiche */
.reveal { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.45s var(--ease), opacity 0.35s, margin 0.45s var(--ease); opacity: 0; margin-top: -22px; }
.reveal > .reveal-inner { overflow: hidden; min-height: 0; display: grid; gap: 18px; }
.reveal.open { grid-template-rows: 1fr; opacity: 1; margin-top: 0; }

/* Schalter */
.switch-row {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; border-radius: 16px;
    background: rgba(3, 7, 18, 0.45); border: 1px solid var(--border-strong);
    cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.switch-row:hover { border-color: rgba(255, 255, 255, 0.22); }
.switch-row .sr-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-soft); flex-shrink: 0; transition: all 0.25s; }
.switch-row .sr-icon svg { width: 20px; height: 20px; }
.switch-row .sr-text { flex: 1; display: grid; }
.switch-row .sr-title { font-weight: 600; }
.switch-row .sr-sub { font-size: 12.5px; color: var(--muted); }
.switch-row.on { border-color: rgba(91, 181, 90, 0.55); background: rgba(91, 181, 90, 0.07); }
.switch-row.on .sr-icon { background: rgba(91, 181, 90, 0.2); color: var(--green-hi); }

.switch { position: relative; width: 52px; height: 30px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; border-radius: 99px; background: rgba(255, 255, 255, 0.14); transition: background 0.25s; }
.switch .thumb { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); transition: transform 0.3s var(--ease); }
.switch input:checked ~ .track { background: var(--green); }
.switch input:checked ~ .thumb { transform: translateX(22px); }
.switch input:focus-visible ~ .track { outline: 2px solid var(--green-hi); outline-offset: 2px; }

/* Stepper (ZT-Anzahl) */
.stepper { display: grid; grid-template-columns: 56px 1fr 56px; gap: 10px; }
.stepper .btn { min-height: 56px; border-radius: 14px; font-size: 22px; }
.stepper .input { text-align: center; font-family: var(--font-display); font-size: 26px; font-weight: 700; min-height: 56px; }

/* Datei-Upload */
.dropzone {
    position: relative; display: grid; justify-items: center; gap: 6px; text-align: center;
    padding: 22px 16px; border-radius: 18px;
    border: 1.5px dashed rgba(255, 255, 255, 0.2); background: rgba(3, 7, 18, 0.35);
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--green); background: rgba(91, 181, 90, 0.06); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .dz-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: rgba(91, 181, 90, 0.14); color: var(--green-hi); margin-bottom: 4px; }
.dropzone .dz-icon svg { width: 24px; height: 24px; }
.dropzone strong { font-size: 14.5px; }
.dropzone span { font-size: 12.5px; color: var(--muted); }
.dz-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dz-actions .btn { position: relative; overflow: hidden; }
.dz-actions input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.thumb-item {
    position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden;
    background: var(--surface-2); border: 1px solid var(--border);
    animation: pop 0.35s var(--ease) both;
}
.thumb-item img { width: 100%; height: 100%; object-fit: cover; }
.thumb-item .file-tile { width: 100%; height: 100%; display: grid; place-content: center; justify-items: center; gap: 4px; padding: 6px; text-align: center; }
.thumb-item .file-tile svg { width: 26px; height: 26px; color: var(--danger); }
.thumb-item .file-tile small { font-size: 10.5px; color: var(--muted); word-break: break-all; line-height: 1.2; max-height: 2.4em; overflow: hidden; }
.thumb-item .thumb-remove {
    position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 50%;
    border: 0; background: rgba(6, 11, 24, 0.85); color: #fff; display: grid; place-items: center;
    backdrop-filter: blur(6px);
}
.thumb-item .thumb-remove svg { width: 14px; height: 14px; }
.thumb-item .thumb-badge { position: absolute; left: 5px; bottom: 5px; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: rgba(6, 11, 24, 0.85); color: var(--green-hi); }
@keyframes pop { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }

.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--green-hi)); transition: width 0.2s; }

/* ---------- App-Shell ---------- */

.shell { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px;
    padding: calc(10px + var(--safe-top)) 18px 10px;
    background: rgba(6, 11, 24, 0.72);
    backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border-bottom: 1px solid var(--border);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar .brand img { height: 40px; width: auto; }
.topbar .spacer { flex: 1; }
.topbar .who { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
    display: grid; place-items: center;
    font-family: var(--font-display); font-weight: 700; font-size: 14px;
    background: linear-gradient(135deg, rgba(91, 181, 90, 0.3), rgba(56, 89, 189, 0.3));
    border: 1px solid var(--border-strong);
}
.who-text { display: grid; line-height: 1.2; text-align: right; }
.who-text strong { font-size: 13.5px; }
.who-text small { font-size: 11.5px; color: var(--muted); }
@media (max-width: 520px) {
    .who-text { display: none; }
    .topbar .brand img { height: 36px; }
}

.main {
    flex: 1; width: 100%; max-width: 760px; margin: 0 auto;
    padding: 22px 16px calc(var(--tabbar-h) + 28px + var(--safe-bottom));
}
.main.wide { max-width: 1240px; }

.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; justify-content: space-around; gap: 4px;
    padding: 8px 10px calc(8px + var(--safe-bottom));
    background: rgba(8, 13, 28, 0.85);
    backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-top: 1px solid var(--border);
}
.tab {
    flex: 1; max-width: 140px; display: grid; justify-items: center; gap: 3px;
    padding: 8px 4px; border-radius: 14px; border: 0; background: transparent;
    color: var(--muted); font-size: 11.5px; font-weight: 600;
    transition: color 0.2s, background 0.2s;
}
.tab svg { width: 23px; height: 23px; transition: transform 0.3s var(--ease); }
.tab:hover { color: var(--text-soft); }
.tab.active { color: var(--green-hi); background: rgba(91, 181, 90, 0.1); }
.tab.active svg { transform: translateY(-1px) scale(1.08); }

@media (min-width: 960px) {
    .shell.has-sidebar { padding-left: 248px; }
    .shell.has-sidebar .tabbar {
        top: 0; right: auto; width: 248px; flex-direction: column; justify-content: flex-start; gap: 6px;
        padding: 96px 16px 24px; border-top: 0; border-right: 1px solid var(--border);
        background: rgba(8, 13, 28, 0.6);
    }
    .shell.has-sidebar .tab { flex: 0 0 auto; max-width: none; display: flex; align-items: center; gap: 12px; padding: 12px 14px; font-size: 14px; }
    .shell.has-sidebar .topbar { margin-left: -248px; padding-left: 26px; z-index: 45; }
    .main { padding-bottom: 48px; }
    .shell:not(.has-sidebar) .main { padding-bottom: calc(var(--tabbar-h) + 28px); }
}

/* ---------- Seiten-Elemente ---------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.card {
    position: relative;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(16, 26, 53, 0.7), rgba(9, 15, 32, 0.72));
    border: 1px solid var(--border);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.card-pad { padding: 22px 18px; }
@media (min-width: 600px) { .card-pad { padding: 26px; } }

.form-stack { display: grid; gap: 22px; }
.form-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.form-title h2 { font-size: 21px; }
.form-title .badge { font-size: 12px; }

.anim-in { animation: rise 0.45s var(--ease) both; }
.stagger > * { animation: rise 0.45s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: 0.04s; }
.stagger > *:nth-child(3) { animation-delay: 0.08s; }
.stagger > *:nth-child(4) { animation-delay: 0.12s; }
.stagger > *:nth-child(5) { animation-delay: 0.16s; }
.stagger > *:nth-child(n+6) { animation-delay: 0.2s; }

/* Badges / Chips */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 99px;
    font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em;
    background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border);
    white-space: nowrap;
}
.badge-ac { background: rgba(91, 181, 90, 0.14); color: var(--green-hi); border-color: rgba(91, 181, 90, 0.3); }
.badge-zt { background: rgba(245, 214, 61, 0.12); color: var(--zt); border-color: rgba(245, 214, 61, 0.3); }
.badge-ok { background: rgba(91, 181, 90, 0.12); color: var(--green-hi); border-color: rgba(91, 181, 90, 0.25); }
.badge-off { background: var(--danger-bg); color: #fca5a5; border-color: rgba(248, 113, 113, 0.25); }
.badge-admin { background: rgba(96, 165, 250, 0.12); color: #93c5fd; border-color: rgba(96, 165, 250, 0.3); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Monatsnavigation */
.month-nav {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
    margin-bottom: 16px;
}
.month-nav h2 { font-size: 18px; text-align: center; flex: 1; }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
@media (min-width: 600px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat {
    padding: 14px 14px 12px; border-radius: 18px;
    background: var(--surface); border: 1px solid var(--border);
    display: grid; gap: 2px; min-width: 0;
}
.stat .stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .stat-value { font-family: var(--font-display); font-size: 22px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.green .stat-value { color: var(--green-hi); }
.stat.yellow .stat-value { color: var(--zt); }
.stat.cyan .stat-value { color: #38bdf8; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 22px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi {
    position: relative; overflow: hidden;
    padding: 18px; border-radius: 20px;
    background: linear-gradient(160deg, rgba(16, 26, 53, 0.85), rgba(9, 15, 32, 0.8));
    border: 1px solid var(--border);
    transition: transform 0.25s var(--ease), border-color 0.25s;
}
.kpi:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.kpi::after { content: ''; position: absolute; width: 120px; height: 120px; border-radius: 50%; right: -40px; top: -40px; background: var(--kpi-glow, rgba(91, 181, 90, 0.18)); filter: blur(30px); }
.kpi .kpi-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--kpi-color, var(--green-hi)); margin-bottom: 12px; }
.kpi .kpi-icon svg { width: 20px; height: 20px; }
.kpi .kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi .kpi-value { font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }
.kpi.k-yellow { --kpi-color: var(--zt); --kpi-glow: rgba(245, 214, 61, 0.15); }
.kpi.k-blue { --kpi-color: #93c5fd; --kpi-glow: rgba(96, 165, 250, 0.16); }
.kpi.k-pink { --kpi-color: #f9a8d4; --kpi-glow: rgba(244, 114, 182, 0.14); }

/* Einträge */
.day-group { margin-bottom: 18px; }
.day-label { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; margin: 0 4px 8px; display: flex; justify-content: space-between; }
.entry {
    display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
    padding: 14px; border-radius: 18px; margin-bottom: 10px;
    background: var(--surface); border: 1px solid var(--border);
    transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.entry:hover { border-color: var(--border-strong); background: var(--surface-2); }
.entry-cat {
    width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center;
    font-family: var(--font-display); font-weight: 800; font-size: 16px;
}
.entry-cat.ac { background: rgba(91, 181, 90, 0.15); color: var(--green-hi); border: 1px solid rgba(91, 181, 90, 0.3); }
.entry-cat.zt { background: rgba(245, 214, 61, 0.12); color: var(--zt); border: 1px solid rgba(245, 214, 61, 0.3); }
.entry-main { min-width: 0; display: grid; gap: 3px; }
.entry-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; color: var(--muted); }
.entry-meta span { display: inline-flex; align-items: center; gap: 4px; }
.entry-meta svg { width: 14px; height: 14px; }
.entry-actions { display: flex; gap: 4px; }
.entry-files { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.mini-thumb {
    width: 54px; height: 54px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border);
    background: var(--surface-2); display: grid; place-items: center; padding: 0; cursor: zoom-in;
    transition: transform 0.2s var(--ease), border-color 0.2s;
}
.mini-thumb:hover { transform: scale(1.05); border-color: var(--green); }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini-thumb svg { width: 22px; height: 22px; color: var(--danger); }
.mini-thumb.pdf { cursor: pointer; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); display: grid; justify-items: center; gap: 10px; }
.empty .empty-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-soft); }
.empty .empty-icon svg { width: 30px; height: 30px; }
.empty h3 { color: var(--text); font-size: 17px; }

/* Filter */
.filters { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin-bottom: 16px; padding: 16px; }
.filters .field > label, .filters .field > .label { font-size: 11px; }
.filters .input, .filters .select { min-height: 46px; font-size: 14.5px; border-radius: 12px; }
.filters .full { grid-column: 1 / -1; }
@media (min-width: 900px) { .filters { grid-template-columns: 1.3fr 1fr 1fr 0.8fr 1.3fr; align-items: end; } .filters .full { grid-column: auto; } }

.presets { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.presets::-webkit-scrollbar { display: none; }
.chip {
    flex-shrink: 0; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--border-strong);
    background: transparent; color: var(--text-soft); font-size: 13px; font-weight: 600;
    transition: all 0.2s;
}
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--green); border-color: var(--green); color: #04140a; }

/* Tabelle (responsive) */
.table-wrap { overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--muted); padding: 14px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 700; border-top: 1px solid var(--border-strong); padding: 14px 16px; background: rgba(255, 255, 255, 0.02); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .muted { color: var(--muted); }
.table .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 12.5px; }
.cell-user small { display: block; color: var(--muted); font-size: 12px; }
.table .files-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.table .mini-thumb { width: 40px; height: 40px; border-radius: 10px; }

@media (max-width: 820px) {
    .table.responsive thead { display: none; }
    .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td, .table.responsive tfoot { display: block; width: 100%; }
    .table.responsive tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
    .table.responsive td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
    .table.responsive td::before { content: attr(data-label); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); text-align: left; }
    .table.responsive td.td-main { padding-bottom: 8px; }
    .table.responsive td.td-main::before { display: none; }
    .table.responsive td .row-actions, .table.responsive td .files-cell { justify-content: flex-end; }
    .table.responsive tfoot td { background: transparent; border: 0; }
}

/* Diagramm */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding: 10px 4px 0; }
.chart .bar {
    flex: 1; min-width: 4px; border-radius: 6px 6px 3px 3px; position: relative;
    background: linear-gradient(180deg, var(--green-hi), rgba(91, 181, 90, 0.25));
    transform-origin: bottom; animation: grow 0.7s var(--ease) both;
}
.chart .bar.empty-bar { background: rgba(255, 255, 255, 0.06); }
.chart .bar:hover { filter: brightness(1.25); }
.chart-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); padding: 8px 4px 0; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.section-title h2 { font-size: 18px; }

.grid-2 { display: grid; gap: 16px; }
@media (min-width: 1000px) { .grid-2 { grid-template-columns: 1.4fr 1fr; } }

/* Mitarbeiter-Karten */
.users-grid { display: grid; gap: 12px; }
@media (min-width: 700px) { .users-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .users-grid { grid-template-columns: repeat(3, 1fr); } }
.user-card { padding: 18px; display: grid; gap: 14px; transition: transform 0.25s var(--ease), border-color 0.25s; }
.user-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.user-card.inactive { opacity: 0.65; }
.user-card .uc-head { display: flex; align-items: center; gap: 12px; }
.user-card .uc-head .avatar { width: 46px; height: 46px; border-radius: 14px; font-size: 16px; }
.user-card .uc-name { font-weight: 700; font-size: 16px; }
.user-card .uc-user { color: var(--muted); font-size: 13px; }
.user-card .uc-stats { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.user-card .uc-stats strong { color: var(--text); display: block; font-size: 15px; }
.user-card .uc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.user-card .uc-actions .btn { flex: 1; }
.user-card .uc-actions .btn-icon { flex: 0 0 44px; }

/* Zugangsdaten-Karte */
.credentials {
    padding: 16px; border-radius: 16px; background: rgba(3, 7, 18, 0.6); border: 1px dashed rgba(91, 181, 90, 0.4);
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-all;
}

/* ---------- Modal / Sheet ---------- */

.modal-backdrop {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(2, 5, 12, 0.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: flex-end; justify-content: center;
    animation: fade 0.25s both;
}
.modal {
    width: 100%; max-width: 520px; max-height: 92dvh; overflow-y: auto;
    border-radius: 26px 26px 0 0;
    background: linear-gradient(180deg, #111b38, #0a1126);
    border: 1px solid var(--border-strong); border-bottom: 0;
    box-shadow: var(--shadow-lg);
    padding: 10px 20px calc(22px + var(--safe-bottom));
    animation: sheet 0.4s var(--ease) both;
}
.modal::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.2); margin: 0 auto 16px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-head h2 { font-size: 20px; }
.modal-body { display: grid; gap: 16px; }
.modal-body p { color: var(--text-soft); }
.modal-foot { display: flex; gap: 10px; margin-top: 22px; }
.modal-foot .btn { flex: 1; }
.modal.wide { max-width: 760px; }
@media (min-width: 640px) {
    .modal-backdrop { align-items: center; padding: 24px; }
    .modal { border-radius: 26px; border-bottom: 1px solid var(--border-strong); padding: 24px 26px 26px; animation: zoom 0.35s var(--ease) both; }
    .modal::before { display: none; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes sheet { from { transform: translateY(100%); } }
@keyframes zoom { from { opacity: 0; transform: scale(0.94) translateY(10px); } }
.closing { animation: fade 0.2s reverse both; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 120; background: rgba(2, 5, 12, 0.94); display: grid; place-items: center; padding: 20px; animation: fade 0.2s both; }
.lightbox img { max-width: 100%; max-height: 82dvh; border-radius: 14px; box-shadow: var(--shadow-lg); animation: zoom 0.3s var(--ease) both; }
.lightbox .lb-bar { position: absolute; top: calc(14px + var(--safe-top)); right: 14px; left: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lightbox .lb-name { font-size: 13px; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Toasts ---------- */

.toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); top: calc(14px + var(--safe-top)); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 16px; border-radius: 16px;
    background: rgba(17, 27, 56, 0.95); border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg); backdrop-filter: blur(12px);
    font-size: 14px; font-weight: 500;
    animation: toastIn 0.45s var(--ease) both; pointer-events: auto;
}
.toast svg { width: 20px; height: 20px; flex-shrink: 0; }
.toast.success svg { color: var(--green-hi); }
.toast.error { border-color: rgba(248, 113, 113, 0.4); }
.toast.error svg { color: var(--danger); }
.toast.out { animation: toastOut 0.3s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(0.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px) scale(0.96); } }

/* Erfolgs-Animation */
.success-burst { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 26px 10px 8px; }
.success-burst .check-circle {
    width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center;
    background: radial-gradient(circle, rgba(91, 181, 90, 0.35), rgba(91, 181, 90, 0.08));
    border: 2px solid var(--green); color: var(--green-hi);
    animation: pop 0.5s var(--ease) both; box-shadow: 0 0 0 0 var(--green-glow);
    animation: pop 0.5s var(--ease) both, ring 1.6s 0.3s ease-out;
}
.success-burst .check-circle svg { width: 40px; height: 40px; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 0.5s 0.25s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 var(--green-glow); } 100% { box-shadow: 0 0 0 26px rgba(91, 181, 90, 0); } }

.text-muted { color: var(--muted); }
.text-green { color: var(--green-hi); }
.text-yellow { color: var(--zt); }
.text-cyan { color: #38bdf8; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mb-4 { margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.noscript { padding: 40px; text-align: center; }

/* Mehrere Kunden */
.customer-item-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.customer-item-row .input { flex: 1; }
.customer-item-row .btn-del-cust { flex-shrink: 0; width: 44px; height: 48px; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); border-radius: 12px; }
.customer-item-row .btn-del-cust:hover { color: var(--danger); background: rgba(248, 113, 113, 0.15); }
.btn-add-customer { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--green-hi); background: rgba(91, 181, 90, 0.08); border: 1px dashed rgba(91, 181, 90, 0.35); border-radius: 12px; padding: 10px 14px; cursor: pointer; transition: all 0.2s; width: 100%; margin-top: 4px; }
.btn-add-customer:hover { background: rgba(91, 181, 90, 0.16); border-color: var(--green); }
.btn-add-customer svg { width: 16px; height: 16px; }
.customer-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.cust-badge { display: inline-flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px; padding: 3px 8px; font-size: 12.5px; color: var(--text-soft); }
.cust-badge svg { width: 12px; height: 12px; opacity: 0.6; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
