/* Schriften: Lora 400/500/400i + Poppins 300/400/500 — nur diese sechs
   Schnitte, je latin + latin-ext, lokal als WOFF2 (DSGVO: keine
   Google-Fonts-CDN-Abrufe). Lizenz: SIL OFL 1.1, siehe fonts/OFL-*.txt */
@font-face {
  font-family: 'Lora';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/lora-400i-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lora';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/lora-400i-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/lora-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/lora-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/lora-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/lora-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/poppins-300-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/poppins-300-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/poppins-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/poppins-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/poppins-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/poppins-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Glomer VLB-Import — „Stille Buchkultur"
   Übernommen aus docs/design-transfer.md (Schwester-App tracking-engel), in
   der dort vorgegebenen Reihenfolge: Tokens -> Basis -> Layout -> Komponenten.
   Kein Bootstrap, kein Build-Schritt.

   Bewusste Abweichungen (dokumentiert, nicht versehentlich):
   - Modal: das Paket setzt <dialog> voraus. Unser Bestätigungsdialog ist ein
     versprechen-basierter <div> (Tippabfrage IMPORTIEREN). Die LOGIK bleibt
     unverändert; er bekommt hier nur die Optik des Pakets.
   - Nav: das Paket hat eine Seitenspalte mit senkrechter .nav. Übernommen.
   - Sticky-Gruppen-Header (Abschnitt 3.3) NICHT übernommen — wir haben keine
     gruppierten Listen. Das Paket rät ausdrücklich davon ab, Bausteine ohne
     Verwendung einzubauen.
   ========================================================================== */

/* ==========================================================================
   1. Design-Tokens (Abschnitt 1 — vollständig übernommen, auch was wir
      heute noch nicht brauchen: halbe Token-Sätze wachsen unkontrolliert nach)
   ========================================================================== */

:root {
  /* Farben — „Stille Buchkultur".
     Teal führt, Creme trägt, Gold akzentuiert.
     Ink ist die einzige Textfarbe, Coral die einzige Warnfarbe. */

  --teal:        #1D6B6B;
  --teal-dark:   #155050;
  --teal-light:  #D6E7E6;
  --teal-soft:   #E1F5EE;

  --cream:       #FDFBF7;
  --cream-warm:  #F9F5EA;
  --cream-dark:  #F4EEE3;

  --gold:        #B8A07A;
  --gold-dark:   #8A7A4A;
  --gold-soft:   #F2EBD9;

  --ink:         #2B2B2B;
  --ink-soft:    #5A5854;
  --ink-faint:   #8C8985;

  --line:        #E8E3D6;  /* EINZIGE Rahmenfarbe. Trennt statt Schatten. */

  --coral:       #993C1D;
  --coral-soft:  #F5C4B3;

  --backdrop:      rgb(43 43 43 / 30%);
  --backdrop-hard: rgb(43 43 43 / 40%);

  /* Schrift. Lora trägt Titel und alles, was nach Buch aussehen soll;
     Poppins trägt die Bedienoberfläche. */
  --font-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --font-sans:  'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:  ui-monospace, 'SFMono-Regular', 'Cascadia Mono', monospace;

  /* ACHTUNG: die Gewichte sind um eine Stufe verschoben. Poppins Light (300)
     ist die Grundschrift, nicht Regular. 400 als Normalgewicht ergäbe eine
     sichtbar schwerere, unruhigere Oberfläche. */
  --fw-normal:   300;
  --fw-medium:   400;
  --fw-semibold: 500;

  --fs-xs:   0.75rem;
  --fs-sm:   0.875rem;
  --fs-base: 1rem;
  --fs-lg:   1.125rem;
  --fs-xl:   1.25rem;

  --lh-tight: 1.35;
  --lh-base:  1.55;
  --ls-title: -0.015em;

  /* Abstände — 4-px-Raster */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-12: 3rem;

  /* Kein Token, sondern eine Regel: jedes anklickbare Element ist mindestens
     44x44 px. Die Quell-App läuft auf Tablets; am Desktop schadet es nicht. */
  --touch: 44px;

  /* Radien — --radius-md ist der Normalfall, alles andere die Ausnahme. */
  --radius-sm:   0.125rem;
  --radius:      0.25rem;
  --radius-md:   0.375rem;
  --radius-lg:   0.5rem;
  --radius-full: 9999px;

  /* Schatten — auf Ink getönt, nie auf Schwarz.
     Karten im Fluss haben KEINEN Schatten; getrennt wird mit --line.
     Schatten tragen ausschließlich Dinge, die über der Seite liegen. */
  --shadow-sm: 0 1px 2px rgb(43 43 43 / 6%);
  --shadow-md: 0 4px 24px rgb(43 43 43 / 18%);
  --shadow-lg: 0 10px 15px -3px rgb(43 43 43 / 10%),
               0 4px 6px -4px rgb(43 43 43 / 10%);
  --shadow-xl: 0 20px 25px -5px rgb(43 43 43 / 10%),
               0 8px 10px -6px rgb(43 43 43 / 10%);

  /* Z-Ebenen — die Leiter steht NUR hier. Wer eine neue Ebene braucht,
     trägt sie hier ein, nicht am Element. */
  --z-sticky:   30;
  --z-bulkbar:  40;
  --z-dialog:   50;
  --z-toast:    60;
  --z-blocking: 70;
  --z-progress: 80;

  /* Bewegung — sparsam. Farbwechsel ja, Verschieben nein. */
  --dur-fast: 120ms;
  --dur-base: 180ms;
  --ease:     cubic-bezier(0.2, 0, 0.2, 1);

  --app-header-h: 56px;
}

/* ==========================================================================
   2. Basis-Styles (Abschnitt 2)
   ========================================================================== */

/* --- 2.1 Grundgerüst und Typografie --- */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: var(--fw-normal);
  font-size: var(--fs-sm);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-title);
  color: var(--ink);
}
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-base); }

p { margin: 0 0 var(--sp-3); }
p:last-child { margin-bottom: 0; }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--gold-soft); color: var(--ink); }

/* ISBN und Zahlenkolonnen: nichtproportional, damit Zahlendreher auffallen. */
.mono { font-family: var(--font-mono); }
.serif { font-family: var(--font-serif); }

.text-soft  { color: var(--ink-soft); }
.text-faint { color: var(--ink-faint); }
.text-warn  { color: var(--coral); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- 2.2 Fokus: EIN Ring für alles Fokussierbare --- */

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: var(--radius);
}
:where(a, button, input, select, textarea):focus:not(:focus-visible) {
  outline: none;
}

/* --- 2.3 Knöpfe --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--touch);
  padding: 0 var(--sp-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn:hover { text-decoration: none; }

.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}
.btn:disabled:active { transform: none; }

.btn--primary {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--cream);
}
.btn--primary:hover:not(:disabled) { background: var(--teal-dark); border-color: var(--teal-dark); }

.btn--secondary {
  background: var(--cream-dark);
  border-color: var(--line);
  color: var(--ink);
}
.btn--secondary:hover:not(:disabled) { background: var(--gold-soft); }

.btn--outline {
  background: var(--cream);
  border-color: var(--line);
  color: var(--ink-soft);
}
.btn--outline:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }

.btn--ghost {
  background: transparent;
  color: var(--ink-soft);
}
.btn--ghost:hover:not(:disabled) { background: var(--cream-dark); color: var(--ink); }

.btn--danger {
  background: var(--coral);
  border-color: var(--coral);
  color: var(--cream);
}
.btn--danger:hover:not(:disabled) { filter: brightness(1.1); }

.btn--danger-quiet {
  background: transparent;
  color: var(--ink-soft);
}
.btn--danger-quiet:hover:not(:disabled) { color: var(--coral); }

.btn--block { width: 100%; }

.btn--icon {
  min-width: var(--touch);
  padding: 0;
  border-radius: var(--radius);
}
.btn--icon svg { width: 20px; height: 20px; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Kleiner Knopf für Zeilenaktionen. Bleibt optisch schlank, bleibt aber
   ein Touchziel: die Fläche ist niedriger, der Klickbereich nicht. */
.btn--sm {
  min-height: 34px;
  padding: 0 var(--sp-3);
  font-size: var(--fs-xs);
}

.segment {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--cream);
}
.segment > button {
  min-height: var(--touch);
  padding: 0 var(--sp-3);
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  cursor: pointer;
}
.segment > button:hover { color: var(--teal); }
.segment > button[aria-pressed='true'],
.segment > button[aria-selected='true'] {
  background: var(--teal);
  color: var(--cream);
}

/* --- 2.4 Formularfelder --- */

.field-row { display: flex; flex-direction: column; gap: var(--sp-1); }

.label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--ink-soft);
}

.field {
  width: 100%;
  min-height: var(--touch);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--cream);
  color: var(--ink);
  font-family: inherit;
  font-size: var(--fs-sm);
  transition: border-color var(--dur-fast) var(--ease);
}
.field::placeholder { color: var(--ink-faint); }
.field:hover:not(:disabled) { border-color: var(--gold); }
.field:focus { border-color: var(--teal); }
.field:disabled { background: var(--cream-warm); color: var(--ink-faint); cursor: not-allowed; }

textarea.field { min-height: 5rem; resize: vertical; line-height: var(--lh-base); }
select.field { appearance: none; padding-right: var(--sp-8); }

.field-icon { position: relative; }
.field-icon > svg {
  position: absolute; left: var(--sp-3); top: 50%;
  width: 16px; height: 16px;
  transform: translateY(-50%);
  color: var(--ink-faint);
  pointer-events: none;
}
.field-icon > .field { padding-left: calc(var(--sp-3) * 2 + 16px); }

.field[aria-invalid='true'] { border-color: var(--coral); }
.field-error {
  display: flex; align-items: center; gap: var(--sp-1);
  font-size: var(--fs-xs); color: var(--coral);
}
.field-hint { font-size: var(--fs-xs); color: var(--ink-faint); }

input[type='checkbox'], input[type='radio'] { accent-color: var(--teal); width: 18px; height: 18px; }

/* --- 2.5 Tabellen und Listenzeilen --- */

.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  padding: var(--sp-2) var(--sp-3);
  background: var(--cream-warm);
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: var(--fw-medium);
  color: var(--ink-soft);
  white-space: nowrap;
}

.table tbody td {
  padding: var(--sp-3);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table tbody tr:hover { background: var(--cream-warm); }
.table tbody tr:focus-visible { background: var(--cream-warm); outline-offset: -2px; }

.table .num { text-align: right; font-family: var(--font-mono); }
.table .center { text-align: center; }

/* Zeile in Ruhe (Statusfarbe statt Bootstrap-table-warning). */
.table tbody tr.row--warn td { background: var(--gold-soft); }
.table tbody tr.row--quiet td { color: var(--ink-faint); }

.row-actions {
  display: inline-flex;
  gap: var(--sp-1);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  tr:hover .row-actions,
  tr:focus-within .row-actions { opacity: 1; }
}
@media (hover: none), (pointer: coarse) {
  .row-actions { opacity: 1; }
}
.row-actions:focus-within { opacity: 1; }

.table-empty {
  padding: var(--sp-12);
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--ink-faint);
}

.table-footer {
  display: flex; flex-wrap: wrap; gap: var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  background: var(--cream-warm);
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs);
  color: var(--ink-soft);
}

/* --- 2.6 Merkzeichen (Badges) --- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0.125rem var(--sp-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: transparent;
  font-size: var(--fs-xs);
  line-height: 1.5;
  white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; }

.badge--warn   { border-color: var(--coral); background: var(--coral-soft); color: var(--coral); }
.badge--accent { border-color: var(--gold);  background: var(--gold-soft);  color: var(--gold-dark); }
.badge--info   { border-color: var(--teal);  color: var(--teal); }
.badge--quiet  { border-color: transparent;  background: var(--cream-warm); color: var(--ink-soft); }

/* Gefüllte Teal-Variante für „erledigt/importiert" — der einzige Zustand,
   der aktiv Erfolg meldet. */
.badge--done   { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }

.badge--dot { border-color: var(--dot, var(--ink-faint)); color: var(--dot, var(--ink-faint)); }
.badge--dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: var(--radius-full);
  background: var(--dot, var(--ink-faint));
}

button.badge { min-height: var(--touch); padding: 0 var(--sp-3); font-size: var(--fs-sm); cursor: pointer; }
button.badge:hover { border-color: var(--teal); color: var(--teal); }

/* --- 2.7 Karten und Container --- */

.card {
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--cream);
}
.card--inset { background: var(--cream-warm); }
.card--calm { padding: var(--sp-8); border-radius: var(--radius-lg); background: var(--cream-warm); }

.section { display: flex; flex-direction: column; gap: var(--sp-3); }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3);
}
.section-title { font-family: var(--font-serif); font-size: var(--fs-base); color: var(--ink); }

.stack-3 { display: flex; flex-direction: column; gap: var(--sp-3); }
.stack-5 { display: flex; flex-direction: column; gap: var(--sp-5); }
.row     { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.spacer  { margin-left: auto; }

/* Meldungsstreifen (ersetzt Bootstraps .alert). Rahmen statt Fläche, wie
   der Rest der Oberfläche: getrennt wird mit --line, nicht mit Tiefe. */
.note {
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--radius-md);
  background: var(--cream);
  font-size: var(--fs-sm);
}
.note--info  { border-left-color: var(--teal); background: var(--teal-soft); }
.note--warn  { border-left-color: var(--gold); background: var(--gold-soft); }
.note--error { border-left-color: var(--coral); background: var(--coral-soft); color: var(--coral); }
.note--done  { border-left-color: var(--teal); background: var(--teal-soft); }
.note code { font-family: var(--font-mono); font-size: var(--fs-xs); }

/* ==========================================================================
   3. Layout-Gerüst (Abschnitt 4)
   ========================================================================== */

.app { display: flex; min-height: 100vh; }

.sidebar {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 12rem;
  background: var(--cream-warm);
  border-right: 1px solid var(--line);
}
@media (min-width: 768px) { .sidebar { width: 14rem; } }

.sidebar__brand { padding: var(--sp-6) var(--sp-4) var(--sp-4); }
.sidebar__name  { font-family: var(--font-serif); font-size: var(--fs-xl); }
.sidebar__sub   { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); }
.sidebar__foot  { padding: var(--sp-3); border-top: 1px solid var(--line); }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 var(--sp-2); flex: 1; }
.nav a, .nav button {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: var(--touch);
  padding: var(--sp-2) var(--sp-3);
  border: 0; border-radius: var(--radius);
  background: transparent;
  font: inherit; font-size: var(--fs-sm);
  color: var(--ink-soft);
  text-align: left; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.nav a:hover, .nav button:hover { background: var(--cream-dark); color: var(--ink); text-decoration: none; }
.nav a[aria-current='page'] { background: var(--teal-soft); color: var(--teal); }
.nav svg { width: 16px; height: 16px; }

/* min-width: 0 ist keine Kosmetik: ohne die Zeile sprengt eine breite
   Tabelle das Raster, statt zu scrollen. */
.main { display: flex; flex-direction: column; flex: 1; min-width: 0; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3);
  height: 56px; flex-shrink: 0;
  padding: 0 var(--sp-4);
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}
.topbar__title { font-family: var(--font-serif); font-size: var(--fs-lg); }

.content { flex: 1; overflow-y: auto; }

/* Zwei Seitenformen, mehr braucht die Anwendung nicht. */
.page-work { display: flex; flex-direction: column; height: 100%; }
.page-work > .toolbar { flex-shrink: 0; padding: var(--sp-3) var(--sp-4); }
.page-work > .scrollbox { flex: 1; min-height: 0; }
.page-read { width: 100%; max-width: 64rem; margin: 0 auto; padding: var(--sp-4); }

/* Schmale Lesefläche: Login, kurze Formulare. */
.page-narrow { width: 100%; max-width: 30rem; margin: 0 auto; padding: var(--sp-4); }

/* Arbeitsfläche in voller Breite: breite Datentabellen (Review, Läufe).
   .page-read begrenzt bewusst die Zeilenlänge — für eine zehnspaltige Tabelle
   ist das die falsche Form, sie würde beschnitten. */
.page-wide { width: 100%; padding: var(--sp-4); }

/* Seitenspalte als Schublade auf schmalen Geräten. */
.sidebar__toggle { display: none; }
@media (max-width: 767px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: var(--z-dialog);
    transform: translateX(-100%);
    transition: transform var(--dur-base) var(--ease);
  }
  .sidebar[data-offen] { transform: none; box-shadow: var(--shadow-xl); }
  .sidebar__toggle { display: inline-flex; }
  .sidebar__scrim {
    position: fixed; inset: 0;
    z-index: calc(var(--z-dialog) - 1);
    background: var(--backdrop);
  }
}

@media print {
  .sidebar, .topbar, .bulkbar, .toast-host, .row-actions { display: none !important; }
  .content { overflow: visible; }
  body { background: #fff; }
}

/* ==========================================================================
   4. Komponenten (Abschnitt 3) — nur die, deren Funktion es bei uns gibt:
      Toast, Modal, Bottom-Bar. Der Sticky-Gruppen-Header (3.3) fehlt
      absichtlich: wir haben keine gruppierten Listen.
   ========================================================================== */

/* --- 3.1 Toast --- */

.toast-host {
  position: fixed;
  top: var(--sp-4);
  right: var(--sp-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-width: min(28rem, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--cream);
  box-shadow: var(--shadow-sm);
  font-size: var(--fs-sm);
  color: var(--ink);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
.toast[data-an] { opacity: 1; transform: none; }

.toast--success { border-color: var(--teal); }
.toast--error   { border-color: var(--coral); color: var(--coral); }
.toast--info    { border-color: var(--gold); }

.toast__text  { flex: 1; min-width: 0; }
.toast__close {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border: 0; border-radius: var(--radius);
  background: transparent;
  color: var(--ink-faint);
  font-size: 16px; line-height: 1;
  cursor: pointer;
}
.toast__close:hover { background: var(--cream-dark); color: var(--ink); }

/* --- 3.2 Modal ---
   Abweichung: das Paket nutzt <dialog> mit ::backdrop. Unser Dialog ist ein
   versprechen-basierter <div> (getippte IMPORTIEREN-Bestätigung) — die Logik
   bleibt unverändert, nur die Optik kommt aus dem Paket. Deshalb ein eigener
   Backdrop statt ::backdrop. */

.modal-backdrop {
  position: fixed; inset: 0;
  z-index: var(--z-dialog);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-4);
  background: var(--backdrop);
}

.modal {
  width: min(28rem, calc(100vw - 2rem));
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--cream);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3);
  min-height: 56px;
  padding: 0 var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.modal__title { font-family: var(--font-serif); font-size: var(--fs-lg); }
.modal__body  { padding: var(--sp-5); }
.modal__foot  {
  display: flex; justify-content: flex-end; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--line);
  background: var(--cream-warm);
}

/* ==========================================================================
   5. Kleine Ergänzungen dieser App (nicht aus dem Paket)
      Bewusst kurz gehalten: was hier steht, deckt Fälle ab, die es in der
      Quell-App nicht gibt (Cover-Vergleich der Review). Keine Utility-Sammlung
      nachbauen — das Paket arbeitet mit .row/.stack-*/.section.
   ========================================================================== */

/* Zweitrangige Zeile in Tabellen und Karten (Autor unter dem Titel, Metadaten). */
.small { font-size: var(--fs-xs); }

/* Formulare, die nebeneinander in einer Tabellenzelle stehen (Aktions-Knöpfe).
   Ohne Bootstrap ist <form> block-level und würde die Knöpfe umbrechen. */
.form-inline { display: inline-block; }

/* Cover-Vergleich VLB vs. Shop im UNSICHER-Fall. */
.cover-vergleich { display: flex; gap: var(--sp-3); margin: var(--sp-2) 0; }
.cover-thumb { text-align: center; margin: 0; }
.cover-thumb img,
.cover-leer {
  width: 60px; height: 90px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--cream);
  object-fit: contain;
}
.cover-leer {
  display: flex; align-items: center; justify-content: center;
  background: var(--cream-warm);
  color: var(--ink-faint);
  font-size: 0.65rem; line-height: 1.1; text-align: center;
}
.cover-thumb figcaption { margin-top: var(--sp-1); font-size: var(--fs-xs); color: var(--ink-soft); }

/* Eingerückter Vergleichsblock (Auflage/Produktform beider Kandidaten). */
.vergleich {
  margin-top: var(--sp-1);
  padding-left: var(--sp-2);
  border-left: 2px solid var(--line);
  font-size: var(--fs-xs);
}

/* --- 3.4 Bottom-Bar der Mehrfachauswahl --- */

.bulkbar {
  position: fixed;
  left: 50%;
  bottom: var(--sp-4);
  z-index: var(--z-bulkbar);
  transform: translate(-50%, calc(100% + var(--sp-8)));
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: min(44rem, calc(100vw - 2rem));
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--cream);
  box-shadow: var(--shadow-lg);
  transition: transform var(--dur-base) var(--ease), opacity var(--dur-base) var(--ease);
  opacity: 0;
}
.bulkbar[data-offen] { transform: translate(-50%, 0); opacity: 1; }
.bulkbar[hidden] { display: none; }

.bulkbar__count { font-weight: var(--fw-medium); white-space: nowrap; }
.bulkbar__actions { display: flex; gap: var(--sp-2); margin-left: auto; flex-wrap: wrap; }

/* Damit die Leiste nie die letzte Zeile verdeckt. */
.bulkbar-platz { height: calc(var(--touch) + var(--sp-8)); }

/* Ausgewählte Zeile: Teal-Kante links, keine Vollfläche. */
.table tbody tr[data-gewaehlt] { background: var(--teal-soft); }
.table tbody tr[data-gewaehlt] td:first-child { box-shadow: inset 3px 0 0 var(--teal); }
