:root {
  --ink: #000000;
  --accent: #d6ff2e;
  --accent-glow: rgba(214, 255, 46, 0.35);
  --neutral: #a6a6a6;
  --surface: #f4f4f4;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

/* ---------- App-Shell: Seitenleiste + Inhalt ---------- */
html, body { height: 100%; }
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--ink);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: relative;
}
.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), rgba(214, 255, 46, 0.15), var(--accent));
}
/* Zeigt die echte Logo-Datei ("lang"), gleiche Gestaltung wie das
   Original, aber als sauber zugeschnittene + hochwertig geglättete
   Export-Fassung (qlege-lang-crop.png) statt der rohen 1000x1000-Datei
   mit hartem Kantentreppchen-Effekt beim Vergrößern. */
.sidebar-brand {
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem 1.2rem;
}
.sidebar-logo {
  width: 172px;
  max-width: 100%;
  display: block;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.8rem;
}
.nav-item {
  display: flex;
  align-items: center;
  text-align: left;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.65rem 0.9rem;
  border-radius: 0.6rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.nav-item.active {
  background: var(--accent);
  color: var(--ink);
}

/* ---------- Inhaltsbereich ---------- */
/* .content selbst scrollt NICHT (das war die Ursache der Kopfzeilen-
   Überschneidung: ein sticky-Header mit negativen Rändern innerhalb
   eines scrollenden Elements). Stattdessen: .content ist eine Flex-
   Spalte, in der die Kopfzeile ein normaler, nicht schrumpfender
   Block ist und NUR .content-scroll darunter scrollt - der Header
   bleibt so garantiert an fester Höhe stehen, ohne Überlappungen. */
.content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.content-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.6rem 2.4rem 3rem;
  position: relative;
}
.view { display: none; }
.view.active { display: block; }

.view-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 1.2rem;
}
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.view-header .view-title { margin-bottom: 0; }
.view-header h2 { margin: 0; }

/* ---------- Dashboard-Kacheln ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.stat-card {
  background: #fff;
  border-radius: 1rem;
  padding: 1.3rem 1.4rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px -12px rgba(0, 0, 0, 0.12);
}
.stat-num {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 0.8rem;
  color: #666;
  font-weight: 600;
  margin-top: 0.15rem;
}

/* ---------- Tabellen ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.data-table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  font-weight: 700;
  padding: 0 0.6rem 0.6rem;
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.08);
}
.data-table td {
  padding: 0.75rem 0.6rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.data-table tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}
.data-table tbody tr:hover {
  background: var(--surface);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ---------- Einfache Listen (Ansprechpartner, Software-Historie) --- */
.plain-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.plain-list-item:last-child { border-bottom: none; }
.plain-list-item-clickable { cursor: pointer; }
.plain-list-item-clickable:hover { background: var(--surface); }
.plain-list-item .pli-main { font-weight: 700; font-size: 0.9rem; }
.plain-list-item .pli-meta { font-size: 0.8rem; color: #666; margin-top: 0.15rem; }
.plain-list-item .pli-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.pli-link {
  background: none;
  border: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-family: var(--font);
}

.btn-back {
  margin-bottom: 1.1rem;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.btn-danger {
  color: #b40004;
  border-color: rgba(230, 0, 5, 0.35);
}
.btn-danger:hover {
  background: #b40004;
  border-color: #b40004;
  color: #fff;
}
/* Modifikator für .btn-secondary: hebt statt der (roten) Gefahren-Aktion
   bewusst die sichere/unkritische Aktion hervor (z. B. "Abbrechen" im
   Bestätigen-Modal) - Markenfarbe statt Rot, damit nicht ausgerechnet der
   Löschen-Vorgang optisch belohnt wird. */
/* .btn-secondary.btn-accent (statt nur .btn-accent) für höhere Spezifität
   als .btn-secondary selbst, das weiter unten im Stylesheet steht und
   background/border sonst trotz gleicher Selektor-"Stärke" per
   Reihenfolge überschreiben würde. */
.btn-secondary.btn-accent {
  background: var(--accent);
  border-color: transparent;
  color: var(--ink);
}
.btn-secondary.btn-accent:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--accent);
}
.btn-inline {
  width: auto;
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
}

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 50;
}
.modal {
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  margin: 0;
  animation: rise 0.25s cubic-bezier(.2,.8,.2,1) both;
}
.modal-wide {
  max-width: 560px;
}
.modal-xwide {
  max-width: 760px;
}
.modal-full {
  max-width: 900px;
  width: 95vw;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.4rem;
}
/* Modifikator: alle Buttons gleich breit nebeneinander statt rechtsbündig
   in ihrer eigenen Textbreite (z. B. Angebot-Art-Auswahl mit 3 gleich-
   wertigen Optionen) - flex:1 macht justify-content ohnehin irrelevant,
   da kein Restplatz übrig bleibt. */
.modal-actions-even > button {
  flex: 1;
  min-width: 0;
  /* .btn-secondary erzwingt sonst white-space:nowrap - der Button-Text
     lief dadurch über den (per flex:1 auf 1/3 geschrumpften) Button
     hinaus statt sauber umzubrechen. */
  white-space: normal;
  line-height: 1.25;
}
.card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 1rem;
  padding: 1.3rem 1.5rem 1.5rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px -12px rgba(0, 0, 0, 0.12);
}
/* Die frühere Eintritts-Animation (card-in, mit nth-of-type-Staffelung
   bis zur 5. Karte) wurde entfernt: Chromium spielt CSS-Animationen bei
   einem display:none→block-Wechsel neu ab, und Ansichten wie die
   Kundenakte haben inzwischen deutlich mehr als 5 Karten - bei jedem
   Ansichtswechsel liefen dadurch viele Animationen gleichzeitig bzw.
   unsauber gestaffelt, was sich wie Ruckeln anfühlte. Karten erscheinen
   jetzt sofort, ohne Animation. */

.card h2 {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: -0.01em;
}
.card h2 .step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
  color: #222;
}
label .hint {
  font-weight: 400;
  color: #666;
}
input[type="text"],
input[type="date"],
input[type="time"],
input[type="email"],
input[type="number"],
select {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 0.7rem;
  border: 1.5px solid rgba(0, 0, 0, 0.14);
  border-radius: 0.55rem;
  font-size: 0.92rem;
  font-family: var(--font);
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

/* Kleine Inline-Auswahl direkt in einem Label (z. B. Textbaustein
   einfügen) - anders als normale <select>-Felder NICHT block/100% breit. */
.textbaustein-select {
  display: inline-block;
  width: auto;
  margin: 0 0 0.5rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #444;
}
/* Das native Kalender-/Uhr-Popup selbst ist vom Betriebssystem vorgegeben
   und lässt sich nicht per CSS anpassen - zumindest das Icon davor wird
   ans Design angeglichen (dezenter, mit Hover-Fläche wie andere Buttons). */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(0.35);
  border-radius: 0.3rem;
  padding: 0.2rem;
  margin-right: -0.15rem;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
  background: var(--surface);
}
input[type="color"] {
  display: block;
  width: 100%;
  height: 2.6rem;
  margin-top: 0.35rem;
  border: 1.5px solid rgba(0, 0, 0, 0.14);
  border-radius: 0.55rem;
  padding: 0.25rem;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="color"]:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.color-swatch-value {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hint {
  color: #666;
  font-size: 0.8rem;
  font-weight: 400;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

#logoPreview {
  display: none;
  max-width: 220px;
  max-height: 90px;
  margin-top: 0.6rem;
  background-color: #fafafa;
  border: 1.5px dashed rgba(0, 0, 0, 0.18);
  border-radius: 0.6rem;
  padding: 0.5rem;
}
#logoPreview.visible {
  display: block;
}

.template-row {
  margin-bottom: 0.4rem;
}
.template-save-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.template-save-row input {
  flex: 1;
}

.btn-primary,
.btn-secondary {
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.3rem;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  font-family: var(--font);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}
.btn-primary {
  background: var(--accent);
  color: var(--ink);
  width: 100%;
  padding: 1rem;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  box-shadow: 0 6px 20px -6px var(--accent-glow);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px -6px var(--accent-glow);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}
.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid rgba(0, 0, 0, 0.16);
  white-space: nowrap;
}
.btn-secondary:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

#progressLog {
  background: var(--ink);
  color: #d7ffb0;
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 0.78rem;
  padding: 0.9rem 1rem;
  border-radius: 0.6rem;
  max-height: 340px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}
#progressLog .ln-step { color: var(--accent); font-weight: 700; }
#progressLog .ln-error { color: #ff6a6a; font-weight: 700; }
#progressLog .ln-done { color: #baffb0; font-weight: 700; }
#progressLog .ln-log { color: #cfcfcf; }

#resultBox {
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: 0.6rem;
  font-size: 0.88rem;
  font-weight: 600;
}
#resultBox.success {
  background: #eaffcf;
  border: 1.5px solid var(--accent);
  color: #354a00;
}
#resultBox.error {
  background: #fdecec;
  border: 1.5px solid #e60005;
  color: #b40004;
}

.hidden {
  display: none;
}

/* ---------- Toast-Benachrichtigungen (ersetzt native alert()-Fenster) ---------- */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--ink);
  color: #fff;
  padding: 0.8rem 1.1rem;
  border-radius: 0.7rem;
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.45);
  max-width: 340px;
  animation: toast-in 0.25s cubic-bezier(.2,.8,.2,1) both;
  pointer-events: auto;
}
.toast.leaving {
  animation: toast-out 0.2s ease both;
}
.toast::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent);
}
.toast.error::before {
  background: #ff6a6a;
}
.toast.error {
  background: #2a0000;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(8px); }
}

/* ---------- Kopfzeile: Personalakte/Firmendaten/Meine Termine + Profil ---------- */
/* Bewusst NICHT in der linken Seitenleiste (die bleibt den eigentlichen
   Generator-Funktionen Dashboard/Rohsoftwaren/Kunden vorbehalten) - eine
   eigene Kopfzeile für die persönlichen/Firmen-Verwaltungsbereiche. */
.topheader {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.9rem 2.4rem;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  position: relative;
  z-index: 30;
}
.topheader-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Generisches Ausklapp-Menü (Mein Bereich, Firmenverwaltung) - ein
   Auslöser-Button + ein darunter erscheinendes Panel mit Links, die
   switchView(...) aufrufen und das Menü dabei schließen. */
.dropdown {
  position: relative;
}
/* Feste Höhe für BEIDE Auslöser-Varianten (Text-only "Firmenverwaltung"
   und Avatar+Text "Mein Bereich") - ohne das würde der Avatar-Kreis den
   Button sichtbar größer machen als den reinen Text-Button daneben. */
.dropdown-trigger {
  height: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  padding: 0 1rem;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  transition: border-color 0.12s, background 0.12s;
  box-sizing: border-box;
}
.dropdown-trigger:hover {
  border-color: var(--ink);
}
.dropdown-trigger.profile-chip {
  padding: 0 1rem 0 0.35rem;
}
.profile-avatar {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dropdown-panel {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 1rem;
  padding: 0.6rem;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.35);
  z-index: 40;
  text-align: left;
}
.dropdown-panel hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin: 0.4rem 0.4rem;
}
.dropdown-panel-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 0.6rem;
  padding: 0.6rem 0.7rem;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.dropdown-panel-item:hover {
  background: var(--surface);
}
.dropdown-panel-item.danger {
  color: #b40004;
}
.dropdown-panel-item.danger:hover {
  background: #fdecec;
}

/* ---------- Unter-Reiter (z. B. Mitarbeiter-Detail) ---------- */
.subtab-nav {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.subtab-item {
  background: #fff;
  border: 1.5px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  color: #444;
}
.subtab-item:hover {
  border-color: var(--ink);
}
.subtab-item.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--accent);
}
.subtab-panel {
  display: none;
}
.subtab-panel.active {
  display: block;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  margin-bottom: 0.7rem;
}
.checkbox-label input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--ink);
}

/* ---------- Mein Profil: Profilbild ---------- */
.profile-photo-row {
  display: flex;
  align-items: center;
  gap: 1.3rem;
}
.profile-photo-preview {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  flex-shrink: 0;
  overflow: hidden;
}
.profile-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Kalender (Monatsraster) ---------- */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.calendar-header .btn-secondary {
  padding: 0.4rem 0.8rem;
}
.calendar-title {
  font-weight: 800;
  font-size: 1rem;
}
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.3rem;
  margin-bottom: 0.3rem;
}
.calendar-weekdays span {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.3rem;
}
.calendar-day {
  aspect-ratio: 1;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.6rem;
  padding: 0.35rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  background: #fff;
  transition: border-color 0.12s, background 0.12s;
  position: relative;
}
.calendar-day:hover {
  border-color: var(--ink);
}
.calendar-day.outside {
  color: #ccc;
  background: var(--surface);
}
.calendar-day.today {
  border-color: var(--ink);
  border-width: 2px;
}
.calendar-day.selected {
  background: var(--ink);
  color: var(--accent);
}
.calendar-day-dot {
  position: absolute;
  bottom: 0.35rem;
  right: 0.35rem;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.55;
}
.calendar-day.selected .calendar-day-dot {
  background: var(--accent);
  opacity: 1;
}
.calendar-day-stunden {
  position: absolute;
  bottom: 0.35rem;
  left: 0.35rem;
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--ink);
  opacity: 0.6;
}
.calendar-day.selected .calendar-day-stunden {
  color: var(--accent);
  opacity: 1;
}

/* ---------- Kalender: Monatsansicht mit farbigen Termin-Chips je Tag
   (statt nur einem Punkt) - nur die Haupt-Kalenderansicht wird höher,
   Mini-Kalender/Stundenzettel-Monatsraster bleiben unverändert quadratisch. ---------- */
#calGrid .calendar-day {
  aspect-ratio: unset;
  min-height: 5.6rem;
  align-items: stretch;
}
.calendar-day-num {
  font-weight: 800;
}
.calendar-day-termine {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  width: 100%;
  margin-top: 0.2rem;
  overflow: hidden;
}
.calendar-day-termin-chip {
  font-size: 0.52rem;
  font-weight: 700;
  color: #fff;
  padding: 0.05rem 0.3rem;
  border-radius: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}
.calendar-day-termin-mehr {
  font-size: 0.5rem;
  font-weight: 700;
  color: #888;
  padding-left: 0.2rem;
}
.calendar-day.selected .calendar-day-termin-mehr {
  color: var(--accent);
}

/* ---------- Stundenzettel: Wochenstreifen (7 Tage in einer Reihe) ---------- */
.sz-week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.sz-week-strip .calendar-day {
  aspect-ratio: unset;
  height: 4.4rem;
}
.sz-week-strip .calendar-day-weekday {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #999;
}
.calendar-day.selected .calendar-day-weekday {
  color: var(--accent);
  opacity: 0.85;
}

/* ---------- Checkbox-Liste (Mehrfachauswahl: Anlagen, Mitglieder, Unterschriften) ---------- */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-height: 220px;
  overflow-y: auto;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.6rem;
  padding: 0.5rem;
}
.checkbox-list-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.4rem;
  border-radius: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.checkbox-list-item:hover {
  background: var(--surface);
}
.checkbox-list-item input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.checkbox-list-empty {
  font-size: 0.82rem;
  color: #888;
  padding: 0.3rem 0.4rem;
}

/* ---------- Anlagen-Picker (Angebot): durchsuchbare Liste + umsortierbare
   Auswahl darunter (Reihenfolge bestimmt später das Inhaltsverzeichnis) ---------- */
.anlagen-schnellauswahl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.anlagen-schnellauswahl-chip {
  border: 1.5px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  background: #fff;
  color: #444;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}
.anlagen-schnellauswahl-chip:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--accent);
}
.anlagen-suche {
  width: 100%;
  margin-bottom: 0.5rem;
}
.anlagen-reihenfolge-hint {
  margin: 0.7rem 0 0.35rem;
}
.anlagen-reihenfolge-liste {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.anlagen-reihenfolge-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.5rem;
  background: var(--surface);
}
.anlagen-reihenfolge-nr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}
.anlagen-reihenfolge-titel {
  flex: 1;
  font-size: 0.83rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.anlagen-reihenfolge-item button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.15rem 0.4rem;
  border-radius: 0.35rem;
  color: #555;
}
.anlagen-reihenfolge-item button:hover:not(:disabled) {
  background: #fff;
}
.anlagen-reihenfolge-item button:disabled {
  opacity: 0.25;
  cursor: default;
}

/* ---------- Bild-Editor (Geschäftsbrief: Bilder auf Briefentwurf platzieren) ---------- */
.bild-editor {
  position: relative;
  width: 100%;
  aspect-ratio: 210 / 297;
  max-height: 620px;
  margin: 0 auto;
  background: #fff;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 0.4rem;
  overflow: hidden;
}
/* Eigenes großes Bild-Editor-Fenster (statt in die Brieferstellung
   gequetscht) - deutlich mehr Platz, damit sich Bilder präzise
   positionieren/zuschneiden lassen, ohne beim Druck "komprimiert" zu wirken.
   WICHTIG: von der Höhe her (nicht wie die Basisklasse von der Breite her)
   begrenzt - sonst kappt max-height nur die Höhe, während width:100% aus
   der Basisklasse bestehen bleibt und das A4-Seitenverhältnis dadurch
   verzerrt (zu breit/zu flach statt Hochformat). */
.bild-editor-gross {
  width: auto;
  height: 78vh;
  max-height: 78vh;
  max-width: 100%;
}
.bild-editor-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #aaa;
}
/* Live-Vorschau des Briefentwurfs im Hintergrund (grobe Näherung an das
   PDF-Layout: schwarzer Kopfbalken + Betreff/Text), damit Bilder relativ
   zum tatsächlichen Inhalt positioniert werden können statt auf weißem
   Grund "blind" verschoben zu werden. */
.bild-editor-preview {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  background: #fff;
  font-family: var(--font);
}
.bild-editor-preview .bep-kopf {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 11%;
  background: var(--ink);
}
.bild-editor-preview .bep-kopf-details {
  position: absolute;
  top: 1.8%;
  right: 3%;
  text-align: right;
  color: #fff;
}
.bild-editor-preview .bep-firmenname {
  color: var(--accent);
  font-size: 0.56rem;
  font-weight: 800;
  line-height: 1.5;
}
.bild-editor-preview .bep-kopf-zeile {
  font-size: 0.42rem;
  line-height: 1.5;
  opacity: 0.85;
}
.bild-editor-preview .bep-absender {
  position: absolute;
  top: 15.5%;
  left: 6%;
  right: 6%;
  font-size: 0.36rem;
  color: #999;
  border-bottom: 0.5px solid #ddd;
  padding-bottom: 0.3em;
}
.bild-editor-preview .bep-adresse {
  position: absolute;
  top: 19%;
  left: 6%;
  right: 55%;
  font-size: 0.48rem;
  line-height: 1.5;
  color: #000;
}
.bild-editor-preview .bep-adresse .bep-adresse-platzhalter {
  color: #bbb;
  font-style: italic;
}
.bild-editor-preview .bep-datum {
  position: absolute;
  top: 26.5%;
  right: 6%;
  font-size: 0.44rem;
  color: #333;
}
.bild-editor-preview .bep-inhalt {
  position: absolute;
  top: 34%;
  left: 6%;
  right: 6%;
  bottom: 15%;
  overflow: hidden;
  font-size: 0.48rem;
  line-height: 1.45;
  color: #333;
  white-space: pre-wrap;
}
.bild-editor-preview .bep-betreff {
  font-weight: 800;
  margin-bottom: 0.6em;
  color: #000;
}
.bild-editor-preview .bep-fuss {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 4%;
  height: 9%;
  border-top: 0.5px solid #ddd;
  display: flex;
  justify-content: space-between;
  padding-top: 0.4em;
  font-size: 0.34rem;
  line-height: 1.5;
  color: #bbb;
}
.bild-editor-bilder {
  position: absolute;
  inset: 0;
}
.bild-editor-bild {
  position: absolute;
  cursor: move;
  border: 1.5px dashed transparent;
}
.bild-editor-bild img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: none;
}
.bild-editor-bild:hover,
.bild-editor-bild.active {
  border-color: var(--ink);
}
.bild-editor-bild.zuschneiden-aktiv {
  border-style: solid;
  border-color: var(--accent);
}
.bild-editor-zuschneiden {
  position: absolute;
  left: 2px;
  bottom: -22px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  padding: 0.1rem 0.35rem;
  border-radius: 0.3rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  white-space: nowrap;
}
.bild-editor-zuschneiden input {
  width: 0.8rem;
  height: 0.8rem;
  margin: 0;
}
.bild-editor-bild .bild-editor-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  cursor: nwse-resize;
}
.bild-editor-bild .bild-editor-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--danger, #b40004);
  color: #fff;
  font-size: 0.65rem;
  line-height: 16px;
  text-align: center;
  cursor: pointer;
}

/* ---------- Kundenstatus ---------- */
.kunde-status-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}
.status-picker {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.status-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1.5px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  padding: 0.35rem 0.8rem 0.35rem 0.55rem;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  color: #555;
  cursor: pointer;
}
.status-option:hover {
  border-color: var(--ink);
}
.status-option.active {
  border-color: var(--ink);
  background: var(--surface);
  color: var(--ink);
}
.status-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.status-normal { background: #1a9c3d; }
.status-priorisiert { background: #000000; }
.status-gesperrt { background: #e60005; }
.status-grenzfall { background: #e6b800; }

/* ---------- Segmentierte Auswahl (Rechnungstyp, Dienstleistungstyp) ---------- */
.segmented {
  display: flex;
  border: 1.5px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  padding: 0.2rem;
  margin-bottom: 1rem;
  gap: 0.2rem;
}
.segmented-option {
  flex: 1;
  min-width: 0;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  color: #666;
  cursor: pointer;
}
.segmented-option.active {
  background: var(--ink);
  color: var(--accent);
}

/* ---------- Bild-Editor: Seiten-Streifen (1 Reiter pro tatsächlicher
   Brief-Seite, auch bei 20+ Seiten - deshalb horizontal scrollbar statt
   gleich breit über die volle Breite verteilt wie .segmented) ---------- */
.bild-editor-seiten-strip {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.15rem 0.15rem 0.7rem;
  margin-bottom: 0.2rem;
}
.bild-editor-seite-btn {
  position: relative;
  flex: 0 0 auto;
  min-width: 3rem;
  padding: 0.45rem 0.8rem;
  border: 1.5px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  background: #fff;
  color: #666;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.bild-editor-seite-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--accent);
}
.bild-editor-seite-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid #fff;
}

/* ---------- Rechnungspositionen im Rechnung-erstellen-Formular ---------- */
.re-positionen-list {
  margin-bottom: 0.6rem;
}
.re-position-row {
  display: grid;
  grid-template-columns: 1fr 90px 110px 90px auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.85rem;
}
.re-position-row input {
  margin-top: 0;
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
}
.re-position-zeilensumme {
  font-weight: 700;
  text-align: right;
}
.re-summen {
  background: var(--surface);
  border-radius: 0.7rem;
  padding: 0.9rem 1.1rem;
  margin: 0.4rem 0 1.1rem;
  font-size: 0.88rem;
}
.re-summen-row {
  display: flex;
  justify-content: space-between;
  padding: 0.15rem 0;
}
.re-summen-row.total {
  font-weight: 800;
  font-size: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin-top: 0.4rem;
  padding-top: 0.5rem;
}

/* ---------- Angebot (ausführlich): Teile-Builder ---------- */
.ang-teil-card {
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.7rem;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}
.ang-teil-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}
.ang-teil-titel {
  flex: 1;
  font-weight: 800;
  border: none;
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 0;
  padding: 0.3rem 0.1rem;
}
.ang-teil-add-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.ang-teil-add-row select {
  flex: 1;
}
.ang-rechnung-teil-gruppe {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding-bottom: 0.3rem;
  margin-bottom: 0.3rem;
}

/* ---------- Software: Name-Karten mit Versionen + Logbuch ---------- */
.software-block {
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.7rem;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}
.software-block h3 {
  margin: 0;
  font-size: 0.95rem;
}
.software-logbuch {
  margin-top: 0.6rem;
}
.software-logbuch summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: #666;
}
.software-logbuch .logbuch-form {
  margin-top: 0.5rem;
}

/* ---------- Rechnungen: Status/Fälligkeit ---------- */
.pli-item-overdue .pli-main {
  color: #b40004;
}
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.badge-overdue {
  background: #fdecec;
  color: #b40004;
}
.badge-paid {
  background: #eaffcf;
  color: #354a00;
}
.badge-warn {
  background: #fff6d9;
  color: #7a5b00;
}
.sub-heading {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #888;
  margin: 1.1rem 0 0.4rem;
}
.sub-heading:first-of-type {
  margin-top: 0.2rem;
}

/* ---------- Kategorien-Liste (Kalender) & Farbpunkte in Terminen ---------- */
.kategorie-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.4rem;
  flex-shrink: 0;
}

/* ---------- Checkbox-Raster (weitere Teilnehmer bei Gruppentermin) ---------- */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.3rem 1rem;
  margin-bottom: 1rem;
}
.checkbox-grid .checkbox-label {
  margin-bottom: 0.3rem;
  font-weight: 500;
  font-size: 0.85rem;
}

/* ---------- Textarea (Auftragsbeschreibung, Brief, Kategorien-Notizen) ---------- */
textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 0.7rem;
  border: 1.5px solid rgba(0, 0, 0, 0.14);
  border-radius: 0.55rem;
  font-size: 0.92rem;
  font-family: var(--font);
  background: #fff;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
#auftragBeschreibungForm textarea,
#logbuchForm input,
#briefForm textarea,
#leistungsbeschreibungForm textarea {
  margin-bottom: 0.8rem;
}
.logbuch-form {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.logbuch-form input {
  flex: 1;
  margin-top: 0;
}

/* ---------- Zeiterfassungs-Widget (Kopfzeile) ---------- */
.zeit-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: #ccc;
  flex-shrink: 0;
}
.zeit-dot.zeit-aktiv {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
#zeiterfassungPanel {
  min-width: 260px;
}
#zeiterfassungPanel label {
  margin-bottom: 0.8rem;
}
#zeiterfassungPanel .btn-primary,
#zeiterfassungPanel .btn-secondary {
  width: 100%;
}

/* ---------- Aufträge: Filterzeile, Status-Badges, Kopfbereich ---------- */
.auftraege-filter-row {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}
.auftraege-filter-row input[type="text"] {
  flex: 1;
  margin-top: 0;
}
.auftraege-filter-row select {
  width: auto;
  min-width: 200px;
  margin-top: 0;
}
.auftrag-status-ausstehend { background: var(--surface); color: #555; }
.auftrag-status-in_bearbeitung_normal { background: #e6f0ff; color: #1a4fa0; }
.auftrag-status-in_bearbeitung_dringend { background: #fdecec; color: #b40004; }
.auftrag-status-warte_auf_zahlung { background: #fff6d9; color: #8a6300; }
.auftrag-status-abgeschlossen { background: #eaffcf; color: #354a00; }

.auftrag-kopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.3rem;
}
.auftrag-kopf-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.auftrag-kopf-actions select {
  width: auto;
  margin-top: 0;
}
.auftrag-art-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}
.auftrag-art-row .segmented {
  margin-bottom: 0;
}

/* ---------- Bankverbindungen (dynamische Liste, + Bank hinzufügen) ---------- */
.bank-row {
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.7rem;
  padding: 0.8rem 0.9rem 0.2rem;
  margin-bottom: 0.7rem;
  position: relative;
}
.bank-row .bank-remove {
  margin: 0.2rem 0 0.6rem;
}

/* ---------- Pagination (abgeschlossene Aufträge) ---------- */
.pagination {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}
.page-btn {
  background: #fff;
  border: 1.5px solid rgba(0, 0, 0, 0.14);
  border-radius: 0.5rem;
  padding: 0.35rem 0.7rem;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  color: #444;
}
.page-btn:hover {
  border-color: var(--ink);
}
.page-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--accent);
}

/* ---------- Feste Farbpalette (Termin-Kategorien) ---------- */
.farb-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.4rem 0 1rem;
}
.farb-swatch {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  padding: 0;
}
.farb-swatch.active {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px #fff inset;
}

/* ---------- Mein Profil: Unterschrift ---------- */
.signature-preview {
  width: 140px;
  height: 76px;
  border-radius: 0.7rem;
  background: var(--surface);
  border: 1.5px dashed rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  padding: 0.4rem;
}
.signature-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ---------- Kalender: echter Tages-Zeitstrahl ---------- */
.day-timeline {
  margin: 1rem 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.7rem;
  overflow: hidden;
}
.timeline-ganztags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.6rem 0.7rem;
  background: var(--surface);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.timeline-ganztags-chip {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.timeline-wrap {
  position: relative;
  overflow-y: auto;
  max-height: 420px;
}
.timeline-rows {
  position: relative;
}
.timeline-row {
  height: 32px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
  position: relative;
}
.timeline-hour {
  position: absolute;
  left: 0.5rem;
  top: -0.5rem;
  font-size: 0.68rem;
  color: #999;
  font-weight: 700;
  background: #fff;
  padding-right: 0.3rem;
}
.timeline-events {
  position: absolute;
  top: 0;
  left: 4.2rem;
  right: 0.5rem;
}
.timeline-event {
  position: absolute;
  left: 0;
  right: 0;
  border-radius: 0.4rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.timeline-event strong {
  font-weight: 800;
  margin-right: 0.3rem;
}

/* ---------- Postfach ---------- */
.postfach-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1rem;
  align-items: start;
}
.postfach-liste {
  padding: 0.5rem !important;
  max-height: 70vh;
  overflow-y: auto;
}
.postfach-nachricht-row {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 0.7rem;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.postfach-nachricht-row:hover { background: rgba(0, 0, 0, 0.03); }
.postfach-nachricht-row.aktiv { background: var(--ink); }
.postfach-nachricht-row.aktiv * { color: #fff !important; }
.postfach-nachricht-row.ungelesen .pn-von,
.postfach-nachricht-row.ungelesen .pn-betreff { font-weight: 800; }
.pn-von {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--ink);
  margin-bottom: 0.15rem;
}
.pn-datum { color: #888; font-weight: 600; font-size: 0.72rem; white-space: nowrap; }
.pn-betreff { font-size: 0.85rem; margin-bottom: 0.1rem; }
.pn-vorschau { font-size: 0.78rem; color: #888; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.postfach-lesepane {
  min-height: 300px;
  max-height: 70vh;
  overflow-y: auto;
}
.postfach-lesepane .pl-betreff {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 0.4rem;
}
.postfach-lesepane .pl-meta {
  font-size: 0.82rem;
  color: #666;
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.postfach-lesepane .pl-body {
  white-space: pre-wrap;
  font-size: 0.92rem;
  line-height: 1.55;
}
.postfach-lesepane .pl-actions {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  gap: 0.6rem;
}
@media (max-width: 900px) {
  .postfach-layout { grid-template-columns: 1fr; }
}
