/* =====================================================================
   Wild Thing – UI-Theme  (dunkle Petrol-Leiste, Münzgelb als Marke)
   Ziel: modern, hochwertig, dokumentenzentriert. Klassennamen stabil.
   ===================================================================== */

:root {
    /* Workspace-Flächen */
    --bg: #edf1ef;
    --bg-grad:
        radial-gradient(1100px 520px at 100% -8%, #d8ebe7 0%, rgba(237,241,239,0) 55%),
        radial-gradient(900px 520px at -5% 110%, #e3efea 0%, rgba(237,241,239,0) 55%);
    --surface: #ffffff;
    --surface-alt: #f5f8f7;
    --surface-hover: #eef4f2;
    --border: #e1e7e5;
    --border-strong: #cdd7d4;

    /* Text */
    --text: #1a1e2e;
    --text-2: #454c61;
    --muted: #767d92;

    /* Akzent (Petrol) */
    --accent: #0e6b66;
    --accent-700: #0a4f4b;
    --accent-soft: #e2f1ef;
    --accent-soft-2: #f1f8f7;
    --accent-ring: rgba(14, 107, 102, .28);

    /* Dunkle Navigationsleiste */
    --nav-bg: linear-gradient(105deg, #0b2e2c 0%, #12423f 100%);
    --nav-text: #a9b0c7;
    --nav-text-strong: #ffffff;
    --nav-hover: rgba(255, 255, 255, .07);
    --nav-active: rgba(255, 255, 255, .13);
    --nav-border: rgba(255, 255, 255, .08);

    /* Status */
    --success: #11824a;
    --success-soft: #e4f6ea;
    --warning: #976406;
    --warning-soft: #fcf2d6;
    --danger: #c5392a;
    --danger-soft: #fdeae7;

    /* Radius & Schatten */
    --radius: 14px;
    --radius-sm: 10px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(20, 51, 49, .05), 0 1px 3px rgba(20, 51, 49, .05);
    --shadow-md: 0 10px 26px rgba(20, 51, 49, .10);
    --shadow-lg: 0 26px 56px rgba(20, 51, 49, .20);

    --topnav-h: 62px;
    --left-w: 268px;
    --right-w: clamp(380px, 33%, 500px);
    --shell-gap: 18px;
    --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
    font-family: "Inter", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    background-image: var(--bg-grad);
    background-attachment: fixed;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    display: flex;
    flex-direction: column;
}

::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 5px; }

.panel__body, .list, .tree-wrap { scrollbar-width: thin; scrollbar-color: #cdd2e0 transparent; }
.panel__body::-webkit-scrollbar, .list::-webkit-scrollbar, .tree-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.panel__body::-webkit-scrollbar-thumb, .list::-webkit-scrollbar-thumb, .tree-wrap::-webkit-scrollbar-thumb {
    background: #d4d8e6; border-radius: 999px; border: 3px solid transparent; background-clip: content-box;
}
.panel__body::-webkit-scrollbar-thumb:hover, .list::-webkit-scrollbar-thumb:hover, .tree-wrap::-webkit-scrollbar-thumb:hover { background: #bcc2d4; background-clip: content-box; }

/* ===== Top navigation (dunkle Kommandoleiste) ===== */
.topnav {
    height: var(--topnav-h);
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 22px;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    box-shadow: 0 4px 18px rgba(16, 40, 38, .22);
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 40;
    color: #fff;
}
.topnav__brand { display: flex; align-items: center; gap: 11px; font-weight: 700; }
.topnav__name { font-size: 15px; color: #fff; letter-spacing: .2px; }
.topnav__logo {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 7px; border-radius: 10px;
    background: #f2b705;
    color: #0b2e2c; font-size: 13px; font-weight: 800; letter-spacing: .5px;
    box-shadow: 0 6px 16px rgba(242, 183, 5, .35);
}
a.topnav__logo { text-decoration: none; }
.topnav__menu { display: flex; gap: 3px; }
.topnav__link {
    padding: 8px 14px; border-radius: var(--radius-pill); text-decoration: none;
    color: var(--nav-text); font-size: 13.5px; font-weight: 500;
    transition: background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.topnav__link:hover { background: var(--nav-hover); color: var(--nav-text-strong); }
.topnav__link.is-active {
    background: rgba(14, 107, 102, .34);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(174, 243, 239, .45);
}
.topnav__link.is-disabled { color: rgba(255, 255, 255, .30); cursor: not-allowed; }
.topnav__link.is-disabled:hover { background: transparent; color: rgba(255, 255, 255, .30); }
.topnav__user { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topnav__username { font-size: 13px; color: #c8cddc; display: flex; align-items: center; gap: 8px; }
.topnav__logout { margin: 0; }
.topnav__user .btn--ghost {
    background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); color: #fff;
}
.topnav__user .btn--ghost:hover { background: rgba(255, 255, 255, .16); color: #fff; }

/* ===== 3-Panel shell ===== */
.shell {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: var(--left-w) minmax(0, 1fr) 0;
    gap: var(--shell-gap);
    padding: var(--shell-gap);
    transition: grid-template-columns .24s var(--ease);
}
.shell.has-detail { grid-template-columns: var(--left-w) minmax(0, 1fr) var(--right-w); }
/* Belege: rechtes Panel bewusst breiter, damit die Positionszeile ohne
   X-Scroll vollständig sichtbar ist (Editor + Detail). */
.shell--docs.has-detail { --right-w: clamp(560px, 54vw, 880px); }

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.panel--left { background: var(--surface); }
.panel--right { box-shadow: var(--shadow-md); }
.panel--right[hidden] { display: none; }

.panel__head {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .1px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--text);
}
.panel--left .panel__head, .panel--right .panel__head { background: var(--surface-alt); }
.panel__sub { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 3px; }
/* Center-Header mit integrierter Suche (zweizeilig) */
.panel__head--stack { flex-direction: column; align-items: stretch; gap: 11px; }
.panel__head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.listsearch { width: 100%; }
.panel__body { padding: 18px; overflow-y: auto; overflow-x: hidden; flex: 1 1 auto; min-height: 0; }
/* Sicherheitsnetz: Detail-Inhalte nie horizontal überlaufen lassen */
.panel__body > * { max-width: 100%; }
.panel__body img { max-width: 100%; height: auto; }
.panel__hint { margin-top: auto; padding: 14px 18px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }
.panel__placeholder { color: var(--muted); font-size: 13.5px; text-align: center; padding: 32px 18px; line-height: 1.6; }
.panel__close {
    border: none; background: transparent; font-size: 22px; line-height: 1; color: var(--muted);
    cursor: pointer; padding: 2px 6px; border-radius: 8px; transition: color .15s, background .15s;
}
.panel__close:hover { color: var(--text); background: var(--surface-hover); }

@keyframes detailIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.detail-enter { animation: detailIn .22s var(--ease) both; }

/* ===== Left nav list ===== */
.navlist { list-style: none; margin: 0; padding: 10px; display: flex; flex-direction: column; gap: 3px; }
.navlist__item {
    padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13.5px; color: var(--text-2);
    cursor: default; display: flex; justify-content: space-between; align-items: center;
    transition: background .15s, color .15s;
}
.navlist__item:not(.is-disabled):not(.is-active):hover { background: var(--surface-hover); color: var(--text); }
.navlist__item.is-active { background: var(--accent-soft); color: var(--accent-700); font-weight: 600; }
.navlist__item.is-disabled { color: #b4b9c8; }
.navlist__link { text-decoration: none; color: inherit; display: block; width: 100%; }

/* ===== Badges ===== */
.badge {
    font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
    background: #eceef4; color: var(--muted); padding: 3px 9px; border-radius: var(--radius-pill);
}
.badge--accent { background: var(--accent); color: #fff; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid transparent; border-radius: var(--radius-sm); padding: 9px 16px;
    font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
    background: #edf1ef; color: var(--text);
    transition: background .15s var(--ease), border-color .15s, box-shadow .15s, transform .04s;
}
.btn:hover { background: #e3f0ef; }
.btn:active { transform: translateY(1px); }
.btn--primary {
    background: linear-gradient(180deg, #15988f, var(--accent));
    color: #fff; box-shadow: 0 4px 12px var(--accent-ring);
}
.btn--primary:hover { background: linear-gradient(180deg, #0e6b66, var(--accent-700)); }
.btn--ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text-2); font-weight: 500; }
.btn--ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn--danger { background: #fff; border-color: #ecb1ab; color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); }
.btn--block { width: 100%; }
.btn--sm { padding: 7px 13px; font-size: 13px; }

/* ===== Form fields ===== */
.field { display: block; margin-bottom: 15px; }
.field__label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field__input {
    width: 100%; padding: 10px 13px; border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); font-size: 14px; background: #fff; color: var(--text);
    font-family: inherit; transition: border-color .15s, box-shadow .15s, background .15s;
}
.field__input::placeholder { color: #9aa1b2; }
.field__input:hover { border-color: #c3c7d8; }
.field__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); background: var(--accent-soft-2); }
textarea.field__input { resize: vertical; min-height: 68px; }

.inline-form { display: flex; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; background: var(--surface-alt); }
.inline-form .field__input { flex: 1 1 160px; width: auto; }

/* ===== Alerts ===== */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 14px; border: 1px solid transparent; }
.alert--inset { margin: 14px 18px; }
.alert--error { background: var(--danger-soft); color: #9a2a1d; border-color: #f2c6c0; }
.alert--success { background: var(--success-soft); color: var(--success); border-color: #b4e1c4; }
.alert--info { background: var(--accent-soft); color: var(--accent-700); border-color: #d5f9f7; }

/* ===== Login ===== */
.auth-body {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
    background: #112a28;
    background-image:
        radial-gradient(1000px 600px at 80% -10%, #2b6b67 0%, rgba(17, 42, 40,0) 55%),
        radial-gradient(800px 600px at 10% 110%, #1d4744 0%, rgba(17, 42, 40,0) 55%),
        linear-gradient(180deg, #112a28, #163634);
}
.auth { width: 100%; max-width: 408px; }
.auth__brand { display: flex; align-items: center; gap: 11px; justify-content: center; margin-bottom: 22px; font-weight: 700; color: #fff; }
.auth__brand .topnav__name { color: #fff; }
.auth__card { background: #fff; border: 1px solid rgba(255,255,255,.6); border-radius: 18px; padding: 30px; box-shadow: var(--shadow-lg); }
.auth__title { margin: 0 0 22px; font-size: 22px; letter-spacing: -.3px; }

/* ===== Welcome ===== */
.welcome__title { font-size: 25px; margin: 0 0 12px; letter-spacing: -.4px; }
.welcome__text { color: var(--text-2); font-size: 14.5px; line-height: 1.7; margin: 0 0 16px; max-width: 680px; }

/* ===== Detail (gemeinsam) ===== */
.detail__header { margin-bottom: 14px; }
.detail__title { margin: 0 0 5px; font-size: 20px; letter-spacing: -.3px; }
.detail__subtitle { margin: 0 0 16px; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail__actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.detail__danger { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.detail__grid { display: grid; grid-template-columns: 100px 1fr; gap: 9px 14px; margin: 0 0 16px; font-size: 14px; }
.detail__grid--wide { grid-template-columns: 150px 1fr; }
.detail__grid dt { color: var(--muted); font-weight: 500; }
.detail__grid dd { margin: 0; word-break: break-word; }
.detail__note { font-size: 13px; color: var(--text-2); background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; line-height: 1.6; }

/* ===== Detail-Tabs (Adresse | Kontakte | Sonstiges) ===== */
.tabs {
    display: flex; gap: 2px; flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    margin: 4px 0 18px;
}
.tabs__btn {
    appearance: none; -webkit-appearance: none;
    border: 0; background: transparent; cursor: pointer;
    padding: 9px 14px; margin-bottom: -1px;
    font-size: 13.5px; font-weight: 600; color: var(--muted);
    border-bottom: 2px solid transparent;
    transition: color .15s var(--ease), border-color .15s var(--ease);
}
.tabs__btn:hover { color: var(--text); }
.tabs__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px 4px 0 0; }
.tabs__btn.is-active { color: var(--accent-700); border-bottom-color: var(--accent); }
.tabpanel[hidden] { display: none; }

/* ===== Inline-Einstellungen (Tab „Sonstiges") ===== */
/* Im schmalen rechten Panel einspaltig -> kein horizontales Scrollen. */
.settings-inline .formgrid { grid-template-columns: 1fr; }
.settings-inline .field__input { min-width: 0; }
.cond {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px 2px;
    margin: 0 0 14px;
    background: var(--surface-alt);
    transition: opacity .15s var(--ease);
}
.cond .checkfield { margin: 0 0 10px; font-weight: 600; }
/* Deaktivierte Kondition: Werte sichtbar, aber gedimmt (bleiben erhalten). */
.cond--off .formgrid { opacity: .45; }

/* ===== Rollen / Permissions ===== */
.permgroup { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 12px; background: var(--surface-alt); }
.permgroup__legend { font-size: 12.5px; font-weight: 700; color: var(--accent-700); padding: 0 6px; text-transform: uppercase; letter-spacing: .4px; }
.permgroup__item { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 13px; }
.permgroup__item input { accent-color: var(--accent); }
.permgroup__key { color: var(--muted); font-size: 11px; background: #eceef4; padding: 2px 7px; border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ===== Settings form ===== */
.settings-form { max-width: 860px; }
.formsection { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px 8px; margin: 0 0 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.formsection > legend { font-size: 12px; font-weight: 800; color: var(--accent-700); padding: 0 8px; text-transform: uppercase; letter-spacing: .6px; }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.checkfield { display: flex; align-items: center; gap: 10px; font-size: 14px; margin: 6px 0 14px; }
.checkfield input { width: 17px; height: 17px; accent-color: var(--accent); }
.formhint { font-size: 12px; color: var(--muted); margin: 2px 0 12px; }
.settings-form__actions { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--surface) 35%); }
@media (max-width: 720px) { .formgrid { grid-template-columns: 1fr; } }

/* ===== Storage panel (Einstellungen) ===== */
.storage-panel { margin-bottom: 18px; }
.storage-panel__body { display: flex; flex-direction: column; gap: 10px; }

/* Zeile 1: Auslastung */
.storage-panel__row--meter {
    display: flex; align-items: center; gap: 18px;
    padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--surface-alt) 0%, #fff 100%);
}
.storage-panel__meter-stats { flex: 0 0 auto; min-width: 148px; }
.storage-panel__meter-main {
    display: block; font-size: 13px; color: var(--text-2); line-height: 1.3;
}
.storage-panel__meter-main strong {
    font-size: 18px; font-weight: 800; color: var(--accent-700); letter-spacing: -.3px;
}
.storage-panel__meter-sub {
    display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted);
}
.storage-panel__row--meter .storagebar-wrap {
    flex: 1 1 auto; min-width: 100px; margin: 0;
}
.storage-panel__row--meter .storagebar { height: 10px; }
.storage-panel__row--meter .badge { flex-shrink: 0; }

/* Zeile 2+3: Limits (je 2 Spalten) */
.storage-panel__row--limits {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
.storage-limit {
    display: flex; flex-direction: column; gap: 7px; min-width: 0;
    padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); box-shadow: var(--shadow-sm);
    transition: border-color .15s var(--ease);
}
.storage-limit--edit:focus-within,
.storage-limit--slider:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.storage-limit--warn { border-top: 3px solid #f59e0b; }
.storage-limit--critical { border-top: 3px solid #ea580c; }
.storage-limit__label {
    font-size: 10.5px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .45px; color: var(--muted);
}
.storage-limit__value {
    font-size: 16px; font-weight: 700; color: var(--text);
    font-variant-numeric: tabular-nums; line-height: 1.2;
}
.storage-limit--edit .field__input,
.storage-limit--slider .field__input { width: 100%; margin-top: 0; }
.storage-limit__control {
    display: flex; align-items: center; gap: 10px; min-height: 28px;
}
.storage-limit__range {
    flex: 1 1 auto; min-width: 0; height: 6px; margin: 0; padding: 0;
    cursor: pointer; accent-color: var(--accent);
}
.storage-limit--warn .storage-limit__range { accent-color: #d97706; }
.storage-limit--critical .storage-limit__range { accent-color: #ea580c; }
.storage-limit__pct {
    flex-shrink: 0; min-width: 2.8em; font-size: 14px; font-weight: 700;
    font-variant-numeric: tabular-nums; color: var(--accent-700); text-align: right;
}
.storage-limit--warn .storage-limit__pct { color: #b45309; }
.storage-limit--critical .storage-limit__pct { color: #c2410c; }

.storagebar-wrap { position: relative; }
.storagebar__mark {
    position: absolute; top: -4px; bottom: -4px; width: 2px;
    transform: translateX(-50%); border-radius: 1px; pointer-events: none; z-index: 2;
}
.storagebar__mark--warn { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245, 158, 11, .2); }
.storagebar__mark--critical { background: #ea580c; box-shadow: 0 0 0 2px rgba(234, 88, 12, .2); }

.storage-panel__note {
    margin: 10px 0 0; padding: 10px 12px; border-radius: var(--radius-sm);
    font-size: 12.5px; line-height: 1.5;
}
.storage-panel--warning .storage-panel__note { background: var(--warning-soft); color: #7c5e03; }
.storage-panel--critical .storage-panel__note,
.storage-panel--exceeded .storage-panel__note { background: var(--danger-soft); color: var(--danger); }
.badge--storage-ok { background: var(--success-soft); color: var(--success); }
.badge--storage-warning { background: var(--warning-soft); color: var(--warning); }
.badge--storage-critical,
.badge--storage-exceeded { background: var(--danger-soft); color: var(--danger); }

@media (max-width: 900px) {
    .storage-panel__row--meter { flex-wrap: wrap; }
    .storage-panel__meter-stats { min-width: 0; flex: 1 1 100%; }
    .storage-panel__row--meter .storagebar-wrap { flex: 1 1 100%; order: 3; }
    .storage-panel__row--meter .badge { margin-left: auto; }
}
@media (max-width: 520px) {
    .storage-panel__row--limits { grid-template-columns: 1fr; }
}

/* ===== Center list ===== */
.list { list-style: none; margin: 0; padding: 9px; overflow: auto; display: flex; flex-direction: column; gap: 3px; }
.list__row {
    position: relative;
    width: 100%; text-align: left; border: 1px solid transparent;
    background: transparent; border-radius: var(--radius-sm); padding: 13px 15px;
    cursor: pointer; display: flex; flex-direction: column; gap: 3px;
    transition: background .12s var(--ease), border-color .12s, box-shadow .12s;
}
.list__row:hover { background: var(--surface-hover); }
.list__row.is-selected { background: var(--accent-soft); border-color: #d1f8f6; box-shadow: var(--shadow-sm); }
.list__row.is-selected::before {
    content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--accent);
}
.list__title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.list__subtitle { font-size: 12px; color: var(--muted); }

.is-loading { opacity: .45; pointer-events: none; }

/* ===== Kunden: Filter (Radios, ohne Button) ===== */
.filter { display: flex; flex-direction: column; gap: 18px; padding: 16px 14px 18px; }
.filtergroup { border: 0; margin: 0; padding: 0; min-width: 0; }
.filtergroup__legend { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--text-2); margin: 0 0 8px; padding: 0; }
.filteropt { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: var(--radius-sm); font-size: 13.5px; cursor: pointer; transition: background .12s var(--ease); }
.filteropt:hover { background: var(--surface-hover); }
.filteropt input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.filteropt input:checked + span { color: var(--accent-700); font-weight: 600; }
.filterselect { display: block; min-width: 0; }
.filterselect .field__input { width: 100%; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ===== Status-Badges ===== */
.badge--status-aktiv { background: var(--success-soft); color: var(--success); }
.badge--status-inaktiv { background: #eceef4; color: #64748b; }
.badge--status-interessent { background: var(--warning-soft); color: var(--warning); }

/* ===== Kunden: Formular ===== */
.cform { max-width: 560px; }
.req { color: var(--danger); font-weight: 700; }
.formerror { margin: 0 0 16px; }
.formerror ul { margin: 6px 0 0; padding-left: 18px; }
.formerror li { margin: 2px 0; }

/* ===== Kunden: Unterbereiche ===== */
.subsection { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 16px; }
.subsection__title { font-size: 12px; font-weight: 800; margin: 0 0 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-2); }
.subsection__empty { font-size: 13px; color: var(--muted); margin: 0 0 10px; }

.card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; background: var(--surface-alt); }
.card__head { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.card__del { margin-left: auto; }
.card__body { font-size: 13px; color: var(--text-2); line-height: 1.55; }

.linkbtn { background: none; border: 0; padding: 0; color: var(--danger); font-size: 12px; cursor: pointer; text-decoration: underline; }
.linkbtn:hover { color: #9a2a1d; }

.miniform { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 14px; margin-top: 12px; background: var(--surface); }
.miniform__row { display: flex; gap: 8px; margin-bottom: 8px; }
/* min-width:0 erlaubt das Schrumpfen der Flex-Items (verhindert X-Overflow) */
.miniform__row .field__input { flex: 1 1 0; width: auto; min-width: 0; }
.field__input--country { flex: 0 0 64px; width: 64px; text-align: center; text-transform: uppercase; }
@media (max-width: 720px) { .miniform__row { flex-direction: column; } .field__input--country { flex: 1 1 auto; width: auto; text-align: left; } }

/* ===== Responsive: rechtes Panel als Drawer ===== */
@media (max-width: 980px) {
    .shell, .shell.has-detail { grid-template-columns: var(--left-w) minmax(0, 1fr); }
    .panel--right {
        position: fixed; top: var(--topnav-h); right: 0; bottom: 0;
        width: min(460px, 92vw); border-radius: 0; box-shadow: var(--shadow-lg); z-index: 25;
        transform: translateX(100%); transition: transform .26s var(--ease);
    }
    /* Belege-Drawer breiter, damit die Positionszeile auch auf Tablets passt */
    .shell--docs .panel--right { width: min(760px, 96vw); }
    .shell.has-detail .panel--right { transform: translateX(0); }
}
@media (max-width: 620px) {
    :root { --left-w: 0px; }
    .shell, .shell.has-detail { grid-template-columns: 1fr; }
    .panel--left { display: none; }
    .topnav { gap: 12px; padding: 0 14px; }
    .topnav__menu { gap: 0; }
    .topnav__link { padding: 8px 10px; }
}

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

/* ===== DMS: Ordnerbaum (linkes Panel) ===== */
/* tree-wrap ist KEIN .panel__body – ohne flex+overflow clippt .panel (overflow:hidden)
   die unteren Ordner und es gibt keinen Scrollbalken. */
.tree-wrap {
    padding: 10px 10px 16px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.tree {
    list-style: none;
    margin: 0;
    padding-left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tree-wrap > .tree { padding-left: 0; }
.tree__item { margin: 0; }
.tree__item--branch {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tree__item--branch > .tree__children {
    margin-top: 2px;
    padding-top: 2px;
    overflow: hidden;
    transition: max-height .22s var(--ease), opacity .18s var(--ease);
    max-height: 2000px;
    opacity: 1;
}
.tree__item--branch.tree__item--collapsed > .tree__children {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
    .tree__item--branch > .tree__children { transition: none; }
    .tree__item--branch.tree__item--collapsed > .tree__children { display: none; max-height: none; opacity: 1; }
}
.tree__toggle {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 28px; margin: 0; padding: 0;
    border: 0; border-radius: 6px; background: transparent;
    color: var(--muted); cursor: pointer;
    transition: background .12s var(--ease), color .12s var(--ease), transform .18s var(--ease);
}
.tree__toggle:hover { background: var(--surface-hover); color: var(--text); }
.tree__toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tree__toggle--spacer { pointer-events: none; visibility: hidden; }
.tree__item--collapsed > .tree__row .tree__chev { transform: rotate(-90deg); }
.tree__chev { display: block; transition: transform .18s var(--ease); }
.tree__link {
    display: flex; align-items: center; gap: 8px; padding: 6px 9px;
    border-radius: var(--radius-sm); font-size: 13.5px; color: var(--text-2);
    text-decoration: none; transition: background .12s var(--ease), color .12s var(--ease);
}
.tree__link:hover { background: var(--surface-hover); color: var(--text); }
.tree__link.is-active { background: var(--accent-soft); color: var(--accent-700); font-weight: 600; }
.tree__root { margin-bottom: 6px; }
.tree__icon { flex: 0 0 auto; font-size: 14px; line-height: 1; }
.tree__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Ordnerzeile mit Papierkorb-Aktion (rechts, beim Hover sichtbar) */
.tree__row { display: flex; align-items: center; gap: 1px; }
.tree__row > .tree__link { flex: 1 1 auto; min-width: 0; }
.tree__del { flex: 0 0 auto; margin: 0; display: flex; opacity: 0; transition: opacity .12s var(--ease); }
.tree__row:hover .tree__del,
.tree__row.is-active .tree__del,
.tree__del:focus-within { opacity: 1; }
.iconbtn {
    display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
    padding: 0; border: 0; background: transparent; color: var(--muted); border-radius: 8px;
    cursor: pointer; transition: background .12s var(--ease), color .12s var(--ease);
}
.iconbtn:hover { background: var(--surface-hover); color: var(--text); }
.iconbtn--danger:hover { background: var(--danger-soft); color: var(--danger); }
@media (hover: none) { .tree__del { opacity: 1; } }

/* Ordner-Sichtbarkeit: Schloss-Aktion je Ordner (nur mit Verwaltungsrecht).
   Eingeschränkte Ordner bleiben dauerhaft markiert, freie erscheinen beim Hover. */
.tree__perm { flex: 0 0 auto; display: flex; opacity: 0; transition: opacity .12s var(--ease); }
.tree__row:hover .tree__perm,
.tree__row.is-active .tree__perm,
.tree__perm:focus-within { opacity: 1; }
.tree__perm.is-restricted { opacity: 1; }
.iconbtn--lock svg { display: block; }
.iconbtn--lock:hover { background: var(--accent-soft); color: var(--accent-700); }
.iconbtn--lock.is-restricted { color: var(--accent-700); background: var(--accent-soft); }
@media (hover: none) { .tree__perm { opacity: 1; } }

/* Aktionsgruppe im Center-Header */
.panel__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.sidebox { padding: 6px 12px 16px; }
.miniform--sep { margin-top: 14px; }

/* ===== DMS: Breadcrumb (Center-Header) ===== */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.crumbs a { color: var(--accent-700); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs__sep { color: var(--muted); font-weight: 400; }

/* ===== DMS: Dateityp-Badge ===== */
.filetype {
    display: inline-flex; align-items: center; justify-content: center; min-width: 36px;
    padding: 2px 6px; border-radius: 5px; font-size: 10px; font-weight: 800;
    letter-spacing: .4px; background: #eef7f6; color: #5b6172; text-transform: uppercase;
}
.filetype--pdf { background: #fdeae7; color: var(--danger); }
.filetype--png, .filetype--jpg, .filetype--jpeg { background: var(--success-soft); color: var(--success); }
.filetype--docx { background: #e4fbf9; color: #14615c; }
.filetype--xlsx { background: #e3f5ea; color: #137a45; }
.filetype--txt { background: #eceef4; color: #64748b; }

/* ===== DMS: Kachel-Ansicht (Center) ===== */
.dmsbrowse { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 6px 4px 16px; }
.dmsgroup { padding: 10px 14px 4px; }
.dmsgroup__head {
    display: flex; align-items: center; gap: 8px; margin: 6px 4px 12px;
    font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--text-2);
}
.dmsgroup__count {
    display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px;
    padding: 0 6px; border-radius: 9px; background: var(--surface-hover); color: var(--muted);
    font-size: 11px; font-weight: 700; letter-spacing: 0;
}
/* Feste Kachelbreite: Größe bleibt unabhängig davon, ob das Detail-Panel offen
   ist (kein 1fr-Strecken -> keine Größen-/Textänderung beim Selektieren). */
.cardgrid {
    --card-w: 152px;
    display: grid; gap: 12px; justify-content: start;
    grid-template-columns: repeat(auto-fill, var(--card-w));
}
.cardgrid__empty { grid-column: 1 / -1; }
.cardgrid__empty .panel__placeholder { padding: 18px 4px; }

/* Gemeinsame Kachel (Ordner + Datei) – identische Größe und Struktur */
.filecard, .foldercard { position: relative; }
.filecard__btn[draggable="true"] { cursor: grab; touch-action: none; position: relative; }
.filecard__btn[draggable="true"]:active { cursor: grabbing; }
.filecard__btn[draggable="true"] .filecard__thumb,
.filecard__btn[draggable="true"] .filecard__title,
.filecard__btn[draggable="true"] .filecard__meta,
.filecard__btn[draggable="true"] .filecard__img,
.filecard__btn[draggable="true"] .filecard__grip {
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
}
.filecard__grip {
    position: absolute; top: 8px; left: 8px; z-index: 1;
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 6px;
    color: var(--muted); background: rgba(255, 255, 255, .88);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    opacity: 0; transition: opacity .12s var(--ease);
}
.filecard:hover .filecard__grip,
.filecard__btn[draggable="true"]:focus-visible .filecard__grip { opacity: 1; }
@media (hover: none) { .filecard__grip { opacity: 1; } }
.filecard__btn {
    display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left;
    border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm);
    padding: 10px; cursor: pointer; text-decoration: none; color: var(--text);
    transition: transform .12s var(--ease), border-color .12s, box-shadow .12s, background .12s;
}
.filecard__btn:hover {
    transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-md);
}
.filecard__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.filecard__btn.is-selected { border-color: #d1f8f6; background: var(--accent-soft); box-shadow: var(--shadow-sm); }
.filecard__thumb {
    position: relative; display: flex; align-items: center; justify-content: center;
    aspect-ratio: 4 / 3; width: 100%; border-radius: 8px; overflow: hidden;
    background: var(--surface-alt); border: 1px solid var(--border);
}
.filecard__badge { font-size: 13px; min-width: 44px; padding: 4px 9px; }
.filecard__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Titel immer 2 Zeilen hoch reservieren -> alle Kacheln gleich hoch */
.filecard__title {
    font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--text);
    min-height: calc(1.3em * 2);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    overflow-wrap: anywhere; word-break: break-word;
}
.filecard__meta { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Löschen direkt auf der Datei-Kachel (oben rechts) */
.filecard__del {
    position: absolute; top: 8px; right: 8px; margin: 0; z-index: 2;
    opacity: 0; transition: opacity .12s var(--ease);
}
.filecard:hover .filecard__del,
.filecard__del:focus-within { opacity: 1; }
.filecard__del .iconbtn { background: rgba(255, 255, 255, .9); box-shadow: var(--shadow-sm); }
@media (hover: none) { .filecard__del { opacity: 1; } }

/* DMS: Drag & Drop – Dateien in Ordner verschieben */
.filecard--dragging { opacity: .55; transform: scale(.97); }
.filecard--moving { opacity: .55; }
[data-drop-folder].drop-target--hover,
.tree__row.drop-target--hover,
.foldercard.drop-target--hover,
.tree-wrap.drop-target--hover {
    outline: 2px dashed var(--accent);
    outline-offset: 2px;
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
}
.tree__link.drop-target--hover,
.crumbs a.drop-target--hover { text-decoration: none; }
.foldercard__btn.drop-target--hover { border-color: var(--accent); }
.tree-wrap { border-radius: var(--radius-sm); }
.foldercard[draggable="true"], .tree__row--draggable { cursor: grab; }
.foldercard--dragging, .tree__row--dragging { opacity: .55; }
.foldercard--moving, .tree__row--moving { opacity: .55; }
.dms-grip {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 28px; margin-right: 2px; border: 0; padding: 0;
    border-radius: 6px; color: var(--muted); background: transparent; cursor: grab;
}
.dms-grip:active { cursor: grabbing; }
.dms-grip svg { display: block; }
.tree__row--draggable { align-items: center; }
.foldercard__grip {
    position: absolute; top: 8px; left: 8px; z-index: 2;
    background: rgba(255, 255, 255, .9); border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.foldercard:hover .foldercard__grip { opacity: 1; }
.panel__sub-note { font-weight: 400; }

/* Toast-Benachrichtigungen (global, org-konfigurierbar) */
.wf-alerts {
    position: fixed;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    max-width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}
.wf-alerts--bottom-right { right: 0; bottom: 0; align-items: flex-end; }
.wf-alerts--bottom-left  { left: 0; bottom: 0; align-items: flex-start; }
.wf-alerts--top-right    { right: 0; top: 58px; align-items: flex-end; }
.wf-alerts--top-left     { left: 0; top: 58px; align-items: flex-start; }

.wf-alert {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    line-height: 1.45;
    box-shadow: var(--shadow-md);
    border: 1px solid transparent;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .28s var(--ease), transform .28s var(--ease);
    cursor: pointer;
    max-width: 100%;
}
.wf-alerts--top-right .wf-alert,
.wf-alerts--top-left .wf-alert {
    transform: translateY(-10px);
}
.wf-alert.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.wf-alert.is-leaving {
    opacity: 0;
    transform: translateY(6px);
}
.wf-alerts--top-right .wf-alert.is-leaving,
.wf-alerts--top-left .wf-alert.is-leaving {
    transform: translateY(-6px);
}
.wf-alert__icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}
.wf-alert__text { flex: 1 1 auto; min-width: 0; }
.wf-alert--success {
    background: var(--success-soft);
    color: var(--success);
    border-color: #b4e1c4;
}
.wf-alert--error {
    background: var(--danger-soft);
    color: #9a2a1d;
    border-color: #f2c6c0;
}
.wf-alert--info {
    background: var(--accent-soft);
    color: var(--accent-700);
    border-color: #d5f9f7;
}

/* Zwei-Schritt-Lösch-Dialog (ersetzt Browser-alert) */
.wfconfirm {
    position: fixed; inset: 0; z-index: 1200;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.wfconfirm[hidden] { display: none !important; }
.wfconfirm__backdrop {
    position: absolute; inset: 0; background: rgba(15, 42, 40, .45);
}
.wfconfirm__dialog {
    position: relative; width: min(440px, 100%); background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-md); padding: 22px 22px 18px;
    animation: detailIn .16s var(--ease) both;
}
.wfconfirm__title { margin: 0 0 10px; font-size: 18px; font-weight: 700; color: var(--text); }
.wfconfirm__lead { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.wfconfirm__item {
    margin: 0 0 18px; padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--surface-alt); border: 1px solid var(--border);
    font-size: 13px; font-weight: 600; color: var(--text); word-break: break-word;
}
.wfconfirm__item--danger { background: var(--danger-soft); border-color: #f5c4c4; color: var(--danger); }
.wfconfirm__actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
body.wfconfirm-open { overflow: hidden; }

/* DMS-Detail: Beleg-PDF-Versionen */
.dmsdetail { display: flex; flex-direction: column; gap: 12px; }
.verlist { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
.verlist thead th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.verlist__row { color: var(--muted); }
.verlist__row td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.verlist__title { color: #6b7280; font-weight: 500; }
.verlist__acts { width: 72px; text-align: right; white-space: nowrap; }
.verlist__acts .iconbtn { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.verlist__del { display: inline; margin: 0; padding: 0; }

/* Ordner-spezifisch: getöntes Thumbnail mit großem Symbol + Löschen-Aktion */
.foldercard__thumb { background: #fff7e6; border-color: #f1e2bd; }
.foldercard__bigicon { font-size: 42px; line-height: 1; filter: saturate(1.05); }
.foldercard__del { position: absolute; top: 8px; right: 8px; margin: 0; opacity: 0; transition: opacity .12s var(--ease); }
.foldercard:hover .foldercard__del,
.foldercard__del:focus-within { opacity: 1; }
.foldercard__del .iconbtn { background: rgba(255, 255, 255, .82); }
@media (hover: none) { .foldercard__del { opacity: 1; } }
.foldercard__perm { position: absolute; right: 8px; bottom: 8px; z-index: 2; opacity: 0; transition: opacity .12s var(--ease); }
.foldercard:hover .foldercard__perm,
.foldercard__perm:focus-within { opacity: 1; }
.foldercard__perm.is-restricted { opacity: 1; }
.foldercard__perm .iconbtn { background: rgba(255, 255, 255, .9); box-shadow: var(--shadow-sm); }
@media (hover: none) { .foldercard__perm { opacity: 1; } }

/* ===== DMS: Ordnerberechtigungen (rechtes Panel) ===== */
.folderperm__state {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px; margin-bottom: 12px;
    border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
}
.folderperm__state--open { background: var(--accent-soft); color: var(--accent-700); }
.folderperm__state--restricted { background: #fff4e5; color: #9a5b00; }
.folderperm__state--locked { background: var(--danger-soft); color: var(--danger); }
.folderperm__list { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; }
.folderperm__item + .folderperm__item { border-top: 1px solid var(--border); }
.folderperm__row {
    display: flex; align-items: flex-start; gap: 10px; padding: 8px 4px;
    cursor: pointer; border-radius: var(--radius-sm);
}
.folderperm__row:hover { background: var(--surface-hover); }
.folderperm__row input[type="checkbox"] { margin-top: 3px; flex: 0 0 auto; }
.folderperm__user { display: flex; flex-direction: column; min-width: 0; }
.folderperm__name { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text); }
.folderperm__mail { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.folderperm__badge {
    background: var(--accent-soft); color: var(--accent-700); border-radius: var(--radius-pill);
    padding: 1px 8px; font-size: 11px; font-weight: 600;
}
.folderperm__badge--muted { background: var(--surface-hover); color: var(--muted); }

/* ===== DMS: Buttons/Formularhilfen ===== */
.btn--secondary { background: var(--accent-soft); border-color: transparent; color: var(--accent-700); font-weight: 600; }
.btn--secondary:hover { background: #e2fbf9; }
.field__hint { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); }
.form__actions { margin-top: 8px; }
.alert__list { margin: 0; padding-left: 18px; }
.alert__list li { margin: 2px 0; }

/* ===== DMS: Detail-Bereiche ===== */
.detail__section { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 14px; }
.detail__h3 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--text-2); margin: 0 0 12px; }
.tagrow { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--accent-soft); color: var(--accent-700); border-radius: var(--radius-pill); padding: 2px 11px; font-size: 12px; }

/* ===== DMS: ACL-Tabelle ===== */
.acltable { width: 100%; border-collapse: collapse; font-size: 13px; }
.acltable th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 5px 6px; border-bottom: 1px solid var(--border); }
.acltable td { padding: 7px 6px; border-bottom: 1px solid var(--border); }
.acltable__chk { text-align: center; width: 72px; }
.acltable__chk input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.acllist { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.acllist li { padding: 4px 0; color: var(--text-2); }
.list__folder { color: var(--accent-700); font-weight: 600; }

/* =====================================================================
   Belege (Phase 6)
   ===================================================================== */

/* Belegtyp- & Status-Badges */
.badge--doctype-quote   { background: #e2f1ef; color: #0a4f4b; }
.badge--doctype-order   { background: #eafaf1; color: #0f7a45; }
.badge--doctype-invoice { background: #fff4e6; color: #9a5b00; }
.badge--docstatus-draft     { background: #eceef4; color: #64748b; }
.badge--docstatus-final     { background: var(--success-soft); color: var(--success); }
.badge--docstatus-cancelled { background: var(--danger-soft); color: var(--danger); }
.badge--order-open      { background: var(--warning-soft); color: var(--warning); }
.badge--order-completed { background: var(--success-soft); color: var(--success); }

.btn--accent { background: var(--accent-soft); border-color: #cbf8f5; color: var(--accent-700); }
.btn--accent:hover { background: #e1fbf9; }

/* Segmentierte Auswahl (Netto/Brutto) */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg__opt { position: relative; }
.seg__opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg__opt span { display: block; padding: 8px 16px; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.seg__opt + .seg__opt span { border-left: 1px solid var(--border-strong); }
.seg__opt input:checked + span { background: var(--accent); color: #fff; }

/* Editor */
.docform { display: flex; flex-direction: column; gap: 14px; }
.docform__title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; }
.docform__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.docform__section { margin: 6px 0 0; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--text-2); }
.docform__actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.field__input--sm { padding: 6px 8px; font-size: 13px; }
.field__input--xs { padding: 5px 8px; font-size: 12px; margin-top: 4px; color: var(--text-2); }

/* Positions-Tabelle – feste Spaltenbreiten (table-layout: fixed) => kein X-Scroll,
   Spalten schrumpfen statt überzulaufen. Die Panelbreite (--right-w) wird in
   Belege bewusst größer gesetzt, damit die Zeile bequem Platz hat. */
.itemtable { border: 1px solid var(--border); border-radius: var(--radius); padding: 2px 6px 12px; background: var(--surface); }
.itemtable__table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.itemtable__table thead th {
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted);
    font-weight: 700; text-align: left; padding: 9px 7px; border-bottom: 1px solid var(--border);
}
.itemtable__table tbody td { padding: 9px 7px; vertical-align: top; border-bottom: 1px solid var(--border); }
.itemtable__table tbody tr:last-child td { border-bottom: 0; }
.itemtable .field__input { width: 100%; min-width: 0; }
/* numerische Spalten rechtsbündig (wie im Belegmuster) */
.itemtable__table th.itemtable__qty, .itemtable__table th.itemtable__price,
.itemtable__table th.itemtable__disc, .itemtable__table th.itemtable__sum { text-align: right; }
.itemtable td.itemtable__qty .field__input, .itemtable td.itemtable__price .field__input,
.itemtable td.itemtable__disc .field__input { text-align: right; }
.itemtable__num  { width: 4%;  color: var(--muted); text-align: center !important; padding-top: 15px !important; font-variant-numeric: tabular-nums; }
.itemtable__qty  { width: 9%; }
.itemtable__unit { width: 11%; }
.itemtable__price { width: 12%; }
.itemtable__disc { width: 9%; }
.itemtable__tax  { width: 15%; }
.itemtable__sum  { width: 11%; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 15px !important; font-weight: 600; color: var(--text); }
.itemtable__del  { width: 5%; text-align: center; padding-top: 12px !important; }
.itemtable .iconbtn { padding: 4px 8px; }
.itemtable > .btn { margin: 10px 4px 0; }

/* Mobile: Positionszeile als gestapelte Karte (kein X-Scroll auf kleinen Screens) */
@media (max-width: 600px) {
    .itemtable__table, .itemtable__table tbody, .itemtable__table tr, .itemtable__table td { display: block; width: auto; }
    .itemtable__table thead { display: none; }
    .itemtable__table tbody tr { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 10px; }
    .itemtable__table tbody td { border: 0 !important; padding: 5px 0 !important; }
    .itemtable__table tbody td.itemtable__num { display: none; }
    .itemtable td[data-label]::before {
        content: attr(data-label); display: block; font-size: 11px; font-weight: 600;
        color: var(--muted); text-transform: uppercase; letter-spacing: .3px; margin-bottom: 4px;
    }
    .itemtable td.itemtable__qty .field__input, .itemtable td.itemtable__price .field__input,
    .itemtable td.itemtable__disc .field__input { text-align: left; }
    .itemtable__sum { text-align: left; padding-top: 5px !important; }
}

/* Summen */
.doctotals { margin-top: 4px; border-top: 1px solid var(--border); padding-top: 10px; }
.doctotals__row { display: flex; justify-content: space-between; align-items: baseline; padding: 3px 0; font-size: 14px; color: var(--text-2); }
.doctotals__row strong { font-variant-numeric: tabular-nums; }
.doctotals__row--sub { font-size: 12px; color: var(--muted); padding-left: 12px; }
.doctotals__row--grand { font-size: 16px; color: var(--text); font-weight: 800; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 8px; }
.doctotals--read { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }

/* Detailansicht */
.docdetail { display: flex; flex-direction: column; gap: 14px; }
.docdetail__head { display: flex; flex-direction: column; gap: 4px; }
.docdetail__number { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 18px; font-weight: 800; }
.docdetail__title { color: var(--text-2); font-weight: 600; }
.docdetail__party { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.docdetail__partyname { font-weight: 700; }
.docdetail__muted { color: var(--muted); font-size: 13px; line-height: 1.5; }
.docdetail__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.docdetail__meta > div { display: flex; flex-direction: column; }
.docdetail__meta span { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.docdetail__meta strong { font-size: 14px; }
.docdetail__freenotes { font-size: 13px; color: var(--text-2); white-space: normal; background: var(--surface-alt); border-radius: var(--radius-sm); padding: 10px 12px; }

.readitems { width: 100%; border-collapse: collapse; font-size: 13px; }
.readitems th { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--border); }
.readitems td { padding: 7px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.readitems .ra { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.docnotes { border-left: 3px solid var(--accent); background: var(--accent-soft-2); border-radius: 6px; padding: 8px 12px; }
.docnotes__item { margin: 2px 0; font-size: 13px; color: var(--text-2); }

.docchain { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.docchain__head { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.docchain__link { background: none; border: 0; text-align: left; color: var(--accent-700); font-weight: 600; font-size: 13px; cursor: pointer; padding: 2px 0; }
.docchain__link:hover { text-decoration: underline; }

.docactions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.docactions form { margin: 0; }

.docpdf { margin-top: 10px; font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.docpdf__label { color: var(--muted); }
.docpdf__link { font-weight: 600; color: var(--accent-700); text-decoration: none; }
.docpdf__link:hover { text-decoration: underline; }
.docpdf__muted { font-size: 12px; color: var(--muted); }

.cond--off .docform__grid { opacity: .45; }

/* Einklappbarer optionaler Block (Liefer-/Objektadresse) */
.docfold { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 12px; }
.docfold__summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); padding: 6px 0; }
.docfold__summary:hover { color: var(--accent-700); }
.docfold__body { display: flex; flex-direction: column; gap: 12px; padding: 8px 0 12px; }

@media (max-width: 720px) {
    .docform__grid, .docdetail__meta { grid-template-columns: 1fr; }
}

/* ===================== Phase 7 – Vorlagen / Template-System ===================== */

/* Detail-/Vorschau-Kopf */
.tpldetail { display: flex; flex-direction: column; gap: 12px; }
.tpldetail--preview { flex: 1; min-height: 0; }
.panel__body--preview { overflow: hidden; display: flex; flex-direction: column; }
.panel__body--preview > .tpldetail--preview { flex: 1; min-height: 0; }
.tpldetail__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.tpldetail__title { margin: 0 0 4px; font-size: 18px; }
.tpldetail__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tpldetail__muted { font-size: 12px; color: var(--muted); }
.tpldetail__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tpldetail__actions .inlineform { margin: 0; }
.tpldetail__hint { font-size: 12px; color: var(--muted); margin: 0; }

/* A4-Vorschau (isolierter iframe, skaliert auf Panelhöhe – kein Doppel-Scroll) */
.tplpreview {
    flex: 1 1 auto;
    min-height: 240px;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: #e9f5f4;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
}
.tplpreview__scaler { transform-origin: top center; }
.tplpreview__frame { display: block; border: 0; background: #fff; overflow: hidden; vertical-align: top; }

/* Editor */
.tplform { display: flex; flex-direction: column; gap: 14px; }
.tplform__head { display: flex; align-items: center; gap: 10px; }
.tplform__head h2 { margin: 0; font-size: 18px; }
.tplform__code { font-family: ui-monospace, "Cascadia Code", "Consolas", monospace; font-size: 12.5px; line-height: 1.5; white-space: pre; tab-size: 2; }
.tplform__actions { display: flex; gap: 8px; }
.formgrid--4 { grid-template-columns: repeat(4, 1fr); }

/* Platzhalter-Hilfe */
.tplhelp__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; padding: 10px 0; }
.tplhelp__group { display: flex; flex-direction: column; gap: 4px; }
.tplhelp__title { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.tplhelp__chip { display: inline-block; font-family: ui-monospace, "Consolas", monospace; font-size: 11.5px; background: var(--accent-soft-2); color: var(--accent-700); border-radius: 4px; padding: 2px 6px; margin: 1px 0; word-break: break-all; }

/* Logo-Feld in den Einstellungen */
.logobox { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.logobox + .logobox { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.logobox__preview { flex: 0 0 auto; width: 200px; min-height: 80px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; background: #fff; padding: 8px; }
.logobox__preview img { max-width: 100%; max-height: 90px; object-fit: contain; }
/* Zweites Briefkopf-Bild ist länglich (ca. 100:20) → flachere Vorschau */
.logobox__preview--wide { width: 280px; min-height: 64px; }
.logobox__preview--wide img { max-height: 56px; }
.logobox__empty { font-size: 12px; color: var(--muted); }
.logobox__controls { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.checkfield { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.field__hint { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.field__hint code { font-family: ui-monospace, "Consolas", monospace; font-size: 11.5px; background: var(--accent-soft-2); color: var(--accent-700); border-radius: 4px; padding: 1px 4px; }

@media (max-width: 720px) {
    .formgrid--4 { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Phase 10: Dashboard, Admin, DMS-Filter ===== */
.inline-form--stack { flex-direction: column; align-items: stretch; }
.inline-form--stack .field__input { flex: none; width: 100%; }

.dashboard { display: flex; flex-direction: column; gap: 22px; }
.dashboard__banner { margin: 0; }
.dashboard__storage { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-alt); }
.dashboard__storage-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; margin-bottom: 8px; }
.dashboard__storage-hint { font-size: 12.5px; margin: 8px 0 0; }
.storagebar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.storagebar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .3s var(--ease); }
.storagebar--warning > span { background: #d97706; }
.storagebar--critical > span { background: #ea580c; }
.storagebar--exceeded > span { background: var(--danger); }

.statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.statcard {
    display: flex; flex-direction: column; gap: 4px; padding: 16px 18px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-alt); text-decoration: none; color: inherit;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.statcard:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.statcard__value { font-size: 28px; font-weight: 700; line-height: 1; color: var(--accent-700); }
.statcard__label { font-size: 12.5px; color: var(--muted); }

.dashboard__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dashboard__section-title { font-size: 15px; font-weight: 600; margin: 0; }
.dashboard__recent-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.dashboard__hint { margin: 0 0 10px; font-size: 12.5px; }
.activitylist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.activitylist__item { display: flex; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.activitylist__item:last-child { border-bottom: 0; }
.activitylist__time { flex: 0 0 auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.activitylist__text { min-width: 0; }

.filterform { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.filterform__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.audittable-wrap { overflow: auto; flex: 1; min-height: 0; }
.audittable { width: 100%; border-collapse: collapse; font-size: 13px; }
.audittable th, .audittable td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.audittable th { font-size: 11px; text-transform: uppercase; letter-spacing: .35px; color: var(--muted); background: var(--surface-alt); position: sticky; top: 0; }
.audittable__time { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.audittable__action { display: block; font-weight: 600; }
.audittable__meta { max-width: 280px; word-break: break-word; }
.audittable__summary { color: var(--text-2); line-height: 1.45; max-width: 42rem; }
.audittable__row { cursor: pointer; transition: background .12s ease; }
.audittable__row:hover { background: var(--surface-hover); }
.audittable__row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.audittable__row.is-selected { background: var(--accent-soft); }
.audittable__row.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.auditdetail__summary { margin-bottom: 18px; font-size: 14px; }
.auditdetail__facts { margin-bottom: 18px; }
.auditdetail__tech { margin: 0; font-size: 12px; line-height: 1.5; }
.auditdetail__tech code { font-size: 11px; }

/* Audit-Filterleiste im Center-Panel (nicht als zweites linkes Panel!) */
.auditfilters {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px;
    padding: 4px 0 2px;
}
.auditfilters__field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.auditfilters__field--grow { flex: 1 1 180px; }
.auditfilters__label {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted);
}
.auditfilters__field .field__input { min-width: 132px; }
.auditfilters__field--grow .field__input { min-width: 160px; width: 100%; }
.auditfilters__actions { display: flex; align-items: center; gap: 8px; padding-bottom: 1px; }
.pager { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--border); }
.pager__info { font-size: 13px; color: var(--muted); }

.dmsfilters { display: flex; flex-wrap: wrap; gap: 10px 16px; padding: 0 18px 12px; }
.dmsfilters__item { display: flex; align-items: center; gap: 8px; }
.dmsfilters__item--grow { flex: 1 1 220px; min-width: 180px; }
.dmsfilters__item--grow .field__input { width: 100%; max-width: 320px; }
.dmsfilters__label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.field__input--sm { padding: 6px 10px; font-size: 13px; min-width: 120px; }

.simplelist { list-style: none; margin: 0 0 16px; padding: 0; }
.simplelist li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.muted { color: var(--muted); }
.formgrid--1 { grid-template-columns: 1fr; }

/* ---- Datensicherung ---------------------------------------------------- */
.backup-status { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; border: 1px solid var(--border); }
.backup-status--ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.backup-status--warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.backup-table { margin: 12px 0 18px; }
.backup-table .verlist__acts { width: auto; }
.backup-table .verlist__acts .btn { margin-left: 4px; }
.backup-info { font-size: 13px; color: var(--muted); }
.backup-info h3 { font-size: 13px; margin: 0 0 6px; color: inherit; }
.backup-info ul { margin: 0; padding-left: 18px; line-height: 1.6; }

/* ---- Beleg-Editor: Kundensuche, weitere Belegarten --------------------- */
.custsearch { margin-bottom: 6px; }
.badge--doctype-request      { background: #f1f9f8; color: #475569; }
.badge--doctype-confirmation { background: #ecfeff; color: #0e7490; }
.badge--doctype-service      { background: #f0fdf4; color: #15803d; }
.badge--doctype-proforma     { background: #f5fefd; color: #0f615b; }
.badge--doctype-credit       { background: #fef2f2; color: #b91c1c; }
.newdoc { position: relative; }
.newdoc > summary { list-style: none; cursor: pointer; }
.newdoc > summary::-webkit-details-marker { display: none; }
.newdoc__menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 220px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 42, 40,.12); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.newdoc__item { text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; font: inherit; font-size: 13px; cursor: pointer; color: inherit; }
.newdoc__item:hover { background: #f1f9f8; }

/* ---- Kundenvorlagen / Objekte ------------------------------------------ */
.custtpl__list { display: flex; flex-wrap: wrap; gap: 6px; }
.custtpl__item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; border: 1px solid var(--border); background: #f8fcfc; border-radius: 8px; padding: 6px 10px; cursor: pointer; font: inherit; color: inherit; max-width: 100%; }
.custtpl__item:hover { border-color: #14857e; background: #e2f1ef; }
.custtpl__name { font-size: 13px; font-weight: 600; }
.custtpl__meta { font-size: 11.5px; color: var(--muted); }
.tplbanner { background: #e2f1ef; border: 1px solid #b5dad5; color: #0a4f4b; border-radius: 8px; padding: 8px 10px; font-size: 13px; margin: 0 0 10px; }
.savetpl { margin-top: 12px; font-size: 13px; }
.savetpl > summary { cursor: pointer; color: #0e6b66; }
.savetpl__form { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.savetpl__form .field__input { flex: 1; min-width: 200px; }
.card__title { font-weight: 600; font-size: 13.5px; }
.card__meta { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.tplactions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---- DMS-Favoriten ------------------------------------------------------ */
.favtree { padding: 8px 10px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.favtree__head { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 2px 4px 4px; }
.favtree__link { display: flex; }
.favstar { display: inline-block; margin-right: 6px; vertical-align: middle; }
.favstar__btn { background: none; border: 0; padding: 2px; cursor: pointer; color: #94a3b8; line-height: 0; border-radius: 6px; }
.favstar__btn:hover { color: #f59e0b; background: #fffbeb; }
.favstar__btn.is-on { color: #f59e0b; }
.panel__head-row .crumbs { display: inline-flex; vertical-align: middle; }
.favgroup__empty { font-size: 13px; color: var(--muted); margin: 4px 0 12px; }
.favcard { position: relative; }
.favcard__del { position: absolute; top: 6px; right: 6px; opacity: 0; transition: opacity .15s; }
.favcard:hover .favcard__del { opacity: 1; }

/* ---- Startseite: Finanzübersicht (Stil Finanzübersicht) --------------------- */
.fin { display: grid; gap: 14px; margin: 6px 0 18px; --fin-ok: #1f8a5b; --fin-ok-soft: #e1f4ea; --fin-warn: #b86e00; --fin-warn-soft: #fdf0d9; --fin-bad: #c23b3b; --fin-bad-soft: #fbe5e5; --fin-accent: #106560; --fin-accent-soft: #e3faf8; --fin-s1: #157b74; --fin-s2: #1f9d6c; }
.fin__kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.fin__kpi { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: grid; gap: 4px; min-width: 0; color: inherit; text-decoration: none; }
.fin__kpi--main { border-color: var(--fin-accent); background: var(--fin-accent-soft); }
.fin__kpi--bad { border-color: #f1b4b4; background: var(--fin-bad-soft); }
.fin__lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fin__val { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.fin__note { font-size: 12.5px; color: var(--muted); }
.fin__panel { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.fin__panel--urgent { border-color: #f1b4b4; background: #fffafa; }
.fin__h { font-size: 14px; font-weight: 650; margin: 0 0 10px; }
.fin__two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 1100px) { .fin__two { grid-template-columns: 1fr; } }
.fin__urgent { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.fin__urgent a { display: flex; gap: 8px; padding: 7px 10px; border-radius: 8px; background: var(--fin-bad-soft); color: #7f1d1d; text-decoration: none; font-size: 13px; }
.fin__urgent a:hover { filter: brightness(.97); }
.fin__right { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin__more { font-size: 12px; color: var(--muted); padding-left: 10px; }
.fin__chart { width: 100%; height: auto; display: block; }
.fin__grid { stroke: #e5e9ef; stroke-width: 1; }
.fin__axis { font-size: 10.5px; fill: #6b7280; }
.fin__bar1 { fill: var(--fin-s1); }
.fin__bar2 { fill: var(--fin-s2); }
.fin__legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.fin__legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.fin__sw1 { background: var(--fin-s1); } .fin__sw2 { background: var(--fin-s2); }
.fin__tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.fin__tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.fin__tbl td { padding: 7px 8px; border-bottom: 1px solid #eef1f5; }
.fin__tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin__tbl a { color: inherit; font-weight: 600; }
.fin__row--warn td { background: var(--fin-warn-soft); }
.fin__row--bad td { background: var(--fin-bad-soft); }
.fin__muted { color: var(--muted); font-size: 11.5px; font-weight: 400; }
.fin__empty { color: var(--muted); font-size: 13px; }
.fin__dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.fin__dot--ok { background: var(--fin-ok); } .fin__dot--warn { background: #e0a100; } .fin__dot--bad { background: var(--fin-bad); }
/* Zahlungsstatus im Beleg */
.paybox { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 12px; font-size: 13px; }
.paybox--paid { background: #ecfdf5; border-color: #a7f3d0; }
.paybox--ok { background: #f8fcfc; }
.paybox--warn { background: #fffbeb; border-color: #fde68a; }
.paybox--bad { background: #fef2f2; border-color: #fecaca; }
.paybox__head { font-weight: 600; }
.paybox__muted { color: var(--muted); font-weight: 400; }
.paybox__form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.badge--paid { background: #e1f4ea; color: #1f8a5b; }
.badge--open-ok { background: #f1f9f8; color: #475569; }
.badge--open-warn { background: #fdf0d9; color: #b86e00; }
.badge--open-bad { background: #fbe5e5; color: #c23b3b; }
.list__num { white-space: nowrap; }
.list__title .badge { white-space: nowrap; }
.paybox__form .field__input { width: auto; flex: 0 0 auto; }
.paybox__form input[name="paid_note"] { flex: 1 1 160px; min-width: 140px; }
.list__title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.list__row { min-width: 0; max-width: 100%; } .list__title { min-width: 0; max-width: 100%; }
.fin__chart { max-height: 300px; }

/* ======================================================================
   Mitarbeiterportal (mobil)
   ====================================================================== */
.portal-body { background: #f1f9f8; min-height: 100vh; margin: 0; padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); font-size: 15px; }
.ptop { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px max(14px, env(safe-area-inset-left, 0px)); background: #0b2e2c; color: #fff; }
.ptop__brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 650; }
.ptop__right { display: flex; align-items: center; gap: 6px; }
.ptop__right form { margin: 0; }
.ptop__link { color: #b5dad5; text-decoration: none; font-size: 13px; padding: 6px 8px; border-radius: 8px; }
.ptop__btn { background: none; border: 1px solid rgba(255,255,255,.25); cursor: pointer; font: inherit; font-size: 13px; }
.portal { max-width: 640px; margin: 0 auto; padding: 14px 14px 20px; display: grid; gap: 12px; }
.pcard { background: #fff; border: 1px solid #e3f0ef; border-radius: 16px; padding: 16px; box-shadow: 0 1px 2px rgba(15, 42, 40,.04); }
.pcard__h { font-size: 16px; margin: 0 0 12px; }
.pcard--soon { background: transparent; border-style: dashed; box-shadow: none; }
.pclock { text-align: center; }
.pclock--work { background: linear-gradient(180deg, #ecfdf5, #fff 70%); border-color: #a7f3d0; }
.pclock--break { background: linear-gradient(180deg, #fffbeb, #fff 70%); border-color: #fde68a; }
.pclock__hello { font-size: 13px; color: #64748b; }
.pclock__state { margin-top: 6px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.pclock__dot { width: 10px; height: 10px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.2); animation: ppulse 1.6s infinite; }
.pclock--break .pclock__dot { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.2); }
@keyframes ppulse { 50% { box-shadow: 0 0 0 8px rgba(16,185,129,0); } }
.pclock__time { font-size: 46px; font-weight: 750; letter-spacing: -.02em; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.pclock__time small { font-size: 14px; font-weight: 500; color: #64748b; letter-spacing: 0; }
.pclock__sub { font-size: 13px; color: #64748b; }
.pclock__actions { display: flex; gap: 10px; margin-top: 16px; }
.pbtn { flex: 1; border: 0; border-radius: 14px; padding: 18px 12px; font: inherit; font-size: 18px; font-weight: 700; cursor: pointer; color: #fff; touch-action: manipulation; }
.pbtn--start { background: #10b981; }
.pbtn--pause { background: #f59e0b; }
.pbtn--stop { background: #ef4444; }
.pbtn--primary { background: #0e6b66; font-size: 16px; padding: 14px; width: 100%; }
.pbtn:active { transform: scale(.98); }
.pclock__warn { margin: 12px 0 0; background: #fef2f2; color: #991b1b; border-radius: 10px; padding: 8px 10px; font-size: 13px; text-align: left; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pgrid--3 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pstat { display: grid; gap: 2px; }
.pstat__lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.pstat__val { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pstat__note { font-size: 12px; color: #64748b; }
.pstat--pos .pstat__val { color: #047857; }
.pstat--neg .pstat__val { color: #b91c1c; }
.pform { display: grid; gap: 10px; }
.pform input[type=date], .pform input[type=text] { font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid #d5dce6; border-radius: 10px; width: 100%; box-sizing: border-box; background: #fff; }
.pform__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pform__row label { display: grid; gap: 4px; font-size: 13px; color: #475569; }
.pform__check { font-size: 14px; display: flex; gap: 8px; align-items: center; }
.pform__hint { font-size: 12.5px; color: #64748b; margin: 0; }
.pseg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pseg label { position: relative; }
.pseg input { position: absolute; opacity: 0; inset: 0; }
.pseg span { display: block; text-align: center; padding: 10px 4px; border: 1px solid #d5dce6; border-radius: 10px; font-size: 14px; }
.pseg input:checked + span { border-color: #0e6b66; background: #e2f1ef; color: #0a4f4b; font-weight: 600; }
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plist__item { display: flex; align-items: center; gap: 10px; justify-content: space-between; border-bottom: 1px solid #f1f9f8; padding-bottom: 8px; }
.plist__item > div { display: grid; }
.plist__item form { margin: 0; }
.plist__muted { color: #64748b; font-size: 12.5px; }
.plist__x { border: 0; background: #f1f9f8; border-radius: 8px; padding: 6px 9px; cursor: pointer; }
.pbadge { font-size: 11.5px; padding: 3px 8px; border-radius: 999px; background: #f1f9f8; color: #475569; white-space: nowrap; }
.pbadge--approved { background: #dcfce7; color: #166534; }
.pbadge--requested { background: #fef3c7; color: #92400e; }
.pbadge--rejected, .pbadge--cancelled { background: #fee2e2; color: #991b1b; }
.pmonth { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pmonth .pcard__h { margin: 0; }
.pmonth__nav { font-size: 24px; text-decoration: none; color: #0e6b66; padding: 0 10px; }
.pdays { list-style: none; margin: 0; padding: 0; }
.pdays__item { display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; padding: 10px 0; border-bottom: 1px solid #f1f9f8; align-items: center; }
.pdays__item.is-warn { background: #fff7f7; }
.pdays__date { font-weight: 600; font-size: 14px; }
.pdays__info { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13.5px; }
.pdays__warn { color: #b91c1c; font-size: 12px; }
.pdays__sum { font-weight: 700; font-variant-numeric: tabular-nums; }
.pdays__sum small { color: #94a3b8; font-weight: 400; }
.ptabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border-top: 1px solid #e3f0ef; padding-bottom: env(safe-area-inset-bottom, 0px); }
.ptabs__item { display: grid; justify-items: center; gap: 2px; padding: 8px 4px 10px; font-size: 11.5px; color: #64748b; text-decoration: none; }
.ptabs__item span { font-size: 20px; }
.ptabs__item.is-active { color: #0e6b66; font-weight: 600; }
.portal-body .wf-alerts { left: 12px; right: 12px; top: 64px; }
@media (min-width: 700px) { .ptabs { max-width: 640px; margin: 0 auto; border: 1px solid #e3f0ef; border-radius: 16px 16px 0 0; } }

/* ======================================================================
   Team & Zeiten (Desktop)
   ====================================================================== */
.tstat { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; display: inline-block; }
.tstat--work { background: #10b981; }
.tstat--break { background: #f59e0b; }
.tpos { color: #047857; } .tneg { color: #b91c1c; }
.tsec { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 8px; }
.tsec:first-child { margin-top: 0; }
.treq { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.treq__actions { display: flex; gap: 6px; }
.tlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.tlist li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tinline { display: inline-flex; gap: 4px; margin: 0; }
.tsettings { margin-top: 20px; font-size: 13px; }
.tsettings > summary, .tbox > summary { cursor: pointer; color: #0e6b66; font-weight: 600; margin-bottom: 8px; }
.tkpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0 14px; }
.tkpis div { background: var(--surface-alt, #f8fcfc); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; display: grid; gap: 2px; }
.tkpis span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tkpis strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.ttable { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-bottom: 12px; }
.ttable th { text-align: left; font-size: 10.5px; text-transform: uppercase; color: var(--muted); padding: 5px 6px; border-bottom: 1px solid var(--border); }
.ttable td { padding: 5px 6px; border-bottom: 1px solid #f1f9f8; vertical-align: top; }
.ttable .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ttable tr.is-off td { color: #94a3b8; background: #fafbfc; }
.ttable tr.is-warn td { background: #fff5f5; }
.tentry > summary { cursor: pointer; display: inline; }
.tentry__form { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; align-items: center; }
.tentry__form .field__input { width: auto; }
.tentry__form input[name="correction_note"], .tentry__form input[name="note"] { flex: 1 1 150px; }
.tbox { margin: 10px 0; font-size: 13px; }
.userperms { margin-top: 12px; }
.userperms summary { cursor: pointer; }
.portal-body { overflow-x: hidden; }
.portal > *, .pgrid > * { min-width: 0; }
.pform input[type=date] { min-width: 0; -webkit-appearance: none; appearance: none; }
.tvac { font-size: 13px; padding: 8px 0; display: grid; gap: 2px; }

/* ======================================================================
   Aufträge & Einsatzkalender
   ====================================================================== */
.jbadge--open { background: #fef3c7; color: #92400e; }
.jbadge--planning { background: #d3eae6; color: #0a4f4b; }
.jbadge--scheduled { background: #dffaf9; color: #10605b; }
.jbadge--released { background: #dcfce7; color: #166534; }
.jbadge--in_progress { background: #cffafe; color: #155e75; }
.jbadge--done { background: #f1f9f8; color: #475569; }
.jbadge--cancelled { background: #fee2e2; color: #991b1b; }
.jobtext { font-size: 13px; margin: 6px 0; }
.jobdetail .docdetail__actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.jobdetail .docdetail__actions form { margin: 0; }
.planbox { border: 1px solid #b5dad5; background: #f9fefe; border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.planbox > summary { cursor: pointer; font-weight: 650; color: #0a4f4b; }
.planform { display: grid; gap: 8px; margin-top: 10px; font-size: 13px; }
.planform--edit { margin: 8px 0 4px; padding: 8px; background: #f8fcfc; border-radius: 8px; }
.planform__row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.planform__row label { display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.planform__row .field__input { width: auto; }
.planform__days { display: flex; flex-wrap: wrap; gap: 10px; }
.planform__userlist { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; }
.ucheck { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.pconf { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 8px; padding: 6px 10px; font-size: 12.5px; margin-top: 6px; }
.pconf--ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.seriesbox { font-size: 13px; background: #f1f8f7; border-radius: 8px; padding: 8px 10px; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.apptlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.appt summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; padding: 6px 8px; border-radius: 8px; background: #f8fcfc; }
.appt--tentative summary { border-left: 3px dashed #8cc8c1; }
.appt--confirmed summary { border-left: 3px solid #15928a; }
.appt--released summary { border-left: 3px solid #10b981; }
.appt--in_progress summary { border-left: 3px solid #06b6d4; }
.appt__date { font-weight: 650; min-width: 62px; }
.appt__users { color: var(--muted); flex: 1; }
.pbadge--tentative { background: #e2f1ef; color: #0a4f4b; }
.pbadge--confirmed { background: #dffaf9; color: #10605b; }
.pbadge--released { background: #dcfce7; color: #166534; }
.pbadge--in_progress { background: #cffafe; color: #155e75; }
.pbadge--done { background: #f1f9f8; color: #475569; }
/* Kalender */
.cal { grid-column: 1 / -1; display: flex; flex-direction: column; min-height: 0; }
.cal__nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cal__title { margin-left: 8px; font-size: 15px; }
.cal__views { display: inline-flex; }
.cal__views .seg__opt { text-decoration: none; color: inherit; padding: 5px 10px; }
.cal__views .seg__opt.is-active { background: #e2f1ef; color: #0a4f4b; font-weight: 600; border-radius: 6px; }
.cal__legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.cal__legend .cchip { display: inline-block; padding: 2px 8px; }
.cal__body { display: flex; gap: 12px; padding: 12px; min-height: 0; flex: 1; overflow: hidden; }
.cal__open { width: 230px; flex: 0 0 230px; overflow: auto; }
.openjob { display: grid; gap: 2px; font-size: 12.5px; padding: 8px; border: 1px solid #fde68a; background: #fffbeb; border-radius: 8px; margin-bottom: 6px; color: inherit; text-decoration: none; }
.cal__grid { flex: 1; overflow: auto; }
.cweek { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 900px; font-size: 12px; table-layout: fixed; }
.cweek--day { min-width: 0; }
.cweek th, .cweek td { border-bottom: 1px solid #eef1f5; border-right: 1px solid #eef1f5; vertical-align: top; padding: 4px; }
.cweek thead th { position: sticky; top: 0; background: #fff; z-index: 2; font-weight: 600; text-align: left; }
.cweek thead th a { color: inherit; text-decoration: none; }
.cweek .cweek__u { width: 140px; position: sticky; left: 0; background: #fff; z-index: 1; text-align: left; font-weight: 600; }
.cweek th.is-today { background: #e2f1ef; }
.cweek th.is-off { color: #94a3b8; }
.cweek__c { height: 58px; }
.cweek__c.is-free { background: repeating-linear-gradient(45deg, #fff, #fff 6px, #fbfefe 6px, #fbfefe 12px); }
.cweek__c.has-abs { background: #fff1f2; }
.cweek__c.is-over, .cmonth__d.is-over { outline: 2px dashed #14857e; outline-offset: -2px; background: #e2f1ef; }
.cchip { display: grid; gap: 1px; margin-bottom: 3px; padding: 4px 6px; border-radius: 6px; background: #d3eae6; color: #0b2e2c; text-decoration: none; border-left: 3px solid #14857e; font-size: 11.5px; line-height: 1.25; cursor: pointer; }
.cchip[draggable="true"] { cursor: grab; }
.cchip.is-dragging { opacity: .4; }
.cchip--tentative { background: #f1f8f7; border-left: 3px dashed #d4a72c; }
.cchip--confirmed { background: #dffaf9; border-left-color: #13837b; }
.cchip--released { background: #dcfce7; border-left-color: #16a34a; }
.cchip--in_progress { background: #cffafe; border-left-color: #0891b2; }
.cchip--done { background: #f1f9f8; border-left-color: #94a3b8; color: #64748b; }
.cchip__t { font-weight: 650; }
.cchip__n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cchip__c { color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; }
.cabs { display: inline-block; font-size: 10.5px; background: #ffe4e6; color: #9f1239; border-radius: 4px; padding: 1px 5px; margin-bottom: 3px; }
.cmonth { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); border-top: 1px solid #eef1f5; border-left: 1px solid #eef1f5; min-width: 800px; }
.cmonth__h { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--muted); padding: 6px; border-right: 1px solid #eef1f5; border-bottom: 1px solid #eef1f5; }
.cmonth__d { min-height: 96px; padding: 4px; border-right: 1px solid #eef1f5; border-bottom: 1px solid #eef1f5; font-size: 11px; }
.cmonth__d.is-empty { background: #fafbfc; }
.cmonth__d.is-off { background: #fbfdfd; }
.cmonth__d.is-today { background: #e2f1ef; }
.cmonth__num { font-weight: 650; color: inherit; text-decoration: none; display: inline-block; margin-bottom: 2px; }
.cal__warn { margin: 6px 0 0; }
@media (max-width: 900px) { .cal__open { display: none; } }
/* Portal: Aufträge & Benachrichtigungen */
.pjobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pjob { display: grid; grid-template-columns: 62px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: #f8fcfc; border: 1px solid #e3f0ef; color: inherit; text-decoration: none; }
.pjob.is-today { background: #ecfdf5; border-color: #a7f3d0; }
.pjob__when { font-size: 12px; color: #64748b; line-height: 1.3; }
.pjob__when strong { font-size: 16px; color: #0f2a28; }
.pjob__what { display: grid; gap: 2px; min-width: 0; }
.pnotes__head { display: flex; justify-content: space-between; align-items: center; }
.pnotes__head form { margin: 0; }
.pnotes__badge { background: #ef4444; color: #fff; font-size: 11px; border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: middle; }
.plist__item.is-new strong::before { content: '● '; color: #ef4444; }
.pback { display: inline-block; color: #0e6b66; text-decoration: none; font-weight: 600; padding: 4px 0; }
.pjobd { display: grid; grid-template-columns: 90px 1fr; gap: 8px 10px; margin: 12px 0 0; font-size: 14px; }
.pjobd dt { color: #64748b; font-size: 12.5px; }
.pjobd dd { margin: 0; }
.pjobd__warn { background: #fffbeb; border-radius: 8px; padding: 6px 8px; }
.pjobd__when { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ptext { font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid #d5dce6; border-radius: 10px; width: 100%; box-sizing: border-box; }
.planform [hidden], .jobform [hidden] { display: none !important; }
.planform__row label.ucheck { display: inline-flex; align-items: center; gap: 6px; color: inherit; font-size: 13px; }
.dangerbox { margin-top: 18px; border: 1px solid #fecaca; background: #fff5f5; border-radius: 10px; padding: 10px 12px; }
.dangerbox > summary { cursor: pointer; font-weight: 650; color: #b91c1c; }
.dangerbox form { display: grid; gap: 8px; margin-top: 8px; }

/* ======================================================================
   Finanzen (wie Finanzübersicht) & Buchhaltung
   ====================================================================== */
.fin { --fin-s3: #1baf7a; --fin-s1: #177670; --fin-s2: #eb6834; }
.fin__balform { margin: 2px 0; }
.fin__balinput { font: inherit; font-size: 20px; font-weight: 650; width: 100%; box-sizing: border-box; padding: 4px 8px; border: 1px solid #c7eae8; border-radius: 6px; background: #fff; font-variant-numeric: tabular-nums; }
.fin__sum { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.fin__sum strong { color: var(--text, #112726); }
.fin__sub { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.fin__ulist { list-style: none; margin: 0; padding: 0; }
.fin__ulist li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid #f3e1e1; font-size: 13px; }
.fin__ulist li:last-child { border-bottom: 0; }
.fin__who { min-width: 0; }
.fin__who small { display: block; color: var(--muted); font-size: 11.5px; }
.fin__amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin__age { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.fin__age--bad { background: var(--fin-bad-soft); color: var(--fin-bad); }
.fin__age--warn { background: var(--fin-warn-soft); color: var(--fin-warn); }
.fin__legend { flex-wrap: wrap; }
.fin__sw--1 { background: var(--fin-s1); } .fin__sw--2 { background: var(--fin-s2); } .fin__sw--3 { background: var(--fin-s3); }
.fin__legend i.fin__sw--dot { background: #112726; border-radius: 50%; }
.fin__b1 { fill: var(--fin-s1); } .fin__b2 { fill: var(--fin-s2); } .fin__b3 { fill: var(--fin-s3); }
.fin__chart .fin__dot { fill: #112726; stroke: #fff; stroke-width: 2; }
.fin__zero { stroke: #9ca3af; }
.fin__bacc { fill: var(--fin-accent); } .fin__bcur { fill: var(--fin-warn); }
.fin__hint { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.fin__panel details summary { cursor: pointer; color: var(--fin-accent); font-size: 13px; margin-top: 8px; }
.fin__tblwrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.fin__table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fin__table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 7px 9px; border-bottom: 1px solid var(--border); background: #f8fcfc; white-space: nowrap; }
.fin__table td { padding: 7px 9px; border-bottom: 1px solid #eef1f5; white-space: nowrap; vertical-align: middle; }
.fin__table td.wide { white-space: normal; min-width: 170px; }
.fin__table .num { text-align: right; font-variant-numeric: tabular-nums; }
.fin__table tr:last-child td { border-bottom: 0; }
.fin__total td { font-weight: 650; border-top: 2px solid var(--border); }
.fin__calc td { white-space: normal; }
.fin__minikpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 10px; }
.fin__minikpis > div { border: 1px solid var(--border); border-radius: 8px; padding: 10px; display: grid; gap: 2px; }
.fin__minikpis strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.fin__minikpis small { color: var(--muted); font-size: 11.5px; }
.fin__note-box { background: var(--fin-warn-soft); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-top: 10px; }
.fin__rate { display: inline-flex; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.fin__rate--good { background: var(--fin-ok-soft); color: var(--fin-ok); }
.fin__rate--mid { background: var(--fin-warn-soft); color: var(--fin-warn); }
.fin__rate--bad { background: var(--fin-bad-soft); color: var(--fin-bad); }
/* Seite Finanzen / Buchhaltung */
.fpg { grid-column: 1 / -1; display: flex; flex-direction: column; min-height: 0; --fin-ok: #1f8a5b; --fin-ok-soft: #e1f4ea; --fin-warn: #b86e00; --fin-warn-soft: #fdf0d9; --fin-bad: #c23b3b; --fin-bad-soft: #fbe5e5; --fin-accent: #106560; --fin-accent-soft: #e3faf8; }
.fpg__tabs { display: flex; gap: 2px; overflow-x: auto; margin-top: 8px; border-bottom: 1px solid var(--border); }
.fpg__tab { padding: 9px 14px; font-weight: 600; font-size: 13.5px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.fpg__tab.is-active { color: var(--fin-accent); border-bottom-color: var(--fin-accent); }
.fpg__body { padding: 14px 16px; overflow: auto; display: grid; gap: 14px; align-content: start; }
.fpg__tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fpg__tools .field__input { width: auto; margin: 0; }
.fpg__tools input[type=search] { flex: 1 1 220px; min-width: 0; }
.fpg__sum { font-size: 13px; color: var(--muted); }
.fpg__sum strong { color: #112726; font-variant-numeric: tabular-nums; }
.fpg__hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.fpg__empty { color: var(--muted); text-align: center; padding: 16px !important; }
.fpg__table tr.is-done td { color: #8a94a3; }
.fpg__table tr.is-gs td:not(:has(.fpg__sel)) { text-decoration: line-through; color: #8a94a3; }
.fpg__table tr.is-age7 td { background: var(--fin-warn-soft); }
.fpg__table tr.is-age14 td { background: var(--fin-bad-soft); }
.fpg__table td.is-pos { color: var(--fin-ok); }
.fpg__st { display: flex; gap: 6px; align-items: center; margin: 0; }
.fpg__sel { font: inherit; font-size: 12.5px; padding: 3px 8px; border-radius: 999px; border: 1px solid transparent; background: #eceff2; color: #5d6d7c; cursor: pointer; display: inline-block; }
.fpg__sel--offen { background: var(--fin-warn-soft); color: var(--fin-warn); }
.fpg__sel--bezahlt { background: var(--fin-ok-soft); color: var(--fin-ok); }
.fpg__sel--gutgeschrieben { background: var(--fin-bad-soft); color: var(--fin-bad); }
.fpg__amt { font: inherit; font-size: 13px; width: 100px; text-align: right; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; font-variant-numeric: tabular-nums; }
.fpg__add, .fpg__upl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; align-items: end; }
.fpg__add label, .fpg__upl label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.fpg__upl { margin-top: 10px; }
.fpg__upl--inline { border-top: 1px solid var(--border); padding-top: 10px; }
.fpg__agent { white-space: normal; font-size: 13px; background: #f8fcfc; border-radius: 8px; padding: 8px 10px; }
.fpg__log { font-size: 13px; padding-left: 18px; margin: 0; display: grid; gap: 4px; }
.fpg__token { margin-top: 10px; font-size: 13px; }
.fpg__token summary { cursor: pointer; color: var(--muted); }
.fpg__token form { margin-top: 6px; }
.fpg__month { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.fpg__month summary { cursor: pointer; font-size: 13px; }
.fpg__month .fin__tblwrap { margin-top: 8px; }
.fpg__purpose { color: var(--muted); font-size: 12px; }
@media (max-width: 700px) { .fpg__body { padding: 10px; } .fin__ulist li { grid-template-columns: 1fr auto; } }
.rolerename { margin: 4px 0 14px; font-size: 13px; }
.rolerename summary { cursor: pointer; color: var(--muted); }
.tjoin { margin-bottom: 12px; }
.tjoin__form { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; align-items: end; }
.tremove { margin: 8px 0; text-align: right; }
.userroles { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; margin: 0; }
.userroles legend { font-size: 12px; color: var(--muted); padding: 0 4px; }
.userroles__item { display: inline-flex; gap: 5px; align-items: center; }
.permgroup__hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); font-size: 11.5px; }
.pclock__geo { margin: 8px auto 0; font-size: 12px; color: #64748b; max-width: 34em; }
.pclock__geo.is-error { color: #b91c1c; font-weight: 600; }
.pclock__actions.is-busy .pbtn { opacity: .55; pointer-events: none; }
/* Standorte beim Stempeln */
.geo__filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 10px; }
.geo__filter .field { margin: 0; min-width: 200px; }
.geo__nav { display: flex; gap: 6px; flex-wrap: wrap; }
.geo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; padding: 16px; }
.geo__map { min-height: 460px; border-radius: 10px; border: 1px solid #e2f0ef; background: #f8fcfc; z-index: 0; }
.geo__h { font-size: 15px; margin: 0 0 10px; }
.geo__list .geo__h + .geo__jobs, .geo__table + .geo__h { margin-top: 18px; }
.geo__empty { color: #64748b; padding: 12px; }
.geo__act { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; background: var(--c); white-space: nowrap; }
.geo__jobs { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.geo__jobs li { padding: 8px 10px; border: 1px solid #e2f0ef; border-radius: 8px; }
.geo__note { margin-top: 14px; }
@media (max-width: 900px) { .geo { grid-template-columns: 1fr; } .geo__map { min-height: 320px; } }
/* Lieferanten */
.sup__chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #475569; }
.sup__new { display: grid; grid-template-columns: 2fr 1.4fr 1.4fr 1.4fr auto; gap: 8px; margin-bottom: 12px; padding: 12px; border: 1px dashed #cbd5e1; border-radius: 10px; }
.sup__new[hidden] { display: none; }
.sup__row { cursor: pointer; }
.sup__row:hover td { background: #f8fcfc; }
.sup__row.is-bad td:first-child { box-shadow: inset 3px 0 0 #dc2626; }
.sup__row.is-open td:first-child { box-shadow: inset 3px 0 0 #d97706; }
.sup__kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.sup__kpis > div { border: 1px solid #e2f0ef; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.sup__kpis span { font-size: 12px; color: #64748b; } .sup__kpis strong { font-size: 18px; } .sup__kpis small { font-size: 11px; color: #94a3b8; }
.sup__kpis .is-open { border-color: #fcd34d; background: #fffbeb; } .sup__kpis .is-bad { border-color: #fca5a5; background: #fef2f2; } .sup__kpis .is-bad strong { color: #b91c1c; }
.sup__h { font-size: 15px; margin: 18px 0 8px; }
.sup__form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; }
.sup__form .field { margin: 0; } .sup__wide { grid-column: 1 / -1; }
.sup__tools { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 12px; border-top: 1px solid #e2f0ef; }
.sup__tools form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sup__dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; } .sup__dl dt { color: #64748b; }
.sup__link { color: inherit; text-decoration: none; border-bottom: 1px dotted #94a3b8; }
@media (max-width: 800px) { .sup__new, .sup__form { grid-template-columns: 1fr; } .sup__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Start: offene Lieferantenrechnungen */
.fin__sup { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fin__sup li > a { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid #e2f0ef; border-radius: 8px; color: inherit; text-decoration: none; }
.fin__sup li > a:hover { background: #f8fcfc; }
.fin__sup li.is-bad > a { border-color: #fca5a5; background: #fef2f2; }
.fin__sup small { display: block; color: #64748b; font-size: 12px; font-weight: 400; }
.fin__sup details { margin: 2px 10px 6px; font-size: 12px; color: #475569; }
.fin__h:has(> a) { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pinstall__txt { font-size: 14px; color: #475569; margin: 6px 0 10px; }
.pinstall[hidden] { display: none; }
.geo__panel { overflow: auto; }
.sup__body { display: block; } .sup__body > * + * { margin-top: 12px; }
/* Mein Konto */
.acct__body { padding: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-content: start; }
.pcard .acct__body { padding: 0; grid-template-columns: 1fr; }
.acct__who { grid-column: 1 / -1; margin: 0; color: #475569; }
.acct__box { border: 1px solid #e2f0ef; border-radius: 12px; padding: 14px 16px; display: grid; gap: 10px; align-content: start; }
.acct__box .field { margin: 0; }
.acct__h { margin: 0; font-size: 15px; }
.acct__pw { display: flex; gap: 6px; } .acct__pw .field__input { flex: 1; }
.acct__suggest { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acct__sugg { background: #e2f1ef; color: #0a4f4b; padding: 4px 8px; border-radius: 6px; font-size: 14px; user-select: all; }
.acct__strength { font-size: 12px; color: #64748b; min-height: 1em; }
.acct__strength[data-level="0"], .acct__strength[data-level="1"] { color: #b91c1c; }
.acct__strength[data-level="2"] { color: #b45309; } .acct__strength[data-level="3"], .acct__strength[data-level="4"], .acct__strength[data-level="5"] { color: #15803d; }
.topnav__username a { color: inherit; text-decoration: none; } .topnav__username a:hover { text-decoration: underline; }
/* Leistungsdatum (mehrere Tage / Zeitraum) */
.svcdate__modes { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; margin-bottom: 6px; }
.svcdate__modes label { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.svcdate__pane { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.svcdate__pane[hidden] { display: none; }
.svcdate__pane[data-pane="multi"] { flex-direction: column; align-items: stretch; }
.svcdate__add { display: flex; gap: 6px; }
.svcdate__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.svcdate__chip { border: 1px solid #b5dad5; background: #e2f1ef; color: #0a4f4b; border-radius: 999px; padding: 2px 10px; font-size: 13px; cursor: pointer; }
.svcdate__chip:hover { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }

/* ---- Mails (Mail-Agent) ---- */
.mailp__kpis{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.5rem}
.mailp__kpi{display:flex;flex-direction:column;align-items:center;min-width:6.5rem;padding:.45rem .7rem;border:1px solid var(--border,#d9dee5);border-radius:10px;text-decoration:none;color:inherit;background:var(--surface,#fff)}
.mailp__kpi strong{font-size:1.35rem;line-height:1.1}
.mailp__kpi span{font-size:.78rem;opacity:.75}
.mailp__kpi.is-bad strong{color:#c0392b}
.mailp__report{border:1px solid var(--border,#d9dee5);border-left:4px solid #147f78;border-radius:10px;padding:.6rem .85rem;margin-bottom:1rem;background:var(--surface,#fff)}
.mailp__report summary{cursor:pointer}
.mailp__reporttext{margin-top:.5rem;line-height:1.5;white-space:normal}
.mailp__tools{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-bottom:.75rem}
.mailp__list{display:flex;flex-direction:column;gap:.6rem}
.mailp__item{position:relative;border:1px solid var(--border,#d9dee5);border-left:5px solid #95a5a6;border-radius:10px;padding:.6rem .85rem .6rem .85rem;background:var(--surface,#fff)}
.mailp__item--dringend{border-left-color:#c0392b}
.mailp__item--wichtig{border-left-color:#e67e22}
.mailp__item--normal{border-left-color:#147f78}
.mailp__item--info{border-left-color:#bdc3c7}
.mailp__item.is-done{opacity:.6}
.mailp__top{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;font-size:.8rem}
.mailp__prio{font-weight:700;text-transform:uppercase;letter-spacing:.03em}
.mailp__item--dringend .mailp__prio{color:#c0392b}
.mailp__item--wichtig .mailp__prio{color:#d35400}
.mailp__reply{background:#fdebd0}
.mailp__due.is-bad{color:#c0392b;font-weight:700}
.mailp__amt{font-weight:600}
.mailp__when{margin-left:auto;opacity:.7}
.mailp__subj{font-size:1rem;margin:.3rem 0 .15rem}
.mailp__sum{margin:.4rem 0 .2rem;line-height:1.45}
.mailp__act{margin:.2rem 0;font-weight:600}
.mailp__btn{margin-top:.35rem}
.mailhome{border:1px solid var(--border,#d9dee5);border-radius:12px;padding:.7rem .9rem;margin:0 0 1rem;background:var(--surface,#fff)}
.mailhome__head{display:flex;flex-wrap:wrap;gap:.5rem;align-items:baseline;justify-content:space-between}
.mailhome__bad{color:#c0392b;font-weight:700}
.mailhome__list{list-style:none;margin:.5rem 0 0;padding:0;display:flex;flex-direction:column;gap:.35rem}
.mailhome__list li{border-left:4px solid #95a5a6;padding:.15rem .6rem}
.mailhome__list li.mailp__item--dringend{border-left-color:#c0392b}
.mailhome__list li.mailp__item--wichtig{border-left-color:#e67e22}
.mailhome__list li.mailp__item--normal{border-left-color:#147f78}
@media (prefers-color-scheme: dark){.mailp__reply{background:#5a3d14}}
.mailhome a{text-decoration:none;color:inherit}.mailhome a:hover{text-decoration:underline}

/* ---- Kontoabgleich (Ampel) ---- */
.rec{--rg:#1f9d55;--rr:#d93636;--ry:#d99a00;--rgr:#8a94a0;--rw:#c4cbd3}
.rec__head{display:flex;flex-wrap:wrap;gap:.75rem;justify-content:space-between;align-items:flex-start}
.rec__chips{display:flex;flex-wrap:wrap;gap:.45rem;margin:.6rem 0 1rem}
.rec__chip{display:inline-flex;align-items:center;gap:.35rem;padding:.35rem .7rem;border:1px solid var(--border,#d9dee5);border-radius:999px;text-decoration:none;color:inherit;font-size:.85rem;background:var(--surface,#fff)}
.rec__chip.is-on{outline:2px solid #147f78;outline-offset:1px}
.rec__chip--all b{color:var(--rr)}
.rec__sym{display:inline-grid;place-items:center;width:1.25rem;height:1.25rem;border-radius:50%;font-size:.75rem;font-weight:800;color:#fff}
.rec__chip.rec--green .rec__sym{background:var(--rg)}.rec__chip.rec--red .rec__sym{background:var(--rr)}.rec__chip.rec--yellow .rec__sym{background:var(--ry)}.rec__chip.rec--grey .rec__sym{background:var(--rgr)}.rec__chip.rec--white .rec__sym{background:transparent;color:var(--rgr);border:2px solid var(--rw)}
.rec__bar{display:flex;height:12px;min-width:140px;border-radius:6px;overflow:hidden;background:var(--rw)}
.rec__bar span.rec--green{background:var(--rg)}.rec__bar span.rec--red{background:var(--rr)}.rec__bar span.rec--yellow{background:var(--ry)}.rec__bar span.rec--grey{background:var(--rgr)}.rec__bar span.rec--white{background:var(--rw)}
.rec__months tr.is-sel td{background:rgba(46, 222, 210,.08)}
.rec__red{color:var(--rr);font-weight:800}
.rec__okt{color:var(--rg);font-weight:800}
.rec__list{display:flex;flex-direction:column;gap:.45rem}
.rec__row{display:flex;gap:.7rem;align-items:flex-start;padding:.55rem .75rem;border:1px solid var(--border,#d9dee5);border-left:6px solid var(--rw);border-radius:10px}
.rec__row.rec--green{border-left-color:var(--rg);background:rgba(31,157,85,.06)}
.rec__row.rec--red{border-left-color:var(--rr);background:rgba(217,54,54,.07)}
.rec__row.rec--yellow{border-left-color:var(--ry);background:rgba(217,154,0,.08)}
.rec__row.rec--grey{border-left-color:var(--rgr)}
.rec__badge{flex:none;display:inline-grid;place-items:center;width:1.9rem;height:1.9rem;border-radius:50%;font-weight:800;font-size:1rem;color:#fff;background:var(--rw)}
.rec--green .rec__badge,.rec__badge.rec--green{background:var(--rg)}
.rec--red .rec__badge,.rec__badge.rec--red{background:var(--rr)}
.rec--yellow .rec__badge,.rec__badge.rec--yellow{background:var(--ry)}
.rec--grey .rec__badge,.rec__badge.rec--grey{background:var(--rgr)}
.rec--white .rec__badge,.rec__badge.rec--white{background:transparent;color:var(--rgr);border:2px solid var(--rw)}
.rec__main{flex:1;min-width:0}
.rec__line{overflow-wrap:anywhere}
.rec__date{opacity:.7;margin-right:.3rem;font-variant-numeric:tabular-nums}
.rec__purpose{overflow-wrap:anywhere}
.rec__info{display:flex;flex-wrap:wrap;gap:.3rem .8rem;font-size:.85rem;margin-top:.2rem}
.rec__lbl{font-weight:700}
.rec--red .rec__lbl{color:var(--rr)}.rec--green .rec__lbl{color:var(--rg)}.rec--yellow .rec__lbl{color:#a87700}
.rec__note{font-style:italic}
.rec__amt{flex:none;font-weight:700;white-space:nowrap;font-variant-numeric:tabular-nums}
.rec__edit summary{cursor:pointer;font-size:.8rem;opacity:.7;margin-top:.2rem}
.rec__form{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.35rem}
.rec__noteinp{min-width:14rem;flex:1}
.rec__legend{margin-top:1rem;font-size:.9rem}
.rec__legend ul{list-style:none;padding:0;display:flex;flex-direction:column;gap:.4rem;margin:.5rem 0}
.rec__legend .rec__badge{width:1.5rem;height:1.5rem;font-size:.8rem;vertical-align:middle}
.rec__rev{border-left:4px solid var(--ry)}
/* Start: Kontoabgleich-Kachel */
.rech{border:1px solid var(--border,#d9dee5);border-radius:12px;padding:.7rem .9rem;margin:0 0 1rem;background:var(--surface,#fff)}
.rech__head{display:flex;flex-wrap:wrap;gap:.5rem;align-items:baseline;justify-content:space-between}
.rech__head a{text-decoration:none;color:inherit}
.rech__months{display:grid;grid-template-columns:auto 1fr auto;gap:.35rem .7rem;align-items:center;margin-top:.55rem;font-size:.85rem}
@media (max-width:640px){.rec__row{flex-wrap:wrap}.rec__amt{margin-left:2.6rem}}
.fpg__body{grid-template-columns:minmax(0,1fr)}.rec{min-width:0}.rec__open{color:var(--rgr)}

/* =====================================================================
   Automaten-Register (Wild Thing)
   ===================================================================== */
.vdtabs { display: inline-flex; gap: 2px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 3px; margin-left: 12px; }
.vdtabs__item { padding: 5px 14px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; color: var(--text-2); text-decoration: none; }
.vdtabs__item:hover { background: var(--surface-hover); color: var(--text); }
.vdtabs__item.is-active { background: var(--accent); color: #fff; }

.vdchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.vdchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--surface); font-size: 12.5px; color: var(--text-2); text-decoration: none; }
.vdchip b { font-variant-numeric: tabular-nums; color: var(--text); }
.vdchip.is-active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent-700); }
.vdchip--betrieb b { color: #11824a; }
.vdchip--defekt b, .vdchip--warn b { color: var(--danger); }
.vdchip--due { background: #fff6d6; border-color: #f2d27a; color: #7a5a00; }
.vdchip--due b { color: #7a5a00; }

.vdst { display: inline-block; padding: 2px 9px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; white-space: nowrap; }
.vdst--betrieb { background: var(--success-soft); color: var(--success); }
.vdst--lager { background: #edf1ef; color: #55625f; }
.vdst--defekt { background: var(--danger-soft); color: var(--danger); }
.vdst--ausgemustert { background: #f1f1f1; color: #8a8a8a; text-decoration: line-through; }

.vddue { font-size: 12.5px; white-space: nowrap; }
.vddue--overdue { color: var(--danger); font-weight: 700; }
.vddue--today { color: #8a6400; font-weight: 700; }
.vddue--later { color: var(--muted); }

.vd__row { cursor: pointer; }
.vd__row:hover td { background: var(--surface-hover); }
.vd__title { font-size: 16px; }
.vd .panel__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Formular */
.vdform { max-width: 980px; }
.vdform__box { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 4px; margin: 0 0 16px; background: var(--surface); }
.vdform__box legend { padding: 0 6px; font-weight: 800; font-size: 13px; color: var(--accent-700); }
.vdform__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.vdform__grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vdform__wide { grid-column: span 2; }
.vdform__actions { display: flex; gap: 8px; margin-top: 6px; }
.vdform__geo { margin: 0 0 12px; font-size: 13px; color: var(--text-2); }
.vdform__geo summary { cursor: pointer; margin-bottom: 8px; }
.vdchecks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.vdstatus { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.vdstatus__opt { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius-pill); cursor: pointer; border: 1px solid transparent; }
.vdstatus__opt:has(input:checked) { border-color: currentColor; box-shadow: 0 0 0 2px currentColor inset; }
.vdaddr { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.req { color: var(--danger); }
@media (max-width: 860px) { .vdform__grid, .vdform__grid--4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .vdform__grid, .vdform__grid--4 { grid-template-columns: 1fr; } .vdform__wide { grid-column: auto; } }

/* Detail */
.vdd__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.vdstat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; display: grid; gap: 2px; }
.vdstat span { font-size: 12px; color: var(--muted); }
.vdstat b { font-size: 20px; font-variant-numeric: tabular-nums; }
.vdd__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 14px; }
.vdd__col { display: grid; gap: 14px; }
.vdcard { padding: 14px 16px; }
.vddl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 13.5px; }
.vddl dt { color: var(--muted); }
.vddl dd { margin: 0; }
.vdnote { margin: 12px 0 0; padding: 10px 12px; background: var(--surface-alt); border-radius: var(--radius-sm); font-size: 13px; }
.vdroute { display: grid; gap: 6px; }
.vdroute__opt { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.vdroute__opt.is-suggest { border-color: #f2d27a; background: #fffbea; }
.vdroute__opt:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.vdroute__opt small { color: var(--muted); }
.vdroute__new { padding: 10px 2px 0; }
.vdroute__with { display: grid; gap: 4px; padding: 8px 2px; }
.vdvisitbox summary { cursor: pointer; padding: 2px 0; }
.vdvisitbox[open] summary { margin-bottom: 12px; }
.vdvisitbox .vdvisit { max-width: 560px; }
.vdcond--ok { color: var(--success); font-weight: 600; }
.vdcond--stoerung { color: #8a6400; font-weight: 700; }
.vdcond--defekt { color: var(--danger); font-weight: 700; }
.vdd__delete { margin-top: 14px; text-align: right; }
@media (max-width: 960px) { .vdd__grid { grid-template-columns: 1fr; } }

/* Routen */
.vdroutes { display: grid; gap: 12px; }
.vdroutecard.is-off { opacity: .6; }
.vdroutecard__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.vdstops { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 13.5px; }
.vdstops li span { margin-left: 6px; }
.vdsuggest { border-color: #f2d27a; background: #fffcef; }
.vdsuggest__item { border-top: 1px solid #f1e3b4; padding: 8px 0; }
.vdsuggest__item summary { cursor: pointer; }
.vdrform { margin-top: 10px; }

/* Karte */
.vdmap { position: relative; }
.vdmap__canvas { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); overflow: hidden; background: #e8eeec; z-index: 0; }
.vdmap__empty { padding: 30px; text-align: center; color: var(--muted); }
.vdmap__legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.vdmap__legend span { display: inline-flex; align-items: center; gap: 6px; }
.vdpin-wrap { background: none; border: 0; }
.vdpin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); vertical-align: middle; }
.vdmap__canvas .vdpin { width: 18px; height: 18px; }
.vdpin--betrieb { background: #11824a; }
.vdpin--due { background: #f2b705; }
.vdpin--lager { background: #8a9592; }
.vdpin--defekt { background: #c5392a; }
.vdhome { padding: 14px 16px; margin-bottom: 18px; }
.vdhome__head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.vdhome__head strong { font-size: 15px; margin-right: 4px; }

/* Mein Bereich – Touren & Besuch */
.ptabs--5 { grid-template-columns: repeat(5, 1fr) !important; }
.vddot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.vdtour { display: flex; align-items: stretch; gap: 0; padding: 0; overflow: hidden; }
.vdtour__main { flex: 1; display: grid; gap: 3px; padding: 12px 14px; text-decoration: none; color: inherit; min-width: 0; }
.jcard.vdtour--overdue { border-left: 5px solid #c5392a; }
.jcard.vdtour--today { border-left: 5px solid #f2b705; }
.jcard.vdtour--later { border-left: 5px solid #cdd7d4; opacity: .85; }
.vdnav { display: flex; align-items: center; padding: 0 14px; background: var(--surface-alt); border-left: 1px solid var(--border); text-decoration: none; font-weight: 600; font-size: 13px; color: var(--accent-700); white-space: nowrap; }
.jchip.jchip--late { background: var(--danger-soft); color: var(--danger); }
.jchip.jchip--today { background: #fff3c4; color: #7a5a00; }
.vdlater { margin-top: 8px; }
.vdlater summary { cursor: pointer; padding: 6px 4px; color: var(--text-2); font-size: 14px; }
.vdtourstrip { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; padding: 14px 16px; }
.vdtourstrip__ico { font-size: 24px; }
.vdtourstrip__txt { flex: 1; display: grid; gap: 2px; }
.vdtourstrip__txt small { color: var(--muted); }
.vdtourstrip.is-due { border-left: 5px solid #f2b705; }
.vdtourstrip.is-late { border-left: 5px solid #c5392a; }
.vdvisitcard__head { display: grid; gap: 2px; margin-bottom: 8px; }
.vdvisitcard__head h1 { margin: 0; font-size: 22px; }
.vdvisitcard__line { margin: 4px 0; font-size: 14.5px; }
.vdvisit .field__input { font-size: 16px; }
.vdvisit__counter { font-size: 26px !important; font-weight: 700; letter-spacing: .02em; padding: 12px 14px !important; font-variant-numeric: tabular-nums; }
.vdvisit__diff { display: block; margin-top: 6px; font-size: 14px; color: var(--text-2); }
.vdvisit__plus { color: var(--success); font-size: 16px; }
.vdvisit__reset { margin: -6px 0 14px; font-size: 13px; }
.vdchecks--big { gap: 8px; margin-bottom: 8px; }
.vdtoggle { position: relative; }
.vdtoggle input { position: absolute; opacity: 0; pointer-events: none; }
.vdtoggle span { display: inline-block; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; user-select: none; }
.vdtoggle input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.vdtoggle--warn input:checked + span { background: #f2b705; border-color: #f2b705; color: #3a2b00; }
.vdtoggle--bad input:checked + span { background: var(--danger); border-color: var(--danger); }
.vdtoggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.vdvisit__save { padding: 14px; font-size: 16px; }
.vdhist { display: grid; grid-template-columns: 1fr 1.4fr .7fr; gap: 8px; padding: 9px 4px; border-bottom: 1px solid var(--border); font-size: 14px; }
.vdhist:last-child { border-bottom: 0; }
.vdhist span:last-child { text-align: right; color: var(--success); font-weight: 700; }
.portal-body { scroll-padding-bottom: 96px; padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important; }
.vdvisit__save, .vdvisit .field__input { scroll-margin-bottom: 96px; }
.vdvisit { padding-bottom: 6px; }
main.portal::after { content: ""; display: block; height: 84px; }
.jcard.vdtour { display: flex; grid-template-columns: none; padding: 0; width: 100%; }
.jcard.vdtour .jcard__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.jcard.vdtour .jcard__line { white-space: normal; }
.vd [hidden], .vdvisit [hidden], .vdroute [hidden] { display: none !important; }
