/* ============================================================
   Belegverwaltung — Design
   ------------------------------------------------------------
   Quelle der Wahrheit ist das Referenz-Mockup (siehe DESIGN.md):
   dunkle Leiste oben, warmes Papier, weisse Flaechen mit duennen
   Linien, keine Schatten, kaum Farbe. --ox ausschliesslich fuer
   Fristueberschreitung.
   ============================================================ */

/* Geist (Vercel) - variable Schnittweite deckt 400/500/600/700 in einer
   Datei ab. Selbst ausgeliefert aus wwwroot/lib/geist (geist-npm-Paket 1.7.2,
   OFL-Lizenz daneben) - kein CDN, das die IP jedes Nutzers sieht (#270). */
@font-face {
    font-family: 'Geist';
    src: url('../lib/geist/Geist-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --font: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* ---------- Palette ---------- */
    --t1: #123E43;      /* Titel, Zahlen, Leiste, primaere Buttons - dunkles Teal */
    --t2: #4F6367;      /* Kontexttext, Nebensaetze - Petrol-Grau statt Braun */
    --t3: #93A6A8;      /* Zeitangaben, Beiwerk, Platzhalter - helles Petrol-Grau statt Braun */
    --paper: #F8F8F6;   /* EINHEITLICHER Hintergrund - Topbar, Sidebar, Seite; fast weiss (#205), die Karten heben sich ueber ihre Linie ab */
    --surface: #FFFFFF; /* Karten, Tabellen, Eingabefelder - bleibt die hellste Flaeche */
    --rule: #E5E2DB;    /* tragende Linien, Rahmen - neutraler als frueher, passt zum helleren Papier */
    --rule2: #EFEDE8;   /* Trennlinien in Listen */
    --ox: #A4362A;      /* AUSSCHLIESSLICH Fristueberschreitung */

    /* Aktivzustand der Navigation - einzige Stelle, die bewusst Orange traegt. */
    --accent-orange: #F85A12;
    --accent-orange-soft: #FFF0E8;

    /* Abstufungen von t1/ox fuer Zustaende - keine neuen Farben */
    --t1-hover: #0C2E32;
    --t1-soft: #E1EBEC;
    --ox-hover: #8B2E24;
    --ox-soft: #F3E4E0;

    /* Rundungen (#205): vier Stufen, keine Einzelwerte mehr im Stylesheet.
       Ziel ist die Mitte zwischen "alles eckig" und "alles fast rund" -
       Pillen (999px) und Kreise (50%) bleiben davon unberuehrt. */
    --radius-xs: 6px;   /* Kleinkram: Badges, Tags, Menuezeilen, Zeilen-Hover */
    --radius-sm: 10px;  /* Bedienelemente: Buttons, Eingabefelder, Icon-Knoepfe */
    --radius: 12px;     /* Flaechen: Karten, Tabellen, Menues, Panels */
    --radius-lg: 16px;  /* Grosse Flaechen: Popups, Kacheln der Zentrale */
    --nav-h: 62px;
    --sidebar-w: 224px;

    /* ---------- Alte Tokennamen (noch von einzelnen Seiten gelesen) ---------- */
    --font-sans: var(--font);
    --accent: var(--t1);
    --accent-strong: var(--t1-hover);
    --accent-hover: var(--t1-hover);
    --accent-soft: var(--t1-soft);
    --accent-contrast: var(--paper);
    --bg: var(--paper);
    --surface-2: var(--rule2);
    --surface-hover: var(--t1-soft);
    --border: var(--rule);
    --border-strong: var(--rule);
    --text: var(--t1);
    --text-muted: var(--t2);
    --text-faint: var(--t3);
    --pos: var(--t1);  --pos-soft: var(--t1-soft);
    --neg: var(--t1);  --neg-soft: var(--rule2);
    --warn: var(--t2); --warn-soft: var(--rule2);
    --info: var(--t2); --info-soft: var(--rule2);
    --shadow-sm: none; --shadow-md: none; --shadow-lg: none;
}

/* Bootstrap auf die Palette ziehen, damit ungestylte Reste nicht ausreissen. */
:root, [data-bs-theme="light"] {
    --bs-body-font-family: var(--font);
    --bs-body-bg: var(--paper);
    --bs-body-color: var(--t1);
    --bs-border-color: var(--rule);
    --bs-primary: var(--t1);
    --bs-primary-rgb: 50, 39, 30;
    --bs-link-color: var(--t1);
    --bs-link-color-rgb: 50, 39, 30;
    --bs-link-hover-color: var(--t1-hover);
    --bs-link-hover-color-rgb: 43, 33, 26;
    --bs-emphasis-color: var(--t1);
    --bs-secondary-color: var(--t2);
    --bs-tertiary-bg: var(--rule2);
    --bs-border-radius: var(--radius-sm);
    --bs-border-radius-sm: var(--radius-xs);
    --bs-border-radius-lg: var(--radius);
    --bs-border-radius-xl: var(--radius-lg);
}

* { box-sizing: border-box; }
html { background: var(--paper); }
/* Die Seite selbst scrollt nie - .content ist fuer jede Seite der einzige
   Scroll-Container (Grund: ohne diesen Riegel kann bei sehr knapp zu
   hohem Inhalt der Mausrad-Scroll an html/body haengen bleiben statt an
   der eigentlich gemeinten Flaeche - beobachtet auf der Zentrale). */
html, body { height: 100%; overflow: hidden; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;
    color: var(--t1);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

/* Startbildschirm (#332): #app-splash in _Host.cshtml bis der Circuit steht,
   dieselbe Klasse in MainLayout.razor, solange Firma/Benutzer geprueft werden.
   Gleiches Aussehen, damit der Wechsel nicht springt. Ausgeblendet ueber den
   Marker .app-ready, den MainLayout vor den statischen Splash rendert - ohne
   Skript und ohne :has(). */
.app-splash {
    position: fixed; inset: 0; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    background: var(--paper);
}
.app-splash-logo { height: 56px; width: auto; opacity: .9; }
.app-ready ~ #app-splash { display: none; }

/* Archivo ist von Haus aus kraeftig - 500 wirkt hier schon wie "fett",
   600 bleibt Namen und Summen vorbehalten. */
h1, h2, h3, h4, h5, h6 { color: var(--t1); margin: 0; font-weight: 500; line-height: 1.25; }
h1 { font-size: 20px; }
h2 { font-size: 17px; }
h5 { font-size: 16px; }
a { color: var(--t1); text-decoration: none; }
p { margin: 0 0 10px; }
.text-muted { color: var(--t2) !important; }
b, strong { font-weight: 600; }

/* Beträge sind keine Sprache: bleiben in jeder Sprache und auch im
   RTL-Layout rechtsbündig und in lateinischen Ziffern (die Kultur für
   Zahlenformate ist ohnehin fix de-AT, siehe LOCALIZATION.md). direction:ltr
   + unicode-bidi:isolate verhindert, dass der Bidi-Algorithmus z.B.
   "1.465,80 €" neben arabischem Text umsortiert; text-align:right
   überschreibt bewusst Bootstraps logisches .text-end (das in RTL nach
   links kippen würde) - beide Klassen stehen an jeder Geldstelle nebeneinander. */
.text-money, .tabular {
    font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
    direction: ltr; unicode-bidi: isolate; text-align: right;
}

:focus-visible { outline: 2px solid var(--t1); outline-offset: 2px; }

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-thumb { background: var(--rule); border: 3px solid var(--paper); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   Kopfleiste + Sidebar
   ------------------------------------------------------------
   Topbar, Sidebar und Seite teilen sich denselben Ton (--paper,
   einheitlich). Kein Strich unter der Topbar - die einzige Trennung
   ist die eine gefadete Vertikale bei --sidebar-w (.app-divider,
   unten), die ueber die volle Hoehe durchlaeuft und oben/unten
   ausblendet.
   ============================================================ */
.topnav {
    position: sticky; top: 0; z-index: 60;
    height: var(--nav-h);
    background: var(--paper);
    color: var(--t1);
    display: flex; align-items: center; gap: 10px;
    padding-inline-end: 24px;
}
.topnav-brand {
    display: flex; align-items: center; justify-content: flex-start; gap: 10px; color: var(--t1);
    width: var(--sidebar-w); flex-shrink: 0; height: 100%;
    /* Fluchtet mit den Nav-Icons (#205): deren Zeichen beginnt bei 30px. Das
       Logo-PNG hat links ~9px transparenten Rand, davor nur die duenne
       Dachlinie - der kraeftige Schriftzug beginnt erst ~14.5px nach der
       Bildkante. Auf den Schriftzug ausgerichtet, nicht auf die Dachlinie,
       sonst wirkt das Logo eingerueckt. */
    padding-inline: 15px 12px;
}
.topnav-brand:hover { color: var(--t1); }
.topnav-logo {
    width: 26px; height: 26px; flex-shrink: 0;
    background: var(--t1); color: var(--paper);
    border-radius: var(--radius-sm);
    display: grid; place-items: center; overflow: hidden;
    font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.topnav-logo img { width: 100%; height: 100%; object-fit: cover; }
.topnav-brand-logo { height: 56px; width: auto; max-width: 100%; object-fit: contain; display: block; }

.topnav-spacer { flex: 1; }

.topnav-search {
    display: flex; align-items: center; gap: 8px;
    width: 500px; height: 38px; margin: 0; margin-inline-start: 20px;
    background: #FFFFFF;
    border: 1px solid var(--rule); border-radius: var(--radius);
    padding-block: 0; padding-inline: 16px;
}
.topnav-search:focus-within { border-color: var(--t3); }
.topnav-search > .bi-search { color: var(--t3); font-size: 15px; flex-shrink: 0; }
.topnav-search input {
    flex: 1; min-width: 0; background: transparent; border: 0; outline: 0;
    color: var(--t1); font: inherit; font-size: 14.5px;
}
.topnav-search input::placeholder { color: var(--t3); }
.topnav-search input::-webkit-search-cancel-button { display: none; }

.topnav-icon {
    position: relative; flex-shrink: 0;
    width: 36px; height: 36px; border-radius: var(--radius-sm); border: 0;
    display: grid; place-items: center;
    background: transparent; color: var(--t2); font-size: 17px;
}
.topnav-icon:hover { background: var(--t1-soft); color: var(--t1); }
.topnav-badge {
    position: absolute; top: 3px; inset-inline-end: 3px; min-width: 16px; height: 16px;
    padding: 0 4px; border-radius: var(--radius-xs); display: grid; place-items: center;
    background: var(--t1); color: var(--paper); font-size: 10.5px; font-weight: 700;
}
.topnav-burger { display: none; color: var(--t1); }
.topnav-burger:hover { background: var(--t1-soft); }

@keyframes menu-in {
    from { opacity: 0; transform: translateY(-6px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.topnav-popover {
    position: absolute; top: calc(var(--nav-h) + 6px); inset-inline-end: 24px; z-index: 70;
    width: 320px; padding: 6px;
    background: var(--surface); color: var(--t1);
    border: 1px solid var(--rule); border-radius: var(--radius);
    animation: menu-in .16s cubic-bezier(.2,.8,.2,1) both;
}
.topnav-popover-title { font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--t2); padding: 8px 10px 4px; }
.topnav-popover-empty { padding: 10px 10px 14px; color: var(--t2); font-size: 14.5px; }

/* ============================================================
   Profil - Avatar, Name, Firma, Chevron; ein Klick oeffnet das
   Menue mit Sprachumschalter (Ausklapp-Untermenue) und Einstellungen.
   ============================================================ */
.profile { position: relative; flex-shrink: 0; margin-inline-start: 4px; }
.profile-trigger {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 10px 5px 5px; border-radius: var(--radius);
    background: transparent; border: 0; cursor: pointer;
    font-family: var(--font); max-width: 220px;
}
.profile-trigger:hover { background: var(--t1-soft); }
.profile-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.3; }
.profile-name { font-size: 14px; font-weight: 600; color: var(--t1); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-company { font-size: 12px; color: var(--t2); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-chevron { flex-shrink: 0; font-size: 12px; color: var(--t2); transition: transform .15s ease; }
.profile-chevron.up { transform: rotate(180deg); }

.profile-menu {
    position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 70;
    min-width: 230px; padding: 6px;
    background: var(--surface); color: var(--t1);
    border: 1px solid var(--rule); border-radius: var(--radius);
    animation: menu-in .16s cubic-bezier(.2,.8,.2,1) both;
}
.profile-menu-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 10px 10px; border: 0; border-radius: var(--radius-xs);
    background: transparent; color: var(--t1);
    font: 500 14.5px var(--font); text-align: start; cursor: pointer;
}
.profile-menu-item:hover { background: var(--t1-soft); }
.profile-menu-item > i:first-child { font-size: 16px; width: 18px; text-align: center; color: var(--t2); flex-shrink: 0; }
.profile-menu-caret { margin-inline-start: auto; font-size: 12px; color: var(--t3); transition: transform .15s ease; }
.profile-menu-caret.open { transform: rotate(90deg); }
.profile-submenu { padding-inline-start: 28px; padding-block: 2px 4px; display: flex; flex-direction: column; gap: 1px; }
.profile-submenu-item { padding: 8px 10px; border-radius: var(--radius-xs); color: var(--t2); font-size: 14px; }
.profile-submenu-item:hover { background: var(--t1-soft); color: var(--t1); }
.profile-submenu-item.active { color: var(--t1); font-weight: 600; }
.profile-menu-sep { height: 1px; margin: 4px 6px; background: var(--rule2); }
.profile-backdrop { position: fixed; inset: 0; z-index: 65; border: 0; background: transparent; }

/* ---------- Sidebar ---------- */
.app-body { height: calc(100vh - var(--nav-h)); display: flex; position: relative; }
.sidebar {
    width: var(--sidebar-w); flex-shrink: 0; height: 100%; overflow-y: auto;
    background: var(--paper);
    padding: 16px 14px 16px;
    /* Spalte, damit der Firmenblock (#205) unten sitzt, egal wie viele
       Punkte darueber stehen. */
    display: flex; flex-direction: column;
}

/* Die eine Trennlinie zwischen Sidebar und Inhalt - faedet oben (unter der
   Topbar) und unten aus statt hart durchzulaufen. Ueberspannt bewusst die
   ganze Fensterhoehe (fixed, nicht Teil von .sidebar), damit sie ohne Bruch
   durch Topbar und Arbeitsflaeche durchgeht. Nur am Desktop - am Handy ist
   die Sidebar eine Schublade ohne feste Spalte daneben. --t3 statt --rule,
   weil Topbar/Sidebar/Inhalt jetzt dieselbe Flaeche sind - ohne den
   Farbunterschied braucht die Linie selbst mehr Praesenz, um noch als
   Trennung zu lesen. */
.app-divider {
    position: fixed; top: 0; bottom: 0; inset-inline-start: var(--sidebar-w); width: 1px; z-index: 61;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent 0%, var(--t3) 18%, var(--t3) 82%, transparent 100%);
}
/* Firma ganz unten (#205): margin-top:auto schiebt den Block ans Ende der
   Spalte; Innenabstand links wie die Nav-Links, damit Logo und Icons fluchten. */
.sidebar-tenant {
    display: flex; align-items: center; gap: 10px; flex-shrink: 0;
    margin-top: auto; padding-block: 14px 2px; padding-inline: 14px 6px; border-top: 1px solid var(--rule2);
    color: var(--t2); min-width: 0;
}
.sidebar-nav { flex-shrink: 0; margin-bottom: 16px; }
.sidebar-tenant-name { font-size: 13.5px; font-weight: 500; color: var(--t2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 11px; border-radius: var(--radius-sm);
    color: var(--t2); font-size: 15px; font-weight: 400;
    border-inline-start: 3px solid transparent;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.sidebar-link i { font-size: 16px; width: 18px; text-align: center; flex-shrink: 0; color: var(--t3); }
.sidebar-link:hover { background: var(--t1-soft); color: var(--t1); }
.sidebar-link:hover i { color: var(--t2); }
/* Aktiv: Text bleibt in --t1 (Kontrast auf dem hellen Orange-Ton waere zu
   schwach fuer Fliesstext) - Orange traegt der Akzentbalken, das Icon und
   der getoente Hintergrund. */
.sidebar-link.active { background: var(--accent-orange-soft); color: var(--t1); font-weight: 600; border-inline-start-color: var(--accent-orange); }
.sidebar-link.active i { color: var(--accent-orange); }
/* Warnpunkt (#214): eine Rechnung ist ueberfaellig oder ein Angebot wartet aufs
   Nachfassen. Rot und pulsierend - auffallen ist hier die Aufgabe, deshalb
   bewusst nicht --ox (das bleibt ruhig, fuer die Kennzeichnung in Listen). */
.nav-alert-dot {
    position: relative; margin-inline-start: auto; width: 9px; height: 9px; flex-shrink: 0;
    border-radius: 50%; background: #FF3B3B; box-shadow: 0 0 8px rgba(255, 59, 59, .8);
}
.nav-alert-dot::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%; background: #FF3B3B;
    animation: nav-alert-pulse 1.8s cubic-bezier(.2, .6, .4, 1) infinite;
}
@keyframes nav-alert-pulse { from { transform: scale(1); opacity: .7; } to { transform: scale(3); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .nav-alert-dot::after { animation: none; } }

/* Unterpunkte (#195): eingerueckt, eine Spur kleiner, mit einer feinen
   Fuehrungslinie links, damit die Zugehoerigkeit ohne Ueberschrift klar ist. */
.sidebar-sub {
    display: flex; flex-direction: column; gap: 1px;
    margin: 1px 0 4px 20px; padding-inline-start: 8px;
    border-inline-start: 1px solid var(--rule);
}
.sidebar-sub .sidebar-link { padding: 7px 10px; font-size: 14px; }
.sidebar-sub .sidebar-link i { font-size: 14.5px; }
.sidebar-group { width: 100%; background: transparent; border-top: 0; border-bottom: 0; border-inline-end: 0; text-align: start; cursor: pointer; font: inherit; font-size: 15px; }
.sidebar-group .sidebar-chevron { margin-inline-start: auto; font-size: 12px; width: auto; transition: transform .15s ease; }
.sidebar-group.open .sidebar-chevron { transform: rotate(180deg); }

/* Todo ist die Handy-Ansicht - am Desktop nicht in der Sidebar. */
.sidebar-link-mobil { display: none; }

/* Trennt Stammdaten von den oberen Menuepunkten - eine gefadete Linie statt
   einer Rubrik-Ueberschrift, kraeftiger als die Listenlinien (--rule2) sonst,
   damit sie neben den Menuepunkten nicht untergeht. */
.sidebar-divider {
    height: 2px; margin: 16px 6px; border: 0;
    background: linear-gradient(to right, transparent 0%, var(--t3) 20%, var(--t3) 80%, transparent 100%);
}

.sidebar-backdrop { position: fixed; inset: var(--nav-h) 0 0 0; z-index: 55; border: 0; background: rgba(50,39,30,.35); display: none; }

/* ---------- Inhalt ---------- */
.content { flex: 1 1 auto; min-width: 0; height: 100%; overflow-y: auto; max-width: 1680px; margin: 0 auto; padding: 32px 40px 56px; }

/* ============================================================
   Bausteine: Karten, Zeilen, Buttons, Pills
   ============================================================ */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: none; color: var(--t1); overflow: hidden; }
.card-accent { border-inline-start: 3px solid var(--t1); }
.card-accent.ox { border-inline-start-color: var(--ox); }
.card-band {
    background: var(--t1); color: var(--paper);
    font-size: 12.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
    padding: 8px 18px;
}
.card-body { padding: 16px 18px; }
.card-title { font-size: 16.5px; font-weight: 500; }
.card-sub { color: var(--t2); font-size: 15px; margin-top: 3px; }
.card-sub .ox { color: var(--ox); }
.card-amount { font-size: 16px; font-weight: 500; margin-top: 4px; font-variant-numeric: tabular-nums; }
.card-amount.ox { color: var(--ox); }
.card-sep { border: 0; border-top: 1px solid var(--rule2); margin: 14px -18px; }
.card-q { font-size: 15px; color: var(--t1); }

.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pill {
    font: 400 14px var(--font); color: var(--t2);
    padding: 7px 13px; border: 1px solid var(--rule); border-radius: var(--radius-sm);
    background: var(--surface); cursor: pointer; line-height: 1.2;
}
.pill:hover { border-color: var(--t3); color: var(--t1); }
.pill.on { background: var(--t1); color: var(--paper); border-color: var(--t1); }
.pill-input {
    font: 500 14px var(--font); color: var(--t1);
    padding: 6px 10px; border: 1px solid var(--t3); border-radius: var(--radius-sm); background: var(--surface);
    min-width: 120px; outline: 0;
}

.btn-dark, .btn-ox {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--t1); color: var(--paper);
    border: 1px solid var(--t1); border-radius: var(--radius-sm);
    font: 500 15px var(--font); padding: 11px 18px; line-height: 1.2;
    cursor: pointer; white-space: nowrap;
    transition: background .12s ease;
}
.btn-dark:hover { background: var(--t1-hover); color: var(--paper); }
.btn-ox { background: var(--ox); border-color: var(--ox); }
.btn-ox:hover { background: var(--ox-hover); color: var(--paper); }
.btn-dark.wide, .btn-ox.wide { width: 100%; }
.btn-dark.sm, .btn-ox.sm { font-size: 14px; padding: 8px 14px; }
.btn-dark:disabled { opacity: .55; cursor: default; }

/* Listenzeilen direkt auf dem Papier - keine Karte um jede Zeile. */
.rows { }
.row-item {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
    padding: 13px 8px; margin: 0 -8px;
    border-bottom: 1px solid var(--rule2);
    cursor: pointer; border-radius: var(--radius-xs);
}
.row-item:hover { background: rgba(50,39,30,.035); }
.row-item:last-of-type { border-bottom: 0; }
.row-main { min-width: 0; }
.row-title { font-size: 16px; font-weight: 400; color: var(--t1); }
.row-title .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--t1); margin-block: 0 2px; margin-inline-end: 8px; }
.row-sub { font-size: 14.5px; color: var(--t2); margin-top: 2px; }
.row-sub .ox { color: var(--ox); }
.row-amt { font-size: 16px; color: var(--t2); font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 1px; }
.row-amt.ox { color: var(--ox); }
.row-tag { font-size: 14.5px; color: var(--t3); white-space: nowrap; padding-top: 1px; }
.rows-more { color: var(--t3); font-size: 14.5px; padding: 12px 0 0; }
.rows-more a { color: var(--t2); text-decoration: underline; }
.rows-total {
    display: flex; justify-content: space-between; align-items: baseline;
    border-top: 1px solid var(--rule); margin-top: 14px; padding-top: 14px;
}
.rows-total span { color: var(--t2); font-size: 15px; }
.rows-total b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rows-empty { color: var(--t3); font-size: 14.5px; padding: 12px 0; }

/* Zurueck zur Liste - sitzt ueber dem Seitentitel, leise, aber immer da. */
.back-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--t2); font-size: 14px; margin-bottom: 10px;
}
.back-link:hover { color: var(--t1); }
.back-link i { font-size: 14px; }

.form-section-title { font-size: 15px; font-weight: 500; margin: 6px 0 8px; }
.pos-table thead th { background: transparent; padding-inline: 8px; }
.pos-table tbody td { padding: 7px 8px; border-bottom: 1px solid var(--rule2); }

/* ============================================================
   Popup (Beleg anlegen)
   ============================================================ */
.dlg-backdrop {
    position: fixed; inset: 0; z-index: 80;
    background: rgba(50,39,30,.42);
    animation: dlg-fade .18s ease-out both;
}
.dlg {
    /* Zentriert ueber left/right 0 + margin auto, NICHT ueber transform: ein bleibendes
       transform macht das Popup zum Bezugsrahmen aller position:fixed-Kinder (Bildviewer,
       Editor, Kalender): die lagen dann im Popup statt im Fenster und wurden dort
       abgeschnitten - Firefox zeigte den Viewer deshalb gar nicht (#218). Die Animation
       setzt transform nur, solange sie laeuft. */
    position: fixed; top: 5vh; left: 0; right: 0; margin-inline: auto; z-index: 81;
    width: min(1060px, calc(100vw - 32px)); max-height: 90vh;
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg);
    outline: none;
    transform: none;
    animation: dlg-in .24s cubic-bezier(.2,.8,.2,1) backwards;
}
.dlg.dlg-sm { width: min(680px, calc(100vw - 32px)); }
/* Mittlere Groesse fuer Stammdaten mit Unterseiten (#212): Leiste links + Felder. */
.dlg.dlg-md { width: min(880px, calc(100vw - 32px)); }
.dlg .validation-errors { margin-bottom: 14px; }
.dlg-backdrop.out { animation: dlg-fade .16s ease-in reverse both; }
.dlg.out { animation: dlg-out .16s ease-in both; }
@keyframes dlg-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dlg-in {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to   { opacity: 1; transform: none; }
}
@keyframes dlg-out {
    from { opacity: 1; transform: none; }
    to   { opacity: 0; transform: translateY(8px) scale(.99); }
}
.dlg-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px 14px; border-bottom: 1px solid var(--rule);
}
.dlg-head h2 { font-size: 18px; }
.dlg-x {
    width: 36px; height: 36px; border: 0; border-radius: var(--radius-sm); background: transparent;
    color: var(--t2); font-size: 16px; display: grid; place-items: center; cursor: pointer;
}
.dlg-x:hover { background: var(--t1-soft); color: var(--t1); }
.dlg-body { overflow: auto; padding: 20px 24px 8px; }
.dlg-foot {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 14px 24px 18px; border-top: 1px solid var(--rule);
}

/* ============================================================
   Uebersicht ("Heute")
   ============================================================ */
.heute-line { color: var(--t3); font-size: 15px; margin-bottom: 22px; }

/* Hero: Gruss + Anspruch links, die Wellen-Grafik rechts, blutet ueber den
   Seitenrand von .content hinaus. Die Grafik ist absolut positioniert statt
   ein Flex-Kind - so bestimmt allein der Text die Hoehe von .hero (der Hero
   wird dadurch so klein wie der Text braucht), und die Grafik kann frei
   darueber schweben, unabhaengig davon wo der Text sitzt. */
.hero {
    position: relative;
    display: flex; align-items: flex-start; gap: 28px;
    margin-bottom: 6px;
    /* Die Karten beginnen erst unter der Grafik, nicht darueber. Weil die
       Grafik absolut sitzt, muss .hero ihre Unterkante selbst nachbilden:
       10px (top) + sichtbarer Teil unterhalb des Gipfels = 53% der
       Bildhoehe (bei 40% sitzt der Gipfel, ab ~93% ist das PNG leer).
       Bildhoehe = 76% Breite * 764/2058, gedeckelt ueber max-width 1400px.
       cqw bezieht sich auf .zentrale (container-type unten). */
    min-height: calc(10px + min(14.95cqw, 275px));
}
.hero-text { flex-shrink: 1; min-width: 220px; max-width: 480px; }
.hero-eyebrow { color: var(--t2); font-size: 14px; margin-bottom: 4px; }
.hero-title { font-size: 25px; font-weight: 600; line-height: 1.3; color: var(--t1); margin: 0; }
.hero-image {
    /* Absolut relativ zu .hero: nimmt an dessen Groessenberechnung nicht mehr
       teil (der Hero-Block ist also nur so hoch wie der Text), "oben" ist
       hier frei einstellbar (auch negativ) statt an die Flex-Zeile gebunden.
       Breite 76% von .hero, Hoehe aus aspect-ratio. Der hoechste Gipfel
       liegt bei ~40% der Bildhoehe - translateY(-40%) zieht ihn unabhaengig
       von der Bildgroesse auf Hoehe der Grusszeile (.hero-eyebrow). */
    position: absolute; top: 10px; inset-inline-end: -40px; z-index: 0;
    transform: translateY(-40%);
    width: 76%; min-width: 260px; max-width: 1400px;
    aspect-ratio: 2058 / 764; height: auto;
    object-fit: contain; object-position: right top;
    pointer-events: none; user-select: none;
}
@media (max-width: 900px) {
    .hero { min-height: 0; }
    .hero-image { display: none; }
    .hero-text { flex-shrink: 1; max-width: none; }
}

/* Schnellzugriff direkt unter dem Titel, im Hero-Text selbst - kein eigener
   Block mehr danach, damit die Karten darunter naeher heranruecken. */
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.btn-hero {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 11px 16px; border-radius: var(--radius-sm);
    font: 500 13.5px var(--font); line-height: 1.2; cursor: pointer; white-space: nowrap;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn-hero i { font-size: 13px; }
.btn-hero-primary { background: var(--t1); color: var(--paper); border: 1px solid var(--t1); }
.btn-hero-primary:hover { background: var(--t1-hover); border-color: var(--t1-hover); }
.btn-hero-secondary { background: var(--white); color: var(--t1); border: 1px solid var(--rule); }
.btn-hero-secondary:hover { border-color: var(--t3); background: var(--t1-soft); }

/* Karten-Grundform - noch von Catch Up (.col-head) und dem Projekt-Ueberblick
   (.dash-card) benutzt. */
.dash-card {
    background: #FFFFFF; border: 0; border-radius: var(--radius-lg);
    padding: 18px 20px 20px; display: flex; flex-direction: column; min-height: 0;
}
.col-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 12px;
}
.col-head h2 { font-size: 16px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.col-head h2 > .bi { color: var(--t1); font-size: 16px; line-height: 1; }
.col-head span { color: var(--t3); font-size: 14px; }

/* Die Zentrale scrollt nie als Ganzes - Liste und Chat scrollen fuer sich,
   die Scrollleiste zeigt sich erst beim Hover. ".content-zentrale" setzt
   MainLayout.razor beim Rendern auf der Startseite (#332, vorher per JS) - ein
   ":has(.zentrale)"-Selektor matcht zwar laut Element.matches(), wird aber
   nicht aus der Stylesheet-Kaskade angewendet. */
.content.content-zentrale {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* Mehr Kopfabstand als die uebrigen Seiten - der Hero bekommt Luft nach
       oben, die Grafik haengt zusaetzlich frei darueber (.hero-image). */
    padding-top: 48px;
    padding-bottom: 20px;
}
.zentrale { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; container-type: inline-size; }
.zentrale .heute-line, .zentrale .hero { flex: 0 0 auto; }
.zentrale-scroll {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
    scrollbar-gutter: stable;
}
.zentrale-scroll::-webkit-scrollbar-thumb { background: transparent; }
.zentrale-scroll:hover::-webkit-scrollbar-thumb,
.zentrale-scroll:focus-within::-webkit-scrollbar-thumb { background: var(--rule); }

/* ============================================================
   Zentrale (#214) - die eine Seite, die Kunst sein darf.
   Bewusste Ausnahme von DESIGN.md (siehe dort): unter dem hellen Hero
   liegen vier Tafeln in Nacht-Petrol, wie die Bergkette im Hero-Bild
   bei Daemmerung. Farbe traegt hier Bedeutung: jedes Projekt hat seinen
   Akzent (Balken oben = Icon unten), Orange-Glut heisst Auslastung, Gruen
   heisst Geld. Bewegung nur beim Laden und unter dem Finger, und nie bei
   "prefers-reduced-motion".
   ============================================================ */
@font-face {
    font-family: 'Geist Mono';
    src: url('../lib/geist/GeistMono-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

.zx {
    --zx-text: #EAF4F2;
    --zx-dim: rgba(234, 244, 242, .64);
    --zx-faint: rgba(234, 244, 242, .38);
    --zx-line: rgba(255, 255, 255, .08);
    --zx-glass: rgba(255, 255, 255, .055);
    --zx-glass-hi: rgba(255, 255, 255, .1);
    --zx-ink: #0A2225;          /* Grund der Tafeln, auch Ring um die Avatare */
    --zx-glut: #FF7A2F;
    --zx-gold: #FFB547;
    --zx-green: #3BE39A;
    --zx-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
}

/* Projekt-Akzente: Glut, Tuerkis, Koralle, Kobalt, Flieder, Limette. */
.zx-accent-0 { --a1: #FF8A3D; --a2: #FFC15E; }
.zx-accent-1 { --a1: #22D3BE; --a2: #8BF0D8; }
.zx-accent-2 { --a1: #FF6B6B; --a2: #FFA88E; }
.zx-accent-3 { --a1: #6F93FF; --a2: #B4C6FF; }
.zx-accent-4 { --a1: #B67CFA; --a2: #E6B9FF; }
.zx-accent-5 { --a1: #9BE135; --a2: #D7F89A; }

/* Links Zeitleiste (flach) ueber den laufenden Projekten, rechts der Chat
   ueber die ganze Hoehe. Ohne Chat-Recht nimmt die linke Spalte alles. */
.zx-board {
    position: relative; z-index: 1; flex: 1 1 auto; min-height: 0;
    display: grid; gap: 16px;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
    grid-template-rows: clamp(132px, 16vh, 168px) minmax(0, 1fr);
}
.zx-board.no-chat { grid-template-columns: minmax(0, 1fr); }
.zx-week { grid-column: 1; grid-row: 1; }
.zx-running { grid-column: 1; grid-row: 2; }
.zx-chat { grid-column: 2; grid-row: 1 / span 2; }
/* Hero auf der Zentrale flacher, die Grafik ruckt hoeher - mehr Platz fuer die Tafeln. */

/* Der Hero reicht bis an die Oberkante und schneidet das Bild unten ab - so darf
   die Grafik gross sein, die Spitze bleibt ganz, der Fuss verschwindet an der Kante. */
.zx .hero {
    overflow: hidden;
    margin-top: calc(-1 * var(--zt, 48px)); padding-top: var(--zt, 48px);
    margin-inline-end: -40px; padding-inline-end: 40px;
    min-height: calc(var(--zt, 48px) + min(10.5cqw, 196px));
}
.zx .hero-image { top: calc(var(--zt, 48px) + 10px); width: 96%; max-width: 1800px; inset-inline-end: 0; transform: translateY(-46%); }

.zx-panel {
    position: relative; isolation: isolate;
    min-width: 0; min-height: 0; display: flex; flex-direction: column;
    padding: 16px 18px; border-radius: 22px; overflow: hidden;
    color: var(--zx-text);
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(34, 211, 190, .16), transparent 55%),
        radial-gradient(90% 120% at 100% 110%, rgba(255, 122, 47, .14), transparent 60%),
        linear-gradient(158deg, #154A50 0%, #0E3236 52%, var(--zx-ink) 100%);
    border: 1px solid rgba(255, 255, 255, .06);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .07),
        0 24px 48px -26px rgba(6, 28, 31, .75);
    animation: zx-rise .6s cubic-bezier(.2, .8, .2, 1) backwards; /* nicht "both": ein stehenbleibendes transform macht die Tafel zum Bezugsrahmen fuer Popups darin (#218) */
}
.zx-chat { animation-delay: .06s; }
.zx-running { animation-delay: .12s; }
/* Koernung - nimmt den Verlaeufen das Plastik. */
.zx-panel::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes zx-rise { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }

.zx-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-height: 30px; }
.zx-head h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .01em; color: #FFFFFF; white-space: nowrap; }
.zx-kw { font: 500 12px var(--zx-mono); color: var(--zx-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: capitalize; }
.zx-count {
    font: 600 11.5px var(--zx-mono); color: var(--zx-ink); background: linear-gradient(135deg, var(--zx-glut), var(--zx-gold));
    padding: 2px 8px; border-radius: 999px; box-shadow: 0 0 14px rgba(255, 122, 47, .45);
}
.zx-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.zx-icon, .zx-chip {
    height: 30px; display: inline-grid; place-items: center; flex-shrink: 0;
    border: 1px solid var(--zx-line); background: var(--zx-glass); color: var(--zx-text);
    border-radius: 10px; cursor: pointer; transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.zx-icon { width: 30px; font-size: 13px; }
.zx-chip { padding: 0 11px; font: 500 12.5px var(--font); }
.zx-icon:hover, .zx-chip:hover { background: var(--zx-glass-hi); border-color: rgba(255, 255, 255, .16); }
.zx-icon:active, .zx-chip:active { transform: scale(.94); }
.zx-empty { color: var(--zx-faint); font-size: 13.5px; padding: 18px 4px; text-align: center; }
.zx-dim { color: var(--zx-faint); }

/* ---------- Projekte der Woche ---------- */
.zx-week-body { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.zx-week-days, .zx-week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.zx-week-days { flex: none; padding-bottom: 8px; border-bottom: 1px solid var(--zx-line); margin-bottom: 8px; }
.zx-day { display: flex; align-items: baseline; justify-content: center; gap: 6px; color: var(--zx-dim); }
.zx-day span { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.zx-day b { font: 600 13px var(--zx-mono); color: var(--zx-text); }
.zx-day.weekend { opacity: .55; }
.zx-day.today b {
    color: var(--zx-ink); background: linear-gradient(135deg, var(--zx-glut), var(--zx-gold));
    padding: 0 7px; border-radius: 8px; box-shadow: 0 0 18px rgba(255, 122, 47, .65);
}
/* Heute als leuchtende Saeule hinter Kopf und Balken. */
.zx-today-col {
    position: absolute; top: -4px; bottom: -6px; z-index: 0; pointer-events: none;
    inset-inline-start: calc(var(--d) * 100% / 7); width: calc(100% / 7);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 122, 47, .16), rgba(255, 122, 47, .03) 70%, transparent);
    box-shadow: inset 0 0 0 1px rgba(255, 122, 47, .22);
}
.zx-week-scroll {
    position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
    scrollbar-width: none;
    /* Tageslinien als Hintergrund - laufen bis ganz nach unten, egal wie viele Zeilen. */
    background-image: linear-gradient(to right, var(--zx-line) 1px, transparent 1px);
    background-size: calc(100% / 7) 100%; background-attachment: local;
}
.zx-week-scroll::-webkit-scrollbar { width: 0; height: 0; }
.zx-week-grid { grid-auto-rows: 21px; row-gap: 5px; padding: 1px 0 4px; }
.zx-bar {
    position: relative; margin-inline: 4px; min-width: 0;
    display: flex; align-items: center; gap: 6px; padding: 0 10px;
    border-radius: 9px; text-decoration: none;
    font: 600 11.5px var(--font); color: #08201F;
    background: linear-gradient(90deg, var(--a1), var(--a2));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 20px -8px var(--a1);
    animation: zx-grow .7s cubic-bezier(.2, .8, .2, 1) both;
    animation-delay: calc(.25s + var(--i, 0) * 45ms);
    transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
.zx-bar:hover { color: #08201F; transform: translateY(-1px); filter: brightness(1.08) saturate(1.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 10px 26px -6px var(--a1); }
.zx-bar > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zx-bar > i { font-size: 12px; flex-shrink: 0; }
.zx-bar .zx-bar-done { margin-inline-start: auto; }
/* Laeuft ueber den Wochenrand: Kante weg, sanft ausgeblendet. */
.zx-bar.cont-l { border-start-start-radius: 0; border-end-start-radius: 0; margin-inline-start: 0; -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.35), #000 22px); mask-image: linear-gradient(90deg, rgba(0,0,0,.35), #000 22px); }
.zx-bar.cont-r { border-start-end-radius: 0; border-end-end-radius: 0; margin-inline-end: 0; -webkit-mask-image: linear-gradient(270deg, rgba(0,0,0,.35), #000 22px); mask-image: linear-gradient(270deg, rgba(0,0,0,.35), #000 22px); }
.zx-bar.cont-l.cont-r { -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.35), #000 22px, #000 calc(100% - 22px), rgba(0,0,0,.35)); mask-image: linear-gradient(90deg, rgba(0,0,0,.35), #000 22px, #000 calc(100% - 22px), rgba(0,0,0,.35)); }
.zx-bar.closed { filter: saturate(.35) brightness(.85); opacity: .7; box-shadow: none; }
[dir="rtl"] .zx-bar.cont-l { -webkit-mask-image: linear-gradient(270deg, rgba(0,0,0,.35), #000 22px); mask-image: linear-gradient(270deg, rgba(0,0,0,.35), #000 22px); }
[dir="rtl"] .zx-bar.cont-r { -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.35), #000 22px); mask-image: linear-gradient(90deg, rgba(0,0,0,.35), #000 22px); }
@keyframes zx-grow { from { clip-path: inset(0 100% 0 0 round 9px); opacity: .3; } to { clip-path: inset(0 0 0 0 round 0); opacity: 1; } }
.zx-week-empty { position: absolute; inset: 0; display: grid; place-items: center; }

/* ---------- Laufende Projekte ---------- */
.zx-list { list-style: none; margin: 0 -8px; padding: 0 8px; }
.zx-list li + li .zx-proj::before {
    content: ""; position: absolute; top: 0; inset-inline: 56px 10px; height: 1px; background: var(--zx-line);
}
.zx-list li { animation: zx-slide .5s cubic-bezier(.2, .8, .2, 1) both; }
.zx-list li:nth-child(1) { animation-delay: .25s; } .zx-list li:nth-child(2) { animation-delay: .3s; }
.zx-list li:nth-child(3) { animation-delay: .35s; } .zx-list li:nth-child(4) { animation-delay: .4s; }
.zx-list li:nth-child(5) { animation-delay: .45s; } .zx-list li:nth-child(n+6) { animation-delay: .5s; }
@keyframes zx-slide { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.zx-proj {
    position: relative; display: grid; align-items: center; gap: 14px;
    grid-template-columns: 42px minmax(150px, 1.5fr) minmax(110px, 1fr) minmax(110px, 1fr) 84px minmax(92px, auto);
    padding: 8px 10px; border-radius: 14px; color: var(--zx-text); text-decoration: none;
    transition: background .15s ease;
}
.zx-proj:hover { background: rgba(255, 255, 255, .05); color: var(--zx-text); }
.zx-proj-icon {
    width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
    font-size: 18px; color: #08201F;
    background: linear-gradient(140deg, var(--a1), var(--a2));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 8px 22px -8px var(--a1);
    transition: transform .2s cubic-bezier(.2, .8, .2, 1);
}
.zx-proj:hover .zx-proj-icon { transform: rotate(-6deg) scale(1.06); }
.zx-proj-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.zx-proj-name { font-size: 14.5px; font-weight: 600; color: #FFFFFF; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zx-proj-sub { display: flex; align-items: center; gap: 8px; min-width: 0; }
.zx-proj-customer { font-size: 12.5px; color: var(--zx-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Status-Pillen auf Nacht: dieselben Toene, nur leuchtend statt pastell. */

.zx-proj-progress { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.zx-proj-progress small, .zx-proj-next small { font-size: 11.5px; color: var(--zx-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zx-bar-track { position: relative; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.zx-bar-fill {
    position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: inherit;
    background: linear-gradient(90deg, #22D3BE, var(--zx-green));
    box-shadow: 0 0 12px rgba(59, 227, 154, .55);
    animation: zx-fill 1.1s cubic-bezier(.2, .8, .2, 1) both; animation-delay: .4s;
    overflow: hidden;
}
/* Ein Lichtstreif wandert ueber den Balken - langsam, nur alle paar Sekunden. */
.zx-bar-fill::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
    transform: translateX(-100%); animation: zx-sheen 3.6s ease-in-out 1.6s infinite;
}
@keyframes zx-fill { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes zx-sheen { 0% { transform: translateX(-100%); } 45%, 100% { transform: translateX(100%); } }

.zx-proj-next { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.zx-proj-next b { font: 600 12.5px var(--zx-mono); color: var(--zx-text); text-transform: capitalize; }

.zx-people { display: flex; align-items: center; justify-content: flex-start; }
.zx-people .avatar { border-color: var(--zx-ink); border-width: 2px; margin-inline-start: -8px; }
.zx-people .avatar:first-child { margin-inline-start: 0; }
.zx-people .zx-more { background: rgba(255, 255, 255, .12); color: var(--zx-text); font-size: 9.5px; }

.zx-value {
    justify-self: end; text-align: end; white-space: nowrap;
    font: 650 15px var(--zx-mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums;
    color: var(--zx-green); text-shadow: 0 0 18px rgba(59, 227, 154, .45);
}
.zx-value small { display: block; font: 500 10.5px var(--font); letter-spacing: .04em; text-transform: uppercase; color: rgba(59, 227, 154, .65); text-shadow: none; }
.zx-value.offer { color: rgba(59, 227, 154, .72); text-shadow: none; }
.zx-value.none { color: var(--zx-faint); text-shadow: none; }

.zx-sum {
    flex: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
    margin: 10px -18px -16px; padding: 14px 28px 16px;
    border-top: 1px solid var(--zx-line);
    background: linear-gradient(180deg, transparent, rgba(59, 227, 154, .07));
}
.zx-sum-label { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--zx-dim); }
.zx-sum-label small { display: block; margin-top: 3px; letter-spacing: .02em; text-transform: none; font-size: 12px; color: rgba(59, 227, 154, .7); }
.zx-sum-value {
    font: 700 30px/1 var(--zx-mono); letter-spacing: -.04em; font-variant-numeric: tabular-nums;
    background: linear-gradient(100deg, #7BFFC4 0%, var(--zx-green) 40%, #22D3BE 70%, #7BFFC4 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 0 16px rgba(59, 227, 154, .45));
    animation: zx-shine 6s linear infinite;
}
@keyframes zx-shine { to { background-position: -220% 0; } }

@media (prefers-reduced-motion: reduce) {
    .zx-panel, .zx-bar, .zx-cell, .zx-list li, .zx-bar-fill, .zx-bar-fill::after, .zx-sum-value { animation: none !important; }
}

/* Niedrige Bildschirme (Laptop 768px): weniger Luft ueber dem Hero und eine
   flachere obere Reihe, damit die Projektliste mehr als zwei Zeilen zeigt. */
@media (max-height: 860px) and (min-width: 901px) {
    .content.content-zentrale { padding-top: 26px; padding-bottom: 14px; --zt: 26px; }
    .zentrale .hero-actions { margin-top: 12px; }
    .zx-board { gap: 12px; grid-template-rows: 128px minmax(0, 1fr); }
    .zx-panel { padding: 12px 16px; border-radius: 18px; }
    .zx-head { margin-bottom: 8px; }
    .zx-week-days { padding-bottom: 6px; margin-bottom: 6px; }
    .zx-week-grid { grid-auto-rows: 20px; row-gap: 5px; }
    .zx-proj { padding-block: 6px; }
    .zx-proj-icon { width: 38px; height: 38px; border-radius: 12px; font-size: 16px; }
    .zx-sum { margin: 8px -16px -12px; padding: 10px 26px 12px; }
    .zx-sum-value { font-size: 26px; }
}

/* Mittelbreit: Projektliste ohne Termin-Spalte, damit Wert und Leute bleiben. */
@media (max-width: 1400px) {
    .zx-proj { grid-template-columns: 42px minmax(140px, 1.5fr) minmax(100px, 1fr) 76px minmax(84px, auto); }
    .zx-proj-next { display: none; }
}
@media (max-width: 1100px) {
    .zx-board { display: flex; flex-direction: column; }
    .zx-week { min-height: 150px; }
    .zx-chat { height: 560px; }
}
@media (max-width: 900px) {
    /* Am Handy scrollt .content wie jede andere Seite - kein Fest-Layout. */
    .content.content-zentrale { height: 100%; overflow-y: auto; display: block; }
    .zentrale { display: block; }
    .zentrale-scroll { overflow: visible; }
    .zx-board { display: flex; }
    .zx-week { overflow-x: auto; }
    .zx-week-body { min-width: 560px; }
    .zx-proj { grid-template-columns: 42px minmax(0, 1fr) auto; row-gap: 8px; }
    .zx-proj-progress { grid-column: 2 / -1; grid-row: 2; }
    .zx-people { display: none; }
}

/* Feed der Baustellen (mittlere Spalte) */
.feed-card {
    background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
    margin-bottom: 20px; overflow: hidden;
    cursor: pointer; transition: border-color .12s ease;
}
.feed-card:hover { border-color: var(--t3); }
/* ============================================================
   Catch Up als Messenger (CatchUpChat.razor, #97)
   ------------------------------------------------------------
   Zeilen wie in Slack/Teams statt Karten: Initialen links, darueber
   Name + [Auftrag] + [Todo] + Uhrzeit. Akzente nur Petrol und Orange -
   Auftrag-Tags petrol, Todo-Tags orange; Initialen-Kreise wie ueberall
   ueber Avatar.razor (#205).
   ============================================================ */
.cu-head { align-items: center; gap: 12px; margin-bottom: 8px; }
.cu-thread-wrap { position: relative; flex: 0 1 300px; min-width: 0; }
.cu-thread {
    width: 100%; height: 32px; display: flex; align-items: center; gap: 8px;
    padding: 0 10px 0 12px; border: 1px solid var(--rule); border-radius: var(--radius-sm);
    background: #FFFFFF; color: var(--t1); font: 500 13.5px var(--font); cursor: pointer; text-align: start;
}
.cu-thread:hover, .cu-thread:focus-visible { border-color: var(--t3); outline: none; }
.cu-thread > .bi-chevron-down { margin-inline-start: auto; font-size: 11px; color: var(--t2); }
/* .cu-head: sonst greift ".col-head span" (grau, 14px) auf die Eintraege durch. */
.cu-head .cu-thread-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--t1); font-size: inherit; }
.cu-head .cu-thread-num { color: var(--t3); font-size: 12px; font-weight: 400; white-space: nowrap; }
.cu-head .cu-time { font-size: 12px; }
.cu-thread-list {
    position: absolute; top: 36px; inset-inline-start: 0; z-index: 21;
    width: max(100%, 300px); max-height: 320px; overflow-y: auto;
    background: #FFFFFF; border: 1px solid var(--rule); border-radius: var(--radius); padding: 6px;
    box-shadow: 0 8px 24px rgba(18, 62, 67, .12);
}
.cu-thread-list button {
    width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px;
    border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--t1);
    font: 14px var(--font); text-align: start; cursor: pointer;
}
.cu-thread-list button:hover { background: var(--t1-soft); }
.cu-thread-list button.on { background: var(--t1-soft); font-weight: 600; }
.cu-thread-list .cu-dot { margin-inline-start: auto; }
/* Neue Nachrichten - Orange, die zweite Akzentfarbe neben Petrol. */
.cu-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
    background: var(--accent-orange); box-shadow: 0 0 0 3px var(--accent-orange-soft);
}

/* Schritte am Auftrag - leise wie "Nachricht gelöscht", zentriert zwischen den Nachrichten. */
.cu-event {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin: 8px 0; padding: 0 12px; text-align: center;
    color: var(--t3); font-size: 13px; font-style: italic;
}
.cu-event > .bi { font-style: normal; color: var(--t2); }
.cu-event .cu-time { font-style: normal; }

.cu-pending-thumb { padding: 0 !important; border: 0; background: none; cursor: pointer; border-radius: var(--radius-sm); }
.cu-pending-tag { font-style: normal; color: var(--accent-orange); font-size: 12px; margin-inline-start: 6px; }
.cu-editor-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cu-tool {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
    border: 1px solid var(--rule); border-radius: var(--radius-sm); background: #FFFFFF;
    color: var(--t1); font: 13.5px var(--font); cursor: pointer;
}
.cu-tool:hover { border-color: var(--t3); }
.cu-tool.on { background: var(--t1); border-color: var(--t1); color: var(--paper); }
.cu-editor-canvas { display: flex; justify-content: center; background: #FFFFFF; border: 1px solid var(--rule2); border-radius: var(--radius); padding: 8px; }
.cu-editor-canvas canvas { max-width: 100%; max-height: 58vh; touch-action: none; cursor: crosshair; border-radius: var(--radius-xs); background: #FFFFFF; }
.cu-editor-caption {
    width: 100%; margin-top: 12px; padding: 8px 12px;
    border: 1px solid var(--rule); border-radius: var(--radius-sm); background: #FFFFFF;
    color: var(--t1); font: 14px var(--font); outline: none;
}
.cu-editor-caption:focus { border-color: var(--t3); }
.cu-editor-canvas { position: relative; }
.cu-sending-overlay {
    position: absolute; inset: 0; z-index: 2; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center; gap: 10px;
    background: rgba(255, 255, 255, .78); color: var(--t1); font-size: 14.5px; font-weight: 500;
}
.cu-spinner {
    width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: inline-block;
    border: 3px solid var(--accent-orange-soft); border-top-color: var(--accent-orange);
    animation: cu-spin .8s linear infinite; vertical-align: -4px;
}
.cu-spinner.small { width: 14px; height: 14px; border-width: 2px; vertical-align: -2px; }
.cu-spinner.light { border-color: rgba(255, 255, 255, .4); border-top-color: #FFFFFF; }
.btn-primary .cu-spinner { border-color: rgba(255, 255, 255, .35); border-top-color: #FFFFFF; margin-inline-end: 4px; }
.cu-pending-tag.loading { color: var(--t2); }
@keyframes cu-spin { to { transform: rotate(360deg); } }
.cu-photo-open { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--radius); }
.cu-photo-open:focus-visible { outline: 2px solid var(--t1); outline-offset: 2px; }
.cu-head-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.cu-search {
    width: 200px; height: 32px; padding: 0 10px;
    border: 1px solid var(--rule); border-radius: var(--radius-sm); background: #FFFFFF;
    color: var(--t1); font: 14px var(--font); outline: none;
}
.cu-search:focus { border-color: var(--t3); }
.cu-search::-webkit-search-cancel-button { display: none; } /* eigenes X daneben */
.cu-icon-btn {
    width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm); flex-shrink: 0;
    display: grid; place-items: center; cursor: pointer;
    background: transparent; color: var(--t2); font-size: 15px;
    transition: background .12s ease, color .12s ease;
}
.cu-icon-btn:hover, .cu-icon-btn.on { background: var(--t1-soft); color: var(--t1); }
.cu-menu-wrap { position: relative; }
.cu-menu-backdrop { position: fixed; inset: 0; z-index: 20; }
.cu-menu {
    position: absolute; top: 36px; inset-inline-end: 0; z-index: 21; min-width: 200px;
    background: #FFFFFF; border: 1px solid var(--rule); border-radius: var(--radius); padding: 6px;
    box-shadow: 0 8px 24px rgba(18, 62, 67, .12);
}
.cu-menu button {
    width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px;
    border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--t1);
    font: 14px var(--font); text-align: start; cursor: pointer;
}
.cu-menu button:hover:not(:disabled) { background: var(--t1-soft); }
.cu-menu button:disabled { color: var(--t3); cursor: default; }
.cu-menu-hint { padding: 2px 10px 6px; font-size: 12.5px; color: var(--t3); }

.cu-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.cu-messages { padding-block: 4px 8px; margin-inline: -8px; padding-inline: 8px; }

.cu-day { display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; color: var(--t3); font-size: 12.5px; }
.cu-day::before, .cu-day::after { content: ""; flex: 1; height: 1px; background: var(--rule2); }

.cu-msg {
    position: relative; display: flex; gap: 12px;
    padding: 6px 8px; margin-inline: -8px; border-radius: var(--radius-sm);
    transition: background .12s ease;
}
.cu-msg + .cu-msg:not(.cont) { margin-top: 6px; }
.cu-msg.cont { padding-top: 1px; }
.cu-msg:hover { background: #F7F6F2; }
.cu-msg.cu-flash { background: var(--accent-orange-soft); }
.cu-avatar-gap { width: 36px; flex-shrink: 0; }
.cu-main { flex: 1; min-width: 0; }
.cu-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; line-height: 1.3; margin-bottom: 2px; }
.cu-name { font-weight: 600; font-size: 14.5px; }
.cu-tag {
    display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    padding: 1px 7px; border-radius: var(--radius-xs); border: 0;
    font: 500 11.5px var(--font); line-height: 1.5; vertical-align: 1px;
}
.cu-tag::before { content: "["; opacity: .55; }
.cu-tag::after { content: "]"; opacity: .55; }
.cu-tag-auftrag { background: var(--t1-soft); color: var(--t1); cursor: pointer; }
.cu-tag-auftrag:hover { background: #CFE0E1; }
.cu-tag-todo { background: var(--accent-orange-soft); color: #B6420C; }
.cu-time { color: var(--t3); font-size: 12px; }
.cu-text { font-size: 14.5px; color: var(--t1); white-space: pre-wrap; overflow-wrap: anywhere; }
.cu-text .translated-note { white-space: normal; }
.cu-edited { color: var(--t3); font-size: 12px; margin-inline-start: 4px; }
.cu-deleted { color: var(--t3); font-style: italic; font-size: 14px; }

.cu-quote {
    display: block; max-width: 520px; margin: 2px 0 4px; padding: 4px 10px;
    border: 0; border-inline-start: 3px solid var(--accent-orange); border-radius: var(--radius-xs);
    background: #F4F3EF; text-align: start; cursor: pointer; font: 13px var(--font);
}
.cu-quote:hover { background: #ECEBE6; }
.cu-quote-name { display: block; font-weight: 600; color: var(--t1); }
.cu-quote-text { display: block; color: var(--t2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cu-quote-text.muted { color: var(--t3); font-style: italic; }

.cu-photo { margin: 4px 0 2px; max-width: 340px; }
.cu-photo img, .cu-photo canvas {
    display: block; max-width: 100%; max-height: 260px; width: auto; height: auto;
    border-radius: var(--radius); border: 1px solid var(--rule2); background: #FFFFFF;
}
.cu-photo canvas:not(.ready) { width: 240px; height: 160px; }
.cu-photo figcaption { margin-top: 4px; font-size: 14px; color: var(--t1); }

/* Hover-Leiste rechts oben an der Nachricht - erst beim Hover sichtbar,
   wie die Scrollleisten und Aktionsbuttons sonst im System. */
.cu-actions {
    position: absolute; top: -12px; inset-inline-end: 8px; z-index: 2;
    display: flex; gap: 2px; padding: 3px;
    background: #FFFFFF; border: 1px solid var(--rule); border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(18, 62, 67, .08);
    opacity: 0; pointer-events: none; transition: opacity .1s ease;
}
.cu-msg:hover .cu-actions, .cu-actions:focus-within { opacity: 1; pointer-events: auto; }
.cu-actions button {
    width: 28px; height: 28px; border: 0; border-radius: var(--radius-xs);
    display: grid; place-items: center; cursor: pointer;
    background: transparent; color: var(--t2); font-size: 14px;
}
.cu-actions button:hover { background: var(--t1-soft); color: var(--t1); }
.cu-actions button.danger:hover { background: var(--ox-soft); color: var(--ox); }

.cu-error {
    margin: 6px 0 0; padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer;
    background: var(--ox-soft); color: var(--ox); font-size: 13.5px;
}

.cu-composer { flex-shrink: 0; margin-top: 8px; border: 1px solid var(--rule); border-radius: var(--radius); background: #FFFFFF; }
.cu-composer:focus-within { border-color: var(--t3); }
.cu-compose-bar, .cu-pending {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px;
    border-bottom: 1px solid var(--rule2); font-size: 13px; color: var(--t2);
}
.cu-compose-bar > i { color: var(--accent-orange); }
.cu-compose-bar.edit > i { color: var(--t1); }
.cu-compose-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cu-compose-bar b { color: var(--t1); font-weight: 600; margin-inline-end: 4px; }
.cu-compose-bar button, .cu-pending button {
    border: 0; background: transparent; color: var(--t3); cursor: pointer; padding: 2px 4px; border-radius: var(--radius-xs);
}
.cu-compose-bar button:hover, .cu-pending button:hover { color: var(--t1); background: var(--t1-soft); }
.cu-pending img { width: 48px; height: 48px; object-fit: cover; border-radius: var(--radius-sm); }
.cu-pending span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cu-input-row { display: flex; align-items: flex-end; gap: 6px; padding: 6px; }
.cu-attach { position: relative; overflow: hidden; margin: 0; }
.cu-attach input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cu-input-row textarea {
    flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent;
    padding: 6px 4px; max-height: 140px; color: var(--t1); font: 14.5px/1.45 var(--font);
}
.cu-input-row textarea::placeholder { color: var(--t3); }
.cu-send {
    width: 34px; height: 34px; border: 0; border-radius: var(--radius-sm); flex-shrink: 0;
    display: grid; place-items: center; cursor: pointer;
    background: var(--accent-orange); color: #FFFFFF; font-size: 14px;
    transition: background .12s ease, opacity .12s ease;
}
.cu-send:hover:not(:disabled) { background: #DD4A08; }
.cu-send:disabled { opacity: .35; cursor: default; }
.feed-body { padding: 16px 20px 18px; }
.feed-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 16px; }
.feed-head b { font-weight: 600; }
.feed-head .where { color: var(--t2); }
.feed-head .when { color: var(--t3); font-size: 14px; white-space: nowrap; }
.feed-note { font-size: 17px; line-height: 1.4; margin: 8px 0 0; }
.feed-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 14px; }
.feed-photo { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-xs); overflow: hidden; background: var(--rule2); }
.feed-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feed-photo span { position: absolute; inset-inline-start: 10px; bottom: 8px; color: #fff; font-size: 13px; text-shadow: 0 1px 2px rgba(0,0,0,.55); }
.feed-foot { margin-top: 12px; color: var(--t3); font-size: 14px; }
.feed-foot b { color: var(--t1); font-size: 19px; font-weight: 500; margin-inline-end: 6px; }

/* Compact Todo mini-list on BelegDetail - narrower column than the full-page rows. */
.row-item.todo-mini { padding: 8px 4px; margin: 0; font-size: 14px; }

/* ============================================================
   Todo-Detail - kompakt, kein Scrollen fuer die ueblichen Faelle.
   ============================================================ */
.todo-detail-head { margin-bottom: 10px; }
.todo-title-input {
    font: 600 20px var(--font); color: var(--t1); border: 1px solid transparent;
    background: transparent; padding: 3px 5px; border-radius: var(--radius-sm); width: 100%;
}
.todo-title-input:hover, .todo-title-input:focus { border-color: var(--rule); background: var(--surface); outline: none; }
.todo-detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--t2); font-size: 14px; margin-top: 4px; }
.todo-meta-input {
    font: 400 13.5px var(--font); color: var(--t2); border: 1px solid var(--rule);
    background: var(--surface); border-radius: var(--radius-sm); padding: 3px 6px; width: auto;
}
.todo-desc-input {
    font: 400 14px var(--font); color: var(--t2); border: 1px dashed transparent;
    background: transparent; width: 100%; resize: none; padding: 3px 5px; margin-top: 4px; border-radius: var(--radius-sm);
    display: block; overflow: hidden;
}
.todo-desc-input:hover, .todo-desc-input:focus { border-color: var(--rule); background: var(--surface); outline: none; }
.todo-desc-input:placeholder-shown:not(:focus) { min-height: 0; }

.todo-timer-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--rule2); border-bottom: 1px solid var(--rule2); margin: 8px 0; }
.todo-timer-elapsed { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 15px; }
.todo-time-history { font-size: 13.5px; color: var(--t2); padding: 4px 0 8px; display: flex; flex-direction: column; gap: 2px; }

/* Fotos - kleine Thumbnails, damit sie nicht viel Platz brauchen. */
.todo-photos-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.photo-thumb-sm { width: 52px; height: 52px; cursor: pointer; flex-shrink: 0; }
.photo-thumb-sm img { width: 52px; height: 52px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--rule); display: block; }
.photo-thumb-sm:hover img { border-color: var(--t3); }
.photo-add-btn {
    width: 52px; height: 52px; border-radius: var(--radius-sm); border: 1px dashed var(--rule);
    display: grid; place-items: center; color: var(--t3); cursor: pointer; flex-shrink: 0; position: relative;
}
.photo-add-btn:hover { border-color: var(--t3); color: var(--t1); }
.photo-add-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Notizen - messenger-artig statt Tabellenzeilen. */
.todo-chat { border: 1px solid var(--rule); border-radius: var(--radius); margin-bottom: 10px; }
.todo-chat-scroll { max-height: 180px; overflow-y: auto; padding: 8px 10px; }
.chat-bubble { background: var(--rule2); border-radius: var(--radius); padding: 6px 10px; margin-bottom: 6px; max-width: 85%; }
.chat-bubble:last-child { margin-bottom: 0; }
.chat-text { font-size: 14.5px; white-space: pre-wrap; }
.chat-meta { font-size: 12px; color: var(--t3); margin-top: 2px; }
.todo-chat-input { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--rule2); }
.todo-chat-input input { flex: 1; }
.feed-top { background: var(--paper); padding: 16px 20px; border-bottom: 1px solid var(--rule); }
.feed-top .feed-note { font-size: 16px; }
.feed-top .sub { color: var(--t2); font-size: 15px; margin-block: 4px 0; margin-inline-start: 26px; }
.feed-top .when { color: var(--t3); font-size: 14px; margin-top: 6px; }
.check {
    display: inline-grid; place-items: center; width: 18px; height: 18px; margin-inline-end: 8px;
    background: var(--t1); color: var(--paper); border-radius: var(--radius-xs); font-size: 12px; vertical-align: -3px;
}
.feed-bottom { padding: 16px 20px 18px; }
.feed-bottom p { margin: 0 0 12px; font-size: 15px; }
.feed-caption { color: var(--t3); font-size: 14px; margin-top: 10px; }

/* ============================================================
   Seitenkopf, Tabellen, Formulare, Badges (uebrige Seiten)
   ============================================================ */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 20px; }
.page-head .subtitle { color: var(--t2); font-size: 14.5px; margin-top: 3px; }
.page-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.btn {
    font-family: var(--font); font-weight: 400; font-size: 14.5px; line-height: 1.2;
    padding: 9px 14px; border-radius: var(--radius-sm); min-height: 38px;
    display: inline-flex; align-items: center; gap: 7px;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
    box-shadow: none !important; transform: none !important;
}
.btn i { font-size: 15px; }
.btn-sm { padding: 6px 10px; font-size: 13.5px; min-height: 32px; }
.btn-primary { background: var(--t1); border-color: var(--t1); color: var(--paper); font-weight: 500; }
.btn-primary:hover, .btn-primary:focus { background: var(--t1-hover); border-color: var(--t1-hover); color: var(--paper); }
/* Auch gesperrt Petrol (#201) - sonst greift Bootstraps Hellblau. */
.btn-primary:disabled, .btn-primary.disabled { background: var(--t1); border-color: var(--t1); color: var(--paper); opacity: .5; }
.btn-outline-secondary, .btn-outline-primary, .btn-outline-danger, .btn-light { color: var(--t1); border: 1px solid var(--rule); background: var(--surface); }
.btn-outline-secondary:hover, .btn-outline-primary:hover, .btn-outline-danger:hover, .btn-light:hover { background: var(--t1-soft); color: var(--t1); border-color: var(--t3); }
.btn-icon { width: 38px; height: 38px; padding: 0; justify-content: center; border: 1px solid var(--rule); background: var(--surface); color: var(--t2); border-radius: var(--radius-sm); }
.btn-icon:hover { color: var(--t1); border-color: var(--t3); }

/* Primär-Knopf "Nächster Schritt" (#145) - eine Hauptsache je Belegseite, groß
   genug für einen Klick mit Handschuhen (mind. 48px). */
.next-step-btn { min-height: 48px; padding: 12px 22px; font-size: 15px; }

.row-actions { opacity: 0; transition: opacity .12s ease; }
tr:hover .row-actions, tr:focus-within .row-actions,
.rz-data-row:hover .row-actions, .rz-data-row:focus-within .row-actions,
.row-item:hover .row-actions, .row-item:focus-within .row-actions { opacity: 1; }
@media (hover: none) { .row-actions { opacity: 1; } }

.surface, .surface-pad { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; }
.border, .border-top, .border-bottom { border-color: var(--rule) !important; }
.rounded, .rounded-3 { border-radius: var(--radius) !important; }

.data-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--t1); --bs-table-border-color: var(--rule); margin-bottom: 0; color: var(--t1); font-size: 15px; }
.table thead th {
    background: var(--paper); color: var(--t2);
    font-size: 12.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
    border-bottom: 1px solid var(--rule); padding: 10px 16px; white-space: nowrap;
}
/* Sortierbare Spaltenkoepfe (SortHeader.razor, #205): der ganze Kopf ist der
   Knopf, der Pfeil zeigt sich leise erst beim Hover oder wenn sortiert ist. */
.table thead th.th-sortable { padding: 0; }
.th-sort {
    display: inline-flex; align-items: center; gap: 5px; width: 100%;
    padding: 10px 16px; border: 0; background: transparent; cursor: pointer;
    color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: start;
}
.text-end > .th-sort { justify-content: flex-end; }
.th-sort i { font-size: 11px; color: var(--t3); opacity: 0; transition: opacity .12s ease; }
.th-sort:hover { color: var(--t1); }
.th-sort:hover i, .th-sort:focus-visible i, .th-sort.on i { opacity: 1; }
.th-sort.on { color: var(--t1); }
.th-sort.on i { color: var(--accent-orange); }
.table-sm thead th.th-sortable .th-sort { padding: 7px 10px; }

.table tbody td { padding: 11px 16px; border-bottom: 1px solid var(--rule2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr:hover { background: rgba(50,39,30,.035); }
.table-sm tbody td, .table-sm thead th { padding: 7px 10px; }
.margin-positive, .margin-negative { color: var(--t1); font-weight: 600; }
.totals-box .fw-bold { font-weight: 700 !important; }

.form-label { font-size: 14px; font-weight: 400; color: var(--t2); margin-bottom: 5px; }
.form-control, .form-select {
    background: var(--surface); border: 1px solid var(--rule); color: var(--t1);
    border-radius: var(--radius-sm); padding: 9px 12px; font-size: 15px; min-height: 40px;
    font-family: var(--font);
}
.form-control::placeholder { color: var(--t3); }
.form-control:focus, .form-select:focus { background: var(--surface); color: var(--t1); border-color: var(--t1); box-shadow: none; }

/* Bewusste, eng begrenzte Ausnahme von "ox nur fuer Fristueberschreitung"
   (siehe DESIGN.md): ein leeres Pflichtfeld, das gerade das Absenden
   blockiert, braucht dieselbe Dringlichkeit. */
.form-control.is-required-empty { border-color: var(--ox); }
.form-control.is-required-empty:focus { border-color: var(--ox); box-shadow: 0 0 0 3px var(--ox-soft); }

/* Kontakt-Auswahl (RadzenDropDown mit Filter statt langem natives <select>) an
   die Optik der Bootstrap-Formularfelder daneben angleichen. */
.rz-kontakt-select.rz-dropdown {
    width: 100%; min-height: 40px; border-radius: var(--radius-sm); border-color: var(--rule);
    font-size: 15px; font-family: var(--font);
}
.rz-kontakt-select .rz-dropdown-filter-container input { font-family: var(--font); font-size: 14.5px; }
.form-control-sm, .form-select-sm { padding: 5px 9px; font-size: 14px; min-height: 32px; }
.form-check-input:checked { background-color: var(--t1); border-color: var(--t1); }
.form-check-input:focus { box-shadow: none; border-color: var(--t1); }

.validation-message, .validation-summary-errors .validation-message { color: var(--t1); font-weight: 600; font-size: 14px; display: block; margin-top: 4px; }
.validation-errors { list-style: none; padding: 0; margin: 0 0 12px; }

/* Status als Text, nicht als Farbe: alle Bootstrap-Farbvarianten sehen gleich aus.
   Helles Orange statt Creme - Text bleibt in --t1, sonst ist der Kontrast auf
   dem hellen Orange-Ton zu schwach. */
.badge {
    font-family: var(--font); font-weight: 500; font-size: 12.5px; padding: 4px 8px;
    border-radius: var(--radius-xs); border: 1px solid var(--accent-orange-soft);
    background: var(--accent-orange-soft); color: var(--t1);
}
.badge.bg-secondary, .badge.bg-primary, .badge.bg-info, .badge.bg-success, .badge.bg-danger, .badge.bg-warning {
    background: var(--accent-orange-soft) !important; color: var(--t1) !important;
}
.badge-overdue { background: var(--ox-soft) !important; color: var(--ox) !important; border-color: var(--ox-soft); font-weight: 600; }

.alert { border-radius: var(--radius); border: 1px solid var(--rule); border-inline-start: 3px solid var(--t1); font-size: 15px; background: var(--surface); color: var(--t1); }
.alert-success, .alert-danger, .alert-info, .alert-light { background: var(--surface); color: var(--t1); border-color: var(--rule); border-inline-start-color: var(--t1); }

.dropdown-menu { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: none; padding: 6px; }
.dropdown-item { color: var(--t1); border-radius: var(--radius-xs); padding: 8px 10px; font-size: 14.5px; }
.dropdown-item:hover { background: var(--t1-soft); color: var(--t1); }

.modal-content { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: none; }
.modal-header, .modal-footer { border-color: var(--rule); }

/* Mail-Dialog: links die echte PDF-Vorschau, rechts das Formular. */
.mail-preview-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: stretch; }
.mail-preview-pane { background: var(--rule2); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; min-height: 520px; }
.mail-preview-pane iframe { width: 100%; height: 100%; min-height: 520px; border: 0; display: block; }
.mail-preview-form { display: flex; flex-direction: column; }
@media (max-width: 900px) {
    .mail-preview-layout { grid-template-columns: 1fr; }
    .mail-preview-pane, .mail-preview-pane iframe { min-height: 320px; }
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 22px; flex-wrap: wrap; }
.tab {
    background: transparent; border: 0; border-bottom: 2px solid transparent;
    color: var(--t2); font-weight: 500; font-size: 15px; font-family: var(--font);
    padding: 10px 14px; margin-bottom: -1px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; min-height: 44px;
}
.tab:hover { color: var(--t1); }
.tab.active { color: var(--t1); border-bottom-color: var(--t1); font-weight: 500; }
.settings-panel { max-width: 720px; }

/* Einstellungen als weisses Fenster (#205): Aufbau wie das Beleg-Popup
   (Kopf, Unterseiten links via .form-layout, Fuss mit Speichern), aber als
   Seite eingebettet statt schwebend. Fuellt die Arbeitsflaeche bis auf 8px
   Rand: die negativen Raender schlucken den Innenabstand von .content
   (32/40/56px, am Handy 20/16/40px). Nur der Bereich rechts scrollt - Kopf
   und Fuss stehen fest, nichts rutscht unter "Speichern". */
.settings-window {
    --sw-gap: 8px;
    margin: calc(var(--sw-gap) - 32px) calc(var(--sw-gap) - 40px) calc(var(--sw-gap) - 56px);
    height: calc(100vh - var(--nav-h) - 2 * var(--sw-gap));
    background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg);
    display: flex; flex-direction: column; overflow: hidden;
}
.settings-window-head {
    flex: none; display: flex; align-items: center; gap: 14px;
    padding: 18px 24px; border-bottom: 1px solid var(--rule);
}
.settings-window-head h1 { font-size: 19px; font-weight: 600; }
.settings-window-icon {
    width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--radius-sm);
    display: grid; place-items: center; font-size: 18px;
    background: var(--accent-orange-soft); color: var(--accent-orange);
}
.settings-window-sub { color: var(--t2); font-size: 14px; margin-top: 1px; }
.form-layout.settings-layout {
    flex: 1 1 auto; min-height: 0; padding-block: 20px 0; padding-inline: 24px 0;
    grid-template-columns: 210px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
    align-items: stretch; gap: 28px;
}
.form-layout.settings-layout .form-steps { align-self: start; }
.form-layout.settings-layout .form-step .num { width: 26px; height: 26px; font-size: 13px; }
.form-layout.settings-layout .form-pane { min-height: 0; overflow-y: auto; padding-block: 0 24px; padding-inline: 0 24px; }
/* Felder nicht ueber die ganze Breite ziehen - lesbar bleibt eine Zeile bis ~860px. */
.form-layout.settings-layout .form-pane > * { max-width: 860px; }
.settings-section-head { margin-bottom: 18px; }
.settings-section-head h2 { font-size: 17px; font-weight: 600; }
.settings-section-head p { color: var(--t2); font-size: 14px; margin: 3px 0 0; }
.settings-window-foot {
    flex: none; display: flex; justify-content: flex-end; align-items: center; gap: 14px;
    padding: 14px 24px; border-top: 1px solid var(--rule); background: var(--surface);
}
@media (max-width: 960px) {
    .settings-window {
        --sw-gap: 6px;
        margin: calc(var(--sw-gap) - 20px) calc(var(--sw-gap) - 16px) calc(var(--sw-gap) - 40px);
    }
}
@media (max-width: 720px) {
    .form-layout.settings-layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); padding-block: 14px 0; padding-inline: 16px 0; gap: 12px; }
    .form-layout.settings-layout .form-steps { margin-inline-end: 16px; }
    .form-layout.settings-layout .form-pane { padding-block: 0 18px; padding-inline: 0 16px; }
    .settings-window-head, .settings-window-foot { padding-inline: 16px; }
}
.settings-saved { color: #1C6B3A; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
/* #262: Meldung neben "Speichern", nicht oben im gescrollten Inhalt - neutral wie .alert-danger (DESIGN.md). */
.settings-save-error { color: var(--t1); font-size: 14px; font-weight: 500; display: inline-flex; align-items: flex-start; gap: 6px; margin-right: auto; max-width: 70ch; }

/* ============================================================
   Todo - wird am Handy mit Handschuhen bedient
   ============================================================ */
.todo-gruppe { margin-bottom: 24px; }
.todo-gruppe-titel {
    display: flex; align-items: center; gap: 8px;
    color: var(--t2); font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--rule);
}
.todo-gruppe-titel.ueberfaellig { color: var(--ox); }
.todo-count { color: var(--t3); font-weight: 500; letter-spacing: 0; }
.todo-gruppe-titel.ueberfaellig .todo-count { color: var(--ox); }
.todo-karte {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 8px; margin: 0 -8px; border-bottom: 1px solid var(--rule2); border-radius: var(--radius-xs);
    transition: background .12s ease;
}
.todo-karte:hover { background: rgba(50,39,30,.035); }
.todo-karte.erledigt { opacity: .55; }
.todo-karte.erledigt .todo-kunde { text-decoration: line-through; }
.todo-check {
    flex-shrink: 0; width: 44px; height: 44px; border-radius: var(--radius-sm);
    display: grid; place-items: center;
    background: var(--surface); border: 1px solid var(--rule);
    color: transparent; font-size: 18px; cursor: pointer;
}
.todo-check:hover { border-color: var(--t1); }
.todo-check.an { background: var(--t1); border-color: var(--t1); color: var(--paper); }
.todo-body { flex: 1; min-width: 0; cursor: pointer; }
.todo-kunde { font-weight: 500; font-size: 16px; }
.todo-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; color: var(--t2); font-size: 14.5px; margin-top: 3px; }
.todo-meta i { margin-inline-end: 3px; }
.todo-nr { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--t1); }
.todo-adresse { color: var(--t2); font-size: 14.5px; margin-top: 2px; }
.todo-maps {
    flex-shrink: 0; width: 44px; height: 44px; border-radius: var(--radius-sm);
    display: grid; place-items: center;
    background: var(--surface); border: 1px solid var(--rule); color: var(--t2); font-size: 18px;
}
.todo-maps:hover { color: var(--t1); border-color: var(--t3); }

/* ============================================================
   UI-Runde #130: reinweisse Tabellen, Petrol-Filterpillen, bunte
   Status-Pillen, Erfassung mit Unterseiten, Todo-Board.
   Bewusste Abweichung von den alten harten Regeln in DESIGN.md
   (Farbe fuer Status, runde Pillen) - siehe dort.
   ============================================================ */
:root {
    --white: #FFFFFF;
    --petrol-line: rgba(18, 62, 67, .22);
}

/* ---------- Status-Pillen: leicht durchscheinend, Text bleibt lesbar ---------- */
.status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    font: 500 12.5px var(--font); line-height: 1; white-space: nowrap;
    padding: 5px 10px 5px 8px; border-radius: 999px;
    border: 1px solid transparent;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.status-pill.tone-slate  { color: #3F5563; background: rgba(100, 125, 145, .14); border-color: rgba(100, 125, 145, .22); }
.status-pill.tone-petrol { color: #0F5A60; background: rgba(24, 128, 136, .14); border-color: rgba(24, 128, 136, .24); }
.status-pill.tone-amber  { color: #8A4B06; background: rgba(240, 160, 30, .18); border-color: rgba(240, 160, 30, .30); }
.status-pill.tone-green  { color: #1C6B3A; background: rgba(46, 170, 90, .15); border-color: rgba(46, 170, 90, .26); }
.status-pill.tone-rose   { color: #9B2342; background: rgba(230, 70, 110, .13); border-color: rgba(230, 70, 110, .24); }

/* Status-Pille als Schalter (#195): Klick oeffnet die erlaubten Uebergaenge. */
.status-switch { display: inline-flex; align-items: center; gap: 4px; background: transparent; border: 0; padding: 0; cursor: pointer; color: var(--t2); }
.status-switch .bi-chevron-down { font-size: 11px; }
.status-switch:hover .status-pill { filter: brightness(.96); }

/* ---------- Projekte als Kontrollzentrale (#196) ---------- */

.pd-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.pd-name { font-size: 26px; margin: 0; }
.pd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--t2); font-size: 14px; }
.pd-meta .bi { color: var(--t3); margin-inline-end: 3px; }
.pd-head-actions { display: flex; gap: 8px; align-items: center; }
.pd-number { font-variant-numeric: tabular-nums; color: var(--t2); }

/* Zweite Kopfzeile: geplante Eckdaten mit Icons (#196) - ohne Kasten (#201):
   Petrol-Icon, darueber die Bezeichnung grau und klein, darunter der Wert. */
.pd-facts { display: flex; flex-wrap: wrap; gap: 10px 36px; margin: 12px 0 16px; }
.pd-fact { display: inline-flex; align-items: center; gap: 10px; }
.pd-fact > i { color: var(--t1); font-size: 18px; }
.pd-fact > div { display: flex; flex-direction: column; line-height: 1.25; }
.pd-fact span { color: var(--t3); font-size: 12px; }
.pd-fact b { font-weight: 600; color: var(--t1); font-size: 14.5px; font-variant-numeric: tabular-nums; }

/* Weisser Knopf (#201) - neben weissen Karten dezent, ohne den Cremeton von --surface. */
.btn-white { background: var(--white); color: var(--t1); border: 1px solid var(--rule); }
.btn-white:hover, .btn-white:focus, .btn-white.show { background: var(--t1-soft); color: var(--t1); border-color: var(--t3); }
.btn-white.pd-delete { color: var(--ox); }
.btn-white.pd-delete:hover, .btn-white.pd-delete:focus { background: var(--ox-soft); color: var(--ox); border-color: var(--ox); }

/* SAP-artige Reiter: nur Text, aktiver Reiter mit Petrol-Unterstrich. */
.pd-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; }
.pd-tab {
    background: transparent; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px;
    padding: 10px 16px; font: 500 15px var(--font); color: var(--t2); cursor: pointer; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 7px;
}
.pd-tab:hover { color: var(--t1); }
.pd-tab.on { color: var(--t1); font-weight: 600; border-bottom-color: var(--t1); }
.pd-tab-n { font-size: 12px; color: var(--t3); background: var(--rule2); border-radius: 999px; padding: 1px 7px; font-weight: 500; }
.pd-soon { display: grid; place-items: center; gap: 8px; padding: 48px 20px; text-align: center; color: var(--t3); }
.pd-soon > i { font-size: 2.2rem; opacity: .5; }
.pd-soon p { margin: 0; max-width: 460px; }

/* Uebersicht (#201): keine Kacheln mehr - eine Zeile kleiner Kennzahlen,
   darunter die Projektangaben als ruhige Liste, rechts der Projektchat. */
.po { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: stretch; height: 100%; min-height: 0; grid-template-rows: minmax(0, 1fr); }
.po-main { overflow-y: auto; overflow-x: hidden; min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 22px; padding-inline-end: 4px; }
.po-chat { min-height: 0; display: flex; flex-direction: column; }
@media (max-width: 1200px) { .po { grid-template-columns: 1fr; } }
.pd-chat { flex: 1 1 auto; min-height: 340px; border: 1px solid var(--rule); border-radius: var(--radius); }
.po-chat-empty { display: grid; place-items: center; gap: 6px; text-align: center; color: var(--t3); padding: 32px 16px; border: 1px dashed var(--rule); border-radius: var(--radius); }
.po-chat-empty i { font-size: 1.8rem; opacity: .5; }
.po-chat-empty p { margin: 0; font-size: 14px; }

/* Oben (#201): Angebot / Auftrag / Rechnungen auf einen Blick, anklickbar. */
.po-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 0 14px; margin-bottom: 4px; border-bottom: 1px solid var(--rule); flex-shrink: 0; }
.po-kpi {
    position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0;
    padding: 4px 30px 4px 16px; border: 0; border-inline-start: 1px solid var(--rule); background: transparent;
    text-align: start; font: inherit; color: inherit; cursor: pointer; border-radius: 0;
}
.po-kpi:first-child { padding-inline-start: 0; border-inline-start: 0; }
/* Dezenter Pfeil: hier geht's weiter in den Reiter. */
.po-kpi::after {
    content: "\F285"; font-family: bootstrap-icons; position: absolute; inset-inline-end: 10px; top: 50%;
    transform: translateY(-50%); font-size: 13px; color: var(--t3); opacity: .6; transition: transform .12s ease, opacity .12s ease;
}
.po-kpi:hover::after { opacity: 1; transform: translate(3px, -50%); color: var(--t1); }
.po-kpi b { overflow: hidden; max-width: 100%; }
.po-kpi > span { font-size: 12px; color: var(--t3); display: flex; align-items: center; gap: 6px; }
.po-kpi > span .bi { color: var(--t1); font-size: 13px; }
.po-kpi b { font-size: 16px; font-weight: 600; color: var(--t1); font-variant-numeric: tabular-nums; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.po-kpi b .status-pill, .po-kpi b .badge { font-size: 11px; padding: 3px 8px 3px 6px; }
.po-kpi small { font-size: 12.5px; color: var(--t2); font-variant-numeric: tabular-nums; }
.po-kpi-action { font-size: 12.5px; font-weight: 500; color: var(--ox); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.po-kpi-action:hover { color: var(--ox); text-decoration: underline; }
@media (max-width: 900px) { .po-kpis { grid-template-columns: 1fr; gap: 10px; } .po-kpi { padding-inline-start: 0; border-inline-start: 0; } }

.po-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 36px; }
@media (max-width: 900px) { .po-cols { grid-template-columns: 1fr; } }
.po-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.po-sec-head h3 { font-size: 12px; font-weight: 500; color: var(--t3); text-transform: uppercase; letter-spacing: .05em; margin: 0; }
.po-sec-note { font-size: 13px; color: var(--t3); }
.po-edit { background: transparent; border: 0; padding: 2px 4px; font-size: 13px; color: var(--t3); cursor: pointer; border-radius: 4px; }
.po-edit:hover { color: var(--t1); background: var(--t1-soft); }
.po-info { margin: 0; }
.po-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; padding: 6px 6px; margin: 0 -6px; border-top: 1px solid var(--rule2); border-radius: 4px; }
.po-row:first-child { border-top: 0; }
.po-row.editable { cursor: pointer; }
.po-row.editable:hover { background: rgba(18, 62, 67, .04); }
.po-row dt { font-size: 13.5px; font-weight: 400; color: var(--t3); display: flex; align-items: center; gap: 8px; }
.po-row dt .bi { color: var(--t1); font-size: 14px; width: 16px; opacity: .85; }
.po-row dd { margin: 0; font-size: 14px; color: var(--t1); display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; position: relative; padding-inline-end: 20px; }
.po-row dd.multi { white-space: pre-line; }
.po-row dd small { font-size: 12.5px; color: var(--t2); flex-basis: 100%; }
.po-row dd small.over { color: var(--ox); }
.po-row dd a { color: var(--t1); }
.po-none { color: var(--t3); }
.po-row-pen { position: absolute; inset-inline-end: 0; top: 3px; font-size: 12px; color: var(--t3); opacity: 0; transition: opacity .12s ease; }
.po-row.editable:hover .po-row-pen { opacity: 1; }
@media (max-width: 600px) { .po-row { grid-template-columns: 1fr; gap: 2px; } }


/* Belege im Projekt mit Namen statt Nummer (#201). */
.pb-doc-pill { max-width: 280px; }
.pb-doc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pb-kind { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: var(--accent-orange-soft); color: var(--accent-orange); flex-shrink: 0; }
.filter-pill.on .pb-kind { background: rgba(255, 255, 255, .2); color: var(--white); }
.pb-create-menu { min-width: 320px; padding: 6px; }
.pb-create-menu .dropdown-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 6px; white-space: normal; }
.pb-create-menu .dropdown-item > .bi { color: var(--t1); font-size: 16px; margin-top: 1px; }
.pb-create-menu .dropdown-item span { display: flex; flex-direction: column; gap: 1px; }
.pb-create-menu .dropdown-item b { font-weight: 600; font-size: 14px; color: var(--t1); }
.pb-create-menu .dropdown-item small { font-size: 12.5px; color: var(--t3); }
.pb-create-menu .dropdown-item:disabled { opacity: .55; }

.pd-card-head:has(.pd-doc-head) { align-items: flex-start; }
.pd-doc-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pd-doc-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--t1-soft); color: var(--t1); font-size: 17px; flex-shrink: 0; }
.pd-doc-names { display: flex; flex-direction: column; min-width: 0; }
.pd-doc-sub { font-size: 12.5px; color: var(--t3); font-variant-numeric: tabular-nums; }
.pd-doc-status { margin: 0 0 0 4px; align-self: center; }
.bt-name { display: inline-flex; align-items: center; gap: 6px; font: 600 17px var(--font); color: var(--t1); min-width: 0; }
.bt-name.empty { color: var(--t2); }
.bt-pen { border: 0; background: transparent; color: var(--t3); padding: 2px 4px; border-radius: 4px; font-size: 13px; cursor: pointer; opacity: .7; }
.bt-pen:hover { opacity: 1; color: var(--t1); background: var(--t1-soft); }
.bt-edit { display: inline-flex; align-items: center; gap: 8px; }
.bt-edit .form-control { height: 34px; min-height: 0; padding: 0 10px; font: 600 15px var(--font); width: min(420px, 60vw); }
.bt-edit small { font-size: 12px; color: var(--t3); }
.bt-error { display: block; font-size: 12.5px; color: var(--ox); }
.po-kpi-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }

/* Knoepfe rechts im Kartenkopf (Umwandeln, Oeffnen). */
.pd-card-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* Auftrag-Reiter ohne Auftrag (#201): die umwandelbaren Angebote als Zeilen. */
.po-offer-list { display: flex; flex-direction: column; gap: 6px; width: min(720px, 100%); margin-top: 6px; }
.po-offer {
    display: grid; grid-template-columns: 16px auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px;
    padding: 8px 8px 8px 14px; background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); text-align: start; color: var(--t1);
}
.po-offer > .bi { color: var(--t1); }
.po-offer-nr { font-weight: 600; font-variant-numeric: tabular-nums; }
.po-offer-title { color: var(--t2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po-offer-sum { font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }

/* Auswahl "aus welchem Angebot/Auftrag" (#201). */
.pick-list { display: flex; flex-direction: column; gap: 6px; }
.pick-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer;
    border: 1px solid var(--rule); border-radius: var(--radius); background: var(--white);
}
.pick-item:hover { border-color: var(--t3); }
.pick-item.on { border-color: var(--t1); background: var(--t1-soft); }
.pick-item input { accent-color: var(--t1); }
.pick-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pick-main b { font-weight: 600; font-size: 14px; }
.pick-main small { color: var(--t2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Mehrfachauswahl ohne Checkbox (Projekt aus Angeboten, #201): die ganze Zeile ist der Schalter. */
.pick-hint { font-size: 12.5px; color: var(--t3); margin: 0 0 8px; }
.pick-scroll { max-height: min(420px, 55vh); overflow-y: auto; }
.pick-row { width: 100%; text-align: start; font: 400 14px var(--font); color: var(--t1); gap: 14px; }
.pick-row:disabled { opacity: .4; cursor: not-allowed; }
.pick-row:disabled:hover { border-color: var(--rule); }
.pick-check {
    width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
    border: 1.5px solid var(--rule); color: transparent; font-size: 11px; transition: all .12s ease;
}
.pick-row.on .pick-check { background: var(--t1); border-color: var(--t1); color: var(--white); }
.pick-nr { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pick-sub { color: var(--t2); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pick-grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pick-sum { font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }

/* Aufgaben (#201): Umschalter Plantafel / Liste. */
.pt-wrap { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.filter-pill .avatar-xs { width: 18px; height: 18px; font-size: 9px; margin-inline-start: -6px; }
.filter-pill.on .avatar-xs { background: rgba(255, 255, 255, .2); color: var(--white); }

/* Kanban, das die restliche Hoehe fuellt (#201): Spalten gleich hoch, nur die
   Karten scrollen in sich - nie die ganze Seite. */
.board.fill-board { flex: 1 1 auto; min-height: 0; align-items: stretch; padding-bottom: 0; }
.board.fill-board .board-col { display: flex; flex-direction: column; min-height: 0; flex: 1 1 0; min-width: 260px; }
.board.fill-board .board-cards { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 4px 4px; }
.pj-page { display: flex; flex-direction: column; height: calc(100dvh - var(--nav-h) - 48px); min-height: 420px; }
.pj-page > *:not(.board) { flex-shrink: 0; }

/* Tabellen ohne Zeilen-Klick (Benutzer): kein Hand-Cursor. */
.data-card.white .table-static tbody tr { cursor: default; }


/* Auftrag: grosse Karte links, Todos rechts. */
.po-order { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: stretch; height: 100%; min-height: 0; }
.po-order > .pd-card { min-height: 0; overflow-y: auto; }
.po-positions { display: flex; flex-direction: column; }
.po-pos-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -4px; }
.po-pos { display: flex; align-items: flex-start; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--rule2); }
.po-pos:first-child { border-top: 0; }
.po-pos-nr { width: 22px; flex-shrink: 0; color: var(--t3); font-variant-numeric: tabular-nums; font-size: 13px; padding-top: 1px; }
.po-pos-main { flex: 1; min-width: 0; }
.po-pos-desc { font-size: 14px; color: var(--t1); }
.po-pos-sub { font-size: 12.5px; color: var(--t3); font-variant-numeric: tabular-nums; }
.po-pos-sum { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 14px; }
.po-add { border-top: 1px solid var(--rule); padding-top: 10px; margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
/* Nachtraege (#202): eigener Abschnitt mit Zwischensumme, Zeilen mit Akzent links. */
.po-co-head {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    margin: 10px 0 2px; padding: 5px 8px; border-radius: 5px;
    background: var(--accent-orange-soft); color: var(--t1); font-size: 13px; font-weight: 600;
}
.po-co-head .bi { color: var(--accent-orange); margin-inline-end: 4px; }
.po-co-head b { font-variant-numeric: tabular-nums; }
.po-pos.co { box-shadow: inset 3px 0 0 var(--accent-orange); padding-inline-start: 8px; }
.po-co-toggle { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; font-size: 13px; color: var(--t2); cursor: pointer; }
.po-co-toggle small { color: var(--accent-orange); }
.pos-co-row td { background: var(--accent-orange-soft); font-weight: 600; font-size: 13.5px; }
.pos-co-row .bi { color: var(--accent-orange); margin-inline-end: 4px; }
.pos-co-badge {
    display: inline-grid; place-items: center; width: 16px; height: 16px; margin-inline-start: 2px;
    border-radius: 3px; background: var(--accent-orange); color: var(--white); font-size: 10px; font-weight: 700; vertical-align: 1px;
}
.po-kpi-co { color: var(--accent-orange) !important; }
.po-kpi-co .bi { margin-inline-end: 3px; }
.po-add-row { display: grid; grid-template-columns: 64px 64px minmax(90px, 1fr) auto; gap: 6px; }
/* Keine Hoch/Runter-Pfeile in der Schnell-Eingabe (#201) - die fressen die schmalen Felder. */
.po-add input[type="number"] { -moz-appearance: textfield; appearance: textfield; padding-inline: 8px; }
.po-add input[type="number"]::-webkit-outer-spin-button,
.po-add input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
@media (max-width: 1100px) { .po-order { grid-template-columns: 1fr; } }
.po-order-card .pd-card-head h3 { gap: 10px; }
.po-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 4px 0 0; }
.po-facts-row { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
@media (max-width: 900px) { .po-facts, .po-facts-row { grid-template-columns: 1fr; } }
.po-facts dt { font-size: 12px; font-weight: 400; color: var(--t3); margin-bottom: 2px; }
.po-facts dt .bi { color: var(--t1); margin-inline-end: 4px; }
.po-facts dd { margin: 0; font-size: 16px; color: var(--t1); }
.po-facts dd.po-sum { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.po-add td { background: rgba(18, 62, 67, .025); }

/* Kuerzel-Kreise, gestapelt wie bei Jira. */
.avatar-stack { display: flex; flex-direction: row-reverse; justify-content: flex-end; }
.avatar-stack .avatar { margin-inline-start: -8px; border: 2px solid var(--white); }
.avatar-stack .avatar:last-child { margin-inline-start: 0; }
/* Initialen-Kreise (Avatar.razor, #205): ueberall der Look des Profil-Avatars
   oben rechts - Orange-Petrol-Verlauf, weisser Rand, weisse Initialen. */
.avatar {
    display: inline-grid; place-items: center; flex-shrink: 0;
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--t1) 115%);
    border: 2px solid var(--surface);
    color: var(--white); font-size: 11.5px; font-weight: 600; letter-spacing: .01em; line-height: 1;
    user-select: none;
}
.avatar-xs { width: 24px; height: 24px; font-size: 9.5px; border-width: 1.5px; }
.avatar-sm { width: 28px; height: 28px; font-size: 10.5px; border-width: 1.5px; }
.avatar-md { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg { width: 38px; height: 38px; font-size: 13px; }

/* Angebot/Rechnungen: Auswahl als Pillen, daneben Neu. */
.pb-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pb-hint { font-size: 13.5px; color: var(--t2); margin: -4px 0 12px; }
.pb-hint .bi { color: var(--t3); }
/* Orange Aktion (Anfuegen, #196) - Gegenstueck zum Petrol-Primaerknopf. */
.btn-accent { background: var(--accent-orange); border: 1px solid var(--accent-orange); color: var(--white); }
.btn-accent:hover, .btn-accent:focus { background: #E04E0C; border-color: #E04E0C; color: var(--white); }
.btn-accent:disabled { background: var(--accent-orange); border-color: var(--accent-orange); color: var(--white); opacity: .5; }
.pd-desc { color: var(--t2); white-space: pre-line; margin: 4px 0 10px; max-width: 760px; }

.pd-card { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; }
.pd-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.pd-card-head h3 { font-size: 15px; font-weight: 600; margin: 0; color: var(--t1); display: flex; align-items: center; gap: 8px; }
.pd-card-head h3 .bi { color: var(--t3); }
.pd-card-sum { font-size: 13.5px; color: var(--t2); font-variant-numeric: tabular-nums; }
.pd-card-empty { color: var(--t3); font-size: 14px; padding: 6px 0; }



.pd-rows { display: flex; flex-direction: column; }
.pd-row {
    display: flex; align-items: center; gap: 12px; padding: 8px 4px;
    border-top: 1px solid var(--rule2); color: var(--t1); text-decoration: none; font-size: 14px;
}
.pd-row:first-child { border-top: 0; }
.pd-row:hover { background: rgba(18, 62, 67, .035); color: var(--t1); }
.pd-row-mid { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pd-card-link { font-size: 14px; color: var(--t3); margin-inline-start: 4px; }
.pd-card-link:hover { color: var(--t1); }

/* ---------- Projektseite in fester Hoehe (#198) ---------- */
/* 88px = Abstand oben/unten im Inhaltsbereich (.content). */
/* Die Seite fuellt den Bildschirm bis knapp an den unteren Rand (#201): oben der
   normale Abstand, unten nur 16px statt des vollen Seitenrands. Kopf und Reiter
   werden nie zusammengedrueckt - nur der Reiter-Inhalt gibt nach und scrollt. */
.pd-page { display: flex; flex-direction: column; height: calc(100dvh - var(--nav-h) - 48px); min-height: 480px; }
.pd-page > *:not(.pd-tab-body) { flex-shrink: 0; }
.pd-page .pd-tab-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.content:has(.pd-page), .content:has(.pj-page) { padding-bottom: 16px; }
/* Kleine Bildschirme: Kopf etwas dichter, damit der Reiter-Inhalt Platz hat. */
@media (max-height: 820px) {
    .pd-page .pd-facts { margin: 6px 0 10px; }
    .pd-page .pd-tabs { margin-bottom: 12px; }
}
.po-wrap { display: flex; flex-direction: column; height: 100%; min-height: 0; }

/* ---------- Projekte als Kanban (#196) ---------- */
.pj-board .pj-col { flex: 1 1 0; min-width: 260px; }
.pj-card { display: flex; flex-direction: column; gap: 4px; }
.pj-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pj-card-top .status-pill { font-size: 11px; padding: 2px 8px 2px 6px; }
.pj-card-name { font-weight: 600; font-size: 14.5px; color: var(--t1); }
.pj-card-sub { font-size: 13px; color: var(--t2); }
/* Archiv (#205): Wegraeumen-Knopf im Spaltenkopf, Archiv-Icon auf der Karte
   (erst beim Hover), Hinweisleiste im archivierten Projekt. */
/* Aktuell / Archiviert unter dem Projekte-Titel (#205): zweiteiliger Schalter. */
.seg-switch {
    display: inline-flex; gap: 2px; margin-top: 10px; padding: 3px;
    background: var(--rule2); border-radius: var(--radius-sm);
}
.seg-switch button {
    display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 14px;
    border: 0; border-radius: calc(var(--radius-sm) - 3px); background: transparent;
    color: var(--t2); font: 500 13.5px var(--font); cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.seg-switch button:hover { color: var(--t1); }
.seg-switch button.on { background: var(--white); color: var(--t1); box-shadow: 0 1px 2px rgba(18, 62, 67, .12); }
.seg-switch .n { font-size: 12px; color: var(--t3); font-variant-numeric: tabular-nums; }
.pj-col-tools { display: inline-flex; align-items: center; gap: 8px; }
.pj-archive-all {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
    border: 1px solid var(--rule); border-radius: 999px; background: var(--white);
    color: var(--t2); font: 500 12px var(--font); cursor: pointer;
}
.pj-archive-all:hover { color: var(--t1); border-color: var(--t3); background: var(--t1-soft); }
.pj-card-top-end { display: inline-flex; align-items: center; gap: 4px; }
.pj-card-archive {
    width: 24px; height: 24px; border: 0; border-radius: var(--radius-xs);
    display: grid; place-items: center; background: transparent; color: var(--t3);
    font-size: 12.5px; cursor: pointer; opacity: 0; transition: opacity .12s ease;
}
.pj-card:hover .pj-card-archive, .pj-card-archive:focus-visible { opacity: 1; }
.pj-card-archive:hover { background: var(--t1-soft); color: var(--t1); }
@media (hover: none) { .pj-card-archive { opacity: 1; } }
.pd-archived {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 0 0 14px; padding: 9px 14px; border-radius: var(--radius);
    background: var(--rule2); color: var(--t2); font-size: 14px;
}
.pd-archived > i { color: var(--t1); }
.pd-archived .btn { margin-inline-start: auto; }
.pj-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12.5px; color: var(--t3); }

/* ---------- Plantafel (#198, neu in #201): Tage x Personen ----------
   Kompakt im Reiter: schmale Zeilen, Todos eines Tages nebeneinander nach
   Uhrzeit. Vollbild (.pb-full): Zeitstrahl je Zelle, 07-17 Uhr, Todos an ihrer
   Uhrzeit (TodoPlanning.Timeline). Eine Leiste, alle Knoepfe gleich hoch. */
.pb { display: flex; flex-direction: column; height: 100%; min-height: 0; outline: none; }
.pb-full {
    position: fixed; inset: 0; z-index: 75; height: auto;
    background: var(--paper); padding: 16px 22px 20px;
}

.pb-toolbar { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; margin-bottom: 10px; flex-shrink: 0; }
.pb-switch { display: inline-flex; height: var(--ctl-h); padding: 3px; gap: 2px; background: rgba(18, 62, 67, .07); border-radius: 8px; }
.pb-switch button {
    display: inline-flex; align-items: center; gap: 6px; height: calc(var(--ctl-h) - 6px); padding: 0 12px;
    border: 0; border-radius: 6px; background: transparent; font: 500 13.5px var(--font); color: var(--t2); cursor: pointer;
}
.pb-switch button:hover { color: var(--t1); }
.pb-switch button.on { background: var(--white); color: var(--t1); box-shadow: 0 1px 2px rgba(18, 62, 67, .14); }

.pb-week { display: flex; align-items: center; gap: 4px; }
.pb-icon-btn, .pb-today, .pb-btn {
    height: var(--ctl-h); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--white); border: 1px solid var(--rule); border-radius: 8px; color: var(--t1);
    font: 500 13.5px var(--font); cursor: pointer; transition: background .12s ease, border-color .12s ease;
}
.pb-icon-btn { width: var(--ctl-h); padding: 0; flex-shrink: 0; }
.pb-icon-btn.sm { width: 26px; height: 26px; border-color: transparent; }
.pb-today, .pb-btn { padding: 0 12px; }
.pb-icon-btn:hover, .pb-today:hover, .pb-btn:hover { background: var(--t1-soft); border-color: var(--t3); }
/* Die Woche als Knopf zwischen den Pfeilen (#204): oeffnet den Monatskalender. */
.pb-week-btn { gap: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pb-week-btn > .bi-calendar3 { color: var(--t2); font-size: 14px; }
.pb-week-btn b { font-weight: 600; color: var(--t1); }
.pb-week-btn span { font-size: 13px; color: var(--t2); font-weight: 400; }
.pb-week-caret { font-size: 11px; color: var(--t3); transition: transform .12s ease; }
.pb-week-btn.on .pb-week-caret { transform: rotate(180deg); }

/* Monatskalender unter "Heute" (#204): heute orange, Wochenende leicht grau,
   Tage mit offenen Todos petrol. Die gezeigte Woche ist dezent hinterlegt. */
.pb-today-wrap { position: relative; }
.pb-today.on { background: var(--t1-soft); border-color: var(--t3); }
.pb-cal-backdrop { position: fixed; inset: 0; z-index: 1040; }
.pb-cal {
    position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 1041;
    width: 272px; padding: 12px; background: var(--white); border: 1px solid var(--rule); border-radius: 10px;
    box-shadow: 0 10px 28px rgba(18, 62, 67, .16);
}
.pb-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pb-cal-head b { font-size: 14px; color: var(--t1); text-transform: capitalize; }
.pb-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.pb-cal-wd { font-size: 11px; color: var(--t3); text-align: center; padding-bottom: 4px; text-transform: uppercase; letter-spacing: .03em; }
.pb-cal-day {
    position: relative; height: 32px; border: 0; border-radius: 7px; background: transparent;
    font: 500 13px var(--font); color: var(--t1); cursor: pointer; font-variant-numeric: tabular-nums;
}
.pb-cal-day:hover { background: var(--t1-soft); }
.pb-cal-day.weekend { background: rgba(18, 62, 67, .05); color: var(--t2); }
.pb-cal-day.outside { color: var(--t3); opacity: .6; }
.pb-cal-day.shown { box-shadow: inset 0 0 0 1px var(--petrol-line); }
.pb-cal-day.todos { background: var(--t1); color: var(--white); opacity: 1; }
.pb-cal-day.todos:hover { background: var(--t1-hover); }
.pb-cal-day.today { background: var(--accent-orange); color: var(--white); font-weight: 600; opacity: 1; }
/* Heute mit offenen Todos: orange bleibt, ein Petrol-Punkt sagt den Rest. */
.pb-cal-day.today.todos::after {
    content: ""; position: absolute; bottom: 4px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px;
    border-radius: 50%; background: var(--white);
}
.pb-cal-legend { display: flex; gap: 14px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--rule2); font-size: 12px; color: var(--t2); }
.pb-cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pb-cal-today {
    margin-inline-start: auto; height: 26px; padding: 0 10px; border: 1px solid var(--accent-orange); border-radius: 7px;
    background: var(--white); color: var(--accent-orange); font: 600 12px var(--font); cursor: pointer;
}
.pb-cal-today:hover { background: var(--accent-orange-soft); }
.pb-cal-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.pb-cal-dot.today { background: var(--accent-orange); }
.pb-cal-dot.todos { background: var(--t1); }

.pb-legend { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--t3); }
.pb-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pb-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.pb-dot.mine { background: var(--t1-soft); box-shadow: inset 3px 0 0 var(--t1); }
.pb-dot.other { background: #EEF1F7; box-shadow: inset 3px 0 0 #8A99BD; }

.pb-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.pb-btn.on { background: var(--t1-soft); border-color: var(--t1); }
.pb-btn.primary { background: var(--t1); border-color: var(--t1); color: var(--white); }
.pb-btn.primary:hover { background: var(--t1-hover); border-color: var(--t1-hover); }
.pb-count { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--rule2); color: var(--t2); font-size: 11.5px; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.pb-btn.has .pb-count { background: var(--accent-orange); color: var(--white); }
.pb-picked {
    display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 10px;
    border-radius: 999px; background: var(--t1-soft); color: var(--t1); font-size: 12.5px; white-space: nowrap;
}
.pb-picked button { border: 0; background: transparent; color: var(--t2); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.pb-picked button:hover { background: rgba(18, 62, 67, .1); color: var(--t1); }

.pb-body { flex: 1 1 auto; min-height: 0; display: flex; gap: 12px; }
.pb-scroll { flex: 1 1 auto; min-width: 0; overflow: auto; background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); }
.pb-grid { display: grid; min-width: 100%; }

.pb-corner, .pb-day { position: sticky; top: 0; z-index: 2; background: var(--white); border-bottom: 1px solid var(--rule); }
.pb-corner {
    inset-inline-start: 0; z-index: 3; padding: 8px 12px; display: flex; align-items: flex-end;
    font-size: 11.5px; color: var(--t3); text-transform: uppercase; letter-spacing: .05em;
}
.pb-day { padding: 8px 10px; border-inline-start: 1px solid var(--rule2); font-size: 12.5px; white-space: nowrap; }
.pb-day span { color: var(--t3); }
.pb-day b { color: var(--t1); font-weight: 600; font-variant-numeric: tabular-nums; }
.pb-day.today b { color: var(--accent-orange); }
.pb-day.today { box-shadow: inset 0 -2px 0 var(--accent-orange); }
.pb-day.weekend { background: #FAFAF8; }
.pb-hours { position: relative; height: 13px; margin-top: 4px; font-size: 10.5px; color: var(--t3); font-variant-numeric: tabular-nums; }
.pb-hours span { position: absolute; top: 0; transform: translateX(-50%); }
.pb-hours span:first-child { transform: none; }
.pb-hours span:last-child { transform: translateX(-100%); }
/* Schmale Wochenendspalte: nur Anfang und Ende. */
.pb-day.weekend .pb-hours span:not(:first-child):not(:last-child) { display: none; }

.pb-person {
    position: sticky; inset-inline-start: 0; z-index: 1; background: var(--white);
    display: flex; align-items: center; gap: 8px; padding: 0 10px 0 12px; min-width: 0;
    border-top: 1px solid var(--rule2); border-inline-end: 1px solid var(--rule); font-size: 13.5px;
}
.pb-person-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-person-n { font-size: 11px; color: var(--t3); background: var(--rule2); border-radius: 999px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.pb-nobody { background: var(--rule2); color: var(--t3); }

.pb-cell {
    border-top: 1px solid var(--rule2); border-inline-start: 1px solid var(--rule2);
    min-height: 46px; padding: 4px; display: flex; gap: 3px; min-width: 0;
    cursor: pointer; transition: background .12s ease;
}
.pb-cell:hover { background: rgba(18, 62, 67, .03); }
.pb-cell.weekend { background: #FAFAF8; }
.pb-cell.today { background: rgba(255, 103, 31, .045); }
.pb-cell.selected { background: var(--t1-soft); box-shadow: inset 0 0 0 2px var(--t1); }
.pb-cell.drop { background: var(--t1-soft); box-shadow: inset 0 0 0 2px var(--t1); }

/* Ein Todo: kompakt als Streifen nebeneinander - zwei teilen sich die Zelle halbe-halbe. */
.pb-todo {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px;
    padding: 3px 6px; border-radius: 4px; background: var(--t1-soft); box-shadow: inset 3px 0 0 var(--t1);
    cursor: pointer; overflow: hidden; font-size: 12px; line-height: 1.25; transition: filter .12s ease, transform .12s ease;
}
.pb-todo:hover { filter: brightness(.96); }
.pb-todo[draggable="true"] { cursor: grab; }
.pb-todo.dragging { opacity: .4; }
.pb-todo.other { background: #EEF1F7; box-shadow: inset 3px 0 0 #8A99BD; }
.pb-todo.other .pb-todo-title { color: #3F4C6B; font-weight: 500; }
.pb-todo.status-inarbeit { box-shadow: inset 3px 0 0 #F0A01E; }
.pb-todo.status-erledigt { opacity: .55; }
.pb-todo.status-erledigt .pb-todo-title { text-decoration: line-through; }
.pb-todo.overdue { box-shadow: inset 3px 0 0 var(--ox); }
.pb-todo-time { font-size: 10.5px; color: var(--t2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-todo-title { font-weight: 600; color: var(--t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-todo-ref { font-size: 11px; color: var(--t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Vollbild: jede Zelle ein Zeitstrahl mit feinen Stundenlinien - --pb-hour ist
   eine Stunde in Prozent der Zelle (ProjectTaskBoard, waechst mit dem Fenster). */
.pb-full .pb-cell {
    display: block; min-height: 64px; padding: 6px 0;
    background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(var(--pb-hour) - 1px), rgba(18, 62, 67, .06) calc(var(--pb-hour) - 1px), rgba(18, 62, 67, .06) var(--pb-hour));
}
.pb-full .pb-cell.selected, .pb-full .pb-cell.drop { background-color: var(--t1-soft); }
.pb-lanes { position: relative; }
.pb-todo.placed { position: absolute; height: 26px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 6px; padding: 0 5px 0 7px; }
.pb-full .pb-person { font-size: 14px; }
.pb-todo.placed .pb-todo-time { flex-shrink: 0; }

/* Ohne Termin: aufklappbare Ablage rechts statt eines grossen Kastens. */
.pb-pool {
    flex: 0 0 240px; display: flex; flex-direction: column; min-height: 0;
    background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px;
    transition: background .12s ease, border-color .12s ease;
}
.pb-pool.drop { background: var(--t1-soft); border-color: var(--t1); }
.pb-pool-head { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; }
.pb-pool-hint { font-size: 12px; color: var(--t3); margin: 2px 0 8px; }
.pb-pool-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.pb-todo.in-pool { flex: 0 0 auto; padding: 6px 8px; }
.pb-pool-empty { font-size: 12.5px; color: var(--t3); text-align: center; margin: 12px 0; }

.pt-toolbar { margin-bottom: 12px; }

/* ---------- Projekt-Notizen (#203): Liste links, Notiz rechts ----------
   Angelehnt an die Notizen-App: Liste nach Zeit gruppiert mit Vorschaubild,
   rechts ein ruhiges "Papier" in Lesebreite, Bilder direkt nach dem Text. */
.pn {
    display: grid; grid-template-columns: 320px minmax(0, 1fr); height: 100%; min-height: 0;
    background: var(--white); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden;
}
@media (max-width: 860px) { .pn { grid-template-columns: 1fr; } .pn-list { max-height: 280px; } }

.pn-list { display: flex; flex-direction: column; min-height: 0; border-inline-end: 1px solid var(--rule); background: #FAFAF7; }
.pn-list-head { padding: 14px 14px 10px; display: flex; flex-direction: column; gap: 10px; }
.pn-list-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pn-list-title h3 { margin: 0; font: 700 18px var(--font); color: var(--t1); display: flex; align-items: baseline; gap: 8px; }
.pn-list-title h3 span { font-size: 13px; font-weight: 500; color: var(--t3); }
.pb-icon-btn.pn-compose { color: var(--accent-orange); font-size: 17px; }
.pb-icon-btn.pn-compose:hover { background: var(--accent-orange-soft); border-color: var(--accent-orange); }
.pn-search { width: 100%; }
.pn-items { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 12px; }
.pn-group {
    position: sticky; top: 0; z-index: 1; background: #FAFAF7;
    padding: 12px 8px 6px; font-size: 11.5px; font-weight: 600; color: var(--t3); text-transform: uppercase; letter-spacing: .06em;
}
.pn-item {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: start;
    padding: 10px 12px; margin-bottom: 2px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; color: var(--t1);
    transition: background .12s ease;
}
.pn-item:hover { background: rgba(18, 62, 67, .05); }
.pn-item.on { background: var(--accent-orange-soft); box-shadow: inset 3px 0 0 var(--accent-orange); }
.pn-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pn-item-title { font: 600 14.5px var(--font); display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pn-item-title .bi { font-size: 11px; color: var(--t3); flex-shrink: 0; }
.pn-item-sub { font-size: 13px; color: var(--t3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pn-item-sub b { font-weight: 500; color: var(--t2); margin-inline-end: 6px; font-variant-numeric: tabular-nums; }
.pn-item-thumb { width: 42px; height: 42px; border-radius: 7px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--rule); }
.pn-empty { font-size: 13.5px; color: var(--t3); text-align: center; margin: 24px 0; }

.pn-editor { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pn-editor > .alert { margin: 10px 16px 0; }
.pn-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
    padding: 12px 16px; border-bottom: 1px solid var(--rule2); flex-shrink: 0;
}
.pn-meta { font-size: 13px; color: var(--t3); display: inline-flex; align-items: center; gap: 6px; min-height: var(--ctl-h); }
.pn-meta .bi { font-size: 15px; }
.pn-spin { display: inline-block; animation: pn-spin 1s linear infinite; }
@keyframes pn-spin { to { transform: rotate(360deg); } }
.pn-actions { display: flex; align-items: center; gap: 8px; }
.pn-actions label { margin: 0; }
.pn-badge { display: inline-flex; align-items: center; gap: 6px; height: var(--ctl-h); padding: 0 12px; font-size: 13.5px; color: var(--t2); background: rgba(18, 62, 67, .05); border-radius: 8px; }
.pb-icon-btn.pn-delete { color: var(--ox); }
.pb-icon-btn.pn-delete:hover { background: var(--ox-soft); border-color: var(--ox); }

/* Das Papier fuellt die ganze Hoehe, der Text den Rest unter Titel und
   Bilderleiste (#204) - ueberall darunter kann man hineinklicken und schreiben. */
.pn-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.pn-paper { flex: 1; width: 100%; max-width: 780px; margin: 0 auto; padding: 18px 40px 32px; display: flex; flex-direction: column; }
.pn-date { text-align: center; font-size: 12.5px; color: var(--t3); margin-bottom: 14px; }
.pn-title {
    border: 0; outline: none; background: transparent; padding: 0; width: 100%; margin-bottom: 8px;
    font: 700 20px/1.3 var(--font); color: var(--t1); letter-spacing: -.005em;
}
.pn-title::placeholder, .pn-body::placeholder { color: var(--t3); opacity: .6; }
.pn-body {
    flex: 1; border: 0; outline: none; background: transparent; padding: 0; width: 100%; resize: none;
    font: 400 16px/1.7 var(--font); color: var(--t1);
    field-sizing: content; min-height: 6lh;
}

/* Bilderleiste zwischen Titel und Text (#204): kompakte Vorschaubilder,
   quer scrollbar, "+" am Ende. Klick oeffnet den Viewer. */
.pn-strip {
    display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin-bottom: 8px;
    scrollbar-width: thin; flex-shrink: 0;
}
.pn-thumb { position: relative; margin: 0; flex-shrink: 0; }
.pn-thumb-open { display: block; padding: 0; border: 0; background: none; border-radius: 9px; cursor: zoom-in; }
.pn-thumb-open img {
    display: block; height: 88px; width: auto; max-width: 160px; min-width: 64px; object-fit: cover;
    border-radius: 9px; box-shadow: 0 1px 3px rgba(18, 62, 67, .18); transition: transform .12s ease, box-shadow .12s ease;
}
.pn-thumb-open:hover img { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(18, 62, 67, .22); }
.pn-thumb .pn-image-x { top: 5px; inset-inline-end: 5px; width: 22px; height: 22px; font-size: 10px; }
.pn-thumb:hover .pn-image-x, .pn-thumb .pn-image-x:focus { opacity: 1; }
.pn-thumb-add {
    flex-shrink: 0; width: 64px; height: 88px; margin: 0; display: grid; place-items: center;
    border: 1.5px dashed var(--rule); border-radius: 9px; color: var(--t3); font-size: 20px; cursor: pointer;
    transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.pn-thumb-add:hover { border-color: var(--accent-orange); color: var(--accent-orange); background: var(--accent-orange-soft); }
.pn-thumb-add.busy { cursor: default; }
.pn-blank { flex: 1; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--t2); text-align: center; padding: 40px; }
.pn-blank-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-orange-soft); color: var(--accent-orange); font-size: 28px; }
.pn-blank b { font-weight: 500; }

.pn-image-x {
    position: absolute; top: 8px; inset-inline-end: 8px; width: 28px; height: 28px; border: 0; border-radius: 50%;
    display: grid; place-items: center; background: rgba(18, 62, 67, .75); color: var(--white); font-size: 12px; cursor: pointer;
    opacity: 0; transition: opacity .12s ease;
}
@media (hover: none) { .pn-image-x { opacity: 1; } }

.pn-share { margin-top: 12px; display: flex; flex-direction: column; gap: 14px; max-height: 45vh; overflow-y: auto; }
.pn-share-title { font-size: 12px; font-weight: 600; color: var(--t3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.pn-share-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 6px; border-radius: 6px; }
.pn-share-row.on { background: var(--t1-soft); }
.pn-share-row label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; cursor: pointer; }
.pn-share-row .bi { color: var(--t1); }
.pn-share-row .form-select { width: 130px; }
.pt-search { width: min(300px, 100%); }
/* Liste der Aufgaben: fuellt den Reiter genau, nichts schiebt die Leisten weg. */
.pt-wrap { overflow: hidden; }
.pt-wrap > .pb-toolbar, .pt-wrap > .pt-toolbar, .pt-wrap > .alert { flex-shrink: 0; }
.board.fill-board .board-col { min-height: 0; }
.todo-allday { display: flex; align-items: center; gap: 8px; margin: 0; }
.todo-time-range { display: inline-flex; align-items: center; gap: 4px; color: var(--t3); }

/* ---------- Filterpillen (Petrol) ---------- */
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
/* Eine Hoehe fuer alle Bedienelemente in Leisten (#201): Suchfelder, Pillen,
   Leistenknoepfe - damit nichts neben dem anderen zu hoch oder zu niedrig steht. */
:root { --ctl-h: 36px; }
.filter-pill {
    display: inline-flex; align-items: center; gap: 7px; height: var(--ctl-h);
    font: 500 13.5px var(--font); color: var(--t1); line-height: 1;
    padding: 0 14px; border-radius: 999px; cursor: pointer;
    background: var(--white); border: 1px solid var(--petrol-line);
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.filter-pill:hover { background: var(--t1-soft); border-color: var(--t1); }
.filter-pill.on { background: var(--t1); border-color: var(--t1); color: var(--white); }
.filter-pill .n { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .6; }
.filter-pill.on .n { opacity: .75; }
.filter-pill.cancelled { opacity: .5; text-decoration: line-through; }
.list-search { position: relative; width: min(320px, 100%); }
.list-search i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--t3); font-size: 14px; }
.list-search .form-control { height: var(--ctl-h); min-height: 0; padding-block: 0; border-radius: 8px; padding-inline-start: 34px; background: var(--white); font-size: 14px; }

/* ---------- Reinweisse Tabelle ---------- */
.data-card.white { background: var(--white); border-color: var(--rule); overflow-x: auto; }
.data-card.white .table thead th { background: var(--white); color: var(--t2); border-bottom-color: var(--rule); }
.data-card.white .table tbody tr { cursor: pointer; }
.data-card.white .table-hover tbody tr:hover { background: rgba(18, 62, 67, .035); }
.cell-nr { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-sub { color: var(--t3); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-title { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Titel als Name des Belegs (#201), Nummer und Datum klein darunter. */
.cell-name { max-width: 360px; }
.cell-name-main { font-weight: 600; color: var(--t1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-name-main.fallback { color: var(--t2); font-weight: 500; }
.cell-title .fallback { color: var(--t3); }
.cell-muted { color: var(--t2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell-amt { text-align: end; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Erfassung mit Unterseiten: Leiste links, Inhalt rechts ---------- */
.form-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: start; }
.form-steps {
    display: flex; flex-direction: column; gap: 2px;
    border-inline-end: 1px solid var(--rule); padding-inline-end: 12px;
    position: sticky; top: 0;
}
.form-step {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: start;
    background: transparent; border: 0; border-radius: var(--radius-sm);
    font: 500 14.5px var(--font); color: var(--t2);
    padding: 9px 10px; cursor: pointer; white-space: nowrap;
}
.form-step:hover { color: var(--t1); background: rgba(18, 62, 67, .05); }
.form-step.on { color: var(--t1); background: var(--t1-soft); }
.form-step .n { margin-inline-start: auto; }
@media (max-width: 720px) {
    /* Schmal: Leiste wieder oben, sonst bleibt fuer die Felder kein Platz. */
    .form-layout { grid-template-columns: 1fr; gap: 12px; }
    .form-steps { flex-direction: row; overflow-x: auto; border-inline-end: 0; border-bottom: 1px solid var(--rule); padding: 0 0 6px; position: static; }
    .form-step { width: auto; }
}
.form-step .num {
    display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
    font-size: 11.5px; font-weight: 600; background: var(--t1-soft); color: var(--t1);
}
.form-step.on .num { background: var(--t1); color: var(--white); }
.form-step .n { font-size: 12px; color: var(--t3); font-variant-numeric: tabular-nums; }
.form-step.has-error { color: var(--ox); }
.form-step.has-error .num { background: var(--ox-soft); color: var(--ox); }
/* Feste Hoehe: das Popup springt beim Wechseln nicht, und keine Unterseite
   muss als Ganzes gescrollt werden - nur eine lange Positionsliste scrollt
   in sich. */
.form-pane { min-height: 330px; }
.pos-scroll { max-height: calc(90vh - 330px); min-height: 180px; overflow: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--white); }
.pos-scroll .pos-table { margin: 0; }
.pos-scroll .pos-table thead th { position: sticky; top: 0; z-index: 1; background: var(--white); }
.pos-table .pos-artikel { width: 120px; }
/* Mindestbreiten (#201): kein Feld wird so schmal, dass man nichts mehr
   eintippen kann; zusammen passen sie in den Anlege-Dialog. Die Hoch/Runter-
   Pfeile der Zahlenfelder fressen hier nur Platz - weg damit. */
.pos-table thead th, .pos-table tbody td { padding-inline: 3px; }
.pos-table .form-control-sm, .pos-table .form-select-sm { padding-inline: 6px; }
.pos-table .form-select-sm { padding-inline-end: 22px; background-position: right 5px center; }
.pos-table .pos-artikel .form-select { min-width: 112px; }
.pos-table input[type="number"] { min-width: 52px; -moz-appearance: textfield; appearance: textfield; }
.pos-table input[type="number"]::-webkit-outer-spin-button,
.pos-table input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pos-table input.pos-price { min-width: 80px; }
.pos-empty { padding: 28px 16px; text-align: center; color: var(--t3); font-size: 14.5px; }
.form-totals {
    display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 6px 22px;
    border-top: 1px solid var(--rule); margin-top: 16px; padding-top: 12px;
    font-size: 14px; color: var(--t2); font-variant-numeric: tabular-nums;
}
.form-totals b { color: var(--t1); font-weight: 500; margin-inline-start: 6px; }
.form-totals .gross b { font-weight: 700; font-size: 16px; }

/* ---------- Anschrift auf dem Beleg (#133) ---------- */
/* "<Suchtext> als neuen Kunden anlegen" (#146) - direkt unter der Kontaktsuche. */
.new-kontakt-panel { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--surface); }
.new-kontakt-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.new-kontakt-head > .bi { font-size: 1.25rem; color: var(--accent); }
.new-kontakt-duplicate { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--t2); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rule2); }
/* Die Anschrift ist beim neuen Kunden die Eingabe, nicht nur eine Kopie - hervorheben. */
.recipient-fields.recipient-fields-new { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

.recipient-fields { margin-top: 12px; padding: 10px 12px 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--white); }
.recipient-fields legend {
    float: none; width: auto; margin: 0 0 8px; padding: 0;
    font: 600 13px var(--font); color: var(--t2);
}
.recipient-fields legend span { font-weight: 400; color: var(--t3); margin-inline-start: 6px; }
.input-icon { position: relative; }
.input-icon i { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); color: var(--t3); font-size: 13px; pointer-events: none; }
.input-icon .form-control { padding-inline-start: 30px; }

/* ---------- Texte wie auf dem Blatt: Kopftext / Positionen / Fusstext (#133) ---------- */
.doc-texts { display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
.doc-text-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.doc-text-head .form-label { font-weight: 600; color: var(--t1); }
.doc-text-where { font-size: 13px; color: var(--t3); }
.doc-text-picker { width: auto; max-width: 240px; margin-inline-start: auto; }
.doc-text textarea { resize: vertical; }
.doc-texts-positions {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 10px 14px; border: 1px dashed var(--petrol-line); border-radius: var(--radius);
    background: var(--t1-soft); color: var(--t1); font: 500 13.5px var(--font); text-align: start;
    font-variant-numeric: tabular-nums; cursor: pointer;
}
.doc-texts-positions:hover { border-color: var(--t1); }

/* ---------- Vorschau ohne Speichern (#133) ---------- */
.beleg-preview-note { font-size: 13.5px; color: var(--t2); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
/* Seit #305 ein eigenes Popup ueber der Maske (BelegPreview in AppDialog). */
.dlg.dlg-preview { width: min(980px, calc(100vw - 32px)); max-height: 94vh; top: 3vh; }
.beleg-preview iframe {
    width: 100%; height: calc(94vh - 250px); min-height: 420px; display: block;
    border: 1px solid var(--rule); border-radius: var(--radius); background: var(--rule2);
}

/* ---------- Textvorlagen in den Einstellungen (#133) ---------- */
.template-item { padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--white); margin-bottom: 8px; }
.template-text { margin-top: 4px; font-size: 13.5px; color: var(--t2); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.template-edit { padding: 12px; border: 1px solid var(--t1); border-radius: var(--radius); background: var(--white); margin-bottom: 10px; }

/* ---------- Angebotsfotos (#131) ---------- */
.photo-drafts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; max-height: calc(90vh - 360px); overflow: auto; }
.photo-draft { position: relative; display: flex; flex-direction: column; gap: 6px; }
.photo-draft img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--rule); background: var(--rule2); display: block; }
.photo-draft-x {
    position: absolute; top: 6px; inset-inline-end: 6px; width: 28px; height: 28px;
    border: 0; border-radius: 50%; background: rgba(18, 62, 67, .75); color: var(--white);
    display: grid; place-items: center; font-size: 12px; cursor: pointer;
}
.photo-draft-x:hover { background: var(--t1); }
.doc-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.doc-photo { margin: 0; }
.doc-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--rule); display: block; }
.doc-photo figcaption { font-size: 13px; color: var(--t2); margin-top: 4px; }

/* ---------- Todo-Board (Jira-artig) ---------- */
.board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 8px; }
.board-col {
    flex: 0 0 300px; background: rgba(18, 62, 67, .04);
    border: 1px solid var(--rule2); border-radius: var(--radius); padding: 10px;
    min-height: 160px; transition: background .12s ease, border-color .12s ease;
}
.board-col.drop { background: var(--t1-soft); border-color: var(--t1); }
.board-col-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 10px; }
.board-col-head .todo-count { font-size: 12.5px; }
.board-cards { display: flex; flex-direction: column; gap: 6px; }
.board-card {
    background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius-sm);
    padding: 8px 10px; cursor: pointer; font-size: 13.5px;
    transition: border-color .12s ease;
}
.board-card:hover { border-color: var(--t3); }
.board-card[draggable="true"] { cursor: grab; }
.board-card.dragging { opacity: .45; }
.board-card-title { font-weight: 500; color: var(--t1); line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.board-card.done .board-card-title { color: var(--t2); text-decoration: line-through; }
.board-card-ref { color: var(--t2); font-size: 12.5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; color: var(--t3); font-size: 12px; font-variant-numeric: tabular-nums; }
.board-card-foot .ox { color: var(--ox); font-weight: 500; }
.board-empty { color: var(--t3); font-size: 13px; text-align: center; padding: 14px 0; }

/* ---------- Kompaktere Todo-Elemente (Handy-Liste, Mini-Liste am Auftrag) ---------- */
.todo-gruppe { margin-bottom: 16px; }
.todo-karte { padding: 7px 6px; margin: 0 -6px; gap: 10px; }
.todo-kunde { font-size: 14.5px; }
.todo-meta { font-size: 12.5px; gap: 2px 10px; margin-top: 1px; }
.todo-adresse { font-size: 12.5px; margin-top: 0; }
.todo-meta .status-pill, .todo-mini .status-pill { font-size: 11px; padding: 3px 8px 3px 6px; }
.row-item.todo-mini { padding: 5px 4px; font-size: 13.5px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
    .topnav { padding-inline: 16px; gap: 6px; }
    .topnav-burger { display: grid; }
    .topnav-brand { width: auto; padding-inline: 2px 12px; }
    .topnav-search { display: none; }
    .app-divider { display: none; }

    /* Sidebar wird am Handy zur Schublade: unsichtbar, bis der Burger sie
       ueber .app.topnav-open oeffnet - dann schwebt sie ueber dem Inhalt. */
    .sidebar { display: none; }
    .app.topnav-open .sidebar {
        display: flex;
        position: fixed; top: var(--nav-h); bottom: 0; inset-inline-start: 0; z-index: 65;
        width: 78vw; max-width: 300px;
    }
    .app.topnav-open .sidebar-backdrop { display: block; }
    /* Am Handy gehoert die persoenliche Todo-Ansicht dazu, am Desktop nicht. */
    .app.topnav-open .sidebar-link-mobil { display: flex; }

    .topnav-popover { inset-inline: 16px; width: auto; }
    .content { padding: 20px 16px 40px; }

    /* Nur der Login-Bildschirm nutzt LanguageSwitcher noch direkt in einer
       Leiste (im Topbar-Profilmenue steckt die Sprache jetzt im Untermenue) -
       dort sprengt der volle Sprachname sonst die schmale Leiste. */
    .lang-switcher-current { display: none; }
    .lang-switcher > summary { width: 36px; padding-inline: 0; justify-content: center; }

    /* Profil: nur noch der Avatar, Name/Firma/Chevron sprengen die schmale
       Leiste neben Marke und Glocke. */
    .profile-trigger { padding: 0; border-radius: 50%; }
    .profile-text, .profile-chevron { display: none; }
    .profile-menu { inset-inline-end: -6px; }
}

/* ---------- Blazor error UI ---------- */
#blazor-error-ui {
    background: var(--surface); color: var(--t1);
    border-top: 1px solid var(--rule); box-shadow: none;
    bottom: 0; display: none; inset-inline-start: 0; padding: .7rem 1.25rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; inset-inline-end: .9rem; top: .6rem; }
.app-logo { max-height: 2rem; max-width: 8rem; object-fit: contain; }

/* ============================================================
   Sprachumschalter (LanguageSwitcher)
   ============================================================ */
/* <details>/<summary> statt Buttonreihe - bleibt bedienbar, egal wie lang die
   Sprachliste wird ("brutal viele Sprachen"). Farbe kommt bewusst über
   currentColor vom Kontext: im dunklen Topnav erbt sie var(--paper) wie die
   übrigen .topnav-icon-Elemente, auf dem hellen Login-Screen var(--t1) über
   .login-lang-bar weiter unten. */
.lang-switcher { position: relative; color: inherit; }
.lang-switcher > summary {
    list-style: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    height: 36px; padding-inline: 10px; border-radius: var(--radius-sm);
    font-size: 14.5px; color: inherit;
}
.lang-switcher > summary::-webkit-details-marker { display: none; }
.lang-switcher > summary:hover { background: rgba(128,128,128,.14); }
.lang-switcher[open] > summary { background: rgba(128,128,128,.14); }
.lang-switcher-current { white-space: nowrap; }
.lang-switcher-list {
    position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 90;
    list-style: none; margin: 0; padding: 6px;
    min-width: 160px; max-height: 60vh; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,.16);
}
.lang-switcher-list a {
    display: block; padding: 8px 10px; border-radius: var(--radius-xs);
    color: var(--t1); font-size: 14.5px; white-space: nowrap;
}
.lang-switcher-list a:hover { background: var(--t1-soft); }
.lang-switcher-list a.active { font-weight: 600; background: var(--t1-soft); }

/* Login-Bildschirm hat sonst kein Chrome (siehe MainLayout) - der
   Umschalter schwebt oben rechts, hell statt im dunklen Topnav-Stil. */
.login-lang-bar { display: flex; justify-content: flex-end; padding: 16px; color: var(--t1); }

/* ============================================================
   Teil 2: Live-übersetzte Notizen (TranslatedText.razor)
   ============================================================ */
/* Dezent wie Zeitangaben/Beiwerk sonst auch (--t3) - keine Farbe, siehe
   LOCALIZATION.md "Teil 2 - Darstellung". Original per Klick aufklappbar. */
.translated-note {
    margin-top: 4px; color: var(--t3); font-size: 13px;
    cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.translated-note:hover { color: var(--t2); }
.translated-note i { font-size: 12px; }
.translated-original {
    margin-top: 4px; padding: 8px 10px; border-inline-start: 2px solid var(--rule);
    color: var(--t2); font-size: 14px; cursor: default;
}

/* ============================================================
   Bilder ueberall (#204): Editor vor dem Einfuegen, Viewer beim Klick.
   Eigene Ebenen ueber allen Popups (auch ueber dem Beleg-Popup).
   ============================================================ */
.imged-backdrop { position: fixed; inset: 0; z-index: 1060; background: rgba(12, 46, 50, .55); }
.imged {
    position: fixed; top: 4vh; left: 50%; transform: translateX(-50%); z-index: 1061;
    width: min(1000px, calc(100vw - 32px)); max-height: 92vh; display: flex; flex-direction: column;
    background: var(--white); border-radius: 12px; box-shadow: 0 24px 60px rgba(12, 46, 50, .35); outline: none;
}
.imged-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 10px; }
.imged-head h2 { margin: 0; font: 600 17px var(--font); color: var(--t1); display: flex; align-items: baseline; gap: 10px; }
.imged-head h2 span { font-size: 13px; font-weight: 500; color: var(--t3); }
.imged-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 0 18px 10px; }
.imged-tool {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px;
    border: 1px solid var(--rule); border-radius: 8px; background: var(--white); color: var(--t1);
    font: 500 13px var(--font); cursor: pointer;
}
.imged-tool:hover { background: var(--t1-soft); }
.imged-tool.on { background: var(--t1); border-color: var(--t1); color: var(--white); }
.imged-hint { margin-inline-end: auto; align-self: center; font-size: 12.5px; color: var(--t3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imged-tool:disabled { opacity: .4; cursor: default; background: var(--white); }
.imged-sep { width: 1px; height: 22px; margin: 0 4px; background: var(--rule); }
/* Text direkt im Bild tippen (#305): schwebt auf dem body, ueber dem Editor. */
.pm-text-input {
    position: fixed; z-index: 1070; padding: 0 10px; min-width: 140px;
    font-family: Arial, sans-serif; font-weight: 700; color: #e03131; background: rgba(255, 255, 255, .92);
    border: 2px solid var(--t1); border-radius: var(--radius-sm); outline: none;
    box-shadow: var(--shadow-float, 0 12px 32px -8px rgba(12, 46, 50, .35));
}
.imged-canvas {
    flex: 1; min-height: 0; overflow: auto; display: grid; place-items: center;
    padding: 12px 18px; background: #F4F6F6; border-block: 1px solid var(--rule2);
}
.imged-canvas canvas { max-width: 100%; max-height: calc(92vh - 190px); touch-action: none; cursor: crosshair; border-radius: 6px; box-shadow: 0 1px 4px rgba(18, 62, 67, .18); }
.imged-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; }

.imgv {
    position: fixed; inset: 0; z-index: 1062; background: rgba(8, 24, 26, .92);
    display: flex; flex-direction: column; outline: none; animation: imgv-in .14s ease-out;
}
@keyframes imgv-in { from { opacity: 0; } to { opacity: 1; } }
.imgv-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; color: rgba(255, 255, 255, .8); flex-shrink: 0; }
.imgv-count { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.imgv-actions { display: flex; gap: 6px; }
.imgv-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 36px; min-width: 36px; padding: 0 10px; justify-content: center;
    border: 0; border-radius: 8px; background: rgba(255, 255, 255, .1); color: var(--white);
    font: 500 13.5px var(--font); text-decoration: none; cursor: pointer;
}
.imgv-btn:hover { background: rgba(255, 255, 255, .2); color: var(--white); }
.imgv-stage { flex: 1; min-height: 0; margin: 0; padding: 0 72px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.imgv-stage img, .imgv-stage canvas { max-width: 100%; max-height: calc(100vh - 130px); object-fit: contain; border-radius: 4px; box-shadow: 0 8px 40px rgba(0, 0, 0, .45); }
.imgv-stage figcaption { color: rgba(255, 255, 255, .85); font-size: 14px; text-align: center; max-width: 70ch; }
.imgv-nav {
    position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border: 0; border-radius: 50%;
    display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: var(--white); font-size: 22px; cursor: pointer;
}
.imgv-nav:hover { background: rgba(255, 255, 255, .22); }
.imgv-nav.prev { left: 14px; }
.imgv-nav.next { right: 14px; }
@media (max-width: 640px) { .imgv-stage { padding: 0 8px 16px; } .imgv-nav { top: auto; bottom: 14px; transform: none; } }
.zoomable { cursor: zoom-in; }
.photo-thumb-sm { position: relative; cursor: zoom-in; }
.photo-thumb-mark {
    position: absolute; bottom: 3px; inset-inline-end: 3px; width: 18px; height: 18px; border-radius: 50%;
    display: grid; place-items: center; font-size: 10px; background: rgba(224, 49, 49, .9); color: var(--white);
}
/* Nur Vorschau (#204): das PDF ueber die volle Breite und hoch genug fuer eine Seite. */
.mail-preview-layout.preview-only { grid-template-columns: 1fr; }
.mail-preview-layout.preview-only .mail-preview-pane,
.mail-preview-layout.preview-only .mail-preview-pane iframe { min-height: min(72vh, 900px); }
/* Vorschau als Seitenbilder (#204): grauer Grund, Seiten untereinander wie im PDF-Viewer. */
.mail-preview-pane.doc-pages {
    overflow-y: auto; max-height: min(72vh, 900px); padding: 16px;
    display: flex; flex-direction: column; align-items: center; gap: 14px; background: #E6E9E9;
}
.mail-preview-pane.doc-pages img { width: 100%; max-width: 760px; height: auto; display: block; background: #fff; box-shadow: 0 2px 10px rgba(18, 62, 67, .18); }

/* ============================================================
   Endbericht (#197) - Fenster wie die Einstellungen (.settings-window),
   rechts die Bereiche. Ruhig: Petrol fuer Struktur, Orange nur fuer
   "erledigt"-Akzente; Fotos tragen die Seite. Der Ueberblick passt ohne
   Scrollen: Kopf, eine Zeile Schritte + Kennzahlen, darunter zwei Spalten.
   ============================================================ */
.report-head-text { flex: 1; min-width: 0; }
.report-head-text .settings-window-sub a { color: var(--t2); text-decoration: underline; text-decoration-color: var(--rule); }
.report-head-text .settings-window-sub a:hover { color: var(--t1); }
.report-head-actions { display: flex; gap: 8px; flex-shrink: 0; }
.report-head-actions .btn[disabled] { opacity: .55; cursor: not-allowed; }
/* Ein Label darf den Icon-Kreis nicht quetschen. */
.form-step .num { flex-shrink: 0; }

.report-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 40px 20px; text-align: center; }
.report-empty > i { font-size: 2.6rem; color: var(--accent-orange); }
.report-empty h2 { font-size: 19px; font-weight: 600; }
.report-empty p { color: var(--t2); max-width: 460px; margin: 0 0 6px; }

/* ---------- Ueberblick ---------- */
.report-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.report-title h2 { font-size: 22px; font-weight: 600; margin: 0; line-height: 1.2; }
.report-desc { color: var(--t2); white-space: pre-line; margin: 6px 0 0; font-size: 14px; }
.report-state { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font: 600 12px var(--font); white-space: nowrap; }
.report-state.done { background: var(--t1); color: var(--white); }
.report-state.done i { color: var(--accent-orange); }
.report-state.running { background: rgba(240, 160, 30, .16); color: #8A4B06; }

.report-strip { margin: 14px 0 16px; }
.report-figures { display: flex; flex-wrap: wrap; gap: 8px; }
.report-figure {
    display: flex; align-items: center; gap: 10px; padding: 7px 14px 7px 11px;
    background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius-sm);
}
.report-figure > i { color: var(--accent-orange); font-size: 16px; }
.report-figure > div { display: flex; flex-direction: column; line-height: 1.2; }
.report-figure span { font-size: 11px; color: var(--t3); text-transform: uppercase; letter-spacing: .05em; }
.report-figure b { font-size: 15px; font-weight: 600; color: var(--t1); font-variant-numeric: tabular-nums; }

.report-overview { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.report-overview-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.report-cover {
    display: block; width: 100%; max-height: 300px; aspect-ratio: 16 / 10; padding: 0; border: 0;
    background: var(--rule2); border-radius: var(--radius-lg); overflow: hidden; cursor: zoom-in;
}
.report-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.report-cover:hover img { transform: scale(1.015); }
.report-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; margin: 0; }
.report-facts dt { font-size: 11.5px; font-weight: 500; color: var(--t3); text-transform: uppercase; letter-spacing: .05em; }
.report-facts dd { margin: 1px 0 0; font-size: 14.5px; color: var(--t1); }
.report-overview-side { min-width: 0; padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--radius); background: #FCFCFB; }
/* Der Ueberblick fuellt den Bereich ohne Scrollen: die Zeile Foto/Verlauf
   bekommt den Rest der Hoehe, das Foto schrumpft notfalls, und nur ein langer
   Verlauf scrollt in sich. */
.form-layout.settings-layout .form-pane.report-pane-fit { display: flex; flex-direction: column; }
.report-pane-fit > .report-overview { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); }
.report-pane-fit .report-overview-main { max-height: 100%; }
.report-pane-fit .report-cover { flex: 0 1 auto; min-height: 120px; }
.report-pane-fit .report-facts { flex: none; }
.report-pane-fit .report-overview-side { max-height: 100%; display: flex; flex-direction: column; }
.report-pane-fit .report-sub { flex: none; }
.report-pane-fit .report-timeline { flex: 0 1 auto; min-height: 0; overflow-y: auto; }

.report-sub { font-size: 14px; font-weight: 600; color: var(--t1); margin: 0 0 10px; }
.report-none { color: var(--t3); font-size: 14px; }

/* Verlauf: senkrechte Linie mit Punkten; Arbeit in Orange. */
.report-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.report-timeline li { position: relative; display: flex; gap: 12px; align-items: baseline; padding-block: 5px; padding-inline: 22px 0; font-size: 13.5px; }
.report-timeline li::before {
    content: ""; position: absolute; inset-inline-start: 2px; top: 10px; width: 10px; height: 10px; border-radius: 50%;
    background: var(--white); border: 2px solid var(--t1); z-index: 1;
}
.report-timeline li:not(:last-child)::after {
    content: ""; position: absolute; inset-inline-start: 6px; top: 20px; bottom: -10px; width: 2px; background: var(--rule);
}
.report-timeline li.work::before { border-color: var(--accent-orange); background: var(--accent-orange); }
.report-timeline time { flex: 0 0 80px; color: var(--t3); font-variant-numeric: tabular-nums; font-size: 12.5px; }

/* ---------- Ausgefuehrte Arbeiten: ruhige Liste je Auftrag ---------- */
.report-group { margin-bottom: 20px; }
.report-group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.report-group-head a { font-weight: 600; color: var(--t1); }
.report-group-head span { color: var(--t3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.report-tasks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule2); }
.report-task { border-bottom: 1px solid var(--rule2); }
.report-task-head {
    width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 4px;
    border: 0; background: transparent; text-align: start; font: inherit; color: var(--t1);
}
button.report-task-head { cursor: pointer; border-radius: var(--radius-xs); }
button.report-task-head:hover { background: rgba(18, 62, 67, .035); }
.report-task-mark { font-size: 15px; width: 16px; text-align: center; color: var(--t3); }
.report-task.done .report-task-mark { color: var(--accent-orange); }
.report-task-title { flex: 1; min-width: 0; font-size: 14.5px; }
.report-task:not(.done) .report-task-title { color: var(--t2); }
.report-task-meta { color: var(--t3); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.report-task-meta i { font-size: 12px; margin-inline-end: 2px; }
/* Status und Chevron haben feste Breiten: "offen" steht in jeder Zeile gleich,
   ob ein Chevron folgt oder nicht (ohne Inhalt bleibt der Platz leer). */
.report-task-status { min-width: 72px; text-align: end; }
.report-task-caret { flex: none; width: 14px; font-size: 11px; color: var(--t3); text-align: center; transition: transform .15s ease; }
.report-task.open .report-task-caret { transform: rotate(180deg); }
.report-task-body { padding-block: 0 12px; padding-inline: 30px 4px; }
.report-note { margin: 0 0 8px; padding: 8px 12px; border-inline-start: 3px solid var(--accent-orange); background: #FAFAF8; border-radius: var(--radius-xs); color: var(--t1); font-size: 14px; }
.report-note small { display: block; margin-top: 3px; color: var(--t3); font-size: 12px; font-style: normal; }
.report-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.report-thumb { width: 108px; height: 81px; padding: 0; border: 0; border-radius: var(--radius-sm); overflow: hidden; cursor: zoom-in; background: var(--rule2); }
.report-thumb img, .report-photo-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Fotos: gross, nach Aufgabe gruppiert ---------- */
.report-photo-set { margin-bottom: 26px; }
.report-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.report-photo { margin: 0; }
.report-photo-img { width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; border-radius: var(--radius); overflow: hidden; cursor: zoom-in; background: var(--rule2); display: block; }
.report-photo figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--t2); }
.report-photo.hidden-photo .report-photo-img { opacity: .35; }
.report-photo.hidden-photo figcaption span { text-decoration: line-through; color: var(--t3); }
.report-photo-toggle { width: 28px; height: 28px; flex-shrink: 0; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--t2); cursor: pointer; display: grid; place-items: center; }
.report-photo-toggle:hover { background: var(--t1-soft); color: var(--t1); }
.report-photo.hidden-photo .report-photo-toggle { color: var(--accent-orange); }

/* ---------- Intern ---------- */
.report-internal-figures { margin: 0 0 20px; }
.report-check { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.report-check li { display: flex; align-items: center; gap: 9px; font-size: 14.5px; }
.report-check li.ok i { color: #2E8B57; }
.report-check li.warn i { color: #C77700; }

@media (max-width: 1100px) {
    .report-overview { grid-template-columns: 1fr; }
    /* Schmal stehen Foto und Verlauf untereinander - dann scrollt der Bereich wieder. */
    .form-layout.settings-layout .form-pane.report-pane-fit { display: block; }
    .report-pane-fit .report-overview-main, .report-pane-fit .report-overview-side { max-height: none; }
}
@media (max-width: 720px) {
    .report-facts { grid-template-columns: 1fr; }
    .report-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .report-task-body { padding-inline-start: 4px; }
    .report-head-actions { flex-wrap: wrap; }
}

/* Popup ueber einem Popup (#212), z. B. neuer Kunde aus dem Beleg heraus. */
.dlg-backdrop.dlg-stacked { z-index: 90; }
.dlg.dlg-stacked { z-index: 91; }

/* Positionen nur ueber Artikel (#212): Suche, Menge, Einheit, Hinzufuegen in einer Zeile. */
.artikel-picker { display: grid; grid-template-columns: minmax(0, 1fr) 72px auto auto; gap: 8px; align-items: center; }
.artikel-picker .rz-dropdown { width: 100%; }
.artikel-picker-qty { min-height: 40px; }
.artikel-picker-unit { color: var(--t3); font-size: 13.5px; min-width: 28px; }
.artikel-picker-item { display: flex; justify-content: space-between; gap: 12px; width: 100%; }
.artikel-picker-item small { color: var(--t3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos-desc { font-size: 14px; color: var(--t1); }
@media (max-width: 720px) {
    .artikel-picker { grid-template-columns: 1fr 80px; }
    .artikel-picker .btn { grid-column: 1 / -1; }
    .artikel-picker-unit { display: none; }
}

/* "Projekt erstellen" im Kopf der laufenden Projekte (#214) - Glut wie Heute und Summe. */
.zx-cta {
    height: 30px; display: inline-flex; align-items: center; gap: 6px; padding: 0 13px;
    border: 0; border-radius: 10px; cursor: pointer;
    font: 600 12.5px var(--font); color: var(--zx-ink);
    background: linear-gradient(135deg, var(--zx-glut), var(--zx-gold));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 18px -6px rgba(255, 122, 47, .8);
    transition: transform .15s ease, filter .15s ease;
}
.zx-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.zx-cta:active { transform: scale(.96); }

/* Helle Tafeln (#214): laufende Projekte und Catch Up in Weiss - dieselbe Form,
   dieselben Akzente, nur auf Tag statt Nacht. Die Variablen kippen, die Regeln
   oben bleiben dieselben. */
.zx-panel.zx-light {
    --zx-text: var(--t1);
    --zx-dim: var(--t2);
    --zx-faint: var(--t3);
    --zx-line: var(--rule2);
    --zx-glass: rgba(18, 62, 67, .04);
    --zx-glass-hi: rgba(18, 62, 67, .08);
    --zx-green: #0E9F6E;
    --zx-ink: #FFFFFF;
    color: var(--t1);
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(34, 211, 190, .07), transparent 55%),
        radial-gradient(90% 120% at 100% 110%, rgba(255, 122, 47, .07), transparent 60%),
        #FFFFFF;
    border: 1px solid var(--rule);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 24px 48px -30px rgba(18, 62, 67, .35);
}
.zx-panel.zx-light::before { opacity: .035; mix-blend-mode: multiply; }
.zx-light .zx-head h2, .zx-light .zx-proj-name { color: var(--t1); }
.zx-light .zx-proj:hover { background: rgba(18, 62, 67, .04); color: var(--t1); }
.zx-light .zx-bar-track { background: var(--rule2); }
.zx-light .zx-bar-fill { box-shadow: 0 0 10px rgba(14, 159, 110, .3); }
.zx-light .zx-value { text-shadow: 0 0 14px rgba(14, 159, 110, .22); }
.zx-light .zx-value.offer, .zx-light .zx-value small, .zx-light .zx-sum-label small { color: rgba(14, 159, 110, .75); }
.zx-light .zx-people .zx-more { background: var(--t1-soft); color: var(--t1); }
.zx-light .zx-sum { background: linear-gradient(180deg, transparent, rgba(14, 159, 110, .06)); }
.zx-light .zx-sum-value {
    background-image: linear-gradient(100deg, #12B886 0%, #0E9F6E 40%, #0F8F8A 70%, #12B886 100%);
    filter: drop-shadow(0 0 12px rgba(14, 159, 110, .25));
}
/* Laufende Projekte nur so hoch wie ihr Inhalt - ab vielen Projekten scrollt die Liste. */
.zx-running { align-self: start; max-height: 100%; }
.zx-chat .col-head h2 { white-space: nowrap; }

/* Viele Projekte an einem Tag (#214): die Zeilen teilen sich die feste Hoehe der
   Tafel und werden schmaler statt abgeschnitten - bis zum duennen Strich, dann
   steht der Name nur noch im Tooltip. Hoechstens so hoch wie bisher (21px). */
.zx-week-scroll { overflow: hidden; }
.zx-week-grid {
    height: 100%; row-gap: clamp(1px, calc(24px / var(--lanes)), 5px);
    grid-auto-rows: unset; grid-template-rows: repeat(var(--lanes), minmax(2px, 21px));
    align-content: start;
}
.zx-bar { container-type: size; min-height: 0; max-height: 21px; border-radius: clamp(2px, 30%, 9px); }
@container (max-height: 15px) {
    .zx-bar > * { display: none; }
}

/* ---------- Wochenwahl (WeekPicker) - Nacht-Glas wie die Tafel ---------- */
.zx-week { overflow: visible; z-index: 3; }
.zx-panel::before { border-radius: inherit; }
.wp { position: relative; }
.zx-icon.on { background: var(--zx-glass-hi); border-color: rgba(255, 122, 47, .5); color: #FFFFFF; }
.wp-backdrop { position: fixed; inset: 0; z-index: 40; }
.wp-pop {
    position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 41; width: 300px;
    padding: 12px; border-radius: 18px; color: #EAF4F2;
    background: linear-gradient(160deg, #164C52, #0B2629);
    border: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 24px 60px -18px rgba(4, 22, 25, .8), inset 0 1px 0 rgba(255, 255, 255, .08);
    animation: wp-in .18s cubic-bezier(.2, .8, .2, 1) both; transform-origin: top right;
}
@keyframes wp-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
.wp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.wp-head b { font: 600 14px var(--font); text-transform: capitalize; }
.wp-nav { width: 30px; height: 30px; border: 0; border-radius: 10px; background: transparent; color: rgba(234, 244, 242, .7); cursor: pointer; display: grid; place-items: center; }
.wp-nav:hover { background: rgba(255, 255, 255, .08); color: #FFFFFF; }
.wp-grid { display: grid; grid-template-columns: 26px repeat(7, 1fr); row-gap: 2px; }
.wp-wd { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: rgba(234, 244, 242, .4); text-align: center; padding-bottom: 4px; }
.wp-week {
    grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center;
    height: 32px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer;
    transition: background .12s ease;
}
.wp-week:hover { background: rgba(255, 255, 255, .07); }
.wp-week.on { background: linear-gradient(90deg, rgba(255, 122, 47, .9), rgba(255, 181, 71, .9)); color: #0A2225; box-shadow: 0 6px 18px -6px rgba(255, 122, 47, .8); }
.wp-kw { font: 500 10px 'Geist Mono', monospace; color: rgba(234, 244, 242, .35); text-align: center; }
.wp-week.on .wp-kw { color: rgba(10, 34, 37, .6); }
.wp-day { font: 500 12.5px 'Geist Mono', monospace; text-align: center; }
.wp-day.out { opacity: .35; }
.wp-day.today { color: #FFB547; font-weight: 700; }
.wp-week.on .wp-day.today { color: #0A2225; text-decoration: underline; text-underline-offset: 3px; }
.wp-week.now:not(.on) { box-shadow: inset 0 0 0 1px rgba(255, 122, 47, .35); }
.wp-foot { display: flex; justify-content: flex-end; margin-top: 10px; }

.pos-table input[inputmode="decimal"] { min-width: 52px; }

/* "Wirklich schließen?" im Popup (#218) */
.dlg-confirm { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(10, 34, 37, .34); border-radius: inherit; animation: dlg-fade .14s ease-out both; }
.dlg-confirm-card { background: var(--white); border-radius: 18px; padding: 22px 24px; width: min(420px, calc(100% - 32px)); box-shadow: var(--shadow-float); }
.dlg-confirm-card h3 { font-size: 17px; font-weight: 650; margin: 0 0 6px; }
.dlg-confirm-card p { color: var(--t3); margin: 0 0 18px; font-size: 14.5px; }
.dlg-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.preset-picker { max-width: 320px; }

/* ---------- Datumsfeld (DatePicker, #218) - Kalender wie die Wochenwahl ---------- */
.dpk { position: relative; }
.dpk-field { display: flex; align-items: center; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--white); min-height: 40px; }
.dpk-field:focus-within { border-color: var(--petrol, #123E43); box-shadow: 0 0 0 3px rgba(18, 62, 67, .12); }
.dpk-input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 12px; height: 38px; font: inherit; outline: none; letter-spacing: .02em; }
.dpk-btn { border: 0; background: transparent; color: var(--t3); width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; border-radius: inherit; }
.dpk-btn:hover { color: var(--petrol, #123E43); }
.dpk-backdrop { position: fixed; inset: 0; z-index: 1090; }
.dpk-pop.wp-pop { position: fixed; z-index: 1091; inset-inline-end: auto; transform-origin: top left; }
.dpk-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dpk-day { height: 34px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: 500 13px 'Geist Mono', monospace; cursor: pointer; transition: background .12s ease; }
.dpk-day:hover { background: rgba(255, 255, 255, .09); }
.dpk-day.out { opacity: .35; }
.dpk-day.today { color: #FFB547; font-weight: 700; }
.dpk-day.on { background: linear-gradient(90deg, rgba(255, 122, 47, .95), rgba(255, 181, 71, .95)); color: #0A2225; font-weight: 700; box-shadow: 0 6px 18px -6px rgba(255, 122, 47, .8); }
.dpk-foot { gap: 6px; }
.dpk-inline .dpk-field { min-height: 30px; border-radius: 9px; }
.dpk-inline .dpk-input { height: 28px; font-size: 13px; width: 96px; }
.dpk-inline .dpk-btn { width: 28px; height: 28px; }

/* Ein Popup in einer Tafel der Zentrale (Chat-Bildeditor): die Tafel ist per isolation ein
   eigener Stapel - ohne eigene Hoehe laege sie unter den Nachbartafeln, das Popup mit ihr (#218). */
.zx-panel:has(.dlg) { z-index: 60; overflow: visible; }

/* Laufende Projekte (#218): Angaben, die es gibt, dunkel - fehlende ("noch keine Aufgaben",
   kein Termin, kein Wert) deutlich blasser, damit man das Vorhandene im Vorbeigehen sieht. */
.zx-light .zx-proj-progress small:not(.zx-dim),
.zx-light .zx-proj-next small:not(.zx-dim) { color: var(--t2); }
.zx-light .zx-proj-next b { color: var(--t1); }
.zx-light .zx-dim, .zx-light .zx-value.none { color: #B7C1C3; font-weight: 400; }

/* Bearbeiten-Stift hinter dem Namen statt ganz rechts (#218); die Namensspalte ist breiter,
   Status schliesst rechts ab. */
.cell-name { max-width: none; min-width: 240px; width: 34%; }
.cell-name-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cell-name-line .cell-name-main { min-width: 0; }
.row-edit { flex-shrink: 0; width: 28px; height: 28px; padding: 0; display: inline-grid; place-items: center; font-size: 12px; }

/* Angebot-/Rechnungen-Reiter im Projekt (#218): Auswahl, Kopf und Summen stehen fest,
   nur die Positionen scrollen - kein Scrollbalken fuer die ganze Seite. */
.pd-tab-body:has(.pb-wrap) { overflow: hidden; }
.pb-wrap { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.pb-wrap > * { flex-shrink: 0; }
.pb-wrap > .pb-doc { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin-bottom: 0; }
.pb-doc > .pb-pos-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.pb-pos-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--white); }
.pb-doc > .form-totals { flex-shrink: 0; }

/* Adressvorschlaege (AddressInput, #218) */
.addr-wrap { position: relative; }
.addr-list { position: absolute; z-index: 30; inset-inline: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--white); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow-float); }
.addr-list li { display: flex; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.addr-list li i { color: var(--t3); }
.addr-list li small { color: var(--t3); margin-inline-start: 4px; }
.addr-list li:hover, .addr-list li.on { background: var(--t1-soft); }

/* Positionen-Unterseite: die Tabelle fuellt die Hoehe, die Eingabezeile sitzt ganz unten. */
.form-pane.pos-pane { display: flex; flex-direction: column; height: calc(90vh - 310px); min-height: 330px; }
.form-pane.pos-pane .pos-scroll { flex: 1 1 auto; min-height: 0; max-height: none; }

/* Position hinzufuegen: oranger Knopf rechts ueber der Tabelle, Suchfeld klappt darunter auf. */
.pos-toolbar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-bottom: 10px; flex: 0 0 auto; }
.pos-toolbar .preset-picker { width: 240px; }
.pos-add-wrap { position: relative; }
.pos-add-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border: 0; border-radius: 999px; font-weight: 600; font-size: 14.5px; cursor: pointer;
    background: linear-gradient(140deg, var(--glut), var(--gold)); color: var(--ink); box-shadow: 0 6px 16px -6px rgba(255, 122, 47, .75); transition: transform .12s, box-shadow .12s; }
.pos-add-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 9px 20px -6px rgba(255, 122, 47, .85); }
.pos-add-btn:disabled { opacity: .5; cursor: default; }
.pos-add-backdrop { position: fixed; inset: 0; z-index: 19; }
.pos-add-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: min(420px, calc(100vw - 64px)); background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 14px 36px rgba(10, 34, 37, .18); overflow: hidden; }
.pos-add-search { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--rule2); color: var(--t3); }
.pos-add-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--t1); }
.pos-entry-list { max-height: 300px; overflow: auto; padding: 4px; }
.pos-entry-option { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.pos-entry-option.on { background: var(--rule2); }
.pos-entry-option small { color: var(--t3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos-entry-option.action { color: var(--t2); }

/* ---------- "Neue Position"-Effekt (row-fx.js) ----------
   1. Die Zeile landet: faellt leicht von oben ein, mit einem Hauch Ueberschwung.
   2. Ein schraeger Lichtstreifen ("/") zieht durch - Petrol aussen, warmes Gold im Kern.
   3. Links waechst eine gluehende Kante (Glut -> Gold) und klingt aus.
   4. Der Netto-Betrag der Zeile blitzt golden auf.
   5. Der Gesamtbetrag zaehlt hoch, glueht, sprueht Funken, "+xx,xx €" schwebt nach oben. */
.row-fresh { position: relative; animation: row-land .55s cubic-bezier(.2, .9, .3, 1.25) both; }
/* Die Toenung auf die Zellen: Bootstrap malt jede Zelle selbst weiss und wuerde eine Zeilenfarbe verdecken. */
.row-fresh > td { animation: row-tint 1.8s ease-out both; }
.row-fresh:not(tr) { animation: row-land .55s cubic-bezier(.2, .9, .3, 1.25) both, row-tint 1.8s ease-out both; }
@keyframes row-land { from { opacity: 0; transform: translateY(-10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes row-tint { 0%, 25% { background-color: rgba(18, 62, 67, .06); } 100% { background-color: transparent; } }

.row-sweep { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; z-index: 0; }
.row-sweep::before {
    content: ""; position: absolute; top: -40%; bottom: -40%; left: 0; width: 38%;
    background: linear-gradient(90deg,
        transparent 0%, rgba(18, 62, 67, .07) 25%, rgba(255, 181, 71, .30) 46%,
        rgba(255, 255, 255, .85) 50%, rgba(255, 181, 71, .30) 54%, rgba(18, 62, 67, .07) 75%, transparent 100%);
    filter: blur(2px);
    transform: translateX(-120%) skewX(-24deg);
    animation: row-sweep 1.15s cubic-bezier(.45, .05, .25, 1) .18s both;
}
@keyframes row-sweep { to { transform: translateX(330%) skewX(-24deg); } }

.row-edge { position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; pointer-events: none;
    background: linear-gradient(180deg, var(--glut), var(--gold)); box-shadow: 0 0 10px rgba(255, 150, 60, .7);
    transform-origin: center; animation: row-edge 1.5s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes row-edge { 0% { transform: scaleY(0); opacity: 1; } 30% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

.cell-glint { animation: cell-glint 1.2s ease-out .35s both; }
@keyframes cell-glint { 0% { color: inherit; text-shadow: none; } 25% { color: #C2620F; text-shadow: 0 0 12px rgba(255, 181, 71, .8); } 100% { color: inherit; text-shadow: none; } }

.form-totals .gross b { display: inline-block; transition: color .3s; }
.total-glow { display: inline-block; animation: total-glow 1.2s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes total-glow {
    0% { transform: scale(1); text-shadow: none; }
    20% { transform: scale(1.14); color: #C2620F; text-shadow: 0 0 18px rgba(255, 181, 71, .9), 0 0 2px rgba(255, 122, 47, .6); }
    100% { transform: scale(1); text-shadow: none; }
}

.money-chip { position: fixed; z-index: 200; pointer-events: none; transform: translate(-50%, 0);
    padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap;
    color: var(--ink); background: linear-gradient(140deg, var(--glut), var(--gold)); box-shadow: 0 6px 16px -6px rgba(255, 122, 47, .8);
    animation: money-chip 1.5s cubic-bezier(.2, .8, .2, 1) .1s both; }
@keyframes money-chip {
    0% { opacity: 0; transform: translate(-50%, 6px) scale(.7); }
    18% { opacity: 1; transform: translate(-50%, -14px) scale(1.06); }
    70% { opacity: 1; transform: translate(-50%, -26px) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -42px) scale(.96); }
}

.money-spark { position: fixed; z-index: 199; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle, #fff 0 30%, var(--gold) 55%, rgba(255, 122, 47, 0) 72%);
    animation: money-spark .9s cubic-bezier(.15, .7, .3, 1) both; }
@keyframes money-spark {
    0% { opacity: 0; transform: translate(0, 0) scale(calc(var(--s) * 1.4)); }
    15% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0); }
}
@media (prefers-reduced-motion: reduce) { .row-fresh, .row-fresh > td, .row-fresh:not(tr), .cell-glint, .total-glow { animation: none; } }

/* Mein Postfach (#244): schmale Spalte, zwei schlichte Karten. */
.mailbox-page { max-width: 640px; display: flex; flex-direction: column; gap: 14px; }
.mailbox-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 20px; }
.mailbox-admin { background: transparent; border-style: dashed; }

/* Postfach-Suche (#246): baut auf der Notizen-Ansicht (.pn) auf. Feste Hoehe,
   damit Liste und Lesespalte je fuer sich scrollen - auf der Postfach-Seite und
   im Projekt-Reiter gleich. */
.mail-hint { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border: 1px dashed var(--rule); border-radius: var(--radius); color: var(--t2); }
.doc-tile .row-item.mail-mini { margin: 0 -8px; padding: 7px 8px; border-color: var(--rule2); flex-direction: column; gap: 2px; border-radius: 10px; cursor: pointer; }
.doc-tile .row-item.mail-mini:last-of-type { border-bottom: 0; }
.mail-mini-subject span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mail-mini-all { display: inline-block; margin-top: 6px; font-size: 13px; }

/* Erinnerungen auf Knopfdruck (#252): Tabelle im Popup. */
.reminder-table td { vertical-align: top; }
.reminder-table .form-control-sm { min-width: 200px; }
.reminder-table tr.reminder-done td { opacity: .6; }
.reminder-ok { color: var(--t2); white-space: nowrap; }
.reminder-fail { color: var(--t1); display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }

/* Aenderungsprotokoll (#291): Warnung bei geaenderter Bankverbindung ueber jeder Seite,
   Verlauf unten auf der Belegseite. */
.bank-alert { flex: 0 0 auto; margin-bottom: 16px; }
.doc-history { margin-top: 18px; padding: 12px 16px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); }
.doc-history > summary { cursor: pointer; font-weight: 500; color: var(--t1); }
.doc-history > summary .text-muted { margin-left: 6px; font-weight: 400; }
.doc-history-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.doc-history-list li { display: flex; flex-wrap: wrap; gap: 4px 12px; }
