/*
 * Design-System project_na: Tokens und .ds-*-Komponenten.
 * Passt sich an die bestehende App an (Montserrat, dunkle Seitenleiste, rotes Logo-Akzent).
 */
:root {
    --ds-ink: #1f2a37;
    --ds-ink-soft: #5b6675;
    --ds-surface: #ffffff;
    --ds-surface-alt: #f6f7f9;
    --ds-line: #e6e9ee;
    --ds-line-strong: #cfd5dd;
    --ds-summary: #3a4656;
    --ds-accent: #c62d2d;
    --ds-focus: #2f6fd6;

    --ds-font: "Montserrat", "Helvetica Neue", Arial, sans-serif;
    --ds-text-xs: 11px;
    --ds-text-sm: 12px;
    --ds-text-md: 14px;

    --ds-radius-sm: 3px;
    --ds-radius-md: 6px;
    --ds-space-1: 4px;
    --ds-space-2: 8px;
    --ds-space-3: 12px;
    --ds-space-4: 16px;
}

/* ---------- Grundlage: Element-Stile, die bis 10/2026 aus Bootstrap 3 kamen (Rest liefert w3.css) ---------- */
body { color: #333; background-color: #fff; }
body, h1, h2, h3, h4, h5, h6 { font-family: "Montserrat", sans-serif; }
h1, h2, h3, h4, h5, h6 { line-height: 1.1; color: inherit; }
h1 { font-weight: 600; }
h2 { font-weight: 500; }
a { text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
p { margin: 0 0 10px; }
ul, ol { margin-top: 0; margin-bottom: 10px; }
ul ul, ul ol, ol ul, ol ol { margin-bottom: 0; }
dl { margin-top: 0; margin-bottom: 20px; }
dt { font-weight: 700; }
dd { margin-left: 0; }
blockquote { padding: 10px 20px; margin: 0 0 20px; font-size: 17.5px; border-left: 5px solid #eee; }
code, kbd, pre, samp { font-family: Menlo, Monaco, Consolas, "Courier New", monospace; }
code { padding: 2px 4px; font-size: 90%; color: #c7254e; background-color: #f9f2f4; border-radius: 4px; }
pre { display: block; padding: 9.5px; margin: 0 0 10px; font-size: 13px; line-height: 1.42857143; color: #333; word-break: break-all; word-wrap: break-word; background-color: #f5f5f5; border: 1px solid #ccc; border-radius: 4px; }
pre code { padding: 0; font-size: inherit; color: inherit; white-space: pre-wrap; background-color: transparent; border-radius: 0; }
table { border-spacing: 0; border-collapse: collapse; background-color: transparent; }
td, th { padding: 0; }
th { text-align: left; }
caption { padding-top: 8px; padding-bottom: 8px; color: #777; text-align: left; }
fieldset { min-width: 0; }
legend { width: 100%; margin-bottom: 20px; font-size: 21px; line-height: inherit; border: 0; border-bottom: 1px solid #e5e5e5; }
label { display: inline-block; max-width: 100%; margin-bottom: 5px; font-weight: 700; }
button, input, select, textarea { font-family: inherit; font-size: inherit; line-height: inherit; }
button, input[type="reset"], input[type="submit"], [role="button"] { cursor: pointer; }
button[disabled] { cursor: default; }
input[type="checkbox"], input[type="radio"] { margin: 4px 0 0; line-height: normal; }
input[type="file"] { display: block; }
input[type="search"] { -webkit-appearance: none; }
select[multiple], select[size] { height: auto; }
[hidden], .hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
@media print {
    .no-print, .hidden-print { display: none !important; }
    a[href]::after { content: none !important; }
}

/* ---------- Gantt ---------- */

.ds-gantt {
    --row-h: 32px;
    --list-w: 360px;
    --head-h: 48px;
    font-family: var(--ds-font);
    color: var(--ds-ink);
    font-variant-numeric: tabular-nums;
}

.ds-gantt-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--ds-space-2);
    margin: var(--ds-space-3) 0;
}
.ds-gantt-toolbar .ds-spacer { flex: 1 1 auto; }

.ds-segmented {
    display: inline-flex;
    border: 1px solid var(--ds-line-strong);
    border-radius: var(--ds-radius-md);
    overflow: hidden;
}
.ds-segmented a,
.ds-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--ds-space-1);
    padding: 6px 12px;
    font-size: var(--ds-text-sm);
    font-weight: 600;
    color: var(--ds-ink);
    background: var(--ds-surface);
    text-decoration: none;
    border: 0;
    cursor: pointer;
}
.ds-segmented a + a { border-left: 1px solid var(--ds-line-strong); }
.ds-segmented a[aria-current="true"] { background: var(--ds-ink); color: #fff; }
.ds-btn { border: 1px solid var(--ds-line-strong); border-radius: var(--ds-radius-md); }
.ds-segmented a:hover,
.ds-btn:hover { background: var(--ds-surface-alt); color: var(--ds-ink); text-decoration: none; }
.ds-segmented a[aria-current="true"]:hover { background: var(--ds-ink); color: #fff; }
.ds-segmented a:focus-visible,
.ds-btn:focus-visible,
.ds-gantt-toggle:focus-visible,
.ds-gantt-bar:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; }
.ds-gantt-range { font-size: var(--ds-text-md); font-weight: 600; min-width: 210px; text-align: center; }

/* Scrollflaeche: Kopf oben und Task-Spalte links bleiben stehen */
.ds-gantt-viewport {
    position: relative;
    overflow: auto;
    max-height: calc(100vh - 260px);
    min-height: 240px;
    border: 1px solid var(--ds-line-strong);
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface);
}
.ds-gantt-grid { position: relative; width: max-content; min-width: 100%; }

.ds-gantt-head,
.ds-gantt-row { display: flex; }
.ds-gantt-head {
    position: sticky;
    top: 0;
    z-index: 4;
    height: var(--head-h);
    background: var(--ds-surface);
    border-bottom: 1px solid var(--ds-line-strong);
}
.ds-gantt-cell-list {
    position: sticky;
    left: 0;
    z-index: 3;
    flex: 0 0 var(--list-w);
    width: var(--list-w);
    background: inherit;
    border-right: 1px solid var(--ds-line-strong);
}
.ds-gantt-head .ds-gantt-cell-list {
    z-index: 5;
    display: flex;
    align-items: flex-end;
    padding: 0 var(--ds-space-3) 6px;
    font-size: var(--ds-text-sm);
    color: var(--ds-ink-soft);
    gap: var(--ds-space-2);
}
.ds-gantt-head .ds-gantt-cell-list button {
    background: none;
    border: 0;
    padding: 0;
    color: var(--ds-ink-soft);
    font-size: var(--ds-text-sm);
    text-decoration: underline;
    cursor: pointer;
}
.ds-gantt-timescale { position: relative; }
.ds-gantt-scale-row { display: flex; height: 50%; }
.ds-gantt-scale-row > div {
    flex: 0 0 auto;
    overflow: hidden;
    white-space: nowrap;
    border-left: 1px solid var(--ds-line);
    font-size: var(--ds-text-xs);
    line-height: 24px;
    padding-left: 4px;
    color: var(--ds-ink-soft);
}
.ds-gantt-scale-row.is-top > div { font-weight: 600; color: var(--ds-ink); font-size: var(--ds-text-sm); overflow: visible; }
.ds-gantt-scale-row.is-top > div > span { position: sticky; left: calc(var(--list-w) + 6px); }
.ds-gantt-scale-row .is-today { color: var(--ds-accent); font-weight: 700; }

.ds-gantt-row {
    height: var(--row-h);
    background: var(--ds-surface);
    border-bottom: 1px solid var(--ds-line);
}
.ds-gantt-row[hidden] { display: none; }
.ds-gantt-row.is-group { background: var(--ds-surface-alt); font-weight: 700; }
.ds-gantt-row:hover { background: #fbfcfd; }
.ds-gantt-row.is-group:hover { background: var(--ds-surface-alt); }

/* Task-Spalte: Einrueckung mit Hilfslinien je Ebene */
.ds-gantt-label {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 6px;
    padding-right: var(--ds-space-2);
    padding-left: calc(var(--ds-space-3) + var(--depth, 0) * 18px);
    background-image: repeating-linear-gradient(to right, transparent 0 20px, var(--ds-line) 20px 21px, transparent 21px 38px);
    background-size: calc(var(--depth, 0) * 18px) 100%;
    background-repeat: no-repeat;
    background-position: var(--ds-space-3) 0;
    font-size: var(--ds-text-md);
    min-width: 0;
}
.ds-gantt-label a { color: var(--ds-ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-gantt-label a:hover { text-decoration: underline; }
.ds-gantt-label .ds-gantt-id { color: var(--ds-ink-soft); font-size: var(--ds-text-sm); flex: 0 0 auto; }
.ds-gantt-row.is-done .ds-gantt-label a { color: var(--ds-ink-soft); }
.ds-gantt-toggle {
    flex: 0 0 18px;
    height: 18px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ds-ink-soft);
    cursor: pointer;
    transition: transform .15s ease;
}
.ds-gantt-toggle[aria-expanded="false"] { transform: rotate(-90deg); }
.ds-gantt-toggle-spacer { flex: 0 0 18px; }
.ds-gantt-nodate { margin-left: auto; flex: 0 0 auto; font-size: var(--ds-text-xs); color: var(--ds-ink-soft); }

/* Zeitachse einer Zeile */
.ds-gantt-track { position: relative; flex: 0 0 auto; height: 100%; }

.ds-gantt-bar {
    position: absolute;
    top: 6px;
    height: calc(var(--row-h) - 13px);
    min-width: 6px;
    border-radius: var(--ds-radius-sm);
    background: var(--bar-color, #c9d3df);
    box-shadow: inset 0 0 0 1px rgba(31, 42, 55, .35);
    font-size: var(--ds-text-xs);
    line-height: calc(var(--row-h) - 13px);
    padding: 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ds-ink);
    cursor: grab;
    user-select: none;
    touch-action: none;
}
.ds-gantt-bar.is-done { opacity: .55; }
.ds-gantt-bar.clip-start { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.ds-gantt-bar.clip-end { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ds-gantt-bar.is-dragging { cursor: grabbing; box-shadow: inset 0 0 0 2px var(--ds-ink), 0 2px 6px rgba(31, 42, 55, .25); z-index: 2; }
.ds-gantt-bar.is-saving { opacity: .6; }

.ds-gantt-milestone {
    padding: 0;
    width: 14px;
    min-width: 14px;
    height: 14px;
    top: calc(var(--row-h) / 2 - 7px);
    transform: rotate(45deg);
    border-radius: 2px;
}

/* Sammelbalken fuer Eltern-Tasks und Projekte: duenne Klammer */
.ds-gantt-summary {
    position: absolute;
    bottom: 5px;
    height: 6px;
    background: var(--ds-summary);
    border-radius: 1px;
    pointer-events: none;
}
.ds-gantt-summary::before,
.ds-gantt-summary::after {
    content: "";
    position: absolute;
    top: 0;
    width: 0;
    height: 0;
    border-top: 6px solid var(--ds-summary);
}
.ds-gantt-summary::before { left: 0; border-right: 6px solid transparent; transform: translateY(100%); }
.ds-gantt-summary::after { right: 0; border-left: 6px solid transparent; transform: translateY(100%); }
.ds-gantt-summary.clip-start::before,
.ds-gantt-summary.clip-end::after { display: none; }
.is-group .ds-gantt-summary { background: var(--ds-ink-soft); }
.is-group .ds-gantt-summary::before,
.is-group .ds-gantt-summary::after { border-top-color: var(--ds-ink-soft); }

/* Hintergrund: Spaltenlinien, Wochenenden, Heute-Linie ueber alle Zeilen */
.ds-gantt-backdrop { position: absolute; top: var(--head-h); bottom: 0; pointer-events: none; z-index: 0; }
.ds-gantt-backdrop > .col { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--ds-line); }
.ds-gantt-backdrop > .col.is-weekend { background: var(--ds-surface-alt); }
.ds-gantt-row,
.ds-gantt-row.is-group { background: transparent; }
.ds-gantt-row .ds-gantt-cell-list { background: var(--ds-surface); }
.ds-gantt-row.is-group .ds-gantt-cell-list { background: var(--ds-surface-alt); }

.ds-gantt-today {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: var(--ds-accent);
    pointer-events: none;
}
.ds-gantt-backdrop.is-front { background: none; z-index: 2; }
.ds-gantt-today span {
    position: sticky;
    top: 2px;
    display: inline-block;
    transform: translateX(-50%);
    margin-left: 1px;
    padding: 1px 6px;
    border-radius: 9px;
    background: var(--ds-accent);
    color: #fff;
    font-size: var(--ds-text-xs);
    font-weight: 700;
}

.ds-gantt-empty {
    padding: 48px var(--ds-space-4);
    text-align: center;
    color: var(--ds-ink-soft);
}
.ds-gantt-empty strong { display: block; color: var(--ds-ink); font-size: var(--ds-text-md); margin-bottom: var(--ds-space-1); }

.ds-gantt-legend { display: flex; flex-wrap: wrap; gap: var(--ds-space-3); margin-top: var(--ds-space-2); font-size: var(--ds-text-sm); color: var(--ds-ink-soft); }
.ds-gantt-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -2px; margin-right: 4px; box-shadow: inset 0 0 0 1px rgba(31, 42, 55, .35); }
.ds-gantt-legend i.is-milestone { transform: rotate(45deg) scale(.8); }
.ds-gantt-legend i.is-summary { height: 5px; background: var(--ds-summary); box-shadow: none; vertical-align: 2px; }

/* ---------- Toast (ui-helpers.js) ---------- */
.ds-toast {
    position: fixed;
    right: var(--ds-space-4);
    bottom: 72px;
    z-index: 1050;
    max-width: 360px;
    padding: 10px 14px;
    border-radius: var(--ds-radius-md);
    background: var(--ds-ink);
    color: #fff;
    font-family: var(--ds-font);
    font-size: var(--ds-text-md);
    box-shadow: 0 4px 14px rgba(31, 42, 55, .25);
}
.ds-toast.is-error { background: var(--ds-accent); }

@media (max-width: 700px) {
    .ds-gantt { --list-w: 200px; }
    .ds-gantt-label .ds-gantt-id { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ds-gantt-toggle { transition: none; }
}

@media print {
    .ds-gantt-toolbar { display: none; }
    .ds-gantt-viewport { max-height: none; overflow: visible; border: 0; }
}

/* ---------- Gantt: Datum beim Ziehen, Bearbeiten-Dialog ---------- */
.ds-gantt-track { cursor: pointer; }
.is-group .ds-gantt-track { cursor: default; }
.ds-gantt-drag-label {
    position: absolute;
    top: -26px;
    transform: translateX(-50%);
    padding: 2px 8px;
    border-radius: var(--ds-radius-sm);
    background: var(--ds-ink);
    color: #fff;
    font-size: var(--ds-text-sm);
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    z-index: 6;
}
.ds-gantt-drag-label::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -5px;
    margin-left: -5px;
    border: 5px solid transparent;
    border-bottom: 0;
    border-top-color: var(--ds-ink);
}
.ds-gantt-drag-guide {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 2px dashed var(--ds-ink);
    pointer-events: none;
    z-index: 2;
}

.ds-dialog {
    width: min(420px, calc(100vw - 32px));
    padding: var(--ds-space-4) var(--ds-space-4) var(--ds-space-3);
    border: 1px solid var(--ds-line-strong);
    border-radius: var(--ds-radius-md);
    font-family: var(--ds-font);
    color: var(--ds-ink);
    box-shadow: 0 10px 30px rgba(31, 42, 55, .25);
}
.ds-dialog::backdrop { background: rgba(31, 42, 55, .35); }
.ds-dialog h3 { margin: 0 0 var(--ds-space-3); font-size: 16px; font-weight: 700; line-height: 1.35; }
.ds-dialog label { display: block; margin: var(--ds-space-2) 0 2px; font-size: var(--ds-text-sm); font-weight: 600; }
.ds-dialog-row { display: flex; gap: var(--ds-space-3); }
.ds-dialog-row > div { flex: 1 1 0; }
.ds-dialog-error { margin: var(--ds-space-2) 0 0; color: var(--ds-accent); font-size: var(--ds-text-sm); }
.ds-dialog-actions { display: flex; align-items: center; gap: var(--ds-space-2); margin-top: var(--ds-space-4); }
.ds-btn-primary { background: var(--ds-ink); border-color: var(--ds-ink); color: #fff; }
.ds-btn-primary:hover { background: var(--ds-summary); color: #fff; }

/* ==========================================================================
   Basis-Bausteine fuer alle Seiten (Vorschau: /styleguide)
   Gelten nur ueber .ds-*-Klassen.
   ========================================================================== */

:root {
    --ds-primary: var(--ds-ink);
    --ds-ok: #2f8a4c;
    --ds-text-lg: 16px;
    --ds-text-xl: 20px;
    --ds-field-h: 36px;
    --ds-label-w: 110px;
}

.ds-page { font-family: var(--ds-font); color: var(--ds-ink); font-size: var(--ds-text-md); line-height: 1.5; font-variant-numeric: tabular-nums; }
.ds-page h1, .ds-page h2, .ds-page h3 { font-family: var(--ds-font); color: var(--ds-ink); margin: 0; }

/* Seitenkopf: Titel, Kontext darunter, Aktionen rechts */
.ds-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--ds-space-3); padding: var(--ds-space-2) 0 var(--ds-space-4); margin-bottom: var(--ds-space-4); border-bottom: 1px solid var(--ds-line); }
.ds-page-head h1 { font-size: var(--ds-text-xl); font-weight: 600; line-height: 1.3; }
.ds-page-head .ds-meta { margin-top: 2px; }
.ds-page-head .ds-actions { margin-left: auto; }
.ds-meta { color: var(--ds-ink-soft); font-size: var(--ds-text-sm); }
.ds-meta a { color: inherit; text-decoration: underline; text-decoration-color: var(--ds-line-strong); }
.ds-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-2); }

/* Knoepfe: ds-btn (Standard), ds-btn-primary (eine Hauptaktion je Seite), ds-btn-quiet, ds-btn-danger */
.ds-btn { min-height: 32px; font-family: var(--ds-font); line-height: 1.2; }
.ds-btn-quiet { border-color: transparent; background: transparent; color: var(--ds-ink-soft); }
.ds-btn-quiet:hover { color: var(--ds-ink); }
.ds-btn-danger { color: var(--ds-accent); }
.ds-btn-danger:hover { background: #fbeeee; color: var(--ds-accent); }
.ds-btn[disabled] { opacity: .5; cursor: default; }

/* Felder: Beschriftung im Feld (wie bisher na-input-group), schmal: Beschriftung darueber */
.ds-field { display: flex; align-items: stretch; min-height: var(--ds-field-h); margin: 0; border: 1px solid var(--ds-line-strong); border-radius: var(--ds-radius-md); background: var(--ds-surface); font-weight: 400; overflow: hidden; }
.ds-field:focus-within { border-color: var(--ds-focus); box-shadow: 0 0 0 3px rgba(47, 111, 214, .15); }
.ds-field-label { flex: 0 0 var(--ds-label-w); display: flex; align-items: center; padding: 0 var(--ds-space-3); background: var(--ds-surface-alt); border-right: 1px solid var(--ds-line); color: var(--ds-ink-soft); font-size: var(--ds-text-sm); font-weight: 600; white-space: nowrap; }
.ds-field .ds-input { border: 0; border-radius: 0; box-shadow: none; }
.ds-field.is-readonly .ds-input { background: var(--ds-surface-alt); color: var(--ds-ink-soft); }
.ds-field.has-error { border-color: var(--ds-accent); }
.ds-field-hint { margin: 4px 0 0; font-size: var(--ds-text-sm); color: var(--ds-ink-soft); }
.ds-field-hint.is-error { color: var(--ds-accent); }
.ds-input { flex: 1 1 auto; min-width: 0; width: 100%; height: auto; min-height: var(--ds-field-h); padding: 6px var(--ds-space-3); border: 1px solid var(--ds-line-strong); border-radius: var(--ds-radius-md); background: var(--ds-surface); color: var(--ds-ink); font: inherit; font-size: var(--ds-text-md); }
.ds-input:focus { outline: none; }
.ds-input:focus-visible:not(.ds-field .ds-input) { border-color: var(--ds-focus); box-shadow: 0 0 0 3px rgba(47, 111, 214, .15); }
.ds-check { display: inline-flex; align-items: center; gap: var(--ds-space-2); margin: 0; font-weight: 400; cursor: pointer; }
.ds-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--ds-ink); }
.ds-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--ds-space-3); align-items: start; }
.ds-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-3); }

@media (max-width: 600px) {
    .ds-field { flex-direction: column; }
    .ds-field-label { flex-basis: auto; padding: 4px var(--ds-space-3); border-right: 0; border-bottom: 1px solid var(--ds-line); }
}

/* Status-Chip: Farbe kommt aus der Tabelle status (farbcode) ueber --chip */
.ds-chip { --chip: #aaa; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 1px 9px 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--chip) 24%, #fff); color: var(--ds-ink); font-size: var(--ds-text-sm); font-weight: 600; line-height: 20px; white-space: nowrap; vertical-align: 1px; }
.ds-chip::before { content: ""; flex: 0 0 8px; height: 8px; border-radius: 50%; background: var(--chip); box-shadow: 0 0 0 1px color-mix(in srgb, var(--chip) 70%, #000); }
.ds-chip-meta { color: var(--ds-ink-soft); font-weight: 400; }

/* Aufgaben-Verweis im Fliesstext (Doku): [#Text|ID#] */
.ds-tasklink { --chip: #aaa; display: inline; padding: 1px 6px 1px 4px; border-radius: var(--ds-radius-sm); background: color-mix(in srgb, var(--chip) 18%, #fff); box-shadow: inset 3px 0 0 var(--chip); color: var(--ds-ink); text-decoration: none; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.ds-tasklink:hover { background: color-mix(in srgb, var(--chip) 32%, #fff); color: var(--ds-ink); text-decoration: none; }
.ds-tasklink .ds-tasklink-id { color: var(--ds-ink-soft); font-size: var(--ds-text-sm); margin-left: 2px; }
.ds-tasklink.is-done { color: var(--ds-ink-soft); text-decoration: line-through; text-decoration-color: var(--ds-line-strong); }

/* Bearbeiter als Initialen */
.ds-avatar { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ds-summary); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .02em; flex: 0 0 auto; }
.ds-person { display: inline-flex; align-items: center; gap: 6px; }

/* Karten und Abschnitte */
.ds-card { background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-md); }
.ds-card-head { display: flex; align-items: center; gap: var(--ds-space-2); padding: var(--ds-space-3) var(--ds-space-4); border-bottom: 1px solid var(--ds-line); }
.ds-card-head h2 { font-size: var(--ds-text-md); font-weight: 700; }
.ds-card-head .ds-count { margin-left: auto; color: var(--ds-ink-soft); font-size: var(--ds-text-sm); }
.ds-card-body { padding: var(--ds-space-4); }
.ds-section-title { margin: 0 0 var(--ds-space-2); font-size: var(--ds-text-sm); font-weight: 700; color: var(--ds-ink-soft); }

/* Zweispaltige Bearbeiten-Seite: Inhalt links, Eigenschaften rechts */
.ds-edit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--ds-space-4); align-items: start; }
.ds-edit-aside { position: sticky; top: 60px; }
.ds-props { display: grid; grid-template-columns: auto 1fr; gap: var(--ds-space-2) var(--ds-space-3); align-items: center; margin: 0; }
.ds-props dt { color: var(--ds-ink-soft); font-size: var(--ds-text-sm); font-weight: 600; }
.ds-props dd { margin: 0; }
.ds-props .ds-input { min-height: 32px; padding: 4px var(--ds-space-2); }
@media (max-width: 900px) {
    .ds-edit-layout { grid-template-columns: 1fr; }
    .ds-edit-aside { position: static; }
}

/* Tabellen: dicht, ruhig, Zahlen rechtsbuendig */
.ds-table { width: 100%; border-collapse: collapse; font-size: var(--ds-text-md); }
.ds-table th { padding: var(--ds-space-2) var(--ds-space-3); background: var(--ds-surface); border-bottom: 1px solid var(--ds-line-strong); color: var(--ds-ink-soft); font-size: var(--ds-text-sm); font-weight: 600; text-align: left; white-space: nowrap; }
.ds-table th a { color: inherit; text-decoration: none; }
.ds-table th[aria-sort] { color: var(--ds-ink); }
.ds-table th[aria-sort="ascending"] a::after { content: " \2191"; }
.ds-table th[aria-sort="descending"] a::after { content: " \2193"; }
.ds-table td { padding: var(--ds-space-2) var(--ds-space-3); border-bottom: 1px solid var(--ds-line); vertical-align: middle; }
.ds-table tbody tr:hover { background: #fbfcfd; }
.ds-table .is-num { text-align: right; }
.ds-table .is-muted { color: var(--ds-ink-soft); }
.ds-table td a { color: var(--ds-ink); }
.ds-table td .ds-id { color: var(--ds-ink-soft); font-size: var(--ds-text-sm); margin-right: 6px; }

/* Filterzeile ueber Listen */
.ds-filterbar { display: flex; flex-wrap: wrap; gap: var(--ds-space-2); align-items: center; margin-bottom: var(--ds-space-3); }
.ds-filterbar .ds-field { flex: 0 1 240px; --ds-label-w: auto; }
.ds-filterbar .ds-field-label { flex-basis: auto; }

/* Farbmuster nur fuer die Vorschau */
.ds-swatches { display: flex; flex-wrap: wrap; gap: var(--ds-space-3); }
.ds-swatch { width: 120px; font-size: var(--ds-text-sm); }
.ds-swatch i { display: block; height: 40px; margin-bottom: 4px; border-radius: var(--ds-radius-sm); box-shadow: inset 0 0 0 1px rgba(31, 42, 55, .12); }

/* Ergaenzungen fuer echte Seiten */
.ds-props label { margin: 0; font-weight: inherit; }
.ds-input-short { width: 90px; flex: 0 0 auto; }
.ds-editor .mce-tinymce { border: 1px solid var(--ds-line-strong) !important; border-radius: var(--ds-radius-md); overflow: hidden; box-shadow: none !important; }
.ds-alert { margin: 0 0 var(--ds-space-4); padding: var(--ds-space-3) var(--ds-space-4); border-radius: var(--ds-radius-md); border: 1px solid var(--ds-line-strong); background: var(--ds-surface-alt); }
.ds-alert.is-error { border-color: color-mix(in srgb, var(--ds-accent) 45%, #fff); background: #fbeeee; color: #7d1d1d; }
.ds-alert ul { margin: 4px 0 0; padding-left: 20px; }
.ds-alert p { margin: 0; }
.ds-badge { display: inline-block; padding: 0 6px; border-radius: var(--ds-radius-sm); font-size: var(--ds-text-xs); font-weight: 700; line-height: 18px; vertical-align: 1px; background: var(--ds-surface-alt); color: var(--ds-ink-soft); }
.ds-badge.is-warn { background: #fbeeee; color: var(--ds-accent); }
.ds-table .is-muted, .ds-page .is-muted { color: var(--ds-ink-soft); }
/* Select2 (Suchauswahl) innerhalb eines ds-field */
.ds-field .select2-container { flex: 1 1 auto; width: auto !important; min-width: 0; }
.ds-field .select2-container .select2-selection--single { height: 100%; min-height: calc(var(--ds-field-h) - 2px); border: 0; border-radius: 0; display: flex; align-items: center; }
.ds-field .select2-container .select2-selection__rendered { padding-left: var(--ds-space-3); color: var(--ds-ink); }
.ds-field .select2-container .select2-selection__arrow { height: 100%; }
/* Doku-Ansicht: <span class="ds-tasklink"><a>Text</a><span class="ds-tasklink-id">#ID</span></span> */
.ds-tasklink a { color: inherit; text-decoration: none; }
.ds-tasklink a:hover { text-decoration: underline; }

/* Startseite */
.ds-home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--ds-space-4); align-items: start; margin-bottom: var(--ds-space-4); }
.ds-home-list ul, .ds-home-activity ul { list-style: none; margin: 0; padding: 0; }
.ds-home-list li { display: flex; align-items: center; gap: var(--ds-space-2); padding: 7px var(--ds-space-4); border-top: 1px solid var(--ds-line); }
.ds-home-list li:first-child { border-top: 0; }
.ds-home-list li > a { flex: 1 1 auto; min-width: 0; color: var(--ds-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-home-list li > a:hover { color: var(--ds-ink); text-decoration: underline; }
.ds-home-list li.is-empty { color: var(--ds-ink-soft); }
.ds-home-list .ds-chip { flex: 0 0 auto; font-size: var(--ds-text-xs); line-height: 18px; }
.ds-card-head a.ds-count { color: var(--ds-ink-soft); text-decoration: underline; text-decoration-color: var(--ds-line-strong); }
.ds-home-bottom { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--ds-space-4); align-items: start; }
.ds-home-activity li { display: flex; gap: var(--ds-space-3); padding: 10px var(--ds-space-4); border-top: 1px solid var(--ds-line); }
.ds-home-activity li:first-child { border-top: 0; }
.ds-home-activity a { color: var(--ds-ink); font-weight: 600; }
.ds-home-activity .ds-id { color: var(--ds-ink-soft); font-weight: 400; margin-right: 4px; }
.ds-home-activity ul { max-height: 520px; overflow-y: auto; }

/* Karten mit Akzentfarbe (Startseite): Streifen oben, Symbol im Kopf */
:root {
    --ds-tone-blue: #2f6fd6;
    --ds-tone-violet: #6f52c4;
    --ds-tone-teal: #17897b;
    --ds-tone-amber: #c17a0a;
    --ds-tone-slate: #5b6675;
}
.ds-card.is-accent { --card-accent: var(--ds-tone-slate); border-top: 3px solid var(--card-accent); }
.ds-card-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 26px; height: 26px; border-radius: var(--ds-radius-md); background: color-mix(in srgb, var(--card-accent, var(--ds-ink)) 14%, #fff); color: var(--card-accent, var(--ds-ink)); font-size: 13px; }

/* Aufgabenansicht */
.ds-star { border: 0; background: none; padding: 0 4px 0 0; color: var(--ds-line-strong); font-size: 18px; vertical-align: 1px; cursor: pointer; }
.ds-star:hover { color: var(--ds-tone-amber); }
.ds-star.is-on { color: #e8a317; }
.ds-star:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; border-radius: 4px; }
.ds-content { overflow-wrap: anywhere; }
.ds-content img { max-width: 100%; height: auto; }
.ds-content > :first-child { margin-top: 0; }
.ds-content > :last-child { margin-bottom: 0; }
.ds-file { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 4px 0; }
.ds-comment-options { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-3); margin-top: var(--ds-space-3); }
.ds-comment-options .ds-field { flex: 0 1 260px; --ds-label-w: auto; }
.ds-file-input { position: relative; display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 6px 12px; border: 1px dashed var(--ds-line-strong); border-radius: var(--ds-radius-md); color: var(--ds-ink-soft); font-size: var(--ds-text-sm); font-weight: 600; cursor: pointer; }
.ds-file-input:hover { border-color: var(--ds-ink-soft); color: var(--ds-ink); }
.ds-file-input input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ds-comments { display: grid; gap: var(--ds-space-3); }
.ds-comment { display: flex; gap: var(--ds-space-3); }
.ds-comment > .ds-avatar { margin-top: 10px; }
.ds-comment-main { flex: 1 1 auto; min-width: 0; background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-md); }
.ds-comment.is-private .ds-comment-main { background: repeating-linear-gradient(-45deg, #fff, #fff 10px, var(--ds-surface-alt) 10px, var(--ds-surface-alt) 20px); }
.ds-comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--ds-space-2); padding: 8px var(--ds-space-4); border-bottom: 1px solid var(--ds-line); }
.ds-comment-edit { margin-left: auto; }
.ds-comment-body { padding: 10px var(--ds-space-4); overflow-wrap: anywhere; }
.ds-history > summary { cursor: pointer; list-style: none; }
.ds-history > summary::-webkit-details-marker { display: none; }
.ds-history > summary h2::before { content: "\25B8"; display: inline-block; margin-right: 6px; color: var(--ds-ink-soft); transition: transform .15s; }
.ds-history[open] > summary h2::before { transform: rotate(90deg); }
.ds-history:not([open]) > summary { border-bottom: 0; }
.ds-popover { position: absolute; top: 65px; right: 50px; z-index: 30; width: min(360px, calc(100vw - 32px)); box-shadow: 0 8px 24px rgba(31, 42, 55, .18); }
@media (max-width: 600px) { .ds-popover { position: fixed; top: 64px; left: 16px; right: 16px; width: auto; } }
.ds-edit-aside .na-reminder-list { margin: 0; padding-left: 18px; }
textarea.ds-input { display: block; resize: vertical; line-height: 1.5; }
.ds-badge.is-ok { background: color-mix(in srgb, var(--ds-ok) 14%, #fff); color: var(--ds-ok); }

/* ---------- Styleguide (/styleguide), nur fuer die Vorschau ---------- */
.ds-sg-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.ds-sg-toc { position: sticky; top: 60px; font-size: var(--ds-text-sm); }
.ds-sg-toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--ds-line); }
.ds-sg-toc a { display: block; padding: 4px 12px; color: var(--ds-ink-soft); text-decoration: none; }
.ds-sg-toc a:hover { color: var(--ds-ink); background: var(--ds-surface-alt); }
.ds-sg-section { padding: 8px 0 32px; margin-bottom: 8px; border-bottom: 1px solid var(--ds-line); scroll-margin-top: 60px; }
.ds-sg-section > h2 { font-size: var(--ds-text-lg); font-weight: 700; margin-bottom: 8px; }
.ds-sg-lead { max-width: 72ch; margin: 0 0 16px; color: var(--ds-ink-soft); }
.ds-sg-note { max-width: 72ch; margin: 8px 0 0; color: var(--ds-ink-soft); font-size: var(--ds-text-sm); }
.ds-sg-rules { max-width: 80ch; margin: 0; padding-left: 20px; }
.ds-sg-rules li { margin-bottom: 6px; }
.ds-sg-example { margin-bottom: 20px; }
.ds-sg-demo { padding: 20px; border: 1px solid var(--ds-line); border-radius: var(--ds-radius-md) var(--ds-radius-md) 0 0; background: repeating-conic-gradient(var(--ds-surface-alt) 0 25%, var(--ds-surface) 0 50%) 0 0 / 16px 16px; }
.ds-sg-example > .ds-sg-note { padding: 8px 12px; margin: 0; border: 1px solid var(--ds-line); border-top: 0; max-width: none; }
.ds-sg-code { border: 1px solid var(--ds-line); border-top: 0; border-radius: 0 0 var(--ds-radius-md) var(--ds-radius-md); }
.ds-sg-code > summary { padding: 6px 12px; cursor: pointer; color: var(--ds-ink-soft); font-size: var(--ds-text-sm); font-weight: 600; }
.ds-sg-code pre, .ds-sg-pre { margin: 0; padding: 12px; border: 0; border-radius: 0; background: var(--ds-surface-alt); font-size: 12px; line-height: 1.5; white-space: pre; overflow-x: auto; }
.ds-sg-pre { border-radius: var(--ds-radius-md); border: 1px solid var(--ds-line); }
.ds-page code { padding: 0; background: none; color: inherit; font-size: .92em; }
.ds-sg-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.ds-sg-space { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: var(--ds-text-sm); }
.ds-sg-space i { display: inline-block; height: 16px; background: var(--ds-tone-blue); }
.ds-sg-radius { width: 130px; padding: 10px; border: 1px solid var(--ds-line-strong); background: var(--ds-surface); font-size: var(--ds-text-sm); }
.ds-sg-static.ds-popover { position: static; }
.ds-sg-progress { height: 8px; margin-bottom: 16px; border-radius: 4px; background: var(--ds-surface-alt); overflow: hidden; }
.ds-sg-progress i { display: block; height: 100%; background: var(--ds-ok); }
.ds-sg-rules code, .ds-sg-section dl code { overflow-wrap: anywhere; }
.ds-sg-todo { min-width: 760px; }
.ds-sg-todo .ds-sg-area th { padding-top: 16px; background: var(--ds-surface-alt); color: var(--ds-ink); font-size: var(--ds-text-md); }
@media (max-width: 900px) {
    .ds-sg-layout { grid-template-columns: minmax(0, 1fr); }
    .ds-sg-toc { position: static; }
    .ds-sg-toc ol { display: flex; flex-wrap: wrap; border-left: 0; }
}

/* ---------- Bereich: Auswertungen und Start ---------- */
/* Diagramme (Google Charts): Flaeche fuellt die Karte, Hoehe ueber --chart-h */
.ds-chart { width: 100%; height: var(--chart-h, 360px); }
.ds-chart-empty { padding: var(--ds-space-4); color: var(--ds-ink-soft); }
/* Summenzeile in Tabellen */
.ds-table tfoot td, .ds-table tfoot th { border-top: 1px solid var(--ds-line-strong); border-bottom: 0; font-weight: 700; color: var(--ds-ink); }
.ds-table.is-compact td, .ds-table.is-compact th { padding: 6px var(--ds-space-3); }
.ds-report-stack { display: grid; gap: var(--ds-space-4); }
.ds-report-stack > .ds-card { min-width: 0; }
.ds-card-body.is-flush { padding: 0; }
.ds-card-head .ds-chip-meta { margin-left: auto; font-size: var(--ds-text-sm); }
/* Aufklappbare Abschnitte in Karten (Aktivitaet je Mitarbeiter) */
.ds-report-toggle { border-top: 1px solid var(--ds-line); }
.ds-report-toggle:first-child { border-top: 0; }
.ds-report-toggle > summary { display: flex; align-items: center; gap: var(--ds-space-2); padding: 10px var(--ds-space-4); cursor: pointer; font-weight: 600; list-style: none; }
.ds-report-toggle > summary::-webkit-details-marker { display: none; }
.ds-report-toggle > summary::before { content: "\25B8"; color: var(--ds-ink-soft); transition: transform .15s; }
.ds-report-toggle[open] > summary::before { transform: rotate(90deg); }
.ds-report-toggle > summary .ds-badge { margin-left: auto; }
.ds-report-toggle > div { padding: 0 var(--ds-space-4) var(--ds-space-3); overflow-x: auto; }
/* Aufwandsliste (hoursForCustomer) */
.ds-report-sheet-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ds-space-3); }
.ds-report-sheet-head img { max-width: 161px; height: auto; }
.ds-report-entry { padding: var(--ds-space-3) 0; border-top: 1px solid var(--ds-line); }
.ds-report-entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--ds-space-1) var(--ds-space-3); }
.ds-report-entry-head strong { font-size: var(--ds-text-md); }
.ds-report-entry-head .ds-report-hours { margin-left: auto; font-weight: 700; white-space: nowrap; }
.ds-report-entry ul { margin: var(--ds-space-2) 0 0; padding-left: 20px; }
/* Suche: Reiter, Gruppen, Treffer */
.ds-search-tabs { margin-bottom: var(--ds-space-4); flex-wrap: wrap; }
.ds-search-tabs a .ds-badge { margin-left: 2px; }
.ds-search-tabs a[aria-current="true"] .ds-badge { background: rgba(255, 255, 255, .2); color: #fff; }
.ds-search-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: var(--ds-space-4); align-items: start; }
.ds-home-list.is-wrap li > a { white-space: normal; }
.ds-page mark { padding: 0 1px; border-radius: 2px; background: color-mix(in srgb, var(--ds-tone-amber) 28%, #fff); color: inherit; }
/* Benachrichtigungen */
.ds-home-list li.is-read > a { color: var(--ds-ink-soft); }
.ds-home-list li .ds-meta { flex: 0 0 auto; white-space: nowrap; }
.ds-notice-text { display: block; overflow: hidden; text-overflow: ellipsis; }
/* Kalender (HTML aus App\Library\Calendar, Klassen na-cal-*) */
.ds-cal { overflow-x: auto; }
.ds-cal table.na-calendar { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0; table-layout: fixed; border: 1px solid var(--ds-line); border-radius: var(--ds-radius-md); background: var(--ds-surface); }
.ds-cal .na-cal-heading th { padding: var(--ds-space-3); font-size: var(--ds-text-lg); font-weight: 700; text-align: center; border-bottom: 1px solid var(--ds-line); }
.ds-cal .na-cal-heading a { display: inline-block; padding: 2px 10px; border: 1px solid var(--ds-line-strong); border-radius: var(--ds-radius-md); color: var(--ds-ink); font-size: var(--ds-text-sm); text-decoration: none; vertical-align: 2px; }
.ds-cal .na-cal-heading a:hover { background: var(--ds-surface-alt); }
.ds-cal .na-cal-week-heading td { padding: 6px var(--ds-space-2); color: var(--ds-ink-soft); font-size: var(--ds-text-sm); font-weight: 600; text-align: left; border-bottom: 1px solid var(--ds-line); }
.ds-cal .na-cal-days td { height: 96px; padding: 0; vertical-align: top; border-right: 1px solid var(--ds-line); border-bottom: 1px solid var(--ds-line); background: var(--ds-surface); }
.ds-cal .na-cal-days td:last-child { border-right: 0; }
.ds-cal .na-cal-days tr:last-child td, .ds-cal tr.na-cal-days:last-child td { border-bottom: 0; }
.ds-cal .na-cal-days td:nth-child(n+6) { background: var(--ds-surface-alt); }
.ds-cal .na-cal-days td:hover { background: #fbfcfd; }
.ds-cal .na-cal-day-num { padding: 4px var(--ds-space-2); color: var(--ds-ink-soft); font-size: var(--ds-text-sm); font-weight: 600; }
.ds-cal .na-cal-highlight { display: inline-block; margin: 2px 4px; padding: 0 7px; border-radius: 999px; background: var(--ds-accent); color: #fff; }
.ds-cal .na-cal-content { padding: 0 4px 4px; }
.ds-cal .na-cal-content ul { margin: 0 0 3px; padding: 0; list-style: none; }
.ds-cal .na-cal-content li { padding: 2px 6px; border-radius: var(--ds-radius-sm); background: color-mix(in srgb, var(--ds-tone-blue) 14%, #fff); box-shadow: inset 3px 0 0 var(--ds-tone-blue); font-size: var(--ds-text-sm); line-height: 1.3; overflow-wrap: anywhere; }
.ds-cal .na-cal-content li a { color: var(--ds-ink); text-decoration: none; }
.ds-cal .na-cal-content li a:hover { text-decoration: underline; }
.ds-cal .na-cal-content li:has(a[href*="notification/"]) { background: color-mix(in srgb, var(--ds-tone-amber) 16%, #fff); box-shadow: inset 3px 0 0 var(--ds-tone-amber); }
.ds-cal-legend { display: flex; flex-wrap: wrap; gap: var(--ds-space-3); margin-top: var(--ds-space-2); font-size: var(--ds-text-sm); color: var(--ds-ink-soft); }
.ds-cal-legend i { display: inline-block; width: 12px; height: 12px; margin-right: 4px; border-radius: 2px; vertical-align: -1px; }
@media (max-width: 700px) {
    .ds-cal table.na-calendar { min-width: 0; }
    .ds-cal .na-cal-heading th { padding: var(--ds-space-2); font-size: var(--ds-text-md); }
    .ds-cal .na-cal-week-heading td { padding: 4px 2px; text-align: center; font-size: var(--ds-text-xs); }
    .ds-cal .na-cal-days td { height: 64px; }
    .ds-cal .na-cal-day-num { padding: 2px 4px; font-size: var(--ds-text-xs); }
    .ds-cal .na-cal-highlight { margin: 2px; padding: 0 5px; }
    .ds-cal .na-cal-content { padding: 0 2px 2px; }
    .ds-cal .na-cal-content li { padding: 1px 3px; font-size: 10px; line-height: 1.2; }
}
@media print {
    .ds-report-sheet .ds-filterbar { display: none; }
}

/* ---------- Bereich: Konto und Verwaltung ---------- */
/* Login, Passwort, Nutzer anlegen: schmale zentrierte Formularkarte */
.ds-narrow { --ds-label-w: 160px; max-width: 460px; margin: 0 auto; }
.ds-narrow .ds-page-head { justify-content: center; text-align: center; border-bottom: 0; margin-bottom: 0; }
.ds-narrow .ds-card-body .ds-actions { margin-top: var(--ds-space-4); }
.ds-narrow .ds-btn-primary { flex: 1 1 auto; justify-content: center; min-height: var(--ds-field-h); }
.ds-narrow .ds-alert ul, .ds-narrow .ds-alert p { margin-top: 0; }
.ds-alert.is-ok { border-color: color-mix(in srgb, var(--ds-ok) 45%, #fff); background: color-mix(in srgb, var(--ds-ok) 10%, #fff); color: #1d5a31; }

/* Grocery CRUD, Theme "ds" (public/assets/grocery_crud/themes/ds, Rahmen admin_gcrud.php). Klassen ohne ds-
   Praefix sind Hooks aus Groceries JavaScript; die Bootstrap-Optik dieser Klassen wird hier neutralisiert. */
.ds-crud { margin-bottom: 50px; }
.ds-crud-body > br { display: none; }
.ds-crud .hidden { display: none !important; }
.ds-crud-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ds-crud .ds-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: var(--ds-text-sm); font-weight: 600; text-decoration: none; cursor: pointer; }
.ds-crud .ds-btn.disabled { opacity: .4; pointer-events: none; }
.ds-crud .ds-btn-primary, .ds-crud .ds-btn-primary:hover, .ds-crud .ds-btn-primary:focus { color: #fff; }

/* Liste: Werkzeugleiste, Tabelle, Fuss */
.ds-crud-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-2); margin-bottom: var(--ds-space-3); }
.ds-crud-toolbar .ds-actions { margin-left: auto; }
.ds-crud-search { position: relative; flex: 0 1 320px; --ds-label-w: auto; }
.ds-crud-search .ds-input { padding-right: 30px; }
.ds-crud-search .ds-input::-webkit-search-cancel-button { display: none; }
.ds-crud .clear-all-search, .ds-crud .clear-search { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--ds-ink-soft); cursor: pointer; }
.ds-crud .clear-all-search:hover, .ds-crud .clear-search:hover { color: var(--ds-ink); }
.ds-crud-scroll { overflow-x: auto; }
.ds-crud .grocery-crud-table { margin: 0; }
.ds-crud .grocery-crud-table tbody td { white-space: nowrap; }
.ds-crud .grocery-crud-table th.column-with-ordering { cursor: pointer; user-select: none; }
.ds-crud .grocery-crud-table th.column-with-ordering:hover { color: var(--ds-ink); }
.ds-crud .grocery-crud-table th.column-with-ordering > div { display: inline; }
.ds-crud .grocery-crud-table th.column-with-ordering .fa { margin-left: 4px; font-size: 10px; }
.ds-crud .grocery-crud-table th.active { color: var(--ds-ink); }
.ds-crud .grocery-crud-table td.active { background: color-mix(in srgb, var(--ds-surface-alt) 60%, transparent); }
.ds-crud .gc-search-row td { position: relative; padding-top: var(--ds-space-1); padding-bottom: var(--ds-space-2); background: var(--ds-surface-alt); border-bottom-color: var(--ds-line-strong); }
.ds-crud .searchable-input { min-width: 110px; min-height: 30px; padding: 3px var(--ds-space-2); font-size: var(--ds-text-sm); }
.ds-crud .searchable-input.value-not-empty { border-color: var(--ds-ink); padding-right: 24px; }
.ds-crud .grocery-crud-table tbody tr.table-warning { background: #fff8e6; }
.ds-crud-check { width: 28px; padding-right: 0 !important; }
.ds-crud-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--ds-ink); }
.ds-crud-actions-col { width: 1%; }
.ds-crud-row-actions { white-space: nowrap; }
.ds-crud-row-actions .ds-btn { min-height: 28px; padding: 3px 8px; }
.ds-crud-empty td { padding: 24px var(--ds-space-4); color: var(--ds-ink-soft); text-align: center; }
.ds-crud-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-3); padding: var(--ds-space-3) var(--ds-space-4); border-top: 1px solid var(--ds-line); }
.ds-crud-perpage { display: inline-flex; align-items: center; gap: var(--ds-space-2); margin: 0 0 0 auto; font-weight: 400; }
.ds-crud-perpage .ds-input { width: auto; min-height: 30px; padding: 2px var(--ds-space-2); }
.ds-crud-pager { display: inline-flex; align-items: center; gap: var(--ds-space-1); }
.ds-crud-pager .ds-btn { justify-content: center; min-width: 32px; padding: 6px; }
.ds-crud-pager .page-number-input { width: 64px; min-height: 32px; padding: 4px 6px; text-align: center; }
.ds-crud .loading-opacity { opacity: .5; }

/* Loeschen-Bestaetigung (gc-modal) und Meldungen (bootstrap-growl) */
.ds-crud-modal { display: none; position: fixed; inset: 0; z-index: 1050; overflow-y: auto; }
.ds-crud-modal .ds-crud-dialog { width: auto; max-width: 420px; margin: 12vh auto 0; padding: var(--ds-space-4); border-radius: var(--ds-radius-md); background: var(--ds-surface); box-shadow: 0 12px 40px rgba(31, 42, 55, .25); font-family: var(--ds-font); color: var(--ds-ink); }
.ds-crud-modal h3 { margin: 0 0 var(--ds-space-2); font-size: 16px; font-weight: 700; }
.ds-crud-modal p { margin: 0; }
body > .modal-backdrop { position: fixed; inset: 0; z-index: 1040; background: rgb(31, 42, 55); opacity: 0; transition: opacity .15s linear; }
body > .modal-backdrop.in { opacity: .35; }
body.modal-open { overflow: hidden; }
.ds-crud-toast { max-width: 360px; padding: 10px 36px 10px 14px; border-radius: var(--ds-radius-md); background: var(--ds-ink); color: #fff; font-family: var(--ds-font); font-size: var(--ds-text-md); box-shadow: 0 4px 14px rgba(31, 42, 55, .25); }
.ds-crud-toast.alert-danger { background: var(--ds-accent); }
.ds-crud-toast a { color: #fff; text-decoration: underline; }
.ds-crud-toast-close { border: 0; background: transparent; color: #fff; font-size: 18px; line-height: 1; opacity: .8; cursor: pointer; }

/* Formular: Beschriftung links, schmal darueber */
.ds-crud-form .ds-card { margin: 0; }
.ds-crud-fields { display: grid; grid-template-columns: minmax(140px, 200px) minmax(0, 1fr); gap: var(--ds-space-3) var(--ds-space-4); align-items: start; }
.ds-crud-field { display: contents; }
.ds-crud-field-label { margin: 0; padding-top: 7px; color: var(--ds-ink-soft); font-size: var(--ds-text-sm); font-weight: 600; }
.ds-crud-field-input { min-width: 0; }
.ds-crud-field-input.read-row { padding-top: 6px; }
.ds-crud .required { margin-left: 2px; color: var(--ds-accent); }
.ds-crud-field.has-error .ds-crud-field-label { color: var(--ds-accent); }
.ds-crud-field.has-error .form-control { border-color: var(--ds-accent); }
.ds-crud-fields > .report-div, .ds-crud-fields > #FormLoading { grid-column: 1 / -1; margin: 0; }
.ds-crud-fields > .report-div p { margin: 0; }
.ds-crud-form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-2); padding: var(--ds-space-3) var(--ds-space-4); border-top: 1px solid var(--ds-line); }

/* Eingaben, die Grocery erzeugt (form-control, chosen, jQuery-UI-Multiselect, Datum) */
.ds-crud .form-control { display: block; width: 100%; max-width: 640px; height: auto; min-height: var(--ds-field-h); padding: 6px var(--ds-space-3); border: 1px solid var(--ds-line-strong); border-radius: var(--ds-radius-md); box-shadow: none; background: var(--ds-surface); color: var(--ds-ink); font-family: var(--ds-font); font-size: var(--ds-text-md); }
.ds-crud .form-control:focus, .ds-crud .ds-input:focus { outline: none; border-color: var(--ds-focus); box-shadow: 0 0 0 3px rgba(47, 111, 214, .15); }
.ds-crud .ds-field .ds-input:focus { box-shadow: none; }
.ds-crud textarea.form-control { min-height: 120px; }
.ds-crud .datepicker-input, .ds-crud .datetime-input { display: inline-block; width: 220px; }
.ds-crud .datepicker-input-clear { margin-left: var(--ds-space-2); color: var(--ds-ink-soft); font-size: var(--ds-text-sm); }
.ds-crud .chosen-container { min-width: 220px; max-width: 640px; font-family: var(--ds-font); font-size: var(--ds-text-md); }
.ds-crud .chosen-container-single .chosen-single { height: var(--ds-field-h); line-height: 34px; padding-left: var(--ds-space-3); border-color: var(--ds-line-strong); border-radius: var(--ds-radius-md); background: var(--ds-surface); box-shadow: none; color: var(--ds-ink); }
.ds-crud .chosen-container-single .chosen-single div { top: 6px; }
.ds-crud .chosen-container-single .chosen-single abbr { top: 12px; }
.ds-crud .chosen-container-multi .chosen-choices { min-height: var(--ds-field-h); padding: 3px 4px; border-color: var(--ds-line-strong); border-radius: var(--ds-radius-md); background: var(--ds-surface); }
.ds-crud .chosen-container-multi .chosen-choices li.search-choice { border-color: var(--ds-line-strong); border-radius: 999px; background: var(--ds-surface-alt); box-shadow: none; color: var(--ds-ink); }
.ds-crud .chosen-container-active .chosen-single, .ds-crud .chosen-container-active .chosen-choices { border-color: var(--ds-focus); box-shadow: 0 0 0 3px rgba(47, 111, 214, .15); }
.ds-crud .chosen-drop { border-color: var(--ds-line-strong); border-radius: 0 0 var(--ds-radius-md) var(--ds-radius-md); }
.ds-crud .ui-multiselect { display: flex; width: 100% !important; max-width: 640px; border: 1px solid var(--ds-line-strong); border-radius: var(--ds-radius-md); overflow: hidden; background: var(--ds-surface); font-family: var(--ds-font); font-size: var(--ds-text-sm); }
.ds-crud .ui-multiselect div.selected, .ds-crud .ui-multiselect div.available { float: none; flex: 1 1 50%; width: auto !important; min-width: 0; }
.ds-crud .ui-multiselect div.selected { border-right: 1px solid var(--ds-line); }
.ds-crud .ui-multiselect div.available { border-left: 0; }
.ds-crud .ui-multiselect .ui-widget-header { display: flex; align-items: center; gap: var(--ds-space-2); padding: 6px var(--ds-space-2); border: 0; border-bottom: 1px solid var(--ds-line); border-radius: 0; background: var(--ds-surface-alt); color: var(--ds-ink-soft); font-weight: 600; }
.ds-crud .ui-multiselect .ui-widget-header .count { flex: 1 1 auto; float: none; padding: 0; }
.ds-crud .ui-multiselect .ui-widget-header a { float: none; color: var(--ds-ink); text-decoration: none; }
.ds-crud .ui-multiselect input.search { float: none; flex: 1 1 auto; width: auto; min-width: 0; height: 26px; margin: 0; padding: 2px 6px; border: 1px solid var(--ds-line-strong); border-radius: var(--ds-radius-sm); font-size: var(--ds-text-sm); }
.ds-crud .ui-multiselect ul { height: 180px !important; }
.ds-crud .ui-multiselect li { display: flex; align-items: center; gap: 6px; height: auto; margin: 0; padding: 4px var(--ds-space-2); border: 0; border-bottom: 1px solid var(--ds-line); background: var(--ds-surface); color: var(--ds-ink); font-size: var(--ds-text-sm); line-height: 1.3; cursor: default; }
.ds-crud .ui-multiselect li:hover { background: var(--ds-surface-alt); }
.ds-crud .ui-multiselect li a.action { position: static; order: 2; margin-left: auto; }
.ds-crud .ui-multiselect li span.ui-icon-arrowthick-2-n-s { position: static; flex: 0 0 16px; opacity: .45; }
.ds-crud .ui-multiselect li.ui-draggable span.ui-icon-arrowthick-2-n-s { display: none; }
.ds-crud .ui-multiselect li.ui-state-hover, .ds-crud .ui-multiselect li.ui-state-highlight { background: var(--ds-surface-alt); }

@media (max-width: 700px) {
    .ds-crud-label { display: none; }
    .ds-crud-toolbar .ds-crud-search { flex: 1 1 100%; flex-direction: row; }
    .ds-crud-search .ds-field-label { border-right: 1px solid var(--ds-line); border-bottom: 0; }
    .ds-crud-toolbar .ds-actions { margin-left: 0; width: 100%; }
    .ds-crud-toolbar .ds-btn-primary { margin-left: auto; }
    .ds-crud-perpage { margin-left: 0; }
    .ds-crud-fields { grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-1); }
    .ds-crud-field-label { padding-top: var(--ds-space-2); }
    .ds-crud .chosen-container { min-width: 0; width: 100% !important; }
    .ds-crud .ui-multiselect { flex-direction: column; }
    .ds-crud .ui-multiselect div.selected { border-right: 0; border-bottom: 1px solid var(--ds-line); }
    .ds-crud .ui-multiselect ul { height: 140px !important; }
}
/* NaCrud-Tabelle (na_crud/table.php): Blaettern */
.ds-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--ds-space-1); margin-top: var(--ds-space-3); }
.ds-pager .w3-button { padding: 4px 10px; border: 1px solid var(--ds-line-strong); border-radius: var(--ds-radius-md); background: var(--ds-surface); color: var(--ds-ink); font-size: var(--ds-text-sm); }
.ds-pager .w3-button.w3-blue { background: var(--ds-ink) !important; border-color: var(--ds-ink); color: #fff !important; }

/* ---------- Bereich: Zeiterfassung ---------- */
/* Aufklapp-Knopf (glyphicon-chevron-*) fuer Tages- und Nutzerzeilen */
.tt-toggle { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 1px solid transparent; border-radius: var(--ds-radius-sm); background: transparent; color: var(--ds-ink-soft); font-size: 11px; cursor: pointer; vertical-align: middle; }
.tt-toggle:hover { background: var(--ds-surface-alt); border-color: var(--ds-line); color: var(--ds-ink); }
.tt-toggle:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 1px; }
.tt-table .tt-toggle-col { width: 36px; }
.tt-table .is-num { white-space: nowrap; }
.tt-table .tt-day td { font-weight: 600; }
.tt-table .tt-day .ds-meta, .tt-table .tt-day .ds-person { font-weight: 400; }
.tt-table .tt-day td { white-space: nowrap; }
.tt-table .tt-slot td { background: var(--ds-surface-alt); font-size: var(--ds-text-sm); }
.tt-table .tt-slot.is-locked td { color: var(--ds-ink-soft); }
.tt-table .tt-text { max-width: 420px; white-space: pre-line; }
.tt-table .tt-indent { padding-left: 40px; white-space: nowrap; }
.tt-table .tt-group td { background: var(--ds-surface-alt); font-weight: 700; }
.tt-table .tt-sum td, .tt-table tfoot td { border-top: 1px solid var(--ds-line-strong); border-bottom: 0; font-weight: 700; }
.tt-table .is-warn td { background: #fbeeee; }
.tt-row-actions { white-space: nowrap; text-align: right; }
.tt-row-actions .ds-btn { min-height: 26px; padding: 2px 8px; }

/* Neue Buchung: Feldraster, Kommentar und Knopfzeile ueber die ganze Breite */
.tt-entry { margin-bottom: var(--ds-space-4); }
.tt-entry-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--ds-space-3); }
.tt-entry-grid .tt-span-2 { grid-column: span 2; }
.tt-entry-grid .tt-span-all { grid-column: 1 / -1; }
.tt-duration .ds-input { min-width: 44px; text-align: right; }
.ds-field-label.tt-unit { flex: 0 0 auto; padding: 0 var(--ds-space-2); border-left: 1px solid var(--ds-line); border-right: 1px solid var(--ds-line); }
.ds-field-label.tt-unit:last-child { border-right: 0; }
@media (max-width: 1100px) {
    .tt-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .tt-entry-grid { grid-template-columns: minmax(0, 1fr); }
    .tt-entry-grid .tt-span-2 { grid-column: auto; }
    .tt-duration { flex-direction: row; flex-wrap: wrap; }
    .tt-duration > .ds-field-label:first-child { flex: 1 0 100%; }
    .tt-duration .ds-input { flex: 1 1 40px; }
    .ds-field-label.tt-unit { border-bottom: 0; }
}

/* Filter: breites Kundenfeld */
.ds-filterbar .ds-field.tt-field-wide { flex: 1 1 360px; }
.tt-filterbar .ds-field { min-width: 0; }
@media (max-width: 600px) {
    .tt-filterbar .ds-field { flex: 1 1 calc(50% - var(--ds-space-2)); }
    .ds-filterbar .ds-field.tt-field-wide { flex: 1 1 100%; }
}

/* Kennzahlen (Meine Zeiten) */
.tt-stats { display: flex; flex-wrap: wrap; gap: var(--ds-space-3); margin-bottom: var(--ds-space-4); }
.tt-stat { flex: 1 1 160px; display: flex; flex-direction: column; gap: 2px; padding: var(--ds-space-3) var(--ds-space-4); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-md); background: var(--ds-surface); }
.tt-stat-label { color: var(--ds-ink-soft); font-size: var(--ds-text-sm); font-weight: 600; }
.tt-stat-value { font-size: var(--ds-text-xl); font-weight: 600; text-align: right; }
.tt-stat.is-neg .tt-stat-value { color: var(--ds-accent); }

/* Abrechnung und Bestellungen: Karten mit Fusszeile */
.tt-block { margin-bottom: var(--ds-space-4); }
.tt-item-head { flex-wrap: wrap; }
.tt-item-head .ds-actions { margin-left: auto; }
.tt-items { grid-template-columns: minmax(0, 1fr); }
.tt-billcopy { display: inline-flex; flex-wrap: wrap; gap: var(--ds-space-1); align-items: center; }
.tt-billcopy .ds-input { width: 150px; min-height: 32px; padding: 4px var(--ds-space-2); }
.tt-card-foot { padding: var(--ds-space-2) var(--ds-space-4); border-top: 1px solid var(--ds-line); background: var(--ds-surface-alt); border-radius: 0 0 var(--ds-radius-md) var(--ds-radius-md); }
.tt-accounting .ds-input { min-height: 30px; padding: 3px 6px; font-size: var(--ds-text-sm); }
.tt-accounting .tt-num-input { width: 52px; text-align: right; }
.tt-accounting .tt-bill-input { width: 120px; }
.tt-accounting .tt-comment { min-width: 260px; }
.tt-total { justify-content: flex-end; }
.tt-orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--ds-space-4); align-items: start; }
.tt-orders .ds-card-head h2 a { color: var(--ds-ink); }
.tt-order-items { list-style: none; margin: 0; padding: var(--ds-space-2) var(--ds-space-4); }
.tt-order-items li { padding: 6px 0; border-bottom: 1px solid var(--ds-line); }
.tt-order-items li:last-child { border-bottom: 0; }
.tt-order-items a { color: var(--ds-ink); }
@media (max-width: 600px) {
    .tt-orders { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Bereich: Aufgaben ---------- */
/* Schmale Formularseite (Kommentar bearbeiten) */
.ds-page.ds-comment-form { max-width: 900px; }
.ds-page label.ds-section-title { display: block; }

/* Kanban: Spalten umbrechen in Zeilen (Ziehen ohne Scrollen), letzte Aktionen darunter bzw. ab 1700px rechts */
.ds-kanban-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-4); align-items: start; }
.ds-kanban { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--ds-space-3); align-items: stretch; }
.ds-kanban-col { display: flex; flex-direction: column; height: 420px; min-width: 0; background: var(--ds-surface-alt); border: 1px solid var(--ds-line); border-top: 3px solid var(--chip, var(--ds-line-strong)); border-radius: var(--ds-radius-md); }
.ds-kanban-col-head { display: flex; align-items: center; gap: var(--ds-space-2); padding: var(--ds-space-2) var(--ds-space-3); }
.ds-kanban-col-head .ds-count { margin-left: auto; color: var(--ds-ink-soft); font-size: var(--ds-text-sm); font-weight: 600; }
.ds-kanban-drop { flex: 1 1 auto; display: flex; flex-direction: column; gap: var(--ds-space-2); padding: 0 var(--ds-space-2) var(--ds-space-2); overflow-y: auto; border-radius: 0 0 var(--ds-radius-md) var(--ds-radius-md); transition: background .1s; }
.ds-kanban-drop.is-over { background: color-mix(in srgb, var(--chip, var(--ds-focus)) 14%, transparent); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--chip, var(--ds-focus)) 60%, #fff); }
.ds-kanban-card { flex: 0 0 auto; padding: var(--ds-space-2) var(--ds-space-3); background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-md); box-shadow: 0 1px 2px rgba(31, 42, 55, .06); cursor: grab; }
.ds-kanban-card:hover { border-color: var(--ds-line-strong); }
.ds-kanban-card:active { cursor: grabbing; }
.ds-kanban-title { color: var(--ds-ink); font-weight: 600; overflow-wrap: anywhere; }
.ds-kanban-title:hover { color: var(--ds-ink); }
.ds-kanban-title .ds-id { color: var(--ds-ink-soft); font-weight: 400; font-size: var(--ds-text-sm); }
.ds-kanban-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.ds-kanban-foot .ds-avatar { width: 22px; height: 22px; font-size: 9px; }
.ds-kanban-time { margin-left: auto; }
.ds-kanban-empty { margin: 0; padding: var(--ds-space-3) var(--ds-space-2); border: 1px dashed var(--ds-line-strong); border-radius: var(--ds-radius-md); color: var(--ds-ink-soft); font-size: var(--ds-text-sm); text-align: center; pointer-events: none; }
.ds-kanban-activity ul { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.ds-kanban-activity li { display: flex; gap: var(--ds-space-2); padding: 10px var(--ds-space-4); border-top: 1px solid var(--ds-line); font-size: var(--ds-text-sm); }
.ds-kanban-activity li:first-child { border-top: 0; }
.ds-kanban-activity li a { color: var(--ds-ink); font-weight: 600; }
.ds-kanban-activity .ds-id { color: var(--ds-ink-soft); font-weight: 400; }
.ds-kanban-time-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ds-space-2); }
@media (min-width: 1700px) {
    .ds-kanban-layout { grid-template-columns: minmax(0, 1fr) 300px; }
    .ds-kanban-activity ul { max-height: 852px; }
}
@media (max-width: 600px) {
    .ds-kanban-col { height: auto; max-height: 420px; }
}

/* Aenderungsverlauf: alter und neuer Wert nebeneinander, geaenderte Zeilen markiert */
.ds-diff { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--ds-space-4); align-items: start; }
.ds-diff-body { padding: var(--ds-space-2) 0; font-size: var(--ds-text-md); overflow-wrap: anywhere; }
.ds-diff-body > p { padding: 0 var(--ds-space-4); }
.ds-diff-line { padding: 1px var(--ds-space-4); white-space: pre-wrap; border-left: 3px solid transparent; }
.ds-diff-line.is-removed { background: #fbeeee; border-left-color: var(--ds-accent); }
.ds-diff-line.is-added { background: color-mix(in srgb, var(--ds-ok) 12%, #fff); border-left-color: var(--ds-ok); }

/* Gantt: Filterzeile (tail.select in ds-field), Bearbeiter rechts neben dem Balken */
.ds-gantt-filter .ds-field.is-wide { flex: 1 1 320px; }
.ds-gantt-filter .ds-field .tail-select { flex: 1 1 auto; width: auto !important; min-width: 0; margin: 0; }
.ds-gantt-filter .ds-field .tail-select .select-label { min-height: calc(var(--ds-field-h) - 2px); border: 0; border-radius: 0; box-shadow: none; }
.ds-gantt-filter .ds-field.is-wide { overflow: visible; }
.ds-gantt-owner { position: absolute; top: 6px; line-height: calc(var(--row-h) - 13px); font-size: var(--ds-text-xs); color: var(--ds-ink-soft); white-space: nowrap; pointer-events: none; z-index: 2; text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff; }
.ds-gantt-owner.is-done { opacity: .55; }

/* ---------- Bereich: Doku und FAQ ---------- */
/* Einheit rechts im Feld (z. B. "Tage" hinter der Zahl) */
.ds-field .ds-field-unit { flex-basis: auto; border-right: 0; border-left: 1px solid var(--ds-line); }
/* Doku: Inhaltsverzeichnis aus Doc::makeIndex (<p class="dyn_index">) */
.ds-doc .dyn_index { margin: 0 0 var(--ds-space-4); padding: var(--ds-space-3) var(--ds-space-4); background: var(--ds-surface-alt); border: 0; border-left: 3px solid var(--ds-line-strong); border-radius: var(--ds-radius-sm); line-height: 1.8; }
.ds-doc .dyn_index a { color: var(--ds-ink); }
.ds-doc .dyn_index a:hover { color: var(--ds-focus); text-decoration: underline !important; }
.ds-doc .ds-content h1, .ds-doc .ds-content h2, .ds-doc .ds-content h3 { margin: 1.2em 0 .4em; font-weight: 600; }
.ds-doc .ds-content h1 { font-size: 22px; }
.ds-doc .ds-content h2 { font-size: 18px; }
.ds-doc .ds-content h3 { font-size: 16px; }
.ds-doc .ds-content h1 a, .ds-doc .ds-content h2 a, .ds-doc .ds-content h3 a { color: inherit; text-decoration: none; }
/* Doku-Liste: Bearbeiten-Knopf in der Zeile, Seitenumbruch */
.ds-table .ds-doc-rowbtn { min-height: 0; padding: 2px 6px; }
.ds-doc-pager { margin-top: var(--ds-space-3); }
/* Doku kopieren: Felder (Titel breiter) und Liste der mitkopierten Seiten und Aufgaben */
.ds-doc-copy { grid-template-columns: minmax(220px, 1fr) minmax(260px, 2fr) minmax(220px, 1fr); }
@media (max-width: 900px) { .ds-doc-copy { grid-template-columns: minmax(0, 1fr); } }
.ds-doc-copylist { margin: 0; padding: var(--ds-space-2) 0; list-style: none; }
.ds-doc-copylist li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--ds-space-2); padding: 6px var(--ds-space-4); border-bottom: 1px solid var(--ds-line); }
.ds-doc-copylist li:last-child { border-bottom: 0; }
.ds-doc-copylist a { color: var(--ds-ink); }
/* Doku bearbeiten: "geoeffnet von" als Meldung im Seitenfluss (custom.css setzt #na-editFlag fixed) */
.ds-page #na-editFlag { position: static; margin: 0 0 var(--ds-space-4); padding: var(--ds-space-3) var(--ds-space-4); z-index: auto; }
.ds-page #na-editFlagUser { display: inline; }
/* FAQ anlegen: aehnliche Fragen unter dem Titel */
.ds-faq-similar { margin: 0; line-height: 1.8; }
.ds-faq-similar a { color: var(--ds-ink); }

/* ---------- Seitenrahmen: Kopfleiste, linke Bereichsleiste, Aktionen rechts, Fusszeile ---------- */
/* templates/header.php, navigation.php, footer.php, App\Library\Sidenav; Verhalten in na.js.php */
.ds-app {
    --ds-frame: #222;
    --ds-frame-ink: #c9ced6;
    --ds-frame-hover: #000;
    --ds-topbar-h: 50px;
    --ds-appnav-w: 75px;
    padding-top: var(--ds-topbar-h);
}
.ds-app #na_main_container { margin: 0 30px 0 var(--ds-appnav-w); padding: 12px 24px 0; }

.ds-topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1030; display: flex; align-items: center; gap: var(--ds-space-3); height: var(--ds-topbar-h); padding: 0 30px 0 var(--ds-space-2); background: var(--ds-frame); color: var(--ds-frame-ink); font-family: var(--ds-font); font-size: var(--ds-text-md); }
.ds-topbar a, .ds-topbar summary { color: var(--ds-frame-ink); }
.ds-topbar-brand { display: flex; align-items: center; flex: 0 0 auto; }
.ds-topbar-brand img { max-height: 46px; }
.ds-topbar-burger { display: none; align-items: center; justify-content: center; width: 40px; height: 36px; border: 1px solid #444; border-radius: var(--ds-radius-md); background: transparent; color: #fff; font-size: 18px; }
.ds-topbar-menu { display: flex; align-items: center; gap: var(--ds-space-3); flex: 1 1 auto; min-width: 0; height: 100%; }
.ds-topbar-areas { display: none; }

.ds-topbar-search { display: flex; flex: 0 1 220px; min-width: 120px; height: 34px; border-radius: var(--ds-radius-md); background: #fff; overflow: hidden; }
.ds-topbar-search input { flex: 1 1 auto; min-width: 0; padding: 0 var(--ds-space-3); border: 0; background: transparent; color: var(--ds-ink); }
.ds-topbar-search button { flex: 0 0 auto; width: 36px; border: 0; border-left: 1px solid var(--ds-line); background: var(--ds-surface-alt); color: var(--ds-ink); }
.ds-topbar-search input:focus { outline: none; }
.ds-topbar-search:focus-within { box-shadow: 0 0 0 3px rgba(47, 111, 214, .45); }
.ds-topbar-recent { flex: 0 1 400px; min-width: 0; }
.ds-topbar-recent .select2-container { width: 100% !important; }
.ds-topbar-recent .select2-selection--single { height: 34px; border: 0; border-radius: var(--ds-radius-md); }
.ds-topbar-recent .select2-selection__rendered { line-height: 34px !important; color: var(--ds-ink-soft) !important; }
.ds-topbar-recent .select2-selection__arrow { height: 32px !important; }

.ds-topbar-end { display: flex; align-items: center; gap: 2px; margin-left: auto; height: 100%; }
.ds-topbar-link, .ds-menu > summary { display: flex; align-items: center; gap: 6px; height: 100%; padding: 0 var(--ds-space-3); cursor: pointer; white-space: nowrap; list-style: none; }
.ds-menu > summary::-webkit-details-marker { display: none; }
.ds-topbar-link:hover, .ds-menu > summary:hover, .ds-menu[open] > summary, .ds-topbar [aria-current="page"] { color: #fff; background: var(--ds-frame-hover); text-decoration: none; }
.ds-topbar-link:focus-visible, .ds-menu > summary:focus-visible, .ds-topbar-burger:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: -2px; }
.ds-topbar .ds-avatar { background: #3a4656; }
.ds-topbar-text { display: none; }
.ds-topbar-badge { min-width: 18px; padding: 1px 5px; border-radius: 9px; background: var(--ds-accent); color: #fff; font-size: var(--ds-text-xs); font-weight: 700; line-height: 16px; text-align: center; margin-left: -4px; }
#na-timetracking-icon { color: #9d9d9d; }

.ds-menu { position: relative; height: 100%; }
.ds-menu-panel { position: absolute; top: 100%; right: 0; z-index: 1040; width: max-content; min-width: 200px; max-width: 360px; border: 1px solid var(--ds-line-strong); border-radius: 0 0 var(--ds-radius-md) var(--ds-radius-md); background: var(--ds-surface); color: var(--ds-ink); box-shadow: 0 8px 24px rgba(31, 42, 55, .18); font-size: var(--ds-text-md); }
.ds-menu-timer .ds-menu-panel, .ds-menu-notes .ds-menu-panel { width: 340px; }
.ds-menu-panel a { color: var(--ds-ink); }
.ds-menu-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--ds-space-2); padding: 10px var(--ds-space-3); border-bottom: 1px solid var(--ds-line); font-weight: 600; }
.ds-menu-head a { font-weight: 400; }
.ds-menu-text { margin: 0; padding: 10px var(--ds-space-3); }
.ds-menu-list { margin: 0; padding: var(--ds-space-1) 0; list-style: none; }
.ds-menu-list li > a { display: block; padding: 7px var(--ds-space-3); }
.ds-menu-list li > a:hover, .ds-menu-list li > a:focus-visible { background: var(--ds-surface-alt); text-decoration: none; outline: none; }
.ds-menu-list li > a[aria-current="page"] { background: var(--ds-surface-alt); color: var(--ds-ink); font-weight: 600; }
.ds-menu-notes .ds-menu-list li { padding: 8px var(--ds-space-3); border-bottom: 1px solid var(--ds-line); }
.ds-menu-notes .ds-menu-list li:last-child { border-bottom: 0; }
.ds-menu-notes .ds-menu-list li > a { padding: 0; font-weight: 600; }
.ds-menu-notes .ds-menu-list li > a:hover { background: transparent; text-decoration: underline; }
.ds-menu-note { display: block; margin: 2px 0; white-space: pre-line; overflow-wrap: anywhere; }
.ds-menu-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-2); padding: 8px var(--ds-space-3); border-top: 1px solid var(--ds-line); background: var(--ds-surface-alt); border-radius: 0 0 var(--ds-radius-md) var(--ds-radius-md); }
.ds-menu-foot #current-time { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Linke Bereichsleiste (unter 601px in der Kopfleiste) */
.ds-appnav { position: fixed; top: var(--ds-topbar-h); bottom: 0; left: 0; z-index: 3; width: var(--ds-appnav-w); overflow-y: auto; background: var(--ds-frame); font-family: var(--ds-font); font-size: 12px; text-align: center; }
.ds-appnav a { display: block; padding: 3px 2px 5px; color: #fff; text-decoration: none; }
.ds-appnav a .fa { display: block; margin: 4px 0 2px; font-size: 28px; }
.ds-appnav a:hover, .ds-appnav a[aria-current="page"] { background: var(--ds-frame-hover); color: #fff; text-decoration: none; }
.ds-appnav a:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: -2px; }

/* Aktionen rechts (Sidenav): fahren beim Ueberfahren aus, auf Touch per Knopf */
/* sichtbar sind 40px (Icon), ausgefahren 160px */
.na-sticky-container { position: fixed; top: 230px; right: -120px; z-index: 2; width: 160px; margin: 0; padding: 0; }
.na-sticky { margin: 0; padding: 0; }
.na-sticky li { height: 39px; margin: 0; padding: 0; list-style: none; transition: margin-left .25s ease-in-out; }
.na-sticky li:hover { margin-left: -120px; }
.ds-sidenav-btn { display: flex; align-items: center; gap: var(--ds-space-2); width: 160px; height: 36px; padding: 0 var(--ds-space-3); border: 0; border-radius: var(--ds-radius-md) 0 0 var(--ds-radius-md); background: var(--ds-summary); color: #fff; font-family: var(--ds-font); font-size: var(--ds-text-md); text-align: left; box-shadow: 0 2px 6px rgba(31, 42, 55, .2); }
.ds-sidenav-btn:hover, .ds-sidenav-btn:focus { background: var(--ds-ink); color: #fff; text-decoration: none; }
.ds-sidenav-btn:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; }
.ds-sidenav-btn .fa { font-size: 16px; }
.ds-sidenav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.na-sticky-toggle-item { display: none; }
.na-sticky-toggle { width: 40px; justify-content: center; padding: 0; }
.na-sticky-toggle .fa { transition: transform .25s ease-in-out; }
@media (max-width: 1200px) { .na-sticky-container { top: 100px; } }
@media (hover: none) {
    .na-sticky li:hover { margin-left: 0; }
    .na-sticky li.na-sticky-toggle-item { display: list-item; }
    .na-sticky-container.is-open .na-sticky li:not(.na-sticky-toggle-item) { margin-left: -120px; }
    .na-sticky-container.is-open .na-sticky-toggle .fa { transform: rotate(180deg); }
}

.ds-footer { display: flex; flex-wrap: wrap; gap: var(--ds-space-2) var(--ds-space-4); margin: 40px 0 0; padding: 18px 16px; border-top: 1px solid var(--ds-line); color: var(--ds-ink-soft); font-family: var(--ds-font); font-size: var(--ds-text-sm); }
.ds-footer a { color: var(--ds-ink-soft); }

/* Select2 ohne Bootstrap-Theme */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple { border-color: var(--ds-line-strong); border-radius: var(--ds-radius-md); }
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single { border-color: var(--ds-focus); }
.select2-dropdown { border-color: var(--ds-line-strong); font-family: var(--ds-font); }
.select2-results__option { padding: 6px 12px; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--ds-ink); }
.select2-container--default .select2-search--dropdown .select2-search__field { border-color: var(--ds-line-strong); border-radius: var(--ds-radius-sm); }

@media (max-width: 900px) {
    .ds-topbar { gap: var(--ds-space-2); padding-right: var(--ds-space-2); }
    .ds-topbar-burger { display: inline-flex; }
    .ds-topbar-menu { display: none; position: fixed; top: var(--ds-topbar-h); left: 0; right: 0; bottom: 0; flex-direction: column; align-items: stretch; gap: var(--ds-space-3); height: auto; padding: var(--ds-space-3) var(--ds-space-4) var(--ds-space-4); overflow-y: auto; background: var(--ds-frame); }
    .ds-topbar.is-open .ds-topbar-menu { display: flex; }
    .ds-topbar-search, .ds-topbar-recent { flex: 0 0 auto; height: 40px; }
    .ds-topbar-recent .select2-selection--single { height: 40px; }
    .ds-topbar-end { flex-direction: column; align-items: stretch; gap: 0; margin: 0; height: auto; border-top: 1px solid #444; }
    .ds-topbar-link, .ds-menu > summary { height: 44px; padding: 0 var(--ds-space-2); border-bottom: 1px solid #333; }
    .ds-topbar-text { display: inline; }
    .ds-menu { height: auto; }
    .ds-menu-panel, .ds-menu-timer .ds-menu-panel, .ds-menu-notes .ds-menu-panel { position: static; width: auto; max-width: none; margin: var(--ds-space-2) 0; border-radius: var(--ds-radius-md); box-shadow: none; }
    .ds-app #na_main_container { margin-right: 0; }
}
@media (max-width: 600px) {
    .ds-appnav { display: none; }
    .ds-topbar-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 2px; }
    .ds-topbar-areas a { display: flex; align-items: center; gap: var(--ds-space-2); padding: 10px var(--ds-space-2); border-radius: var(--ds-radius-md); color: #fff; }
    .ds-topbar-areas a[aria-current="page"], .ds-topbar-areas a:hover { background: var(--ds-frame-hover); text-decoration: none; }
    .ds-app #na_main_container { margin: 0; padding: 12px 12px 0; }
}
@media print {
    .ds-app { padding-top: 0; }
    .ds-app #na_main_container { margin: 0; padding: 0; }
}
