/* Portalrahmen — Bauteile aus docs/workscope-ui-konzept.html.
   Klassennamen bewusst wie in der Vorlage, damit ein Abgleich möglich bleibt.
   Farben, Radien und Abstände kommen aus tokens.css. */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* ===== Grundgerüst ===== */
.screen {
    display: grid;
    grid-template-columns: minmax(13rem, 226px) minmax(0, 1fr);
    min-height: 100vh;
}

.side {
    background: var(--surface);
    border-right: 1px solid var(--stroke);
    display: flex;
    flex-direction: column;
    padding: 16px 12px 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 8px 18px;
}

.brand .logo {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, #3BAAEA, #0D6599);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    flex: none;
}

.brand b {
    font-size: 14px;
    color: var(--ink);
    display: block;
    line-height: 1.2;
}

.brand span {
    font-size: 11.5px;
    color: var(--ink-3);
}

/* ===== Abteilungsauswahl — ganz oben, vor allem anderen ===== */
.scopebox {
    margin-bottom: 6px;
}

.scopelab {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--ink-3);
    padding: 0 10px 5px;
}

.scopebtn {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    text-align: left;
    padding: 9px 11px;
    border: 1.5px solid transparent;
    background: var(--brand-soft);
    border-radius: 12px;
    cursor: pointer;
    font: inherit;
    color: var(--ink);
}

.scopebtn:hover {
    border-color: var(--accent);
}

.scopebtn .scdot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
    flex: none;
}

.scopebtn .scdot.aus {
    background: var(--ink-3);
}

.scopebtn b {
    font-size: 13.5px;
    color: var(--brand);
    display: block;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scopebtn span.scsub {
    font-size: 10.5px;
    color: var(--ink-2);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scopelist {
    margin-top: 4px;
    border: 1px solid var(--stroke);
    border-radius: var(--r-ctrl);
    background: var(--surface);
    box-shadow: var(--sh);
    overflow: hidden;
}

.scopelist button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 8px 11px;
    font: 600 12.5px var(--font);
    color: var(--ink-2);
    cursor: pointer;
}

.scopelist button:hover {
    background: var(--fill);
}

.scopelist button.on {
    color: var(--brand);
    background: var(--brand-soft);
}

/* ===== Navigation ===== */
.nav {
    display: flex;
    flex-direction: column;
}

.grp2 {
    padding: 16px 11px 6px;
}

.grp2 .gt {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--ink-3);
    display: block;
}

.grp2 .gs {
    font-size: 11px;
    color: var(--ink-3);
    display: block;
    margin-top: 2px;
    line-height: 1.35;
}

.grp2 .gt {
    color: var(--ink-2);
}

/* Linke Linie fasst die Gruppe zusammen — wie in der Vorlage. */
.ngroup {
    border-left: 2px solid var(--stroke);
    margin-left: 13px;
    padding-left: 5px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ngroup a {
    font-size: 13px;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-2);
    text-decoration: none;
    cursor: pointer;
}

.nav a svg {
    width: 17px;
    height: 17px;
    flex: none;
}

.nav a:hover {
    background: var(--fill);
}

.nav a.on {
    background: var(--brand-soft);
    color: var(--brand);
}

.nav a .badge {
    margin-left: auto;
    background: var(--amber-soft);
    color: var(--amber);
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 7px;
}

.sidefoot {
    margin-top: auto;
    border-top: 1px solid var(--stroke);
    padding: 11px 11px 2px;
    font-size: 11.5px;
    color: var(--ink-3);
    line-height: 1.6;
}

.sidefoot .ok {
    color: var(--green);
    font-weight: 600;
}

.sidefoot .warn {
    color: var(--amber);
    font-weight: 600;
}

/* ===== Werkzeugleiste ===== */
.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 22px 14px;
    flex: none;
    border-bottom: 1px solid var(--stroke);
    background: var(--surface);
    flex-wrap: wrap;
}

.title h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--ink);
    margin: 0;
}

.title .sub {
    font-size: 12.5px;
    color: var(--ink-2);
    margin-top: 2px;
}

.spacer {
    flex: 1;
}

.zdiv {
    width: 1px;
    height: 24px;
    background: var(--stroke-2);
    flex: none;
    margin: 0 3px;
}

.icobtn {
    width: 36px;
    height: 36px;
    border-radius: var(--r-ctrl);
    background: var(--surface);
    border: 1px solid var(--stroke);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--ink-2);
    flex: none;
}

.icobtn:hover {
    background: var(--fill);
}

.icobtn svg {
    width: 16px;
    height: 16px;
}

.prof {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3BAAEA, #0D6599);
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    display: grid;
    place-items: center;
    flex: none;
    cursor: pointer;
    border: 0;
}

.content {
    flex: 1;
    padding: 20px 22px 40px;
    min-width: 0;
}

/* ===== Knöpfe ===== */
.btn {
    border: 0;
    border-radius: var(--r-ctrl);
    padding: 0 15px;
    height: 36px;
    font: 600 13.5px var(--font);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: none;
    white-space: nowrap;
}

.btn.primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 2px 8px rgba(13, 101, 153, .28);
}

.btn.primary:hover {
    background: var(--brand-pressed);
}

.btn.primary:disabled {
    background: var(--stroke-2);
    box-shadow: none;
    cursor: default;
    color: #fff;
}

.btn.ghost {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--stroke);
}

.btn.ghost:hover {
    background: var(--fill);
}

.btn.ghost:disabled {
    color: var(--ink-3);
    cursor: default;
}

.btn.danger {
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red-soft);
}

.btn.sm {
    height: 30px;
    padding: 0 11px;
    font-size: 12.5px;
}

/* ===== Karten und Abschnitte ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--r-card);
    box-shadow: var(--sh);
    margin-bottom: 14px;
}

.card-h {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 10px;
}

.card-h h2 {
    font-size: 14.5px;
    font-weight: 700;
    flex: 1;
    color: var(--ink);
    margin: 0;
}

.card-h .note {
    font-size: 12px;
    color: var(--ink-3);
    font-weight: 500;
}

.card-b {
    padding: 2px 16px 16px;
}

/* Karte ohne eigenen Kopf — Inhalt direkt, mit gleicher Innenfläche. */
.card.pad {
    padding: 14px 16px 16px;
}

.card.pad > h2 {
    font-size: 14.5px;
    font-weight: 700;
    margin: 0 0 8px;
}

.hint {
    font-size: 12.5px;
    color: var(--ink-2);
    line-height: 1.55;
}

.knopfzeile {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.formfeld {
    display: block;
    margin-bottom: 14px;
    max-width: 26rem;
}

.formfeld > span {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2);
    margin: 0 0 5px 2px;
    display: block;
}

.ic {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--brand-soft);
    color: var(--brand);
    display: grid;
    place-items: center;
    flex: none;
}

.ic svg {
    width: 15px;
    height: 15px;
}

.ic.am {
    background: var(--amber-soft);
    color: var(--amber);
}

.ic.gr {
    background: var(--green-soft);
    color: var(--green);
}

.ic.rd {
    background: var(--red-soft);
    color: var(--red);
}

.sec {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .85px;
    text-transform: uppercase;
    color: var(--ink-3);
    margin: 24px 0 10px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.sec:first-child {
    margin-top: 0;
}

.sec .ln {
    flex: 1;
    height: 1px;
    background: var(--stroke);
}

/* ===== Pillen, Marken, Chips, Segmente ===== */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    flex: none;
    white-space: nowrap;
}

.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.purple { background: var(--purple-soft); color: var(--purple); }
.pill.grey { background: var(--fill-2); color: var(--ink-2); }

.pill .d {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}

.mk {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 5px;
    margin: 0 3px 2px 0;
    white-space: nowrap;
}

.mk.red { background: var(--red-soft); color: var(--red); }
.mk.amber { background: var(--amber-soft); color: var(--amber); }
.mk.green { background: var(--green-soft); color: var(--green); }
.mk.blue { background: var(--blue-soft); color: var(--blue); }
.mk.grey { background: var(--fill-2); color: var(--ink-2); }
.mk.purple { background: var(--purple-soft); color: var(--purple); }

.chip {
    border: 1px solid var(--stroke);
    background: var(--surface);
    border-radius: 999px;
    padding: 6px 13px;
    font: 600 12.5px var(--font);
    color: var(--ink-2);
    cursor: pointer;
    display: inline-flex;
    gap: 6px;
    align-items: center;
    white-space: nowrap;
    flex: none;
}

.chip:hover {
    background: var(--fill);
}

.chip.on,
.chip[aria-pressed="true"] {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.chip .n {
    background: var(--fill-2);
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 11px;
}

.chip.on .n,
.chip[aria-pressed="true"] .n {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

.seg {
    display: inline-flex;
    background: var(--fill-2);
    border-radius: 10px;
    padding: 3px;
    flex: none;
}

.seg button {
    border: 0;
    background: transparent;
    font: 600 12.5px var(--font);
    color: var(--ink-2);
    padding: 6px 13px;
    border-radius: 8px;
    cursor: pointer;
}

.seg button.on,
.seg button[aria-pressed="true"] {
    background: var(--surface);
    color: var(--brand);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

/* ===== Kennzahlen-Kacheln ===== */
.kpis {
    display: grid;
    gap: 12px;
}

.kpis.c4 { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.kpis.c3 { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.kpis.c2 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }

.kpi {
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--r-tile);
    padding: 13px 15px 12px;
    box-shadow: var(--sh);
    display: flex;
    flex-direction: column;
}

.kpi .l {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: var(--ink-3);
}

.kpi .v {
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -.025em;
    color: var(--ink);
    margin-top: 5px;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    display: flex;
    align-items: baseline;
    gap: 7px;
}

.kpi .v small {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-2);
}

.kpi .s {
    font-size: 12px;
    color: var(--ink-2);
    margin-top: 4px;
    line-height: 1.45;
}

.kpi.warn { border-color: #F0D6AC; }
.kpi.warn .v { color: var(--amber); }
.kpi.bad .v { color: var(--red); }
.kpi.good .v { color: var(--green); }

/* ===== Aufklappbarer Nachweis in Kacheln ===== */
.dd {
    margin-top: 11px;
    border-top: 1px solid var(--stroke);
    padding-top: 9px;
}

.dd > summary {
    list-style: none;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--brand);
    display: flex;
    align-items: center;
    gap: 7px;
    user-select: none;
}

.dd > summary::-webkit-details-marker {
    display: none;
}

.dd > summary::before {
    content: '▸';
    font-size: 11px;
    transition: transform .15s;
    display: inline-block;
}

.dd[open] > summary::before {
    transform: rotate(90deg);
}

.dd > summary:hover {
    color: var(--brand-pressed);
}

.dd-b {
    margin-top: 9px;
    border: 1px solid var(--stroke);
    border-radius: 11px;
    overflow: hidden;
    background: var(--bg);
}

.dd-b .cap {
    font-size: 11.5px;
    color: var(--ink-2);
    padding: 9px 12px;
    background: var(--fill);
    border-bottom: 1px solid var(--stroke);
    line-height: 1.5;
}

/* ===== Tabellen ===== */
.tblwrap {
    overflow-x: auto;
    border: 1px solid var(--stroke);
    border-radius: 11px;
}

.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    background: var(--surface);
}

.tbl th {
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: var(--ink-3);
    padding: 9px 11px;
    border-bottom: 1px solid var(--stroke);
    white-space: nowrap;
    background: var(--surface);
}

.tbl td {
    padding: 9px 11px;
    border-bottom: 1px solid var(--stroke);
    color: var(--ink);
    vertical-align: middle;
}

.tbl tbody tr:hover {
    background: var(--fill);
}

.tbl tbody tr:last-child td {
    border-bottom: 0;
}

.tbl .num {
    text-align: right;
    white-space: nowrap;
}

.tbl .mut {
    color: var(--ink-2);
}

.tbl tfoot td {
    font-weight: 700;
    border-bottom: 0;
    border-top: 1.5px solid var(--stroke-2);
    background: var(--fill);
}

.tid {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-3);
}

/* ===== Hinweisbanner ===== */
.banner {
    display: flex;
    gap: 11px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 12.5px;
    line-height: 1.55;
    align-items: flex-start;
    margin-bottom: 14px;
}

.banner.amber { background: var(--amber-soft); color: #7a4c0d; }
.banner.green { background: var(--green-soft); color: #0b5c41; }
.banner.red { background: var(--red-soft); color: #8f2723; }
.banner.blue { background: var(--blue-soft); color: #0b4d73; }

.banner b {
    display: block;
    margin-bottom: 2px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="hell"]) .banner.amber { color: #F0A23E; }
    :root:not([data-theme="hell"]) .banner.green { color: #2BB585; }
    :root:not([data-theme="hell"]) .banner.red { color: #F0605B; }
    :root:not([data-theme="hell"]) .banner.blue { color: #3BAAEA; }
}

:root[data-theme="dunkel"] .banner.amber { color: #F0A23E; }
:root[data-theme="dunkel"] .banner.green { color: #2BB585; }
:root[data-theme="dunkel"] .banner.red { color: #F0605B; }
:root[data-theme="dunkel"] .banner.blue { color: #3BAAEA; }

/* ===== Benutzerkachel mit Aufklappmenü ===== */
.profwrap {
    position: relative;
    flex: none;
}

.profmenu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 30;
    min-width: 15rem;
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: 13px;
    box-shadow: var(--sh-pop, 0 12px 24px rgba(15, 25, 35, .16), 0 34px 80px rgba(15, 25, 35, .28));
    padding: 6px;
}

.profmenu .kopf {
    padding: 8px 10px 10px;
    border-bottom: 1px solid var(--stroke);
    margin-bottom: 6px;
}

.profmenu .kopf b {
    display: block;
    font-size: 13px;
    color: var(--ink);
}

.profmenu .kopf span {
    display: block;
    font-size: 11.5px;
    color: var(--ink-3);
    margin-top: 1px;
}

.profmenu .abschnitt {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--ink-3);
    padding: 6px 10px 4px;
}

.profmenu .eintrag {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    border-radius: 9px;
    padding: 8px 10px;
    font: 600 12.5px var(--font);
    color: var(--ink-2);
    cursor: pointer;
}

.profmenu .eintrag:hover {
    background: var(--fill);
}

.profmenu .eintrag.on {
    background: var(--brand-soft);
    color: var(--brand);
}

.profmenu .eintrag svg {
    width: 15px;
    height: 15px;
    flex: none;
}

.profmenu .trenner {
    height: 1px;
    background: var(--stroke);
    margin: 6px 0;
}

/* ===== Leerzustand ===== */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 34px 16px 30px;
    gap: 3px;
}

.empty .eic {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: var(--fill);
    color: var(--ink-3);
    display: grid;
    place-items: center;
    margin-bottom: 12px;
}

.empty .eic svg {
    width: 26px;
    height: 26px;
}

.empty b {
    font-size: 14.5px;
    color: var(--ink);
}

.empty span {
    font-size: 12.5px;
    color: var(--ink-2);
    line-height: 1.55;
    max-width: 330px;
    margin-top: 3px;
}

.empty .acts {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

/* ===== Formularfelder ===== */
.flabel {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2);
    margin: 0 0 5px 2px;
    display: block;
}

.fhelp {
    font-size: 11.5px;
    color: var(--ink-3);
    margin: 5px 0 0 2px;
    line-height: 1.5;
}

.fgroup {
    margin-bottom: 17px;
}

.grid2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 14px;
}

.grid3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 14px;
}

/* Alle Eingabefelder — bewusst über den Ausschluss, weil ein Blazor-Feld
   ohne ausdrücklichen Typ gar kein type-Attribut rendert und ein Selektor
   auf input[type=text] es dann nicht erwischt. */
input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=file]),
select,
textarea {
    width: 100%;
    max-width: 100%;
    background: var(--fill);
    border: 1.5px solid transparent;
    border-radius: var(--r-ctrl);
    padding: 8px 12px;
    font: 14px var(--font);
    color: var(--ink);
    transition: .14s;
}

input:not([type=checkbox]):not([type=radio]):focus,
select:focus,
textarea:focus {
    outline: 0;
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder,
textarea::placeholder {
    color: var(--ink-3);
}

input:disabled,
select:disabled,
textarea:disabled {
    color: var(--ink-3);
    cursor: default;
}

/* Auswahlfeld mit eigenem Pfeil, sonst bleibt es systemgrau. */
select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
        linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
    background-position: calc(100% - 15px) calc(50% + 1px), calc(100% - 10px) calc(50% + 1px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 30px;
}

/* Kontrollkästchen: Markenfarbe statt Systemblau, größere Trefferfläche. */
input[type=checkbox],
input[type=radio] {
    width: 17px;
    height: 17px;
    accent-color: var(--accent);
    cursor: pointer;
    flex: none;
}

/* In Tabellen und Werkzeugleisten sollen Felder nicht die volle Breite nehmen. */
.tbl input,
.tbl select,
.toolbar select {
    width: auto;
    min-width: 6rem;
    padding: 6px 10px;
    font-size: 12.5px;
}

.toolbar select {
    padding-right: 28px;
}

/* ===== Fortschritt und Schalter ===== */
.prog {
    height: 7px;
    border-radius: 999px;
    background: var(--fill-2);
    overflow: hidden;
}

.prog i {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    flex: none;
    display: grid;
    place-items: center;
    font-size: 11.5px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #3BAAEA, #0D6599);
}

/* ===== Anmeldung / Assistent (eigener Rahmen) ===== */
.anmeldeseite {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--bg);
    padding: 20px;
}

.anmeldekarte {
    width: min(24rem, 94vw);
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--r-card);
    box-shadow: var(--sh);
    padding: 26px;
}

.fehltext {
    color: var(--red);
    font-size: 12.5px;
    line-height: 1.5;
}

/* ===== Zeitraster ===== */
.zeitraster .raster-kopf {
    display: flex;
    gap: .4rem;
    margin-bottom: .6rem;
}

.zeitraster td.zelle {
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    cursor: pointer;
    min-width: 1.7rem;
}

.zeitraster td.zelle.gebucht { background: var(--green-soft); }

.zeitraster td.zelle.luecke {
    background: repeating-linear-gradient(45deg, var(--amber-soft), var(--amber-soft) 3px, transparent 3px, transparent 6px);
}

.zeitraster td.zelle.abwesend { background: var(--blue-soft); }

.zeitraster td.zelle.wochenende,
.zeitraster td.zelle.betriebsfrei {
    background: var(--fill);
    color: var(--ink-3);
}

.zeitraster .zellen-detail {
    margin-top: .75rem;
    border: 1px solid var(--stroke);
    border-radius: var(--r-ctrl);
    padding: .75rem .9rem;
    background: var(--surface);
}

.zeitraster .marke.nachtrag {
    background: var(--purple-soft);
    color: var(--purple);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    padding: .05rem .45rem;
    margin-left: .35rem;
}

/* ===== Abrufanzeige in der Werkzeugleiste ===== */
.sync {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--ink-2);
    background: var(--fill);
    border-radius: 999px;
    padding: 6px 12px;
    flex: none;
    white-space: nowrap;
}

.sync .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    flex: none;
}

.sync.warn .dot {
    background: var(--amber);
}

.sync.busy {
    color: var(--accent);
    background: var(--accent-soft);
}

.sync.busy .dot {
    background: var(--accent);
}

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

.spin {
    animation: spin 900ms linear infinite;
}

/* ===== Trendbalken in Kacheln ===== */
.spark {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 26px;
    margin-top: 9px;
}

.spark i {
    flex: 1;
    background: var(--fill-2);
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    display: block;
}

.spark i.cur {
    background: var(--brand);
}

.sparkl {
    font-size: 10.5px;
    color: var(--ink-3);
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
}

/* ===== Stapelbalken mit Legende ===== */
.bar {
    display: flex;
    height: 16px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--fill-2);
    margin: 2px 0 10px;
}

.bar i {
    display: block;
    height: 100%;
}

.leg {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: var(--ink-2);
}

.leg span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.leg em {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    font-style: normal;
    flex: none;
}

/* ===== Rechenaufstellung (Kapazität) ===== */
.calc {
    font-size: 12.5px;
}

.calc .r {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--stroke);
}

.calc .r:last-child {
    border-bottom: 0;
}

.calc .k {
    flex: 1;
    color: var(--ink-2);
}

.calc .k b {
    color: var(--ink);
    font-weight: 600;
}

.calc .n {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    min-width: 86px;
    text-align: right;
    color: var(--ink);
}

.calc .r.tot {
    border-top: 1.5px solid var(--stroke-2);
    border-bottom: 0;
    margin-top: 4px;
    padding-top: 9px;
}

.calc .r.tot .k {
    color: var(--ink);
    font-weight: 700;
}

.calc .r.tot .n {
    font-size: 15px;
}

.calc .warnv .n {
    color: var(--amber);
}

.calc .r.sub .k,
.calc .r.sub .n {
    color: var(--ink-3);
    font-weight: 500;
    font-size: 11.5px;
}

/* ===== Einstellungen: Bereichsleiste und Kartenkennzeichnung ===== */
.scopebar {
    margin-bottom: 16px;
}

.scopebarin {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 14px;
    border-radius: 12px;
    background: var(--brand-soft);
}

.scopebarin b {
    display: block;
    font-size: 12.5px;
    color: var(--brand);
}

.scopebarin span {
    display: block;
    font-size: 11.5px;
    color: var(--ink-2);
    line-height: 1.5;
    margin-top: 1px;
}

.sctag {
    display: inline-block;
    margin-left: 9px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--brand-soft);
    color: var(--brand);
    vertical-align: middle;
    letter-spacing: .2px;
}

.sctag.sys {
    background: var(--fill-2);
    color: var(--ink-2);
}

/* ===== Ordnerbaum ===== */
.tree {
    border: 1px solid var(--stroke);
    border-radius: 12px;
    background: var(--surface);
    max-height: 230px;
    overflow-y: auto;
    padding: 6px;
}

.tnode {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 9px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--ink);
    border: 2px solid transparent;
    width: 100%;
    text-align: left;
    background: transparent;
    font-family: inherit;
}

.tnode:hover {
    background: var(--fill);
}

.tnode.sel {
    background: var(--accent-soft);
    border-color: var(--accent);
    font-weight: 600;
}

.tnode .wid {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--ink-3);
    opacity: .75;
    margin-left: auto;
}

/* ===== Umschalter ===== */
.sw {
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: var(--stroke-2);
    position: relative;
    cursor: pointer;
    flex: none;
    transition: .16s;
    border: 0;
    padding: 0;
}

.sw::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: .16s;
}

.sw.on {
    background: var(--accent);
}

.sw.on::after {
    transform: translateX(16px);
}

.swrow {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--stroke);
}

.swrow:last-child {
    border-bottom: 0;
}

.swrow .swtext {
    flex: 1;
}

.swrow .swtext b {
    display: block;
    font-size: 13px;
    color: var(--ink);
}

.swrow .swtext span {
    display: block;
    font-size: 11.5px;
    color: var(--ink-2);
    line-height: 1.5;
    margin-top: 1px;
}

.tabrow {
    display: flex;
    gap: 7px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

/* ===== Reiter ===== */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--stroke);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.tabs button {
    border: 0;
    background: transparent;
    font: 600 13px var(--font);
    color: var(--ink-2);
    padding: 9px 13px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tabs button:hover {
    color: var(--ink);
}

.tabs button[aria-selected="true"] {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

/* ===== Zeitraster als Wärmebild ===== */
.hmgrid {
    display: grid;
    gap: 3px;
    align-items: center;
}

.hmgrid .hc {
    height: 28px;
    border-radius: 5px;
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    background: var(--fill);
    cursor: pointer;
    transition: transform .08s;
    border: 0;
    color: var(--ink);
    font-family: inherit;
}

.hmgrid.wide .hc {
    height: 32px;
    border-radius: 7px;
    font-size: 11.5px;
}

.hmgrid .hc:hover {
    transform: scale(1.12);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(15, 25, 35, .22);
}

.hmgrid .hc.sel {
    outline: 2px solid var(--ink);
    outline-offset: 1px;
    z-index: 3;
}

.hmgrid .hc.fut {
    background: transparent;
    border: 1px dashed var(--stroke-2);
    cursor: default;
}

.hmgrid .hc.fut:hover {
    transform: none;
    box-shadow: none;
}

.hmgrid .hc.we {
    background: var(--fill);
    opacity: .5;
    cursor: default;
}

/* Lücke an einem Arbeitstag — gestrichelt hervorgehoben. */
.hmgrid .hc.gap {
    background: transparent;
    border: 1.5px dashed var(--amber);
    color: var(--amber);
}

.hmgrid .hc.abs {
    background: var(--blue-soft);
    color: var(--blue);
    cursor: default;
}

.hkw {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--ink-3);
    text-align: center;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--stroke);
    margin-bottom: 3px;
}

.hmgrid .hh {
    text-align: center;
    font-size: 9.5px;
    font-weight: 700;
    color: var(--ink-2);
    line-height: 1.2;
}

.hmgrid .hh span {
    display: block;
    font-size: 8.5px;
    font-weight: 500;
    color: var(--ink-3);
}

.hmgrid .hh.we {
    color: var(--ink-3);
}

.hmgrid .hh.today,
.hmgrid .hh.today span {
    color: var(--accent);
    font-weight: 700;
}

.hname {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
}

.avatar.sm {
    width: 24px;
    height: 24px;
    font-size: 10px;
    border-radius: 8px;
}

.hsum {
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
    padding-top: 4px;
    border-top: 1px solid var(--stroke);
}

/* ===== Zeilenauswahl ===== */
.row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 11px;
    border-radius: 11px;
    cursor: pointer;
    border: 2px solid transparent;
}

.row:hover {
    background: var(--fill);
}

.row.sel {
    background: var(--accent-soft);
    border-color: var(--accent);
}

/* ===== Dialog ===== */
.scrim {
    position: fixed;
    inset: 0;
    background: rgba(15, 25, 35, .35);
    display: grid;
    place-items: center;
    z-index: 40;
    padding: 24px;
}

.dlg {
    background: var(--surface);
    border-radius: 18px;
    box-shadow: var(--sh-pop, 0 12px 24px rgba(15, 25, 35, .16), 0 34px 80px rgba(15, 25, 35, .28));
    width: min(720px, 100%);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dlg.narrow {
    width: min(470px, 100%);
}

.dlg-h {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--stroke);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.dlg-h h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

.dlg-h .sub {
    font-size: 12.5px;
    color: var(--ink-2);
    margin-top: 2px;
}

.dlg-b {
    padding: 18px 22px;
    overflow-y: auto;
    flex: 1;
}

.dlg-f {
    padding: 14px 22px;
    border-top: 1px solid var(--stroke);
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--fill);
}

.mono {
    font-family: var(--mono);
    font-size: 11.5px;
}

.tnum {
    font-variant-numeric: tabular-nums;
}

.pos { color: var(--red); font-weight: 600; }
.neg { color: var(--green); font-weight: 600; }

/* ===== Bruchpunkte =====
   1280 / 1024 / 768, wie in CLAUDE.md vorgesehen. Unter 768 wird aus der
   Seitenleiste eine Schublade über dem Inhalt; der Burger im Seitenkopf öffnet
   sie. Die frühere Fassung stapelte die Leiste nur über den Inhalt — auf einem
   Telefon hätte man vor jeder Seite erst die ganze Navigation weggescrollt. */

/* Der Burger existiert nur schmal; darüber steht die Seitenleiste ohnehin. */
.burger {
    display: none;
    border: 1px solid var(--stroke);
    background: var(--surface);
    color: var(--ink-2);
    border-radius: 10px;
    width: 38px;
    height: 38px;
    flex: none;
    cursor: pointer;
    place-items: center;
}

.burger svg { width: 20px; height: 20px; }

.burger:hover { background: var(--fill); color: var(--ink); }

.side-scrim { display: none; }

@media (max-width: 1280px) {
    .screen { grid-template-columns: minmax(12rem, 200px) minmax(0, 1fr); }
}

@media (max-width: 1024px) {
    .content { padding: 16px 16px 32px; }
    .toolbar { padding: 14px 16px 12px; }
    .scrim { padding: 16px; }
}

@media (max-width: 768px) {
    .screen { grid-template-columns: minmax(0, 1fr); }

    .burger { display: grid; }

    /* Schublade: liegt über dem Inhalt, nicht daneben. */
    .side {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(19rem, 86vw);
        z-index: 60;
        overflow-y: auto;
        border-right: 1px solid var(--stroke);
        transform: translateX(-100%);
        transition: transform .18s ease-out;
        box-shadow: 0 0 0 rgba(15, 25, 35, 0);
    }

    .screen.menu-offen .side {
        transform: translateX(0);
        box-shadow: 0 12px 24px rgba(15, 25, 35, .16), 0 34px 80px rgba(15, 25, 35, .28);
    }

    .screen.menu-offen .side-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 50;
        border: 0;
        padding: 0;
        background: rgba(15, 25, 35, .35);
    }

    /* Der Seitenkopf bleibt erreichbar — auf einem Telefon ist er die einzige
       Stelle, an der Burger und Konto stehen. */
    .toolbar {
        position: sticky;
        top: 0;
        z-index: 30;
        padding: 10px 12px;
        gap: 8px;
        row-gap: 8px;
    }

    .title h1 { font-size: 17px; }

    .title .sub {
        font-size: 11.5px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Titel und Kachel in Zeile eins, Aktionen in Zeile zwei über die volle
       Breite — nebeneinander wären beide unbrauchbar schmal. */
    .toolbar .spacer { flex: 1 0 0; }

    .toolbar .zdiv { display: none; }

    .content { padding: 12px 12px 28px; }

    .sec { margin-top: 18px; }

    /* Vollflächige Dialoge: ein zentriertes Fenster mit Rand verschenkt auf
       390 px die halbe Fläche. */
    .scrim { padding: 0; place-items: stretch; }

    .dlg,
    .dlg.narrow {
        width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .dlg-h { padding: 14px 16px 12px; }
    .dlg-b { padding: 14px 16px; }

    .dlg-f {
        padding: 12px 16px;
        flex-wrap: wrap;
    }

    .dlg-f .btn { flex: 1 1 auto; justify-content: center; }

    .card-h {
        flex-wrap: wrap;
        row-gap: 6px;
    }

    /* Fingerbreite Ziele statt Mauszeigergenauigkeit. */
    .btn,
    .chip {
        min-height: 38px;
    }

    .knopfzeile { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    /* Aktionen des Seitenkopfs umbrechen auf eine eigene Zeile. */
    .toolbar .btn,
    .toolbar > a.btn { flex: 1 1 auto; justify-content: center; }

    .kpis.c4,
    .kpis.c3,
    .kpis.c2 { grid-template-columns: minmax(0, 1fr); }

    .grid2 { grid-template-columns: minmax(0, 1fr); }
}
