/* ==========================================================================
   Hikaya - Gestaltungssystem
   Ersetzt die sieben konkurrierenden Stylesheets des Altsystems
   (modern-design-system, unified-theme, modern-styles, modern-dashboard,
   improved-styles, style, login) durch eine Datei mit einer Token-Ebene.
   ========================================================================== */

:root {
    color-scheme: light dark;

    /* Ebene 1 - Grundfarben */
    --teal-400: #3d9b93;
    --teal-600: #1d6b66;
    --teal-700: #16534f;
    --teal-900: #0b2f2d;
    --amber-100: #fdf0d9;
    --amber-300: #f2c168;
    --amber-500: #e0a02c;
    --amber-700: #9c6b12;
    --n-0: #ffffff;
    --n-25: #fbfbfa;
    --n-50: #f5f5f3;
    --n-100: #ececeb;
    --n-200: #dedede;
    --n-500: #7c7c7a;
    --n-700: #414140;
    --n-900: #1a1a19;
    --n-950: #111110;
    --green-100: #e2f2e2;
    --green-500: #3f9142;
    --red-100: #fbe4e2;
    --red-500: #c2453c;
    --blue-100: #e3edf8;
    --blue-500: #3a6ea8;

    /* Ebene 2 - Bedeutung */
    --bg-app: light-dark(var(--n-50), var(--n-950));
    --bg-surface: light-dark(var(--n-0), var(--n-900));
    --bg-sunken: light-dark(var(--n-25), var(--n-950));
    --bg-rail: light-dark(var(--teal-900), #0a1614);
    --bg-hover: light-dark(var(--n-50), #232322);
    --bg-inert: light-dark(#f7f7f5, #171716);

    --text-strong: light-dark(var(--n-900), var(--n-50));
    --text-body: light-dark(var(--n-700), var(--n-200));
    --text-muted: light-dark(var(--n-500), #8b8b89);
    --text-on-rail: #cfe3e0;

    --line: light-dark(var(--n-200), #2f2f2e);
    --line-soft: light-dark(var(--n-100), #242423);

    --accent: light-dark(var(--teal-600), var(--teal-400));
    --accent-soft: light-dark(#eef7f6, #12302e);
    --gold: light-dark(var(--amber-700), var(--amber-300));
    --gold-soft: light-dark(var(--amber-100), #3a2c0d);
    --ok: light-dark(var(--green-500), #78c07a);
    --ok-soft: light-dark(var(--green-100), #16301a);
    --warn: light-dark(var(--amber-700), var(--amber-300));
    --warn-soft: light-dark(var(--amber-100), #3a2c0d);
    --bad: light-dark(var(--red-500), #e8837a);
    --bad-soft: light-dark(var(--red-100), #3a1a17);
    --info: light-dark(var(--blue-500), #8db4dd);
    --info-soft: light-dark(var(--blue-100), #16283c);

    --font-sans: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow-card: 0 1px 2px light-dark(rgb(0 0 0 / .05), rgb(0 0 0 / .4));

    accent-color: var(--accent);
}

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

html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font-sans);
    background: var(--bg-app);
    color: var(--text-body);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    margin: 0;
    color: var(--text-strong);
    font-weight: 600;
    letter-spacing: -.01em;
    text-wrap: balance;
}

a { color: var(--accent); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* --------------------------------------------------------------- Layout */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.rail {
    background: var(--bg-rail);
    color: var(--text-on-rail);
    display: flex;
    flex-direction: column;
    padding: 18px 14px 14px;
    gap: 4px;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
.brand-mark {
    width: 36px; height: 36px; border-radius: 11px;
    display: grid; place-items: center; flex: none;
    background: linear-gradient(145deg, var(--amber-300), var(--amber-500));
    color: var(--teal-900);
}
.brand-name { color: #fff; font-weight: 650; font-size: 16px; letter-spacing: -.02em; line-height: 1.1; }
.brand-sub { font-size: 11px; color: rgb(207 227 224 / .62); letter-spacing: .04em; text-transform: uppercase; }

.rail-group { margin-top: 16px; }
.rail-label {
    font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
    color: rgb(207 227 224 / .45); padding: 0 10px 7px; font-weight: 600;
}
.rail-link {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 9px; min-height: 36px;
    color: var(--text-on-rail); text-decoration: none; font-size: 13.5px;
}
.rail-link svg { flex: none; opacity: .72; }
.rail-link:hover { background: rgb(255 255 255 / .06); color: #fff; }
.rail-link[aria-current="page"] { background: rgb(255 255 255 / .1); color: #fff; font-weight: 550; }
.rail-link[aria-current="page"] svg { opacity: 1; color: var(--amber-300); }
.rail-link .pill {
    margin-inline-start: auto; font-size: 11px; font-weight: 650;
    background: var(--amber-500); color: var(--teal-900);
    border-radius: 99px; padding: 1px 7px; min-width: 20px; text-align: center;
}

.rail-foot {
    margin-top: auto; padding-top: 14px;
    border-top: 1px solid rgb(255 255 255 / .08);
    display: flex; align-items: center; gap: 10px;
}
.avatar {
    width: 32px; height: 32px; border-radius: 50%; flex: none;
    background: linear-gradient(140deg, var(--teal-400), var(--teal-700));
    color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 650;
}
.rail-foot .who { font-size: 12.5px; color: #fff; font-weight: 550; line-height: 1.25; }
.rail-foot .role { font-size: 11px; color: rgb(207 227 224 / .6); }
.rail-foot form { margin-inline-start: auto; }
.rail-foot button {
    background: transparent; border: 0; color: rgb(207 227 224 / .6);
    cursor: pointer; padding: 6px; border-radius: 7px; display: grid; place-items: center;
}
.rail-foot button:hover { background: rgb(255 255 255 / .08); color: #fff; }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 28px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--line);
}
.crumb { font-size: 12.5px; color: var(--text-muted); }
.crumb b { color: var(--text-strong); font-weight: 600; }
.topbar-right { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }

.page { padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 23px; }
.page-head p { margin: 3px 0 0; font-size: 13.5px; color: var(--text-muted); }

/* -------------------------------------------------------------- Bausteine */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.card-head {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
}
.card-head h3 { font-size: 14.5px; }
.card-head .sub { font-size: 12px; color: var(--text-muted); }
.card-body { padding: 18px; }

.btn {
    display: inline-flex; align-items: center; gap: 7px;
    border: 1px solid var(--line); background: var(--bg-surface); color: var(--text-body);
    border-radius: var(--radius-sm); padding: 7px 13px;
    font: inherit; font-size: 13px; font-weight: 550;
    cursor: pointer; min-height: 36px; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { border-color: var(--bad); color: var(--bad); }
.btn-block { width: 100%; justify-content: center; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-strong); }
.field input, .field select, .field textarea {
    font: inherit; font-size: 14px; color: var(--text-strong);
    background: var(--bg-surface); border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: 9px 12px; min-height: 40px; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
.field .hint { font-size: 11.5px; color: var(--text-muted); }
.field .error { font-size: 12px; color: var(--bad); font-weight: 550; }
.field:has(.error) input { border-color: var(--bad); }

/* Meldungen */
.flash-stack { display: flex; flex-direction: column; gap: 8px; }
.flash {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px;
}
.flash svg { flex: none; margin-top: 1px; }
.flash-success { background: var(--ok-soft); color: var(--ok); }
.flash-error   { background: var(--bad-soft); color: var(--bad); }
.flash-warning { background: var(--warn-soft); color: var(--warn); }
.flash-info    { background: var(--info-soft); color: var(--info); }

.badge {
    display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
    font-size: 11.5px; font-weight: 600; border-radius: 99px; padding: 3px 9px;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok   { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad  { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--info-soft); color: var(--info); }

table { width: 100%; border-collapse: collapse; }
thead th {
    text-align: start; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-muted); font-weight: 600;
    padding: 9px 18px; border-bottom: 1px solid var(--line); background: var(--bg-sunken);
}
tbody td { padding: 9px 18px; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
tbody tr:hover { background: var(--bg-hover); }

/* Zahlen immer untereinander ausgerichtet. */
.num, td.num, .hrs, .eur { font-variant-numeric: tabular-nums; text-align: end; }

/* ------------------------------------------------ Schlichte Seiten (Login) */
.plain {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background:
        radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 60%),
        var(--bg-app);
}
.plain-card {
    width: 100%; max-width: 390px;
    background: var(--bg-surface); border: 1px solid var(--line);
    border-radius: 18px; box-shadow: 0 12px 40px light-dark(rgb(16 40 38 / .1), rgb(0 0 0 / .5));
    padding: 30px;
}
.plain-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 24px; }
.plain-brand .brand-mark { width: 48px; height: 48px; border-radius: 14px; }
.plain-brand h1 { font-size: 20px; }
.plain-brand p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-muted); }
.plain-form { display: flex; flex-direction: column; gap: 16px; }
.plain-foot { margin-top: 20px; text-align: center; font-size: 12px; color: var(--text-muted); }

/* -------------------------------------------------------------- Fehlerseite */
.error-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; text-align: center; }
.error-page .code { font-size: 64px; font-weight: 700; color: var(--accent); letter-spacing: -.03em; line-height: 1; }
.error-page h1 { font-size: 20px; margin: 12px 0 6px; }
.error-page p { color: var(--text-muted); max-width: 34rem; margin: 0 auto 22px; }

/* ------------------------------------------------------------------ Schmal */
@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .rail { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
    .rail-group, .rail-foot { margin: 0; border: 0; padding: 0; }
    .rail-label { display: none; }
    .page, .topbar { padding-inline: 16px; }
}

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

/* --------------------------------------------------- Formulare und Listen */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.card-foot {
    display: flex;
    gap: 8px;
    padding: 14px 18px;
    border-top: 1px solid var(--line-soft);
    background: var(--bg-sunken);
}

.toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.toolbar input[type="search"],
.toolbar select {
    font: inherit;
    font-size: 13px;
    color: var(--text-strong);
    background: var(--bg-sunken);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 7px 11px;
    min-height: 36px;
}
.toolbar input[type="search"] { flex: 1 1 16rem; }

.check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--text-body);
    cursor: pointer;
    min-height: 36px;
}
.check input { width: 16px; height: 16px; }

tfoot td {
    border-top: 2px solid var(--line);
    background: var(--bg-sunken);
    padding: 11px 18px;
    font-size: 13.5px;
}

table input[type="time"] {
    font: inherit;
    font-size: 13.5px;
    font-variant-numeric: tabular-nums;
    color: var(--text-strong);
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 5px 8px;
    min-height: 34px;
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ------------------------------------------------------- Stundennachweis */
.monthnav {
    display: flex; align-items: center; gap: 2px;
    border: 1px solid var(--line); border-radius: 10px;
    background: var(--bg-surface); padding: 3px;
}
.monthnav .btn { border: 0; min-height: 30px; padding: 0 10px; background: transparent; }
.monthnav .cur {
    font-size: 13.5px; font-weight: 600; color: var(--text-strong);
    padding: 0 12px; min-width: 120px; text-align: center;
}

.summary {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px; background: var(--line);
    border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.sum { background: var(--bg-surface); padding: 13px 16px; }
.sum .lb { font-size: 11.5px; color: var(--text-muted); font-weight: 550; }
.sum .vl {
    font-size: 22px; font-weight: 640; color: var(--text-strong);
    letter-spacing: -.025em; font-variant-numeric: tabular-nums; margin-top: 4px; line-height: 1.1;
}
.sum .vl small { font-size: 12.5px; color: var(--text-muted); font-weight: 550; margin-inline-start: 2px; }
.sum .ft { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

tr.wk td { background: var(--bg-sunken); padding: 6px 18px; border-top: 1px solid var(--line); }
.wk-inner {
    display: flex; align-items: center; font-size: 11px; color: var(--text-muted);
    font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
}
.wk-inner .tot { margin-inline-start: auto; text-transform: none; letter-spacing: 0; font-size: 12px; }
.wk-inner .tot b { color: var(--text-strong); font-variant-numeric: tabular-nums; }

tr.off td { background: var(--bg-inert); color: var(--text-muted); padding: 5px 18px; }
tr.today td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.today .dt .n { color: var(--accent); }

.dt { display: flex; align-items: baseline; gap: 7px; }
.dt .n {
    font-weight: 650; color: var(--text-strong);
    font-variant-numeric: tabular-nums; min-width: 20px; font-size: 14px;
}
.dt .w { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
tr.off .dt .n { color: var(--text-muted); font-size: 13px; }

.tin {
    width: 78px; font: inherit; font-size: 13.5px;
    font-variant-numeric: tabular-nums; color: var(--text-strong);
    background: var(--bg-surface); border: 1px solid var(--line);
    border-radius: 7px; padding: 5px 8px; text-align: center; min-height: 32px;
}
.tin:disabled { background: var(--bg-inert); color: var(--text-muted); }

.txt {
    width: 100%; font: inherit; font-size: 13px; color: var(--text-strong);
    background: var(--bg-surface); border: 1px solid transparent;
    border-radius: 7px; padding: 5px 8px; min-height: 32px;
}
.txt:hover:not(:disabled) { border-color: var(--line); }
.txt:disabled { color: var(--text-muted); }

.hrs {
    font-variant-numeric: tabular-nums; font-weight: 650;
    color: var(--text-strong); text-align: end; display: block; font-size: 14px;
}
.hrs.zero { color: var(--text-muted); font-weight: 500; }

/* Anwesenheit als Segmentschalter statt zweier Kontrollkästchen */
.pres {
    display: inline-flex; background: var(--bg-inert);
    border: 1px solid var(--line); border-radius: 8px; padding: 2px; gap: 2px;
}
.pres label { display: inline-flex; cursor: pointer; }
.pres input { position: absolute; opacity: 0; width: 0; height: 0; }
.pres span {
    font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 6px;
    color: var(--text-muted); white-space: nowrap; min-height: 26px;
    display: inline-flex; align-items: center;
}
.pres input:checked + span {
    background: var(--bg-surface); color: var(--text-strong); box-shadow: var(--shadow-card);
}
.pres input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.st {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
}
.st.ok { background: var(--ok-soft); color: var(--ok); }
.st.no { background: transparent; color: light-dark(#d8d8d6, #3a3a38); }
.st.sync { background: var(--info-soft); color: var(--info); }
.st.fail { background: var(--bad-soft); color: var(--bad); }

.saved-state { font-size: 12.5px; color: var(--text-muted); }
.saved-state.is-ok { color: var(--ok); font-weight: 550; }
.saved-state.is-error { color: var(--bad); font-weight: 600; }

/* Berechnungsgrundlage */
.crow {
    display: grid; grid-template-columns: 1fr 92px 118px 132px; gap: 10px;
    align-items: center; padding: 11px 18px;
    border-top: 1px solid var(--line-soft); font-size: 13.5px;
}
.crow:first-child { border-top: 0; }
.crow .lab { color: var(--text-strong); font-weight: 550; }
.crow .q, .crow .r, .crow .a { text-align: end; font-variant-numeric: tabular-nums; }
.crow .q { color: var(--text-strong); font-weight: 600; }
.crow .r { color: var(--text-muted); }
.crow .a { color: var(--text-strong); font-weight: 650; }
.crow.ot .q, .crow.ot .a { color: var(--gold); }
.crow.head { background: var(--bg-sunken); border-top: 0; }
.crow.head span {
    font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-muted); font-weight: 600;
}
.crow.total { border-top: 2px solid var(--line); background: var(--accent-soft); padding-block: 14px; }
.crow.total .lab { font-size: 15px; font-weight: 650; }
.crow.total .a { font-size: 20px; font-weight: 700; letter-spacing: -.02em; color: var(--accent); }

.notice {
    display: flex; gap: 10px; align-items: flex-start;
    border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.45;
}
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice b { display: block; font-weight: 650; }
.notice span { color: var(--text-body); opacity: .88; }

.chip-filter {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--line); background: var(--bg-surface); color: var(--text-muted);
    border-radius: 99px; padding: 5px 12px; font-size: 12.5px; font-weight: 550;
    text-decoration: none; min-height: 32px;
}
.chip-filter b { font-variant-numeric: tabular-nums; }
.chip-filter.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ------------------------------------------------------------ Abrechnung */
.kpis {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1px; background: var(--line-soft); border-bottom: 1px solid var(--line-soft);
}
.kpi { background: var(--bg-surface); padding: 12px 18px; }
.kpi .k {
    font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-muted); font-weight: 600;
}
.kpi .v {
    font-size: 19px; font-weight: 640; color: var(--text-strong);
    font-variant-numeric: tabular-nums; margin-top: 3px; letter-spacing: -.02em;
}
.kpi .v small { font-size: 12px; color: var(--text-muted); font-weight: 550; }
.kpi .v.gold { color: var(--gold); }

.crow .lab small {
    display: block; color: var(--text-muted);
    font-weight: 400; font-size: 11.5px; margin-top: 1px;
}
.crow.sub { background: var(--bg-inert); }
.crow.sub .lab, .crow.sub .a { font-weight: 600; }

.meter { height: 6px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }

.btn-sm { padding: 5px 10px; min-height: 32px; font-size: 12.5px; }

/* ------------------------------------------------------- Startseite */
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

.stack { display: flex; flex-direction: column; }
.item {
    display: flex; gap: 12px; padding: 13px 18px;
    border-top: 1px solid var(--line-soft); align-items: flex-start;
}
.item:first-child { border-top: 0; }
.item:hover { background: var(--bg-hover); }
.item .mark {
    width: 34px; height: 34px; border-radius: 10px; flex: none;
    display: grid; place-items: center;
}
.item .t { font-size: 13.5px; color: var(--text-strong); font-weight: 550; line-height: 1.3; }
.item .d { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.item .go { margin-inline-start: auto; align-self: center; color: var(--text-muted); }

.date-chip {
    width: 42px; flex: none; text-align: center; border-radius: 9px;
    border: 1px solid var(--line); padding: 4px 0; background: var(--bg-sunken);
}
.date-chip b {
    display: block; font-size: 15px; color: var(--text-strong);
    font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums;
}
.date-chip span {
    font-size: 10px; text-transform: uppercase;
    letter-spacing: .05em; color: var(--text-muted);
}

.chart { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 8px; }
.bar-col {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 8px; height: 100%; justify-content: flex-end;
}
.bar { width: 100%; max-width: 30px; border-radius: 5px 5px 0 0; background: var(--accent-soft); }
.bar-col.now .bar { background: var(--accent); }
.bar-lab { font-size: 11px; color: var(--text-muted); font-weight: 550; }
.bar-col.now .bar-lab { color: var(--text-strong); font-weight: 700; }

/* ==========================================================================
   Ausbaustufe 8: Benachrichtigungen, Dateien, Berichte, Arbeitsplan
   ========================================================================== */

/* ------------------------------------------------------------- Kopfzeile */
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }

.bell {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 9px;
    color: var(--text-muted); text-decoration: none;
    border: 1px solid transparent;
}
.bell:hover { background: var(--bg-hover); color: var(--text-strong); border-color: var(--line); }
.bell.has-unread { color: var(--accent); }
.bell-count {
    position: absolute; top: -3px; inset-inline-end: -3px;
    min-width: 17px; height: 17px; padding: 0 4px;
    display: grid; place-items: center;
    border-radius: 99px; background: var(--bad); color: #fff;
    font-size: 10px; font-weight: 700; line-height: 1;
    font-variant-numeric: tabular-nums;
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* -------------------------------------------------------- Benachrichtigungen */
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-sunken);
        border: 1px solid var(--line); border-radius: 10px; }
.tab {
    padding: 5px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 550;
    color: var(--text-muted); text-decoration: none;
}
.tab:hover { color: var(--text-strong); }
.tab.is-active { background: var(--bg-surface); color: var(--text-strong); box-shadow: var(--shadow-sm); }

.notif-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.notif {
    display: flex; gap: 12px; align-items: flex-start;
    background: var(--bg-surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 12px 14px;
}
/* Ungelesenes bekommt eine Kante, keine Farbfläche - lesbar bleibt lesbar. */
.notif.is-unread { border-inline-start: 3px solid var(--accent); }
.notif.sev-warning.is-unread { border-inline-start-color: var(--warn); }
.notif.sev-error.is-unread   { border-inline-start-color: var(--bad); }
.notif.sev-success.is-unread { border-inline-start-color: var(--ok); }
.notif-body { flex: 1; min-width: 0; }
.notif-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.notif-text { margin: 5px 0 0; font-size: 12.5px; color: var(--text-body); line-height: 1.5; }
.notif-actions { display: flex; gap: 6px; align-items: center; flex: none; }

.tag {
    font-size: 10.5px; font-weight: 650; letter-spacing: .03em; text-transform: uppercase;
    border-radius: 5px; padding: 2px 6px;
}
.tag-info    { background: var(--info-soft); color: var(--info); }
.tag-success { background: var(--ok-soft);   color: var(--ok); }
.tag-warning { background: var(--warn-soft); color: var(--warn); }
.tag-error   { background: var(--bad-soft);  color: var(--bad); }

.muted { color: var(--text-muted); font-size: 12px; }
.empty { padding: 28px; text-align: center; color: var(--text-muted); }
.empty p { margin: 0; }

/* ----------------------------------------------------------------- Dateien */
.attach { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 3px; }
.attach a { color: var(--accent); text-decoration: none; word-break: break-all; }
.attach a:hover { text-decoration: underline; }
.attach form { display: inline; }
.attach-add { margin: 4px 0 6px; }
.attach-add input[type="file"] { font-size: 11px; max-width: 190px; }

.linklike {
    border: 0; background: none; padding: 0 2px; cursor: pointer;
    color: var(--text-muted); font: inherit; font-size: 14px; line-height: 1;
}
.linklike:hover { color: var(--bad); }

input[type="file"] {
    width: 100%; font: inherit; font-size: 12.5px; color: var(--text-body);
    border: 1px dashed var(--line); border-radius: 9px; padding: 8px 10px;
    background: var(--bg-sunken);
}
input[type="file"]:hover { border-color: var(--accent); }

/* ---------------------------------------------------------------- Berichte */
.report-block {
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px 14px; margin-bottom: 10px; background: var(--bg-sunken);
}
.report-block > summary {
    cursor: pointer; display: flex; align-items: center; gap: 10px;
    font-size: 13.5px; list-style: none;
}
.report-block > summary::-webkit-details-marker { display: none; }
.report-block > summary::before {
    content: "▸"; color: var(--text-muted); font-size: 11px; transition: transform .15s;
}
.report-block[open] > summary::before { transform: rotate(90deg); }
.report-block .form-stack { margin-top: 12px; }

.form-stack { display: flex; flex-direction: column; gap: 12px; }

.report-view { margin: 0; display: grid; gap: 12px; }
.report-view dt {
    font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-muted); font-weight: 600;
}
.report-view dd { margin: 3px 0 0; font-size: 13.5px; line-height: 1.55; }

.gap-row {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 8px 0; border-top: 1px solid var(--line-soft);
}
.gap-row:first-child { border-top: 0; }
.gap-weeks { display: flex; gap: 5px; flex-wrap: wrap; }
.gap-weeks a {
    font-size: 11.5px; font-variant-numeric: tabular-nums;
    border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px;
    color: var(--text-muted); text-decoration: none; background: var(--bg-surface);
}
.gap-weeks a:hover { border-color: var(--accent); color: var(--accent); }

/* ------------------------------------------------------------ Arbeitsplan */
.stat-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.stat {
    background: var(--bg-surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 14px 16px;
}
.stat .k {
    font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-muted); font-weight: 600;
}
.stat .v {
    font-size: 22px; font-weight: 700; letter-spacing: -.02em;
    font-variant-numeric: tabular-nums; margin-top: 4px;
}
.stat .s { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

tr.holiday td { background: var(--warn-soft); }
tr.break td   { background: var(--info-soft); }

/* ---------------------------------------------------------- Schlichte Seiten */
.plain-links { margin-top: 14px; text-align: center; font-size: 12.5px; }
.plain-links a { color: var(--accent); text-decoration: none; }
.plain-links a:hover { text-decoration: underline; }

.page-actions { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }

.notice-ok   { background: var(--ok-soft);   color: var(--ok);
               border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.45; }
.notice-warn { background: var(--warn-soft); color: var(--warn);
               border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.45; }

/* ==========================================================================
   Ausbaustufe 9: Stundenplan, Team, Downloads
   ========================================================================== */

/* ---------------------------------------------------------- Stundenplan */
.week-grid {
    display: grid; grid-template-columns: repeat(5, 1fr);
    gap: 1px; background: var(--line-soft);
    border-top: 1px solid var(--line-soft);
}
.week-col { background: var(--bg-surface); padding: 10px; min-height: 120px; }
.week-head {
    font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-muted); font-weight: 600; margin-bottom: 8px;
}
.week-empty { color: var(--text-muted); font-size: 13px; padding: 6px 0; }

.slot {
    position: relative;
    border: 1px solid var(--line); border-radius: 8px;
    padding: 7px 9px; margin-bottom: 6px; background: var(--bg-sunken);
}
.slot-time {
    font-size: 11px; color: var(--text-muted); font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.slot-subject { font-size: 13px; font-weight: 600; margin-top: 1px; }
.slot-room { font-size: 11.5px; color: var(--text-muted); }
.slot-note { font-size: 11px; color: var(--warn); margin-top: 3px; line-height: 1.35; }
.slot-del { position: absolute; top: 3px; inset-inline-end: 5px; }
.slot-del .linklike { font-size: 13px; }

@media (max-width: 900px) {
    .week-grid { grid-template-columns: 1fr; }
    .week-col { min-height: 0; }
}

/* ----------------------------------------------------------------- Team */
.team-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}
.team-card {
    display: flex; gap: 12px; align-items: flex-start;
    background: var(--bg-surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 14px;
}
.team-card.is-off { opacity: .55; }
.team-photo {
    width: 54px; height: 54px; flex: none; border-radius: 12px;
    object-fit: cover; background: var(--bg-sunken);
}
.team-initials {
    display: grid; place-items: center;
    font-size: 17px; font-weight: 650; color: var(--accent);
    background: var(--accent-soft);
}
.team-body { min-width: 0; flex: 1; }
.team-name { font-size: 14.5px; font-weight: 650; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.team-role { font-size: 12.5px; color: var(--accent); font-weight: 550; margin-top: 1px; }
.team-text { margin: 6px 0 0; font-size: 12.5px; color: var(--text-body); line-height: 1.5; }
.team-contact { margin-top: 7px; font-size: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.team-contact a { color: var(--accent); text-decoration: none; word-break: break-all; }
.team-contact a:hover { text-decoration: underline; }
.team-actions { margin-top: 9px; display: flex; gap: 6px; }

/* ==========================================================================
   Ausbaustufe 10: Nachrichten
   ========================================================================== */

/* Zwei Spalten, feste Höhe: der Verlauf scrollt in sich, die Seite nicht.
   Damit bleiben Kopf und Eingabefeld immer sichtbar. */
.mail {
    display: grid; grid-template-columns: 310px 1fr;
    gap: 14px; align-items: stretch;
    height: calc(100vh - 190px); min-height: 460px;
    /* .page ist ein Flex-Container; ohne dies schrumpft der Block auf seinen
       Inhalt zusammen und die Höhenangabe oben bliebe wirkungslos. */
    flex: none;
}

.mail-list, .mail-thread {
    display: flex; flex-direction: column; min-height: 0;
    background: var(--bg-surface); border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden;
}

/* ----------------------------------------------------------- Posteingang */
.mail-list-head { padding: 10px; border-bottom: 1px solid var(--line-soft); background: var(--bg-sunken); }
.mail-new { display: flex; gap: 6px; }
.mail-new select { flex: 1; min-width: 0; font-size: 12.5px; }
.mail-new .btn { flex: none; padding-inline: 10px; }

.mail-threads { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }

.thread {
    display: flex; gap: 10px; align-items: center;
    padding: 9px 10px; border-radius: 10px;
    text-decoration: none; color: inherit;
    border: 1px solid transparent;
}
.thread:hover { background: var(--bg-hover); }
.thread.is-active { background: var(--accent-soft); border-color: var(--accent); }

.thread-avatar {
    width: 36px; height: 36px; flex: none; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--bg-sunken); color: var(--text-muted);
    font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.thread.is-active .thread-avatar,
.thread.is-unread .thread-avatar { background: var(--accent); color: #fff; }
.thread-avatar.lg { width: 42px; height: 42px; font-size: 14px; }

.thread-body { flex: 1; min-width: 0; display: block; }
.thread-top { display: flex; align-items: baseline; gap: 8px; }
.thread-top b {
    font-size: 13.5px; font-weight: 600; flex: 1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thread-time { font-size: 11px; color: var(--text-muted); flex: none; }
.thread-preview {
    display: block; font-size: 12px; color: var(--text-muted); margin-top: 1px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thread-you { color: var(--text-muted); opacity: .8; }

/* Ungelesenes wird über Schriftstärke gezeigt, nicht über eine Farbfläche -
   die Liste bleibt so auch mit zwanzig Einträgen ruhig. */
.thread.is-unread .thread-top b { font-weight: 750; }
.thread.is-unread .thread-preview { color: var(--text-body); font-weight: 550; }

.thread-badge {
    flex: none; min-width: 19px; height: 19px; padding: 0 5px;
    display: grid; place-items: center; border-radius: 99px;
    background: var(--accent); color: #fff;
    font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------- Verlauf */
.mail-head {
    display: flex; align-items: center; gap: 11px;
    padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
    background: var(--bg-sunken); flex: none;
}
.mail-head-name { font-size: 14.5px; font-weight: 650; }
.mail-head-role { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

.mail-body {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 3px;
    scroll-behavior: smooth;
}

.mail-day { text-align: center; margin: 12px 0 8px; }
.mail-day span {
    font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
    text-transform: uppercase; color: var(--text-muted);
    background: var(--bg-sunken); border: 1px solid var(--line-soft);
    border-radius: 99px; padding: 3px 11px;
}

.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }

.bubble {
    max-width: min(76%, 560px);
    background: var(--bg-sunken); border: 1px solid var(--line);
    border-radius: 14px 14px 14px 4px;
    padding: 8px 12px 5px; margin-bottom: 5px;
}
.bubble-row.mine .bubble {
    background: var(--accent); border-color: var(--accent); color: #fff;
    border-radius: 14px 14px 4px 14px;
}
.bubble-text { font-size: 13.5px; line-height: 1.5; word-wrap: break-word; }
.bubble-time {
    font-size: 10.5px; color: var(--text-muted);
    text-align: end; margin-top: 2px; font-variant-numeric: tabular-nums;
}
.bubble-row.mine .bubble-time { color: rgb(255 255 255 / .75); }

.bubble-file {
    display: flex; align-items: center; gap: 8px; margin-top: 5px;
    padding: 7px 9px; border-radius: 9px; text-decoration: none;
    background: var(--bg-surface); border: 1px solid var(--line);
    color: var(--accent); font-size: 12.5px; font-weight: 550;
}
.bubble-file small { display: block; font-weight: 400; color: var(--text-muted); font-size: 11px; }
.bubble-file:hover { border-color: var(--accent); }
.bubble-row.mine .bubble-file {
    background: rgb(255 255 255 / .14); border-color: rgb(255 255 255 / .28); color: #fff;
}
.bubble-row.mine .bubble-file small { color: rgb(255 255 255 / .75); }

/* -------------------------------------------------------------- Eingabe */
.mail-compose {
    display: flex; align-items: flex-end; gap: 8px; flex: none;
    padding: 11px 14px; border-top: 1px solid var(--line-soft); background: var(--bg-sunken);
}
.mail-compose textarea {
    flex: 1; resize: none; min-height: 38px; max-height: 160px;
    font: inherit; font-size: 13.5px; line-height: 1.45;
    padding: 9px 12px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--bg-surface); color: var(--text-body);
}
.mail-compose textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

.clip {
    flex: none; width: 38px; height: 38px; border-radius: 10px;
    display: grid; place-items: center; cursor: pointer;
    border: 1px solid var(--line); background: var(--bg-surface); color: var(--text-muted);
}
.clip:hover { color: var(--accent); border-color: var(--accent); }
.clip input[type="file"] { display: none; }
.clip.has-file { background: var(--accent); border-color: var(--accent); color: #fff; }

.mail-compose .send {
    flex: none; width: 38px; height: 38px; padding: 0;
    display: grid; place-items: center; border-radius: 10px;
}

.mail-hint {
    flex: none; padding: 0 14px 9px; font-size: 11px; color: var(--text-muted);
    background: var(--bg-sunken);
}

.mail-empty {
    padding: 26px 18px; text-align: center; color: var(--text-muted); font-size: 13px;
}
.mail-empty p { margin: 0 0 3px; }
.mail-empty-lg {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 6px;
}

@media (max-width: 860px) {
    .mail { grid-template-columns: 1fr; height: auto; }
    .mail-list { max-height: 320px; }
    .mail-thread { min-height: 440px; }
    .mail-body { max-height: 50vh; }
}

/* Zahl am Menüpunkt (ungelesene Unterhaltungen). */
.rail-link { position: relative; }
.rail-count {
    margin-inline-start: auto;
    min-width: 18px; height: 18px; padding: 0 5px;
    display: grid; place-items: center; border-radius: 99px;
    background: var(--bad); color: #fff;
    font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Ausbaustufe 11: Benutzerhandbuch
   ========================================================================== */

.manual { display: grid; grid-template-columns: 232px 1fr; gap: 20px; align-items: start; }

/* Das Inhaltsverzeichnis bleibt beim Scrollen stehen - ein Handbuch liest
   niemand von oben nach unten, man springt hinein. */
.manual-toc {
    position: sticky; top: 18px;
    background: var(--bg-surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 12px 10px;
    display: flex; flex-direction: column; gap: 1px;
}
.manual-toc-title {
    font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-muted); font-weight: 600; padding: 2px 8px 8px;
}
.manual-toc a {
    display: flex; align-items: baseline; gap: 9px;
    padding: 6px 9px; border-radius: 8px;
    font-size: 12.5px; color: var(--text-body); text-decoration: none; line-height: 1.35;
}
.manual-toc a:hover { background: var(--bg-hover); color: var(--text-strong); }

.manual-nr {
    flex: none; font-size: 10.5px; font-weight: 700;
    color: var(--text-muted); font-variant-numeric: tabular-nums;
    min-width: 14px;
}

.manual-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.manual-section {
    background: var(--bg-surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 20px 24px;
    /* Ohne Abstand landet die Überschrift beim Sprung unter der Kopfzeile. */
    scroll-margin-top: 18px;
}
.manual-section h2 {
    display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
    font-size: 17px; margin: 0 0 12px;
    padding-bottom: 9px; border-bottom: 1px solid var(--line-soft);
}
.manual-section h2 .manual-nr { font-size: 13px; color: var(--accent); }
.manual-section h3 {
    font-size: 13.5px; font-weight: 650; margin: 18px 0 6px; color: var(--text-strong);
}
.manual-section h3:first-of-type { margin-top: 0; }
.manual-section p { margin: 0 0 9px; font-size: 13.5px; line-height: 1.6; }
.manual-section ul, .manual-section ol { margin: 0 0 10px; padding-inline-start: 20px; }
.manual-section li { font-size: 13.5px; line-height: 1.6; margin-bottom: 4px; }
.manual-section code {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 12px; background: var(--bg-sunken);
    border: 1px solid var(--line-soft); border-radius: 4px; padding: 1px 5px;
}
.manual-section table { margin: 4px 0 10px; }
.manual-section table td { font-size: 13px; }

/* Hinweiskästen: Warnung und Bestätigung sind verschieden wichtig und sollen
   verschieden aussehen. */
.manual-section .warn-note,
.manual-section .ok-note {
    border-inline-start: 3px solid; border-radius: 0 9px 9px 0;
    padding: 9px 13px; margin: 10px 0; font-size: 13px; line-height: 1.55;
}
.manual-section .warn-note { border-color: var(--warn); background: var(--warn-soft); }
.manual-section .ok-note   { border-color: var(--ok);   background: var(--ok-soft); }

.fuer {
    font-size: 10.5px; font-weight: 650; letter-spacing: .03em;
    text-transform: uppercase; color: var(--text-muted);
    background: var(--bg-sunken); border: 1px solid var(--line-soft);
    border-radius: 5px; padding: 2px 7px;
}

.faq { margin: 0; }
.faq dt {
    font-size: 13.5px; font-weight: 650; margin-top: 14px;
    color: var(--text-strong);
}
.faq dt:first-child { margin-top: 0; }
.faq dd {
    margin: 4px 0 0; padding-inline-start: 13px;
    border-inline-start: 2px solid var(--line);
    font-size: 13px; line-height: 1.6; color: var(--text-body);
}

.manual-foot {
    font-size: 12px; color: var(--text-muted); text-align: center;
    padding: 8px 0 4px; line-height: 1.55;
}

@media (max-width: 900px) {
    .manual { grid-template-columns: 1fr; }
    .manual-toc { position: static; }
}

/* Druckfassung: eine Spalte, keine Kästen, Kapitel nicht zerreißen. */
.manual-print .manual-section { page-break-inside: avoid; margin-bottom: 14px; }
.manual-print .manual-section h2 { font-size: 12pt; }
.manual-print .manual-section h3 { font-size: 10.5pt; }
.manual-print .manual-section p,
.manual-print .manual-section li { font-size: 9.5pt; }
.manual-print .warn-note, .manual-print .ok-note {
    border: 1px solid #9a9a96; border-inline-start-width: 3px;
    background: #fafaf8; padding: 7px 10px; font-size: 9pt;
}
.manual-print .manual-nr { color: #1d6b66; }

/* ==========================================================================
   Unterschrift hinterlegen
   ========================================================================== */

.sig-current { display: flex; gap: 16px; align-items: flex-start; }
.sig-current .k {
    font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-muted); font-weight: 600; margin-bottom: 6px;
}
.sig-current .s { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }
/* Weißer Grund: die Grafik ist schwarz auf durchsichtig und wäre im dunklen
   Erscheinungsbild sonst unsichtbar. */
.sig-current img {
    max-height: 78px; max-width: 340px;
    background: #fff; border: 1px solid var(--line);
    border-radius: 9px; padding: 8px 12px; display: block;
}

.sig-pad-wrap {
    position: relative;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
    height: 200px; overflow: hidden;
}
#sig-pad { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }

/* Die Linie zeigt, wo unterschrieben wird - ohne sie schwebt der Strich
   irgendwo in der Fläche. */
.sig-line {
    position: absolute; inset-inline: 34px; bottom: 52px; height: 1px;
    background: #c9c9c5; pointer-events: none;
}
.sig-hint {
    position: absolute; inset-inline-start: 0; inset-inline-end: 0; bottom: 28px;
    text-align: center; font-size: 12.5px; color: #9a9a96; pointer-events: none;
}

.sig-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 12px; }
.sig-or { font-size: 12px; color: var(--text-muted); margin-inline: 3px; }

/* ==========================================================================
   Hell / Dunkel umschalten
   ========================================================================== */

/* Die Farbtoken stehen schon durchgehend in light-dark(). Deshalb genügt es,
   die Farbwelt am Wurzelelement festzunageln - jedes Token folgt von selbst.
   Eine zweite Token-Ebene je Erscheinungsbild wäre doppelte Wahrheit. */
html[data-theme="light"] { color-scheme: only light; }
html[data-theme="dark"]  { color-scheme: only dark; }

.theme-switch {
    display: inline-flex; gap: 2px; padding: 3px;
    background: var(--bg-sunken); border: 1px solid var(--line);
    border-radius: 99px;
}
.theme-switch button {
    display: grid; place-items: center;
    width: 28px; height: 26px; padding: 0;
    border: 0; border-radius: 99px; background: transparent;
    color: var(--text-muted); cursor: pointer;
}
.theme-switch button:hover { color: var(--text-strong); }
.theme-switch button[aria-pressed="true"] {
    background: var(--bg-surface); color: var(--accent);
    box-shadow: var(--shadow-card);
}

/* Auf der Anmeldeseite gibt es keine Kopfzeile - dort schwebt der Schalter
   oben rechts, damit er auch vor der Anmeldung erreichbar ist. */
.theme-float { position: fixed; top: 16px; inset-inline-end: 16px; z-index: 5; }

@media print { .theme-switch, .theme-float { display: none; } }

/* Logo des Trägers in der Navigation. */
.brand-logo {
    width: 36px; height: 36px; flex: none; border-radius: 10px;
    display: grid; place-items: center; overflow: hidden;
    background: #fff; padding: 3px;
}
.brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

/* Vorschau in den Einstellungen. */
.logo-row { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.logo-preview {
    width: 190px; height: 96px; flex: none;
    display: grid; place-items: center; padding: 10px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-preview.is-empty { background: var(--bg-sunken); border-style: dashed; }
.logo-preview span { font-size: 12px; color: var(--text-muted); }
.logo-forms { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 10px; }
