:root {
    --bg: #f1f5f9;
    --card: #ffffff;
    --ink: #1e293b;
    --muted: #64748b;
    --line: #e2e8f0;
    --sidebar: #1c1b2b;
    --sidebar-2: #1e2b3c;
    --sidebar-ink: #cbd5e1;
    --sidebar-active: #5856D6;
    --primary: #5856D6;
    --primary-dark: #4744c7;
    --green: #16a34a;
    --amber: #d97706;
    --red: #dc2626;
    --blue: #2563eb;
    --shadow: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
    --shadow-lg: 0 10px 25px rgba(15,23,42,.08);
}

/* Das hidden-Attribut muss immer wirken. Ohne diese Regel setzt jede eigene
   display-Angabe es aus – ".btn { display: flex }" liess einen per JS
   versteckten Knopf sichtbar bleiben. */
[hidden] { display: none !important; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }

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

/* Seitenleiste (TimeMoto-Stil) */
.sidebar {
    width: 240px; flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-ink);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: .55rem;
    padding: 1.25rem 1rem; font-size: 1.2rem; font-weight: 700; color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.07);
    text-decoration: none;
}
.sidebar-brand:hover span { text-decoration: underline; }
.sidebar-brand span { line-height: 1.2; overflow-wrap: anywhere; max-width: 100%; }
.sidebar-brand .logo {
    width: 48px; height: 48px; border-radius: 12px; background: var(--primary);
    display: grid; place-items: center; color: #fff; font-size: 1.6rem; flex-shrink: 0;
}
.logo.logo-icon svg { width: 62%; height: 62%; display: block; }
.brand-logo { height: auto; width: auto; max-width: 190px; max-height: 60px; object-fit: contain; border-radius: 8px; display: block; }
.sidebar nav { padding: .75rem 0; overflow-y: auto; flex: 1; }
.nav-group-label {
    padding: .9rem 1.25rem .35rem; font-size: .7rem; letter-spacing: .08em;
    text-transform: uppercase; color: #64748b;
}
.nav-item {
    display: flex; align-items: center; gap: .7rem;
    padding: .6rem 1.25rem; color: var(--sidebar-ink); text-decoration: none;
    font-size: .92rem; border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--sidebar-2); color: #fff; }
.nav-item.active { background: var(--sidebar-2); color: #fff; border-left-color: var(--sidebar-active); }
.nav-item .ic { width: 22px; display: inline-flex; align-items: center; justify-content: center; opacity: .92; }
.nav-svg { width: 20px; height: 20px; display: block; }
.sidebar-user {
    padding: .9rem 1.25rem; border-top: 1px solid rgba(255,255,255,.07);
    font-size: .85rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.sidebar-user .who { color: #fff; font-weight: 600; }
.sidebar-user .role { color: #64748b; font-size: .75rem; }

/* Helles Farbschema: helle Seitenleiste statt dunkler. */
body.theme-hell { --sidebar: #ffffff; --sidebar-2: #eef2f7; --sidebar-ink: #475569; }
body.theme-hell .sidebar { border-right: 1px solid var(--line); }
body.theme-hell .sidebar-brand { color: var(--ink); border-bottom-color: var(--line); }
body.theme-hell .nav-group-label { color: #94a3b8; }
body.theme-hell .nav-item:hover,
body.theme-hell .nav-item.active { color: var(--ink); }
body.theme-hell .sidebar-user { border-top-color: var(--line); }
body.theme-hell .sidebar-user .who { color: var(--ink); }
body.theme-hell .sidebar-user .role { color: var(--muted); }
body.theme-hell .avatar-sm { color: var(--ink); }

/* Hauptbereich */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    display: flex; align-items: center; gap: 1rem; background: var(--card);
    border-bottom: 1px solid var(--line); padding: .85rem 1.75rem;
}
.topbar h1 { font-size: 1.25rem; margin: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; justify-content: flex-end; }
.topbar .clock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .95rem; }
.status-pill.my-status { text-decoration: none; font-size: .85rem; padding: .3rem .85rem; }
.status-pill.my-status:hover { filter: brightness(.97); }
.topbar .clock strong { color: var(--ink); }
.idle-timer {
    display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--muted);
    background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: .25rem .7rem;
    font-variant-numeric: tabular-nums;
}
.idle-timer strong { color: var(--ink); }
.idle-timer.idle-warn { color: var(--red); border-color: var(--red); background: #fef2f2; }
.idle-timer.idle-warn strong { color: var(--red); }
@media (max-width: 640px) { .idle-timer { display: none; } }
.content { padding: 1.75rem; max-width: 1200px; width: 100%; }
.vendor-footer { display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap;
    margin-top: 2rem; padding-top: 1.1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.vendor-footer a { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
.vendor-footer .vendor-logo { height: 22px; width: auto; display: block; }
.login-wrap .vendor-footer { border-top: none; color: rgba(255,255,255,.6); margin-top: 1.5rem; }
.login-wrap .vendor-footer .vendor-logo { height: 24px; }

/* ---------- Login (ohne Sidebar) ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--sidebar);
    background-image: radial-gradient(circle at 30% 20%, #33306a 0%, #1c1b2b 58%); padding: 1rem; }
.login-card { background: var(--card); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 2rem; width: 100%; max-width: 380px; }
/* Logo und Firmenname auf der Anmeldeseite. Ein breites Kundenlogo und der
   Name nebeneinander passen nicht immer in die 380 px der Karte – dann rutscht
   der Name in eine eigene Zeile darunter, statt gequetscht zu werden oder aus
   der Karte zu laufen. Beides bleibt mittig, damit es in jedem Fall wie
   gewollt aussieht. */
.login-card .logo-row { display: flex; flex-wrap: wrap; align-items: center;
    justify-content: center; gap: .55rem .8rem; margin-bottom: 1.25rem; text-align: center; }
.login-card .logo { width: 46px; height: 46px; border-radius: 11px; background: var(--primary); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.5rem; flex-shrink: 0; }
.login-card .logo-row .name { font-size: 1.35rem; font-weight: 700; }
/* Nicht fest 54 px hoch: Ein sehr breites Logo wuerde sonst an der
   Breitengrenze haengen bleiben und verzerrt wirken. So schrumpft es
   gleichmaessig, bis es passt. */
.login-card .brand-logo { height: auto; max-height: 54px; max-width: 100%; }
.login-card .logo-row .name { max-width: 100%; }

/* ---------- Laufende Uhr (Ladebildschirm) ----------
   Aus HTML-Elementen statt SVG, damit sich die Zeiger in jedem Browser um
   denselben Punkt drehen. Groesse ueber --zc, Farbe ueber currentColor. */
.ze-clock { --zc: 92px; position: relative; display: block; color: #fff;
    width: var(--zc); height: calc(var(--zc) + var(--zc) * .12); flex-shrink: 0; }
.ze-clock-sm { --zc: 46px; }
.ze-crown { position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: calc(var(--zc) * .26); height: calc(var(--zc) * .075);
    border-radius: calc(var(--zc) * .04); background: currentColor; }
.ze-crown::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    width: calc(var(--zc) * .07); height: calc(var(--zc) * .07); background: currentColor; }
.ze-face { position: absolute; left: 0; bottom: 0; width: var(--zc); height: var(--zc);
    border: calc(var(--zc) * .055) solid currentColor; border-radius: 50%; box-sizing: border-box; }
.ze-tick { position: absolute; left: 50%; top: calc(var(--zc) * .055);
    width: calc(var(--zc) * .035); height: calc(var(--zc) * .1); margin-left: calc(var(--zc) * -.0175);
    /* Drehpunkt = Mittelpunkt des Zifferblatts. Die Marke beginnt .11*zc unter
       der Aussenkante (Rahmen + Abstand), der Mittelpunkt liegt bei .5*zc. */
    background: currentColor; opacity: .55; transform-origin: 50% calc(var(--zc) * .39); }
.ze-t3 { transform: rotate(90deg); }
.ze-t6 { transform: rotate(180deg); }
.ze-t9 { transform: rotate(270deg); }
.ze-hand { position: absolute; left: 50%; bottom: 50%; background: currentColor;
    border-radius: calc(var(--zc) * .03); transform-origin: 50% 100%; }
.ze-hand-h { width: calc(var(--zc) * .055); margin-left: calc(var(--zc) * -.0275);
    height: calc(var(--zc) * .25); animation: ze-hand 8s linear infinite; }
.ze-hand-m { width: calc(var(--zc) * .04); margin-left: calc(var(--zc) * -.02);
    height: calc(var(--zc) * .35); animation: ze-hand 1.6s linear infinite; }
.ze-pin { position: absolute; left: 50%; top: 50%; width: calc(var(--zc) * .1); height: calc(var(--zc) * .1);
    margin: calc(var(--zc) * -.05) 0 0 calc(var(--zc) * -.05); border-radius: 50%; background: currentColor; }
@keyframes ze-hand { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ---------- Ladebildschirm bei der Anmeldung ---------- */
.splash { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center;
    background: var(--sidebar);
    background-image: radial-gradient(circle at 30% 20%, #33306a 0%, #1c1b2b 58%);
    animation: splash-in .18s ease both; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; padding: 1.5rem; text-align: center; }
.splash-logo { max-width: 260px; max-height: 78px; width: auto; height: auto; object-fit: contain; }
.splash-name { color: #fff; font-size: 1.3rem; font-weight: 700; }
.splash-text { color: rgba(255,255,255,.72); font-size: .9rem; letter-spacing: .02em; }
.splash-vendor { height: 26px; width: auto; margin-top: 1.4rem; opacity: .65; }
@keyframes splash-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Karten & Raster ---------- */
h1 { font-size: 1.4rem; margin: 0 0 1rem; }
h2 { font-size: 1.05rem; margin: 0 0 .85rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.card-narrow { max-width: 460px; }
.card-wide { max-width: 860px; }
.open-warning { border-color: #fca5a5; background: #fef2f2; }
.open-warning h2 { color: #b91c1c; }
.pending-warning { border-color: #93c5fd; background: #eff6ff; }
.pending-warning h2 { color: #1d4ed8; }
.note-box { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem; }
.note-box ul { color: var(--ink); }
.over-warning { border-color: #fcd34d; background: #fffbeb; }
.over-warning h2 { color: #92400e; }
.card h2 { display: flex; align-items: center; gap: .5rem; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }

/* Symbole in Ueberschriften, Schaltflaechen und Hinweisen. Gleicher Icon-Satz
   wie in der Seitenleiste (siehe icon_paths()), damit links und rechts
   dieselbe Bildsprache steht. Groesse und Farbe folgen dem Text. */
.ui-ic { width: 1.15em; height: 1.15em; flex: 0 0 auto; vertical-align: -.19em; }
.btn .ui-ic { width: 1.05em; height: 1.05em; }
.btn-small .ui-ic { width: 1em; height: 1em; }

.grid { display: grid; gap: 1rem; margin-bottom: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.dash-top { grid-template-columns: 1.1fr .9fr; align-items: start; }

/* Kennzahlen-Kacheln */
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.stat-label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.6rem; font-weight: 700; margin-top: .3rem; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--muted); font-size: .82rem; margin-top: .2rem; }

/* Grosse Stempeluhr */
.punch-clock { text-align: center; padding: .5rem 0 1rem; }
.punch-clock .big-time { font-size: 3rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.punch-clock .big-date { color: var(--muted); margin-bottom: 1rem; }
.status-pill { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .9rem; border-radius: 999px; font-weight: 600; font-size: .9rem; }
.status-pill .dot { width: 9px; height: 9px; border-radius: 50%; }
.pill-working { background: #dcfce7; color: #166534; }
.pill-working .dot { background: var(--green); }
.pill-break { background: #fef3c7; color: #92400e; }
.pill-break .dot { background: var(--amber); }
.pill-out { background: #e2e8f0; color: #475569; }
.pill-out .dot { background: #94a3b8; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .55rem 1rem; border: 1px solid var(--line); border-radius: 8px; background: #fff;
    color: var(--ink); cursor: pointer; font-size: .92rem; text-decoration: none; font-weight: 500; }
.btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-block { width: 100%; }
.btn-small { padding: .32rem .6rem; font-size: .82rem; }
.btn-lg { padding: .7rem 1.4rem; font-size: 1rem; }
.btn-danger { color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-right { margin-left: auto; }

.stamp-buttons { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }
.kiosk-qr { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--line); text-align: center; }
.kiosk-qr-code { display: inline-block; line-height: 0; background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--line); }
.kiosk-qr-code svg { width: 140px; height: 140px; display: block; }
.kiosk-qr .muted { margin-top: .5rem; font-size: .82rem; }
.btn-stamp { padding: .95rem 1.75rem; font-size: 1.02rem; font-weight: 600; color: #fff; border: none; min-width: 140px; }
.btn-in { background: var(--green); }
.btn-in:hover { background: #15803d; }
.btn-out { background: var(--red); }
.btn-out:hover { background: #b91c1c; }
.btn-break { background: var(--amber); }
.btn-break:hover { background: #b45309; }
.inline { display: inline; }

/* ---------- Formulare ---------- */
.form label, .form-inline label { display: block; margin-bottom: .85rem; font-size: .88rem; color: var(--muted); font-weight: 500; }
.form input, .form select, .form textarea,
.form-inline input, .form-inline select {
    display: block; width: 100%; margin-top: .3rem; padding: .55rem .65rem;
    border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; color: var(--ink); background: #fff;
}
.form input:focus, .form select:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
.form-inline { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.form-inline label { margin-bottom: 0; }
.form-inline input, .form-inline select { width: auto; }
.chk { display: inline-flex; align-items: center; gap: .35rem; color: var(--ink); font-weight: 400; }
.chk input { width: auto; display: inline; margin: 0; }
.chk-block { margin-top: 1.75rem; }
.weekdays { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; margin-bottom: .85rem; }
.weekdays legend { color: var(--muted); font-size: .85rem; padding: 0 .3rem; }
.weekdays .chk { margin-right: .9rem; }

/* Soll-Stunden je Wochentag: umbrechendes Raster, jedes Feld breit genug lesbar */
.weekday-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: .5rem; }
.weekday-grid label { margin: 0; text-align: center; font-size: .82rem; font-weight: 600; color: var(--ink); }
.weekday-grid input { text-align: center; width: 100%; margin-top: .3rem; padding: .5rem .3rem; font-variant-numeric: tabular-nums; }
/* Vom Geburtsdatum gesteuerte Bereiche (Jugendschutz, Berufsschule) */
.is-hidden { display: none !important; }
.minor-note { margin: .2rem 0 .8rem; padding: .6rem .8rem; border-radius: 8px; font-size: .85rem;
    background: #fff7ed; border: 1px solid #fdba74; color: #9a3412; }
.school-toggle { margin: .2rem 0 .8rem; }

/* Wochentag als Ankreuzfeld (Berufsschultage) */
.weekday-grid label.chk-day { display: flex; flex-direction: column; align-items: center; gap: .3rem;
    padding: .5rem .3rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--bg); }
.weekday-grid label.chk-day input { width: auto; margin: 0; padding: 0; accent-color: var(--primary); cursor: pointer; }
.weekday-grid label.chk-day:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }

/* ---------- Tabellen ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .55rem .65rem; border-bottom: 1px solid var(--line); }
.table thead th { color: var(--muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; }
.table tbody tr:hover { background: #f8fafc; }
.table tfoot th { border-top: 2px solid var(--line); font-size: .9rem; background: #f8fafc; }
.table-month td, .table-month th { white-space: nowrap; }
.row-weekend { background: #f8fafc; color: var(--muted); }
.row-today td { box-shadow: inset 3px 0 0 var(--primary); }
.actions { display: flex; gap: .4rem; flex-wrap: wrap; }

/* Badges */
.badge { display: inline-block; padding: .13rem .55rem; border-radius: 999px; font-size: .76rem; background: var(--line); color: var(--ink); font-weight: 500; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dcfce7; color: #166534; }
/* Rolle und Sonderstatus in der Benutzerliste */
.badge-role-admin { background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary-dark); font-weight: 600; }
.badge-role-employee { background: #e2e8f0; color: #475569; }
.badge-role-azubi { background: #ffedd5; color: #9a3412; font-weight: 600; }
.badge-minor { background: #ffedd5; color: #9a3412; font-weight: 600; }
.badge-exempt { background: #f1f5f9; color: #64748b; font-style: italic; }
.badge-open-nogo { background: #fef3c7; color: #92400e; }
.badge-open-none { background: #fee2e2; color: #991b1b; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-src { background: #e0f2fe; color: #075985; }
.badge-system { background: #ede9fe; color: #5b21b6; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* Statistik-Seite */
.stat-danger { border-color: #fca5a5; background: #fef2f2; }
.stat-danger .stat-value { color: #b91c1c; }
.saldo-pos-txt { color: var(--green); font-weight: 600; }
.saldo-neg-txt { color: var(--red); font-weight: 600; }
.stat-bars { display: flex; flex-direction: column; gap: .5rem; }
.stat-bar-row { display: grid; grid-template-columns: 64px 1fr 80px; align-items: center; gap: .75rem; }
.stat-bar-label { color: var(--muted); font-size: .85rem; }
.stat-bar-track { background: var(--bg); border-radius: 999px; height: 16px; overflow: hidden; }
.stat-bar-fill { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.stat-bar-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: .88rem; }

/* Abwesenheitsarten */
.abs-urlaub { background: #dbeafe; color: #1e40af; }
.abs-krank { background: #fee2e2; color: #991b1b; }
.abs-feiertag { background: #ede9fe; color: #5b21b6; }
.abs-gleitzeit { background: #cffafe; color: #155e75; }
.abs-fortbildung { background: #dcfce7; color: #166534; }
.abs-berufsschule { background: #ffedd5; color: #9a3412; }
.abs-unbezahlt { background: #f1f5f9; color: #475569; }
.row-absence { background: #f0f9ff; }

/* Anwesenheits-Board */
/* Nebeneinander statt untereinander: Bei 60 Mitarbeitern ist eine einspaltige
   Liste seitenlang. Die Spalten richten sich nach der Breite – auf dem Handy
   bleibt es eine Spalte, am Bildschirm werden es zwei bis vier. */
.presence-list { display: grid; gap: .6rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); }
.presence-row { display: flex; align-items: center; gap: .9rem; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.presence-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--sidebar-2); color: #fff; display: grid; place-items: center; font-weight: 600; flex-shrink: 0; overflow: hidden; }
.presence-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Kleiner Avatar (Seitenleiste, Benutzerliste) */
.avatar-sm { width: 30px; height: 30px; border-radius: 50%; background: var(--sidebar-2); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: .82rem; flex-shrink: 0; overflow: hidden; }
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Avatar-Widget im Benutzerformular */
.avatar-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.avatar-preview { width: 72px; height: 72px; border-radius: 50%; background: #e2e8f0; color: #475569; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-initials { font-size: 1.6rem; font-weight: 700; }
.avatar-controls { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.av-camera { margin-top: .85rem; }
.av-video { width: 240px; max-width: 100%; border-radius: 10px; background: #000; display: block; }
.av-cam-buttons { display: flex; gap: .5rem; margin-top: .5rem; }
.av-hint { font-size: .82rem; }
.presence-main { flex: 1; min-width: 0; }
.presence-name { font-weight: 600; }
.presence-meta { color: var(--muted); font-size: .82rem; }

/* Flash */
.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .92rem; border: 1px solid transparent; }
.flash-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.flash-error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

/* ---------- Abwesenheitskalender ---------- */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.cal-modes { display: flex; gap: .4rem; }
.cal-nav { display: flex; align-items: center; gap: .75rem; }
.cal-nav strong { min-width: 8rem; text-align: center; }

.cal-title { font-weight: 700; margin-bottom: .5rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head { text-align: center; font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: .2rem 0; font-weight: 600; }
.cal-cell { min-height: 84px; border: 1px solid var(--line); border-radius: 8px; padding: .3rem; background: #fff; overflow: hidden; }
.cal-empty { border: none; background: transparent; }
.cal-weekend { background: #f8fafc; }
.cal-holiday { background: #faf5ff; }
.cal-today { outline: 2px solid var(--primary); outline-offset: -2px; }
.cal-daynum { font-size: .8rem; color: var(--muted); font-weight: 600; margin-bottom: .15rem; }
.cal-entries { display: flex; flex-direction: column; gap: 2px; }
.cal-entry { display: block; font-size: .72rem; padding: .08rem .35rem; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-pending { border: 1px dashed currentColor; opacity: .75; background: transparent !important; }
.cal-more { font-size: .68rem; color: var(--muted); }

/* Warnmarkierung im Tag: Gehen vergessen / nicht gebucht */
.cal-warn { font-weight: 700; }
.warn-open { background: #fef3c7; color: #92400e; }
.warn-missing { background: #fee2e2; color: #991b1b; }
.cal-cell.cal-flag-open { background: #fffbeb; box-shadow: inset 0 0 0 2px #fcd34d; }
.cal-cell.cal-flag-missing { background: #fef2f2; box-shadow: inset 0 0 0 2px #fca5a5; }
.cal-mini-day.cal-flag-open { background: #fcd34d; color: #92400e; }
.cal-mini-day.cal-flag-missing { background: #fca5a5; color: #991b1b; }
.cal-legend { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--line); }

/* Zwei-Monats-Ansicht */
.cal-two { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.cal-compact .cal-cell { min-height: 64px; }
.cal-compact .cal-entry { font-size: .68rem; }

/* Jahresansicht (12 Mini-Monate) */
.cal-year { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.cal-mini-title { font-weight: 600; font-size: .85rem; margin-bottom: .35rem; text-align: center; }
.cal-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-mini-head { text-align: center; font-size: .6rem; color: var(--muted); }
.cal-mini-day { text-align: center; font-size: .7rem; padding: .2rem 0; border-radius: 4px; color: var(--ink); }
.cal-mini-day.cal-weekend { color: var(--muted); }
.cal-mini-day.cal-has { font-weight: 700; cursor: help; }
.cal-mini-day.cal-today { outline: 1px solid var(--primary); }

@media (max-width: 900px) {
    .cal-two { grid-template-columns: 1fr; }
    .cal-year { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .cal-year { grid-template-columns: 1fr; }
    .cal-cell { min-height: 68px; }
}

.muted { color: var(--muted); font-size: .9rem; }
.hint { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; margin-top: .25rem; }
.neg { color: var(--red); font-weight: 600; }
.pos { color: var(--green); font-weight: 600; }
.monthnav { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
/* Benutzer bearbeiten: volle Breite als aufklappbare Zeile (kein Überlappen) */
.edit-row > td { background: #f8fafc; padding: 0; border-top: 2px solid var(--primary); }
.edit-panel { padding: 1.25rem; }
details summary { display: inline-block; list-style: none; cursor: pointer; }
details summary::-webkit-details-marker { display: none; }

/* ---------- Responsiv ---------- */
@media (max-width: 900px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: 1fr; }
    .dash-top { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .app { flex-direction: column; }
    /* Inhalt + Status-Kopfleiste zuerst, Menue darunter (Status sofort sichtbar). */
    .main { order: -1; }
    .sidebar { order: 1; }
    .topbar { position: sticky; top: 0; z-index: 20; flex-wrap: wrap; gap: .5rem .8rem; padding: .7rem 1rem; }
    .topbar h1 { font-size: 1.1rem; }
    .topbar-right { gap: .7rem; }
    .sidebar { width: 100%; height: auto; position: static; flex-direction: column; }
    /* Kompakter Markenkopf: Icon und Name nebeneinander statt gestapelt. */
    .sidebar-brand { flex-direction: row; justify-content: center; gap: .5rem; padding: .8rem 1rem; font-size: 1.05rem; }
    .sidebar-brand .logo { width: 34px; height: 34px; font-size: 1.15rem; border-radius: 9px; }
    /* Menü als gleichmäßiges 2-Spalten-Raster mit sichtbaren Gruppen-Überschriften. */
    .sidebar nav { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; padding: .5rem .5rem .7rem; }
    .nav-group-label { display: block; grid-column: 1 / -1; padding: .55rem .4rem .1rem; }
    .nav-item { border-left: none; border-radius: 8px; padding: .6rem .55rem; font-size: .88rem; }
    .nav-item.active { border-left: none; }
    .grid-2, .grid-4 { grid-template-columns: 1fr; }
    .content { padding: 1rem; }
    .table { display: block; overflow-x: auto; }
}

/* ---------- Terminal / Kiosk ---------- */
.terminal-body { background: var(--sidebar); background-image: radial-gradient(circle at 30% 10%, #1e3a44 0%, #16202e 60%); color: #fff; min-height: 100vh; }
.terminal-wrap { max-width: 900px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; min-height: 100vh; display: flex; flex-direction: column; }
/* gap: auf einem hochkant stehenden Tablet reicht die Breite sonst nicht und
   Firmenname und Uhrzeit stossen aneinander ("Musterbetrieb15:10"). */
.terminal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.terminal-brand { display: flex; align-items: center; gap: .6rem; font-size: 1.2rem; font-weight: 700; }
.terminal-clock { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.terminal-title { text-align: center; font-weight: 600; font-size: 1.3rem; margin: .5rem 0 1.5rem; }
.terminal-flash { padding: 1rem 1.25rem; border-radius: 12px; margin-bottom: 1.25rem; font-size: 1.1rem; font-weight: 600; text-align: center; }

.terminal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 1rem; }
.terminal-tile { display: flex; align-items: center; justify-content: center; min-height: 118px; padding: 1.25rem .75rem; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 16px; color: #fff; text-decoration: none; transition: background .12s; }
.terminal-tile:hover, .terminal-tile:active { background: rgba(255,255,255,.14); }
/* Das Kuerzel ist der einzige Inhalt der Kachel und muss aus zwei Metern
   lesbar sein. clamp(), damit ein zur Unterscheidung verlaengertes Kuerzel
   ("M. Wa.") auf schmalen Kacheln nicht umbricht. */
.terminal-tile-label { font-size: clamp(1.5rem, 4.2vw, 2.2rem); font-weight: 700; text-align: center;
    letter-spacing: .02em; white-space: nowrap; }

.terminal-punch { max-width: 420px; margin: 0 auto; width: 100%; }
/* ---------- QR-Code auf der Kurzanleitung ---------- */
.sheet-qr { display: flex; align-items: center; gap: 1rem; margin: .9rem 0 .6rem;
    padding: .8rem; border: 1px solid #cbd5e1; border-radius: 10px; background: #f8fafc; }
.sheet-qr-code { flex-shrink: 0; width: 104px; height: 104px; }
.sheet-qr-code svg { width: 100%; height: 100%; display: block; }
.sheet-qr-text { display: flex; flex-direction: column; gap: .2rem; font-size: .88rem; line-height: 1.4; }
.sheet-qr-url { font-size: .74rem; color: #64748b; word-break: break-all; }
@media print {
    /* Auf Papier zaehlt jeder Millimeter – und der Code muss scharf bleiben. */
    .sheet-qr { background: none; page-break-inside: avoid; }
}

/* ---------- Lizenzstand in der Kopfzeile ---------- */
.lizenz-pill {
    display: inline-flex; align-items: center; gap: .35rem; margin-left: .9rem;
    padding: .25rem .65rem; border-radius: 999px; text-decoration: none;
    background: var(--bg); border: 1px solid var(--line); color: var(--muted);
    font-size: .82rem; white-space: nowrap; flex-shrink: 0;
}
.lizenz-pill:hover { border-color: var(--primary); color: var(--ink); }
.lizenz-pill strong { color: var(--ink); }
/* Alle Plaetze belegt: auffaellig, aber nicht alarmierend – es ist kein Fehler,
   sondern eine Grenze, die erreicht wurde. */
.lizenz-pill.voll { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.lizenz-pill.voll strong { color: #92400e; }
/* Auf schmalen Bildschirmen nur die Zahlen – "Lizenzen" ist dann verzichtbar. */
@media (max-width: 860px) { .lizenz-wort { display: none; } }
@media (max-width: 520px) { .lizenz-pill { display: none; } }

/* ---------- Anwesenheit: Status per Klick umstellen (Admin) ---------- */
.presence-switch { position: relative; flex-shrink: 0; }
.presence-switch-btn { display: inline-flex; align-items: center; gap: .35rem; background: none;
    border: none; padding: 0; cursor: pointer; font: inherit; border-radius: 999px; }
.presence-switch-btn:hover .status-pill, .presence-switch-btn:focus-visible .status-pill {
    filter: brightness(.96); box-shadow: 0 0 0 2px var(--ring); }
.presence-caret { color: var(--muted); font-size: .7rem; }
.presence-menu { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 60; min-width: 210px;
    background: var(--card); border: 1px solid var(--line); border-radius: 10px;
    box-shadow: var(--shadow-lg); padding: .35rem; text-align: left; }
.presence-menu-head { font-size: .78rem; color: var(--muted); padding: .3rem .55rem .35rem; }
.presence-menu-item { display: block; width: 100%; text-align: left; padding: .5rem .55rem;
    background: none; border: none; border-radius: 7px; cursor: pointer; font: inherit; color: var(--ink); }
.presence-menu-item:hover { background: var(--bg); }
.presence-menu-hint { font-size: .74rem; color: var(--muted); padding: .4rem .55rem .25rem;
    border-top: 1px solid var(--line); margin-top: .3rem; line-height: 1.35; }

/* ---------- Hilfe (Handbuch in der App) ---------- */
.help-search { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; }
.help-search input { width: 100%; }
.help-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .help-wrap { grid-template-columns: 1fr; } }

.help-toc { position: sticky; top: 1rem; background: var(--card); border: 1px solid var(--line);
    border-radius: 12px; padding: .9rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
.help-toc-title { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; }
.help-toc a { display: block; padding: .38rem .5rem; border-radius: 8px; color: var(--ink);
    text-decoration: none; font-size: .9rem; line-height: 1.35; }
.help-toc a:hover { background: var(--bg); }

.help-body { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    padding: 1.5rem; max-width: 780px; line-height: 1.6; }
.help-body p { margin: 0 0 .8rem; }
.help-h1 { font-size: 1.25rem; margin: 1.8rem 0 .8rem; padding-bottom: .4rem; border-bottom: 2px solid var(--primary); scroll-margin-top: 1rem; }
.help-body > .help-h1:first-child { margin-top: 0; }
.help-h2 { font-size: 1.02rem; margin: 1.4rem 0 .6rem; color: var(--primary-dark); }
.help-bullet { padding-left: 1.1rem; position: relative; margin-bottom: .5rem; }
.help-bullet::before { content: "•"; position: absolute; left: .15rem; color: var(--primary); }
.help-note { border-left: 3px solid var(--primary); background: var(--bg); padding: .7rem .9rem; border-radius: 0 8px 8px 0; }
.help-warn { border-left: 3px solid var(--red); background: #fef2f2; color: #7f1d1d;
    padding: .7rem .9rem; border-radius: 0 8px 8px 0; display: flex; gap: .5rem; align-items: flex-start; }
.help-bild { margin: .9rem 0 1.2rem; }
.help-bild img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; display: block; }
/* Deckblatt-Logo: klein und ohne Rahmen – es ist kein Bildschirmfoto. */
.help-bild-logo img { max-height: 42px; width: auto; border: none; border-radius: 0; }
.help-treffer { background: #fef9c3; border-radius: 6px; }
@media print {
    .help-wrap { grid-template-columns: 1fr; }
    .help-body { border: none; padding: 0; max-width: none; }
}

/* ---------- Terminal: Eingabe der Personalnummer ---------- */
.nr-felder { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1rem; }
.nr-feld { display: flex; flex-direction: column; gap: .2rem; padding: .7rem .9rem; cursor: pointer;
    background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.15);
    border-radius: 12px; color: #fff; font: inherit; text-align: left; }
/* Das aktive Feld muss auf einen Blick erkennbar sein – sonst tippt jemand die
   PIN ins Nummernfeld und wundert sich. */
.nr-feld.is-aktiv { border-color: var(--primary); background: rgba(255,255,255,.12); }
.nr-label { font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.nr-wert { font-size: 1.7rem; font-weight: 700; letter-spacing: .12rem; min-height: 1.3em; }
@media (max-width: 420px) { .nr-felder { grid-template-columns: 1fr; } }

/* ---------- Terminal-Modus B: offline gemerkte Buchungen ---------- */
.offline-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 8000;
    padding: .85rem 1rem; text-align: center; font-size: 1rem;
    background: #334155; color: #e2e8f0; border-top: 1px solid rgba(255,255,255,.15);
}
.offline-bar.warten { background: #92400e; color: #fef3c7; }
.offline-bar.ok     { background: #166534; color: #dcfce7; }
.offline-bar.fehler { background: #991b1b; color: #fee2e2; }

/* PIN-Maske, die einspringt, wenn die eigentliche PIN-Seite nicht ladbar ist */
/* Voll deckend: Am Kiosk schimmerten sonst die Kacheln und der Kopf durch
   und ueberlagerten die Ziffern. */
.offline-pin { position: fixed; inset: 0; z-index: 8100; display: grid; place-items: center;
    background: #16202e; padding: 1rem; overflow-y: auto; }
.offline-pin-box { width: 100%; max-width: 420px; text-align: center; }
.offline-pin-box .pin-pad { margin-top: 1rem; }
.offline-pin-box .terminal-actions { margin-top: 1rem; }

/* Auswahl des Verhaltens in den Einstellungen */
.offline-choice { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: 1rem; }
.offline-choice input { margin-top: .28rem; flex-shrink: 0; }
.offline-choice .hint { margin-top: .2rem; }

.terminal-person { display: flex; align-items: center; gap: 1rem; justify-content: center; margin-bottom: 1.25rem; text-align: center; }
.terminal-person-name { font-size: 2rem; font-weight: 700; letter-spacing: .02em; }
.pin-display { height: 3rem; border-radius: 12px; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; letter-spacing: .5rem; font-size: 2rem; margin-bottom: 1rem; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.pin-key { padding: 1.1rem 0; font-size: 1.6rem; font-weight: 600; border-radius: 14px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.08); color: #fff; cursor: pointer; }
.pin-key:active { background: rgba(255,255,255,.2); }
.pin-clear, .pin-back { font-size: 1.3rem; background: rgba(255,255,255,.04); }
.terminal-hint { text-align: center; color: #cbd5e1; margin: 1.25rem 0 .75rem; }
/* Immer alle vier Aktionen (der Status bleibt am oeffentlichen Terminal
   verborgen), deshalb ein festes 2x2-Raster statt einer umbrechenden Reihe. */
.terminal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.terminal-actions .btn-stamp { width: 100%; }
.terminal-cancel { display: block; text-align: center; margin-top: 1rem; background: transparent; color: #cbd5e1; border-color: rgba(255,255,255,.2); }
.terminal-pinchange-note { text-align: center; color: #fde68a; background: rgba(217,119,6,.15); border: 1px solid rgba(217,119,6,.4); border-radius: 12px; padding: .6rem .8rem; margin: 0 0 1rem; font-size: .95rem; }
.pin-change-fields { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.pin-change-fields label { color: #cbd5e1; font-size: .85rem; display: flex; flex-direction: column; gap: .25rem; }
.pin-change-fields .pin-field { font-size: 1.6rem; letter-spacing: .4rem; text-align: center; padding: .6rem; border-radius: 12px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.1); color: #fff; }
.pin-change-fields .pin-field:focus { outline: 2px solid var(--primary); }

/* ---------- Feinschliff ---------- */
:root { --ring: rgba(14,165,164,.28); }

/* Weiche Übergänge */
.btn, .nav-item, .stat, .card, .terminal-tile, .presence-row, .status-pill, .badge, details summary {
    transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease, transform .10s ease, color .14s ease;
}

/* Feinere Schatten & Hover-Anhebung bei Kacheln */
.card { box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06); }
.stat { position: relative; overflow: hidden; }
.stat:hover { box-shadow: 0 6px 18px rgba(15,23,42,.09); transform: translateY(-1px); }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); opacity: .0; transition: opacity .15s; }
.stat:hover::before { opacity: .5; }

/* Buttons: mehr Tiefe */
.btn-primary { box-shadow: 0 1px 2px rgba(14,165,164,.25); }
.btn:active { transform: translateY(1px); }
.btn-stamp { box-shadow: 0 2px 6px rgba(15,23,42,.14); }
.btn-stamp:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(15,23,42,.18); }
.btn-stamp:active { transform: translateY(0); }

/* Eingabefelder: ruhigerer Fokus-Ring */
.form input:focus, .form select:focus, .form textarea:focus,
.form-inline input:focus, .form-inline select:focus,
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }

/* Sidebar-Navigation etwas lebendiger */
.nav-item { border-radius: 0 8px 8px 0; margin-right: .5rem; }
.nav-item:hover { transform: translateX(2px); }
.nav-item.active { box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }

/* Topbar mit feiner Trennung */
.topbar { box-shadow: 0 1px 0 rgba(15,23,42,.04); }

/* Tabellen: ruhiger Hover, klarere Kopfzeile */
.table thead th { background: #f8fafc; }
.table tbody tr { transition: background-color .1s; }

/* Badges: dezent abgerundet, leichte Kontur */
.badge { box-shadow: inset 0 0 0 1px rgba(15,23,42,.04); }

/* Presence-Zeilen Hover */
.presence-row:hover { border-color: #cbd5e1; box-shadow: 0 2px 8px rgba(15,23,42,.06); }

/* Avatare mit feinem Rahmen */
.presence-avatar, .avatar-sm, .avatar-preview { box-shadow: 0 0 0 2px rgba(255,255,255,.6), 0 1px 2px rgba(15,23,42,.12); }

/* Geburtstags-Banner */
.birthday-banner {
    border: 1px solid #fcd34d;
    background: linear-gradient(90deg, #fffbeb, #fef3c7);
    color: #92400e; font-size: 1rem;
    display: flex; align-items: center; gap: .5rem;
}

/* Flash-Meldungen einblenden */
.flash { animation: flash-in .2s ease both; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Sanftes Scrollverhalten */
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
    /* Ohne Animation stehen beide Zeiger auf 12 und liegen uebereinander – das
       sieht nach einer defekten Uhr aus. Deshalb eine ruhende Stellung. */
    .ze-hand-h { transform: rotate(310deg); }
    .ze-hand-m { transform: rotate(55deg); }
}

/* Einstellungen: Aktionsleisten */
.form-actions {
    margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line);
    display: flex; justify-content: flex-end;
}
.testmail-row {
    display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap;
    margin-top: .9rem; padding-top: .9rem; border-top: 1px dashed var(--line);
}
.testmail-row .muted { font-size: .82rem; }

/* Arbeitszeit-Kalender (Team-Zeiten) */
.cal-time { display: block; font-size: .82rem; font-weight: 700; color: var(--ink); }
.cal-saldo { display: block; font-size: .7rem; font-weight: 600; }
.cal-saldo.pos { color: var(--green, #16a34a); }
.cal-saldo.neg { color: var(--red, #dc2626); }
.cal-open { color: var(--green, #16a34a); }
.cal-compact .cal-time { font-size: .74rem; }
.cal-mini-day.saldo-pos { background: #dcfce7; font-weight: 700; }
.cal-mini-day.saldo-neg { background: #fee2e2; font-weight: 700; }
a.cal-mini-day { text-decoration: none; }
a.cal-mini-day:hover { outline: 1px solid var(--primary); }

/* Tageszelle als Korrektur-Link */
a.cal-cell-link { display: block; color: inherit; text-decoration: none; position: relative; transition: border-color .12s, box-shadow .12s; }
a.cal-cell-link:hover { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
a.cal-cell-link::after {
    content: "\270E"; position: absolute; top: 4px; right: 6px; font-size: .78rem;
    color: var(--primary); opacity: 0; transition: opacity .12s;
}
a.cal-cell-link:hover::after { opacity: 1; }

/* Vergleichsmodus (mehrere Mitarbeiter, farbige Namenspunkte) */
.cmp-row { display: flex; align-items: center; gap: .3rem; font-size: .78rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.cmp-row.cmp-top { font-weight: 800; }
.cmp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-val { flex-shrink: 0; font-weight: 700; }
.cmp-dot { display: inline-block; width: .62rem; height: .62rem; border-radius: 50%; flex-shrink: 0; }
.cmp-delta { display: inline-block; font-size: .72rem; font-weight: 700; margin-top: .15rem; color: var(--muted); }
.cmp-delta.pos { color: var(--green); }
.cmp-delta.neg { color: var(--red); }
.cal-compact .cmp-row { font-size: .7rem; }
/* Vergleichszellen dürfen wachsen (mehrere Zeilen) */
.cal-compare .cal-cell { overflow: visible; }
.cal-mini-day.cmp-multi { background: #e0e7ff; font-weight: 700; }

/* Teilnehmer-Farbpalette */
/* 16 unterscheidbare Farben: mit „Alle auswählen" koennen leicht ein Dutzend
   Personen gleichzeitig im Kalender stehen. Danach wiederholt sich die Reihe –
   der Name steht in jeder Zelle daneben, die Farbe ist nur eine Lesehilfe. */
.cmp-c0 { background: #2563eb; } .cmp-c1 { background: #7c3aed; }
.cmp-c2 { background: #059669; } .cmp-c3 { background: #d97706; }
.cmp-c4 { background: #db2777; } .cmp-c5 { background: #0891b2; }
.cmp-c6 { background: #65a30d; } .cmp-c7 { background: #dc2626; }
.cmp-c8 { background: #1e3a8a; } .cmp-c9 { background: #4c1d95; }
.cmp-c10 { background: #065f46; } .cmp-c11 { background: #92400e; }
.cmp-c12 { background: #9d174d; } .cmp-c13 { background: #155e75; }
.cmp-c14 { background: #3f6212; } .cmp-c15 { background: #991b1b; }

/* Namensliste in der Kalender-Kopfzeile */
.cmp-people { display: inline-flex; flex-wrap: wrap; gap: .1rem .8rem; align-items: center; }
.cmp-person { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .9rem; }

/* Mehrfachauswahl „Vergleichen mit" */
.compare-picker { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; background: #fff; align-self: flex-end; }
.compare-picker > summary { cursor: pointer; font-size: .9rem; color: var(--ink); list-style: none; user-select: none; white-space: nowrap; }
.compare-picker > summary::-webkit-details-marker { display: none; }
.compare-picker > summary::before { content: "\25B8"; display: inline-block; margin-right: .4rem; transition: transform .12s; }
.compare-picker[open] > summary::before { transform: rotate(90deg); }
.compare-grid {
    position: absolute; z-index: 30; top: calc(100% + .3rem); left: 0;
    display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: .15rem 1rem;
    background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
    padding: .7rem .9rem; max-height: 260px; overflow-y: auto; min-width: 340px;
}
.compare-grid .chk { display: flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 400; white-space: nowrap; }
/* „Alle auswählen" steht über der Namensliste und nimmt beide Spalten ein. */
.compare-tools {
    grid-column: 1 / -1; display: flex; gap: .4rem;
    padding-bottom: .5rem; margin-bottom: .25rem; border-bottom: 1px solid var(--line);
}

/* Tagesplaner (horizontale Timeline) */
.planner { display: flex; flex-direction: column; gap: .35rem; }
.planner-row { display: grid; grid-template-columns: 190px 1fr; align-items: center; gap: .6rem; }
.planner-head { margin-bottom: .1rem; }
.planner-head .planner-track { height: 16px; border: none; background: none; overflow: visible; }
.planner-hour { position: absolute; transform: translateX(-50%); font-size: .7rem; color: var(--muted); top: 0; font-variant-numeric: tabular-nums; }
.planner-label { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.planner-who { min-width: 0; }
.planner-who .pname { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.planner-who .pmeta { font-size: .74rem; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.planner-track {
    position: relative; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: #fff;
    background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
    background-size: calc(100% / var(--hours)) 100%; overflow: hidden;
}
.planner-bar { position: absolute; top: 4px; bottom: 4px; border-radius: 4px; min-width: 3px; }
.planner-bar.work { background: var(--primary); }
.planner-bar.brk { background: var(--amber); }
.planner-bar.open { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.4) 0 6px, transparent 6px 12px); }
.planner-bar.planner-abs { display: flex; align-items: center; padding: 0 .5rem; font-size: .72rem; font-weight: 600; overflow: hidden; white-space: nowrap; }
.planner-now { position: absolute; top: -1px; bottom: -1px; width: 2px; background: var(--red); z-index: 3; }
.planner-swatch { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; vertical-align: -1px; }
.planner-swatch.work { background: var(--primary); }
.planner-swatch.brk { background: var(--amber); }
.planner-swatch.open { background: var(--primary); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.55) 0 4px, transparent 4px 8px); }
.planner-swatch.abs { background: #ede9fe; }
.planner-swatch.now { background: var(--red); width: 3px; }
@media (max-width: 640px) { .planner-row { grid-template-columns: 116px 1fr; } }

/* QR-Code fuer 2FA-Einrichtung */
.qr-box {
    display: inline-block;
    background: #fff;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
    margin: .25rem 0 .75rem;
    line-height: 0;
}
.qr-box svg { width: 220px; height: 220px; display: block; }

/* Druckansicht fuer Berichte */
/* Nur im Ausdruck sichtbar (z. B. Kopfzeile des Kalenders). */
.print-only { display: none; }
.print-head { margin: 0 0 .6rem; padding-bottom: .4rem; border-bottom: 1px solid #999; font-size: .9rem; }

@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .content { padding: 0; max-width: none; }
    .card { box-shadow: none; border: 1px solid #ccc; }
    body { background: #fff; }
    .print-only { display: block; }

    /* Kalender: Farben der Abwesenheiten müssen mitgedruckt werden, sonst
       ist der Ausdruck unbrauchbar (Browser lassen Hintergründe sonst weg). */
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    /* Nicht mitten in einem Monat oder in der Legende umbrechen. */
    .cal-grid, .cal-mini, .cal-legend { break-inside: avoid; page-break-inside: avoid; }
    .cal-toolbar { margin-bottom: .4rem; }
}

/* Aufklappbarer Hinweis (spart Platz, Text bleibt bei Bedarf verfuegbar) */
.info-details { margin-top: .9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.info-details > summary { cursor: pointer; padding: .55rem .8rem; font-size: .87rem; font-weight: 600; color: var(--ink); }
.info-details > summary::marker { color: var(--muted); }
.info-details p { margin: 0 .8rem .7rem; font-size: .85rem; color: var(--muted); line-height: 1.5; }

/* Unterabschnitt innerhalb einer Karte (z. B. "Buchung hinzufügen" unter der
   Buchungsliste): gehoert inhaltlich dazu, braucht aber eine sichtbare Trennung. */
.sub-block { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.sub-title { font-size: .95rem; font-weight: 600; margin: 0 0 .7rem; color: var(--ink); }

/* ---------- Zeiten korrigieren: Buchungstabelle ---------- */
/* Aufbau wie unter „Anträge": echte Tabelle mit ausgerichteten Spalten.
   Die Eingabefelder sitzen in den Zellen und gehoeren per form-Attribut zu
   einem Formular ausserhalb der Tabelle (ein <form> darf keine <td>
   umschliessen). Farben bleiben: Speichern blau, Löschen rot. */
.table-events td { vertical-align: middle; }
/* Die Felder liegen in Tabellenzellen, nicht in einem .form-Container - ohne
   diese Regel blieben sie im grauen Systemlook des Browsers. */
.table-events input, .table-events select {
    display: block; margin: 0; padding: .55rem .65rem;
    border: 1px solid var(--line); border-radius: 8px;
    font-size: .95rem; color: var(--ink); background: #fff;
}
.table-events input:focus, .table-events select:focus {
    outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary);
}
.table-events input[name="time"] {
    width: 6.5rem; text-align: center; font-variant-numeric: tabular-nums;
}
.table-events select[name="type"] { width: 100%; max-width: 13rem; }
.table-events td.actions { white-space: nowrap; }
.table-events .badge { white-space: nowrap; }

@media (max-width: 760px) {
    .table-events select[name="type"] { max-width: none; }
    .table-events td.actions { white-space: normal; }
}

/* ---------- Statistik: aufklappbare Kennzahlen ---------- */
/* Die Zahlen in „Kennzahlen je Mitarbeiter" sind Schaltflaechen, sehen aber wie
   Text aus - erst beim Ueberfahren wird die Klickbarkeit sichtbar. */
.drill-btn {
    border: 0; background: none; padding: .1rem .35rem; margin: -.1rem -.35rem;
    font: inherit; color: inherit; cursor: pointer; border-radius: 6px;
    text-decoration: underline; text-decoration-style: dotted;
    text-underline-offset: 3px; text-decoration-color: var(--line);
}
.drill-btn:hover { background: #eef2ff; color: var(--primary); text-decoration-color: var(--primary); }
.drill-btn.is-open { background: var(--primary); color: #fff; text-decoration: none; }
.table-drillable td.is-danger .drill-btn { color: var(--red); font-weight: 600; }
.table-drillable td.is-danger .drill-btn.is-open { color: #fff; background: var(--red); }

/* Seitenblätterung (Protokoll) */
.pager { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-top: 1rem; }
.pager .is-disabled { opacity: .45; pointer-events: none; }
.pager-gap { color: var(--muted); padding: 0 .2rem; }
.pager-info { margin-left: auto; font-size: .85rem; }

/* Terminal-Kürzel in der Benutzerliste: schmal und monospace, damit es sich
   klar vom Namen daneben abhebt. */
.badge-kuerzel {
    background: var(--bg); color: var(--muted); border: 1px solid var(--line);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .02em; white-space: nowrap;
}

/* Sortierbare Spaltenüberschrift: sieht aus wie der übrige Kopf, der Pfeil
   zeigt die aktive Spalte und die Richtung. */
.th-sort {
    display: inline-flex; align-items: center; gap: .3rem;
    color: inherit; text-decoration: none; white-space: nowrap;
}
.th-sort:hover { color: var(--primary); }
.th-sort .sort-ind { opacity: .3; font-size: .85em; }
.th-sort:hover .sort-ind { opacity: .7; }
.th-sort.is-active { color: var(--primary); }
.th-sort.is-active .sort-ind { opacity: 1; }

.drill-row > td { background: #f8fafc; padding: 0; }
.drill-panel { padding: .9rem 1rem 1rem; border-left: 3px solid var(--primary); }
.drill-title { font-size: .95rem; font-weight: 600; margin-bottom: .6rem; }
.table-drill { margin: 0; background: var(--card); border-radius: 8px; overflow: hidden; }
.table-drill th, .table-drill td { padding: .45rem .7rem; font-size: .9rem; }
.table-drill tr:last-child td { border-bottom: 0; }

@media print {
    .drill-btn { text-decoration: none; }
    .drill-panel { border-left-color: #94a3b8; }
}

/* ---------- Einseitige Kurzanleitung fuers Tablet (Ausdruck/PDF) ---------- */
/* Eigenstaendige Seite, auf A4 ausgelegt: alles Wichtige auf eine Seite. */
.sheet-body { background: var(--bg); margin: 0; }
.sheet-bar {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    max-width: 21cm; margin: 1rem auto 0; padding: .75rem 1rem;
    background: var(--card); border: 1px solid var(--line); border-radius: 10px;
}
.sheet-bar .muted { flex: 1; font-size: .85rem; }

.sheet {
    max-width: 21cm; margin: 1rem auto 2rem; padding: 1.6cm 1.7cm;
    background: #fff; color: var(--ink);
    border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
}
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; }
.sheet-head .brand-logo { max-height: 46px; width: auto; }
.sheet-head .logo-icon { width: 46px; height: 46px; color: var(--primary); }
.sheet-firma { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sheet h1 { font-size: 1.5rem; margin: .15rem 0 .2rem; }
.sheet-sub { margin: 0; color: var(--muted); }
.sheet h2 {
    font-size: 1rem; margin: 1rem 0 .4rem; padding-bottom: .2rem;
    border-bottom: 2px solid var(--primary); display: inline-block;
}

/* Kuerzel und PIN – der eigentliche Zweck des Blattes. */
.sheet-key { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.sheet-key-box { border: 2px solid var(--primary); border-radius: 12px; padding: .8rem 1rem; text-align: center; }
.sheet-key-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sheet-key-value { font-size: 2.3rem; font-weight: 700; color: var(--primary); line-height: 1.1; }
.sheet-key-note { font-size: .78rem; color: var(--muted); line-height: 1.35; }
.sheet-pin-line { min-height: 2.8rem; display: flex; align-items: center; justify-content: center; }
.sheet-pin {
    width: 6.5rem; font-size: 2rem; font-weight: 700; text-align: center; letter-spacing: .25em;
    color: var(--primary); border: 0; border-bottom: 2px dashed var(--line); background: transparent;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.sheet-pin:focus { outline: none; border-bottom-color: var(--primary); }
.sheet-pin-missing { color: var(--muted); font-style: italic; }

.sheet-steps { margin: .25rem 0 .6rem 1.1rem; padding: 0; line-height: 1.5; }
.sheet-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: .2rem 0 .6rem; }
.sheet-act { padding: .45rem .9rem; border-radius: 8px; color: #fff; font-weight: 600; font-size: .95rem; }
.sheet-act.act-in { background: var(--green); }
.sheet-act.act-break { background: var(--amber); }
.sheet-act.act-out { background: var(--red); }
.sheet-hint { font-size: .85rem; color: var(--muted); margin: .35rem 0 0; line-height: 1.5; }
.sheet-rules { margin: .25rem 0 0 1.1rem; padding: 0; line-height: 1.5; }
.sheet-rules li { margin-bottom: .22rem; }

.sheet-week { width: 100%; border-collapse: collapse; margin-top: .3rem; }
.sheet-week th, .sheet-week td {
    border: 1px solid var(--line); padding: .4rem; text-align: center; font-size: .95rem;
}
.sheet-week th { background: var(--bg); font-size: .8rem; color: var(--muted); }
.sheet-week .sheet-frei { color: var(--muted); }

.sheet-foot {
    display: flex; justify-content: space-between; margin-top: 1.1rem; padding-top: .5rem;
    border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted);
}

@media print {
    @page { size: A4 portrait; margin: 12mm; }
    .sheet-bar { display: none !important; }
    .sheet-body { background: #fff; }
    .sheet { max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
    /* Farben der Tasten muessen mitgedruckt werden, sonst ist die Zuordnung weg. */
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .sheet-pin { border-bottom-color: #94a3b8; }
    .sheet h2, .sheet-key, .sheet-week { break-inside: avoid; page-break-inside: avoid; }
}

/* Geraeteangabe an einer Buchung ("Zeiten korrigieren") – dezent, weil sie im
   Normalfall niemanden interessiert und nur bei Nachfragen zaehlt. */
.ev-geraet { display: block; font-size: .72rem; color: var(--muted); margin-top: .15rem; }

/* ---------- NFC-Anhänger am Terminal ---------- */
.nfc-box { display: flex; align-items: center; gap: 1rem; max-width: 520px; margin: 0 auto 1.5rem;
    padding: 1rem 1.2rem; border: 2px dashed rgba(255,255,255,.25); border-radius: 16px; color: #fff; }
.nfc-box.fehler { border-color: #f87171; border-style: solid; background: rgba(220,38,38,.12); }
.nfc-ring { width: 58px; height: 58px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
    background: rgba(255,255,255,.1); }
.nfc-ring svg { width: 28px; height: 28px; }
.nfc-text { display: flex; flex-direction: column; gap: .15rem; }
.nfc-text strong { font-size: 1.05rem; }
.nfc-text span { font-size: .88rem; color: rgba(255,255,255,.7); }
.nfc-aktion { max-width: 520px; margin: 0 auto 1.5rem; text-align: center; }

/* Anhänger beschreiben (Verwaltung) */
.nfc-write { padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); text-align: center; }
.nfc-ok { color: var(--green); font-weight: 600; }
.nfc-fehler { color: var(--red); }
.nfc-code-anzeige { display: block; padding: .6rem .8rem; background: var(--bg); border: 1px solid var(--line);
    border-radius: 8px; font-size: .82rem; word-break: break-all; margin: .4rem 0; }

/* Rückmeldung direkt am Benutzer-Formular. Die Meldung oben auf der Seite
   allein genügt nicht: Nach dem Speichern springt die Ansicht zum Formular. */
.speicher-hinweis { display: flex; align-items: center; gap: .5rem; margin: 0 0 1rem;
    padding: .7rem .9rem; border-radius: 8px; font-size: .92rem;
    animation: speicher-auf .25s ease both; }
.speicher-hinweis.ok { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.speicher-hinweis.fehler { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
@keyframes speicher-auf { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Kennwortfelder: Schalter zum Anzeigen (rechts im Feld) und Rückmeldung
   direkt darunter. Der Hinweis kommt beim Tippen, spätestens beim Verlassen
   des Feldes – nicht erst nach dem Abschicken. */
.pw-box { position: relative; display: block; }
.pw-box input { padding-right: 5.5rem; }
.pw-auge { position: absolute; right: .3rem; top: .3rem; bottom: 0;
    display: flex; align-items: center; gap: .3rem;
    border: 0; background: none; padding: 0 .5rem; cursor: pointer;
    color: var(--muted); font-size: .78rem; font-weight: 600; font-family: inherit; }
.pw-auge:hover { color: var(--primary); }
.pw-hinweis.ok { color: var(--green); font-weight: 600; }
.pw-hinweis.fehler { color: var(--red); font-weight: 600; }

/* Warnhinweis in der gleichen Form wie die Speicher-Rückmeldung. */
.flash-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.speicher-hinweis.warnung { background: #fef3c7; color: #92400e; border: 1px solid #fde68a;
    align-items: flex-start; }

/* Buchungen aller Mitarbeiter (Übersicht der Verwaltung): eine Karte je
   Person, darin die Buchungen des Tages in ihrer Reihenfolge. */
.tagesbuchungen { display: grid; gap: .6rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); }
.tagesbuchung { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: .7rem .9rem; }
.tagesbuchung.hat-warnung { border-color: #fde68a; background: #fffbeb; }
.tagesbuchung-kopf { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.tagesbuchung-name { flex: 1; min-width: 0; font-weight: 600; }
.tagesbuchung-name a { color: inherit; text-decoration: none; }
.tagesbuchung-name a:hover { text-decoration: underline; }
.buchungskette { display: flex; flex-wrap: wrap; gap: .35rem; }
.buchung { display: inline-flex; align-items: baseline; gap: .3rem; white-space: nowrap;
    padding: .2rem .5rem; border-radius: 6px; font-size: .8rem;
    background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.buchung strong { font-variant-numeric: tabular-nums; }
.buchung-in       { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
.buchung-out      { background: #e2e8f0; border-color: #cbd5e1; color: #334155; }
.buchung-break_start, .buchung-break_end { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.buchung-quelle { font-size: .72rem; opacity: .75; font-style: italic; }
.buchung-warnung { display: flex; align-items: center; gap: .4rem; margin: .5rem 0 0;
    font-size: .82rem; color: #92400e; }

/* Gruß über der Auswahl am Terminal – wie in Nextcloud nach der Anmeldung. */
.terminal-gruss { margin: 0 0 .2rem; text-align: center; font-size: clamp(1.3rem, 3.2vw, 2rem);
    font-weight: 600; color: #fff; letter-spacing: -.01em; }

/* Abwesenheit an einem Tag in „Zeiten korrigieren": Urlaub war dort vorher
   gar nicht zu sehen – der Tag sah aus wie eine vergessene Buchung. */
.tages-abwesenheit { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
    margin: 0 0 .9rem; padding: .6rem .8rem; border-radius: 8px;
    background: var(--bg); border: 1px solid var(--line); font-size: .9rem; }
.tages-abwesenheit.ist-offen { background: #fef3c7; border-color: #fde68a; color: #92400e; }

/* Wiederherstellungscodes ausdrucken: Beim Drucken bleibt nur der Kasten mit
   den Codes stehen. Die Codes gibt es genau einmal zu sehen – ein Ausdruck
   (oder „Als PDF sichern" im Druckdialog) ist die einzige Kopie. */
@media print {
    body:has(.codes-blatt) .sidebar,
    body:has(.codes-blatt) .topbar,
    body:has(.codes-blatt) .card:not(.codes-blatt),
    body:has(.codes-blatt) .flash { display: none !important; }
    body:has(.codes-blatt) .codes-blatt {
        border: 1px solid #999 !important; background: #fff !important;
        box-shadow: none; page-break-inside: avoid; }
    .codes-raster div { border-color: #999 !important; }
}
.codes-kopf { color: var(--muted); font-size: .9rem; }

/* Entschiedener Antrag – einmalig auf der Übersicht. Auffällig genug, dass
   man ihn nicht übersieht: Er kommt kein zweites Mal. */
.antrag-bescheid { display: flex; align-items: flex-start; gap: .7rem;
    border-left: 4px solid var(--green); }
.antrag-bescheid.ist-abgelehnt { border-left-color: var(--red); }
.antrag-bescheid .ui-ic { flex-shrink: 0; margin-top: .15rem; color: var(--green); }
.antrag-bescheid.ist-abgelehnt .ui-ic { color: var(--red); }

/* Untermenü der Einstellungen: eingerückt und kleiner, damit auf einen Blick
   klar ist, dass es zu „Einstellungen" gehört. */
.nav-sub { display: flex; flex-direction: column; margin: .1rem 0 .3rem; }
.nav-item-sub { padding-left: 2.4rem; font-size: .88rem; opacity: .9; }
.nav-item-sub .ic { width: 16px; height: 16px; }
.nav-item-sub .ic svg { width: 16px; height: 16px; }

/* Zwischenüberschrift innerhalb eines Formulars – gruppiert zusammengehörige
   Felder, ohne dass ein weiteres Kästchen nötig wäre. */
.feld-gruppe { margin: .2rem 0 .5rem; font-size: .82rem; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* Übersicht der freigeschalteten Funktionen (reine Anzeige). */
.feature-liste { display: grid; gap: .35rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.feature-eintrag { display: flex; align-items: center; gap: .4rem; font-size: .9rem;
    padding: .35rem .55rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.feature-eintrag strong { margin-left: auto; color: var(--green); font-size: .8rem; }
.feature-eintrag.ist-aus { background: var(--bg); color: var(--muted); }
.feature-eintrag.ist-aus strong { color: var(--muted); }

/* Monatsabschluss: offen (neutral) oder geschlossen (deutlich). */
.monatsabschluss { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.monatsabschluss.ist-zu { border-left: 4px solid var(--amber); background: #fffbeb; }
.monatsabschluss .ma-text { display: flex; align-items: center; gap: .5rem; flex: 1; min-width: 240px; }
.monatsabschluss .ui-ic { flex-shrink: 0; color: var(--muted); }
.monatsabschluss.ist-zu .ui-ic { color: var(--amber); }

/* Namen im Anwesenheits-Board führen zur Zeitkorrektur – dezent, damit die
   Liste nicht wie ein Linkverzeichnis aussieht. */
.presence-name a { color: inherit; text-decoration: none; }
.presence-name a:hover { text-decoration: underline; }
