/* ==========================================================================
   LSH Portal v4 — Zusammengefuehrtes Stylesheet (portal.css)
   Alle CSS-Module in einer Datei — kein @import, kein Cache-Problem.
   Reihenfolge: Variables > Reset > Layout > Components > Utilities >
                Responsive > Pages (Home, Contacts, Notices, Forms,
                Documents, Mealplan, Gallery)
   Generiert: 2026-04-06 | Update: 2026-04-12 (elegant redesign)
   ========================================================================== */

/* ==========================================================================
   0. FONTS — Lokal gehostet (DSGVO-konform)
   ========================================================================== */

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/assets/fonts/cormorant-garamond-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: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/assets/fonts/cormorant-garamond-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: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 300 400;
  font-display: swap;
  src: url('/assets/fonts/cormorant-garamond-latin-ext-italic.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: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 300 400;
  font-display: swap;
  src: url('/assets/fonts/cormorant-garamond-latin-italic.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: 'Outfit';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/assets/fonts/outfit-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: 'Outfit';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/assets/fonts/outfit-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;
}


/* ==========================================================================
   1. VARIABLES — CSS Custom Properties
   ========================================================================== */

:root {
  /* --- Farben (ISL Design v4.3) --- */
  --navy:   #0f2248;
  --navy2:  #1a3a72;
  --blue:   #2a5298;
  --acc:    #c9a24a;
  --line:   #d0cbbf;
  --bg:     #faf8f2;
  --white:  #fff;
  --text:   #1a2240;
  --muted:  #3d4d6a;  /* war: #4a5a80 → besserer Kontrast */
  --ink:    #080e1e;
  --ivory:  #faf8f2;
  --ivory2: #f2efe6;
  --parchment: #e8e2d4;

  /* Status-Farben */
  --ok:     #059669;
  --warn:   #d97706;
  --danger: #dc2626;

  /* Hintergrund-Varianten (halbtransparent) */
  --ok-bg:     rgba(5, 150, 105, 0.1);
  --warn-bg:   rgba(217, 119, 6, 0.1);
  --danger-bg: rgba(220, 38, 38, 0.1);
  --acc-bg:    rgba(201, 162, 74, 0.12);

  /* --- Border Radius --- */
  --r:    8px;
  --r-sm: 4px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 9999px;

  /* --- Spacing --- */
  --sp-xs:  4px;
  --sp-sm:  8px;
  --sp-md:  16px;
  --sp-lg:  24px;
  --sp-xl:  32px;
  --sp-2xl: 48px;

  /* --- Schatten (ISL — bläulich-warm) --- */
  --shadow-sm: 0 1px 3px rgba(15, 34, 72, .08);
  --shadow-md: 0 4px 12px rgba(15, 34, 72, .10);
  --shadow-lg: 0 8px 24px rgba(15, 34, 72, .15);

  /* --- Gold-Akzent --- */
  --gold:    #c9a24a;
  --gold-lt: #e8c97a;
  --gold-dk: #a07830;

  /* --- Typografie --- */
  --font:       'Outfit', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-mono:  "Consolas", "Monaco", monospace;

  /* Schriftgroessen */
  --fs-xs:  0.8125rem; /* 13px  (war: 12px) */
  --fs-sm:  0.875rem;  /* 14px  (war: 13px) */
  --fs-md:  0.9375rem; /* 15px  (war: 14px) */
  --fs-base: 1rem;     /* 16px */
  --fs-lg:  1.125rem;  /* 18px */
  --fs-xl:  1.25rem;   /* 20px */
  --fs-2xl: 1.5rem;    /* 24px */
  --fs-3xl: 1.875rem;  /* 30px */

  /* --- Transitions --- */
  --trans:      200ms ease;
  --trans-fast: 120ms ease;
  --trans-slow: 300ms ease;

  /* --- Z-Index Skala --- */
  --z-base:    1;
  --z-dropdown: 100;
  --z-sticky:  200;
  --z-modal:   500;
  --z-toast:   600;
  --z-tooltip: 700;

  /* --- Layout --- */
  --header-h: 64px;
  --nav-h:    48px;
  --max-w:    1200px;
  --sidebar-w: 280px;
}


/* ==========================================================================
   2. RESET — Minimaler Reset fuer konsistentes Rendering
   ========================================================================== */

/* Box-Sizing global */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Margin & Padding zuruecksetzen */
* {
  margin: 0;
  padding: 0;
}

/* Dokument */
html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* Body als Flex-Container fuer sticky Footer */
body {
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh; /* Fix: iOS-Adressleiste korrekt beruecksichtigen */
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* Touch-Optimierung: Verhindert Double-Tap-Zoom */
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

/* Medien responsive */
img,
video,
svg {
  max-width: 100%;
  display: block;
}

/* Formulare erben Schrift */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* Textareas nur vertikal resizable */
textarea {
  resize: vertical;
}

/* Links zuruecksetzen */
a {
  color: inherit;
  text-decoration: none;
}

/* Listen zuruecksetzen */
ul,
ol {
  list-style: none;
}

/* Tabellen */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Buttons zuruecksetzen */
button {
  cursor: pointer;
  background: none;
  border: none;
}

/* Fieldset */
fieldset {
  border: none;
}

/* Dialog */
dialog {
  padding: 0;
  border: none;
}

/* Zusammenfassung ohne Pfeil-Marker */
summary {
  cursor: pointer;
}

/* Fokus-Stil (wird in components ueberschrieben) */
:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ==========================================================================
   3. LAYOUT — Header, Navigation, Main-Bereich, Footer, Grid-System
   ========================================================================== */

/* ---------- Header ---------- */
.hdr {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  height: var(--header-h);
  padding: 0 var(--sp-lg);
  background:
    radial-gradient(ellipse 55% 200% at 5% 50%, rgba(26,58,114,.85) 0%, transparent 70%),
    radial-gradient(ellipse 40% 200% at 95% 50%, rgba(15,34,72,.6) 0%, transparent 65%),
    var(--navy);
  color: var(--white);
  /* Dezente Trennlinie unten mit Goldschimmer */
  border-bottom: 1px solid rgba(201,162,74,.12);
  box-shadow: 0 1px 12px rgba(8,14,30,.35);
}

.hdr-logo-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.hdr-logo {
  height: 40px;
  width: auto;
  max-width: 140px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  object-fit: contain;
}

.hdr-title {
  flex-shrink: 1;
  min-width: 0;
}

.hdr-title h1 {
  font-size: var(--fs-lg);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  line-height: 1.2;
}

.hdr-title p {
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Suchfeld im Header */
.hdr-search {
  flex: 1;
  max-width: 400px;
  margin-left: auto;
  position: relative;
}

.hdr-search-desktop {
  position: relative !important;
  width: 100%;
  display: block;
}

.hdr-search input[type="search"],
.hdr-search input {
  width: 100%;
  padding: var(--sp-sm) var(--sp-md) !important;
  padding-left: 48px !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-size: var(--fs-md);
  transition: background var(--trans), border-color var(--trans);
}

.hdr-search input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.hdr-search input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--acc);
}

/* Lupe absolut positioniert, ausserhalb des Eingabe-Textbereichs */
.hdr-search .search-icon,
.hdr-search-icon {
  position: absolute !important;
  left: 16px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 18px !important;
  height: 18px !important;
  opacity: 0.7;
  pointer-events: none;
  z-index: 2;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 !important;
  padding: 0 !important;
}
.hdr-search .search-icon svg,
.hdr-search-icon svg {
  width: 18px !important;
  height: 18px !important;
  display: block;
  max-width: 18px;
  max-height: 18px;
}

/* Header-Aktionen (Schloss, Login etc.) */
.hdr-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-left: auto;
  flex-shrink: 0;
}

.hdr-actions .btn-icon,
.hdr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  background: rgba(255,255,255,.1);
  border: none;
  color: var(--white);
  cursor: pointer;
  opacity: 0.8;
  transition: opacity var(--trans), background var(--trans);
  text-decoration: none;
}

.hdr-actions .btn-icon:hover,
.hdr-btn:hover {
  opacity: 1;
  background: rgba(255,255,255,.2);
}

.hdr-btn svg {
  width: 20px;
  height: 20px;
}

/* ---------- Navigation ---------- */
.nav-bar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav-bar::-webkit-scrollbar {
  display: none;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  height: var(--nav-h);
  padding: 0 var(--sp-lg);
  white-space: nowrap;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-sm) var(--sp-md);
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--muted);
  border-radius: var(--r-full);
  white-space: nowrap;
  transition: color var(--trans), background var(--trans);
  position: relative;
  flex-shrink: 0;
}

.nav-tab:hover {
  color: var(--text);
  background: var(--bg);
}

.nav-tab.active {
  color: var(--gold);
  background: var(--acc-bg);
}

/* Hilfe & Notruf — visuell abgesetzt (rot, am Ende) */
.nav-tab-help {
  color: #dc2626 !important;
  margin-left: auto;
}

.nav-tab-help:hover {
  color: #b91c1c !important;
  background: #fee2e2 !important;
}

.nav-tab-help.active {
  color: #b91c1c !important;
  background: #fee2e2 !important;
}

.nav-tab-help.active::after {
  background: #dc2626 !important;
}

/* Accent-Underline fuer aktiven Tab */
.nav-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: var(--sp-md);
  right: var(--sp-md);
  height: 2px;
  background: var(--gold);
  border-radius: 2px 2px 0 0;
}

.nav-tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-label {
  font-size: inherit;
}

/* ---------- Main-Bereich ---------- */
.main {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-lg);
}

/* ---------- Seiten (SPA-Routing) ---------- */
/* Alpine x-show kontrolliert display:none/block — kein .active noetig */
.page {
  animation: pageIn 250ms ease;
}

/* Alpine x-show steuert Sichtbarkeit — KEIN display-override */
[x-cloak] { display: none !important; }

/* x-icon SVGs in Flex-Containern: nicht schrumpfen, inline bleiben */
[x-icon] svg,
button svg,
a svg {
  flex-shrink: 0;
  display: inline-block;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Footer ---------- */
/* ── Footer ────────────────────────────────────────────── */
.footer {
  background:
    radial-gradient(ellipse 70% 80% at 15% 30%, rgba(26,58,114,.9) 0%, transparent 65%),
    radial-gradient(ellipse 50% 90% at 85% 70%, rgba(15,34,72,.7) 0%, transparent 60%),
    var(--ink);
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--fs-xs);
  margin-top: auto;
  /* Goldene Trennlinie oben — Spiegelung des Header-Akzents */
  border-top: 1px solid rgba(201,162,74,.18);
  position: relative;
  overflow: hidden;
}

/* Subtiles Rauschen wie auf der Login-Seite */
.footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  pointer-events: none;
  opacity: .4;
  z-index: 0;
}

.footer > * {
  position: relative;
  z-index: 1;
}

.footer-top {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px var(--sp-xl) 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: start;
}

.footer-col-left  { justify-self: start; }
.footer-col-mid   { justify-self: center; text-align: center; }
.footer-col-right { justify-self: end;   text-align: right; }

.footer-logo {
  max-width: 160px;
  width: 100%;
  height: auto;
  margin-bottom: 10px;
  opacity: .85;
}

.footer-school-name {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: .5px;
  color: rgba(255,255,255,.8);
  margin-bottom: 4px;
}

.footer-tagline {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(201,162,74,.6);
  margin-bottom: 8px;
}

.footer-address {
  font-size: 11px;
  line-height: 1.7;
  color: rgba(255,255,255,.45);
}

.footer-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}

.footer-divider::before,
.footer-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(201,162,74,.25), transparent);
}

.footer-gem {
  width: 6px;
  height: 6px;
  background: var(--acc);
  transform: rotate(45deg);
  opacity: .7;
  box-shadow: 0 0 8px rgba(201,162,74,.4);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
}

.footer-nav a {
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: 12px;
  transition: color var(--trans);
}

.footer-nav a:hover { color: var(--gold-lt); }

.footer-legal-note {
  font-size: 10px;
  color: rgba(255,255,255,.3);
  line-height: 1.6;
}

.footer-credit {
  font-size: 10px;
  color: rgba(255,255,255,.25);
  line-height: 1.6;
  margin-top: 6px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.05);
  text-align: center;
  padding: 10px var(--sp-xl);
  font-size: 10px;
  color: rgba(255,255,255,.25);
}

/* Responsive Footer */
@media (max-width: 768px) {
  .footer-top {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 20px;
  }
  .footer-col-left,
  .footer-col-right { justify-self: center; text-align: center; }
}

/* ---------- Grid-System ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sp-md);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-md);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-md);
}

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}

/* ---------- Section ---------- */
.section {
  margin-bottom: var(--sp-2xl);
}

.section-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--sp-md);
}

.section-subtitle {
  font-size: var(--fs-md);
  color: var(--muted);
  margin-bottom: var(--sp-lg);
}


/* ==========================================================================
   4. COMPONENTS — Wiederverwendbare UI-Bausteine
   ========================================================================== */

/* ==================== Cards ==================== */

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--sp-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--trans), transform var(--trans);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-flat {
  box-shadow: none;
}

.card-flat:hover {
  transform: none;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-md);
}

.card-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--navy);
}

.card-body {
  font-size: var(--fs-md);
  color: var(--text);
  line-height: 1.6;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-top: var(--sp-md);
  padding-top: var(--sp-md);
  border-top: 1px solid var(--line);
}

.card-meta {
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* ==================== Buttons ==================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  font-size: var(--fs-md);
  font-weight: 500;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--trans);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary: Navy-Hintergrund */
.btn-primary {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  border-bottom: 2px solid rgba(201,162,74,.4);
}

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

/* Secondary: Outline */
.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border-color: var(--line);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg);
  border-color: var(--blue);
  color: var(--blue);
}

/* Accent */
.btn-accent {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}

.btn-accent:hover:not(:disabled) {
  background: var(--acc);
  border-color: var(--acc);
}

/* Danger */
.btn-danger {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
  border-color: #b91c1c;
}

/* Ghost (transparent) */
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg);
  color: var(--text);
}

/* Klein */
.btn-sm {
  padding: var(--sp-xs) var(--sp-sm);
  font-size: var(--fs-xs);
  border-radius: var(--r-sm);
}

/* Gross */
.btn-lg {
  padding: var(--sp-md) var(--sp-xl);
  font-size: var(--fs-base);
}

/* Icon-Button (quadratisch) */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--r);
  flex-shrink: 0;
}

.btn-icon.btn-sm {
  width: 28px;
  height: 28px;
}

/* Button-Gruppe */
.btn-group {
  display: inline-flex;
  gap: 0;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-radius: var(--r) 0 0 var(--r);
}

.btn-group .btn:last-child {
  border-radius: 0 var(--r) var(--r) 0;
}

.btn-group .btn + .btn {
  border-left: 0;
}

/* ==================== Badges ==================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: 2px var(--sp-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
  border-radius: var(--r-full);
  line-height: 1.4;
}

.badge-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.badge-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-info {
  background: var(--acc-bg);
  color: var(--blue);
}

.badge-neutral {
  background: var(--bg);
  color: var(--muted);
}

/* ==================== Formular-Elemente ==================== */

.input,
.select,
.textarea {
  width: 100%;
  padding: var(--sp-sm) var(--sp-md);
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: border-color var(--trans), box-shadow var(--trans);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-bg);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  background: var(--bg);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Fehlerzustand */
.input-error {
  border-color: var(--danger);
}

.input-error:focus {
  box-shadow: 0 0 0 3px var(--danger-bg);
}

/* Erfolgszustand */
.input-ok {
  border-color: var(--ok);
}

.input-ok:focus {
  box-shadow: 0 0 0 3px var(--ok-bg);
}

/* Select mit eigenem Pfeil */
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235a7d9a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Textarea */
.textarea {
  min-height: 100px;
}

/* Formular-Gruppe */
.form-group {
  margin-bottom: var(--sp-md);
}

.form-label {
  display: block;
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--sp-xs);
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-hint {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: var(--sp-xs);
}

.form-error {
  font-size: var(--fs-xs);
  color: var(--danger);
  margin-top: var(--sp-xs);
}

/* Checkbox / Radio Wrapper */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  cursor: pointer;
  font-size: var(--fs-md);
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  flex-shrink: 0;
}

/* ==================== Chips (Filter) ==================== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-xs) var(--sp-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all var(--trans);
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.chip.active {
  background: var(--acc-bg);
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 600;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
}

/* ==================== Tabelle ==================== */

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

.table th {
  text-align: left;
  padding: var(--sp-sm) var(--sp-md);
  font-weight: 600;
  color: var(--muted);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

.table td {
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

/* Gestreifte Zeilen */
.table-striped tbody tr:nth-child(even) {
  background: var(--bg);
}

/* Hover-Effekt */
.table-hover tbody tr:hover {
  background: var(--acc-bg);
}

/* Responsive Tabelle */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.table-responsive .table {
  margin-bottom: 0;
}

/* ==================== Breadcrumb ==================== */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-bottom: var(--sp-md);
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: ">";
  margin-right: var(--sp-sm);
  color: var(--line);
}

.breadcrumb-item a:hover {
  color: var(--blue);
}

.breadcrumb-item.active {
  color: var(--text);
  font-weight: 500;
}

/* ==================== Skeleton (Lade-Platzhalter) ==================== */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg) 25%,
    var(--line) 50%,
    var(--bg) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--r-sm);
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--sp-sm);
  width: 80%;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-title {
  height: 20px;
  width: 50%;
  margin-bottom: var(--sp-md);
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
}

.skeleton-card {
  height: 160px;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ==================== Modal ==================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 37, 64, 0.5);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-lg);
}

/* .open Klasse fuer CSS-gesteuerte Modals (Admin etc.) */
.modal-overlay.open {
  display: flex;
}

.modal,
.modal-box {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--trans);
}

/* modal-content: fuer x-if Modals (Admin) — sofort sichtbar, kein .open noetig */
.modal-content {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
}

.modal-overlay.open .modal,
.modal-overlay.open .modal-box {
  transform: scale(1) translateY(0);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color var(--trans);
}

.modal-close:hover {
  color: var(--text);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-lg);
  border-bottom: 1px solid var(--line);
}

.modal-title {
  font-size: var(--fs-lg);
  font-weight: 600;
}

.modal-body {
  padding: var(--sp-lg);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-sm);
  padding: var(--sp-md) var(--sp-lg);
  border-top: 1px solid var(--line);
}

/* ==================== Toast / Benachrichtigungen ==================== */

.toast-container {
  position: fixed;
  top: calc(var(--header-h) + var(--sp-md));
  right: var(--sp-lg);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-md) var(--sp-lg);
  background: var(--white);
  border-radius: var(--r);
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--blue);
  font-size: var(--fs-md);
  pointer-events: auto;
  animation: toastIn 300ms ease;
  max-width: 400px;
}

.toast-ok    { border-left-color: var(--ok); }
.toast-warn  { border-left-color: var(--warn); }
.toast-danger { border-left-color: var(--danger); }

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==================== Empty State ==================== */

.empty-state {
  text-align: center;
  padding: var(--sp-2xl) var(--sp-lg);
  color: var(--muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--sp-md);
  opacity: 0.4;
}

.empty-state-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp-sm);
}

.empty-state-text {
  font-size: var(--fs-md);
  max-width: 400px;
  margin: 0 auto;
}

/* ==================== Divider ==================== */

.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: var(--sp-lg) 0;
}

/* ==================== Avatar ==================== */

.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: var(--acc-bg);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--fs-md);
  flex-shrink: 0;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: var(--fs-xs);
}

.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: var(--fs-xl);
}

/* ==================== Spinner ==================== */

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}

.spinner-sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.spinner-inline {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==================== Loading Overlay ==================== */

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-2xl);
  min-height: 200px;
}


/* ==========================================================================
   5. UTILITIES — Kleine Helfer fuer schnelles Styling
   ========================================================================== */

/* ==================== Sichtbarkeit ==================== */

.hidden {
  display: none !important;
}

/* Screenreader-Only (visuell versteckt, fuer Accessibility) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Interner Bereich: Standardmaessig versteckt */
/* KEIN !important — damit Alpine x-show die Kontrolle behaelt */
.internal-only {
  display: none;
}

/* Sichtbar wenn interner Zugang freigeschaltet */
body.internal-unlocked .internal-only {
  display: revert;
}

/* Fuer Elemente mit x-show: Alpine setzt inline display:none, das muss gewinnen */
body.internal-unlocked .internal-only[style*="display: none"] {
  display: none;
}

/* Nur fuer Public sichtbar (wird bei internem Zugang versteckt) */
body.internal-unlocked .public-only {
  display: none;
}

/* ==================== Text ==================== */

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

.text-muted   { color: var(--muted); }
.text-ok      { color: var(--ok); }
.text-warn    { color: var(--warn); }
.text-danger  { color: var(--danger); }
.text-blue    { color: var(--blue); }
.text-navy    { color: var(--navy); }
.text-white   { color: var(--white); }

.text-xs   { font-size: var(--fs-xs); }
.text-sm   { font-size: var(--fs-sm); }
.text-md   { font-size: var(--fs-md); }
.text-base { font-size: var(--fs-base); }
.text-lg   { font-size: var(--fs-lg); }
.text-xl   { font-size: var(--fs-xl); }
.text-2xl  { font-size: var(--fs-2xl); }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-bold   { font-weight: 700; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================== Flexbox ==================== */

.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-start   { display: flex; align-items: flex-start; }
.flex-end     { display: flex; align-items: center; justify-content: flex-end; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.items-stretch { align-items: stretch; }

.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }

/* ==================== Gap ==================== */

.gap-xs  { gap: var(--sp-xs); }
.gap-sm  { gap: var(--sp-sm); }
.gap-md  { gap: var(--sp-md); }
.gap-lg  { gap: var(--sp-lg); }
.gap-xl  { gap: var(--sp-xl); }

/* ==================== Margin ==================== */

/* Margin Top */
.mt-xs  { margin-top: var(--sp-xs); }
.mt-sm  { margin-top: var(--sp-sm); }
.mt-md  { margin-top: var(--sp-md); }
.mt-lg  { margin-top: var(--sp-lg); }
.mt-xl  { margin-top: var(--sp-xl); }
.mt-2xl { margin-top: var(--sp-2xl); }

/* Margin Bottom */
.mb-xs  { margin-bottom: var(--sp-xs); }
.mb-sm  { margin-bottom: var(--sp-sm); }
.mb-md  { margin-bottom: var(--sp-md); }
.mb-lg  { margin-bottom: var(--sp-lg); }
.mb-xl  { margin-bottom: var(--sp-xl); }
.mb-2xl { margin-bottom: var(--sp-2xl); }

/* Margin Left/Right */
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ==================== Padding ==================== */

.p-sm  { padding: var(--sp-sm); }
.p-md  { padding: var(--sp-md); }
.p-lg  { padding: var(--sp-lg); }
.p-xl  { padding: var(--sp-xl); }

.px-sm { padding-left: var(--sp-sm); padding-right: var(--sp-sm); }
.px-md { padding-left: var(--sp-md); padding-right: var(--sp-md); }
.px-lg { padding-left: var(--sp-lg); padding-right: var(--sp-lg); }

.py-sm { padding-top: var(--sp-sm); padding-bottom: var(--sp-sm); }
.py-md { padding-top: var(--sp-md); padding-bottom: var(--sp-md); }
.py-lg { padding-top: var(--sp-lg); padding-bottom: var(--sp-lg); }

/* ==================== Width / Height ==================== */

.w-full { width: 100%; }
.h-full { height: 100%; }

/* ==================== Rounded ==================== */

.rounded      { border-radius: var(--r); }
.rounded-sm   { border-radius: var(--r-sm); }
.rounded-lg   { border-radius: var(--r-lg); }
.rounded-full { border-radius: var(--r-full); }

/* ==================== Cursor ==================== */

.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }

/* ==================== Overflow ==================== */

.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* ==================== Position ==================== */

.relative { position: relative; }
.absolute { position: absolute; }
.sticky   { position: sticky; }


/* ==========================================================================
   6. RESPONSIVE — Media Queries fuer Tablet, Mobile und Touch-Optimierung
   ========================================================================== */

/* ==================== Tablet (max-width: 900px) ==================== */

@media (max-width: 900px) {

  /* ---- Header ---- */
  .hdr {
    padding: 0 var(--sp-md);
    gap: var(--sp-sm);
  }

  .hdr-subtitle,
  .hdr-title p {
    display: none;
  }

  .hdr-search {
    max-width: 200px;
  }

  /* ---- Navigation (Tablet) ---- */
  .nav-tabs {
    padding: 0 var(--sp-md);
    gap: var(--sp-xs);
  }

  .nav-tab {
    font-size: var(--fs-sm);
    padding: var(--sp-sm) var(--sp-md);
    min-height: 48px;        /* Touch-Target nach WCAG/Material */
    min-width: 48px;
  }

  .nav-tab svg {
    width: 20px;
    height: 20px;
  }

  .nav-label {
    font-size: 12px;
  }

  /* ---- Main ---- */
  .main {
    padding: var(--sp-md);
  }

  /* ---- Grids: 2 Spalten ---- */
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  /* ---- Modal volle Breite ---- */
  .modal,
  .modal-box {
    max-width: calc(100vw - var(--sp-lg) * 2);
  }

  /* ---- Tabelle scrollbar ---- */
  .table-responsive {
    margin: 0 calc(var(--sp-md) * -1);
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  /* ---- Contact-Links mit mehr Padding ---- */
  .contact-link {
    padding: var(--sp-sm) var(--sp-md);
  }
}

/* ==================== Mobile (max-width: 600px) ==================== */

@media (max-width: 600px) {

  /* ---- CSS-Variablen anpassen ---- */
  :root {
    --header-h: 52px;
    --nav-h: 56px;     /* mehr Platz fuer 2-zeilige Tabs (Icon + Label) */
  }

  /* ---- Header ---- */
  .hdr {
    padding: 0 12px;
    gap: var(--sp-sm);
    height: 52px;
  }

  .hdr-logo {
    height: 28px;
    width: auto;
    max-width: 100px;
  }

  /* Titel-Text auf Smartphones ausblenden — spart Platz */
  .hdr-title {
    display: none;
  }

  .hdr-title h1 {
    font-size: 15px;
  }

  .hdr-title p {
    display: none;
  }

  .hdr-search {
    display: none;
  }

  .hdr-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .hdr-btn svg {
    width: 18px;
    height: 18px;
  }

  /* ---- Navigation (Mobile): Icons + kleines Label, horizontal scroll ---- */
  .nav-tabs {
    padding: 0 var(--sp-sm);
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    flex-direction: column;     /* Icon oben, Label drunter */
    padding: 8px 10px;
    font-size: 10px;
    min-height: 52px;           /* groesseres Touch-Target */
    min-width: 56px;
    gap: 3px;
    flex-shrink: 0;
    line-height: 1.1;
  }

  .nav-tab .nav-label {
    display: inline;            /* Label sichtbar lassen */
    font-size: 10px;
    font-weight: 500;
  }

  .nav-tab svg {
    width: 22px;
    height: 22px;
  }

  /* Aktiver Tab: Underline an die neue Padding-Geometrie anpassen */
  .nav-tab.active::after {
    left: 8px;
    right: 8px;
  }

  /* ---- Main ---- */
  .main {
    padding: 12px;
  }

  .container {
    padding: 0 8px;
  }

  /* ---- Alle Grids auf 1 Spalte ---- */
  .grid-2,
  .grid-3,
  .grid-4,
  .contact-grid,
  .form-grid,
  .forms-grid,
  .document-grid,
  .documents-grid,
  .quick-links-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  /* ---- Seitenheadings ---- */
  h2 { font-size: 20px; }
  .section-title { font-size: var(--fs-lg); }

  /* ---- Cards ---- */
  .card,
  .contact-card,
  .notice-card,
  .form-card,
  .document-card {
    padding: 12px;
    border-radius: 8px;
  }

  /* ---- Chips: horizontal scroll ---- */
  .dept-chips,
  .notices-filter,
  .doc-categories,
  .documents-categories,
  .gallery-filters,
  .chip-group {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: var(--sp-xs);
  }

  .dept-chips::-webkit-scrollbar,
  .notices-filter::-webkit-scrollbar,
  .doc-categories::-webkit-scrollbar,
  .documents-categories::-webkit-scrollbar,
  .gallery-filters::-webkit-scrollbar,
  .chip-group::-webkit-scrollbar {
    display: none;
  }

  .dept-chip,
  .chip {
    min-height: 36px;
    flex-shrink: 0;
  }

  /* ---- Hero ---- */
  .hero {
    padding: var(--sp-md) var(--sp-sm);
  }

  .hero-logo {
    max-width: 200px;
  }

  .hero h2 {
    font-size: 18px;
  }

  /* ---- Kontakte ---- */
  .contacts-search {
    max-width: 100%;
  }

  .contact-card-header {
    gap: var(--sp-sm);
  }

  .contact-avatar {
    width: 32px;
    height: 32px;
    font-size: var(--fs-sm);
  }

  /* Contact-Links als volle-Breite Touch-Buttons */
  .contact-link {
    min-height: 44px;
    padding: 10px 12px;
    display: flex;
    width: 100%;
    background: var(--bg);
    border-radius: 6px;
    align-items: center;
  }

  .contact-link:hover {
    background: var(--acc-bg);
    text-decoration: none;
  }

  /* ---- Schwarzes Brett / Notices ---- */
  .notice-card {
    padding: 12px;
    border-left-width: 3px;
  }

  .notice-card-header {
    flex-direction: column;
    gap: var(--sp-xs);
  }

  .notice-date {
    align-self: flex-start;
  }

  /* ---- Formulare ---- */
  .form-detail {
    padding: var(--sp-md);
  }

  .form-detail .form-group {
    margin-bottom: var(--sp-md);
  }

  .form-detail input,
  .form-detail select,
  .form-detail textarea,
  .form-field .input,
  .form-field textarea,
  .form-field select {
    font-size: 16px; /* Verhindert iOS-Zoom beim Focus */
    padding: 12px;
  }

  .form-detail-title {
    font-size: var(--fs-xl);
  }

  .forms-grid {
    grid-template-columns: 1fr;
  }

  .form-submit-btn {
    width: 100%;
  }

  /* ---- Dokumente ---- */
  .document-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .document-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .document-download {
    align-self: flex-start;
  }

  .documents-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .documents-search {
    max-width: 100%;
  }

  /* ---- Speiseplan ---- */
  .mealplan-table {
    display: none;
  }

  .mealplan-nav {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-sm);
    text-align: center;
  }

  .mealplan-nav-btn {
    align-self: center;
  }

  .mealplan-toolbar {
    flex-wrap: wrap;
  }

  /* ---- Galerie ---- */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-sm);
  }

  .lightbox-nav {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .lightbox-prev {
    left: var(--sp-sm);
  }

  .lightbox-next {
    right: var(--sp-sm);
  }

  /* ---- Recent Notices (Startseite) ---- */
  .recent-notice-item {
    padding: var(--sp-sm) var(--sp-md);
    flex-direction: column;
    align-items: flex-start;
  }

  .recent-notices-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-sm);
  }

  /* ---- Quick-Links (Startseite) ---- */
  .quick-links-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-sm);
  }

  .quick-link-card {
    padding: var(--sp-md);
  }

  /* ---- Breadcrumb: Stack vertikal ---- */
  .breadcrumb {
    flex-wrap: wrap;
    gap: var(--sp-xs);
  }

  /* ---- Modal als Bottom-Sheet ---- */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal,
  .modal-box {
    max-width: 100%;
    max-height: 80vh;
    max-height: 80dvh;
    border-radius: 16px 16px 0 0;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: var(--sp-md);
  }

  /* ---- Buttons: Volle Breite auf Mobile ---- */
  .btn-full-mobile {
    width: 100%;
  }

  /* ---- Toast volle Breite ---- */
  #isl-toast-root {
    left: var(--sp-sm) !important;
    right: var(--sp-sm) !important;
    max-width: none !important;
  }

  /* ---- Footer ---- */
  .footer {
    padding: 8px var(--sp-md);
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  /* ---- Consent / DSGVO ---- */
  .form-field-checkbox {
    align-items: flex-start;
  }

  /* ---- Allergen-Legende ---- */
  .allergen-legend-grid {
    grid-template-columns: 1fr;
  }

  /* ---- Empty State kompakter ---- */
  .empty-state {
    padding: var(--sp-lg) var(--sp-md);
  }
}

/* ==================== Touch-Targets (pointer: coarse) ==================== */

@media (pointer: coarse) {
  /* Alle interaktiven Elemente: 44px min Touch-Target */
  .btn,
  .chip,
  .dept-chip,
  .form-check,
  .contact-link,
  .notice-toggle-btn,
  .notice-card-attachment,
  .form-back-btn,
  .quick-link-card {
    min-height: 44px;
  }

  /* Nav-Tabs: 52px Touch-Target mit ausreichend Padding */
  .nav-tab {
    min-height: 52px;
    padding: 10px 14px;
  }

  /* Icon-Buttons */
  .btn-icon {
    width: 44px;
    height: 44px;
  }

  .btn-icon.btn-sm {
    width: 36px;
    height: 36px;
  }

  /* Groessere Checkboxen/Radios */
  .form-check input[type="checkbox"],
  .form-check input[type="radio"],
  .form-field-checkbox input[type="checkbox"],
  .form-field-radio input[type="radio"] {
    width: 24px;
    height: 24px;
  }

  /* Contact-Links Touch-freundlich */
  .contact-link {
    padding: 12px;
  }

  /* Mealplan Buttons */
  .mealplan-nav-btn {
    width: 44px;
    height: 44px;
  }

  .mealplan-today-btn {
    min-height: 44px;
    padding: var(--sp-sm) var(--sp-md);
  }

  /* Document Download */
  .document-download-btn {
    min-height: 44px;
    padding: var(--sp-sm) var(--sp-md);
  }

  /* Lightbox Navigation */
  .lightbox-close,
  .lightbox-nav {
    min-width: 44px;
    min-height: 44px;
  }

  /* Gallery Items etwas groesser */
  .gallery-item {
    min-height: 120px;
  }

  /* Beliebtheits-Sterne auf Touch-Geraeten etwas groesser */
  .meal-stars-display {
    font-size: 20px;
  }

  /* Inputs: mindestens 44px, 16px font verhindert iOS-Zoom */
  .input,
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  select,
  textarea {
    min-height: 44px;
    font-size: 16px;
  }
}

/* ==================== iPhone Safe-Area Insets ==================== */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .footer {
    padding-bottom: calc(var(--sp-md) + env(safe-area-inset-bottom));
  }

  .modal-overlay {
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* Bottom-Sheet Modal auf Mobile */
  @media (max-width: 600px) {
    .modal,
    .modal-box {
      padding-bottom: env(safe-area-inset-bottom);
    }
  }
}

/* ==================== Grosse Bildschirme (min-width: 1400px) ==================== */

@media (min-width: 1400px) {
  .main {
    padding: var(--sp-xl);
  }
}

/* ==================== Druck ==================== */

@media print {
  .hdr,
  .nav-bar,
  .footer,
  .toast-container,
  .modal-overlay,
  .btn,
  .hdr-actions {
    display: none !important;
  }

  .main {
    max-width: none;
    padding: 0;
  }

  .page {
    display: block !important;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  body {
    background: white;
    color: black;
  }
}


/* ==========================================================================
   7. PAGE: HOME — Startseite
   ========================================================================== */

/* Hero-Bereich */
.hero {
  text-align: center;
  padding: var(--sp-xl) var(--sp-md) var(--sp-lg);
  max-width: 600px;
  margin: 0 auto;
}

.hero-logo {
  max-width: 400px;
  width: 100%;
  height: auto;
  margin: 0 auto;
  display: block;
}

.hero h2 {
  font-size: var(--fs-2xl);
  color: var(--navy);
  margin-top: var(--sp-md);
  font-weight: 600;
}

.hero p {
  color: var(--muted);
  font-size: var(--fs-base);
  margin-top: var(--sp-sm);
}

/* Quick-Links Grid */
.quick-links-section {
  margin-top: var(--sp-xl);
}

.quick-links-section h3 {
  font-size: var(--fs-xl);
  color: var(--navy);
  margin-bottom: var(--sp-md);
  font-weight: 600;
}

.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-md);
}

.quick-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--sp-lg);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  transition: box-shadow var(--trans), transform var(--trans);
}

.quick-link-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.quick-link-icon {
  width: 48px;
  height: 48px;
  background: var(--acc-bg);
  color: var(--blue);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-md);
}

.quick-link-icon svg {
  width: 24px;
  height: 24px;
}

.quick-link-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--sp-xs);
}

.quick-link-desc {
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.4;
}

/* ── Einheitliche Link-Karten (Links, Software, Anleitungen) ──────── */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-md);
}

.link-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 4px 12px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow var(--trans), transform var(--trans), border-color var(--trans);
  text-align: left;
  position: relative;
  color: var(--text);
}

.link-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--acc);
}

.link-card-icon {
  grid-row: 1 / span 2;
  grid-column: 1;
  width: 40px;
  height: 40px;
  background: var(--acc-bg);
  color: var(--blue);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.link-card-icon svg {
  width: 22px;
  height: 22px;
}

.link-card-body {
  grid-column: 2;
  min-width: 0;
}

.link-card-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
  word-wrap: break-word;
}

.link-card-desc {
  margin-top: 4px;
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link-card.is-open .link-card-desc {
  -webkit-line-clamp: unset;
}

.link-card-host {
  margin-top: 6px;
  font-size: 11px;
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-card-arrow {
  grid-row: 1;
  grid-column: 3;
  width: 16px;
  height: 16px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.link-card-arrow svg {
  width: 16px;
  height: 16px;
}

.link-card-expanded {
  grid-row: 3;
  grid-column: 1 / -1;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: #333;
  line-height: 1.6;
  white-space: pre-line;
  cursor: default;
}

.link-card-expanded p {
  margin: 0;
}

@media (max-width: 600px) {
  .links-grid {
    grid-template-columns: 1fr;
  }
}

/* Letzte Mitteilungen */
.recent-notices {
  margin-top: var(--sp-xl);
}

.recent-notices-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-md);
}

.recent-notices h3 {
  font-size: var(--fs-xl);
  color: var(--navy);
  font-weight: 600;
  margin: 0;
}

.recent-notices-link {
  font-size: var(--fs-sm);
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
}

.recent-notices-link:hover {
  text-decoration: underline;
}

/* Kompakte Mitteilungs-Karten auf der Startseite */
.recent-notice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
  transition: box-shadow var(--trans), transform var(--trans);
  text-decoration: none;
  color: inherit;
}

.recent-notice-item + .recent-notice-item {
  margin-top: var(--sp-sm);
}

.recent-notice-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.recent-notice-content {
  flex: 1;
  min-width: 0;
}

.recent-notice-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 var(--sp-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-notice-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.recent-notice-date {
  font-size: var(--fs-xs);
  color: var(--muted);
  white-space: nowrap;
}

/* Home Responsive */
@media (max-width: 640px) {
  .hero {
    padding: var(--sp-lg) var(--sp-md);
  }

  .hero-logo {
    max-width: 280px;
  }

  .hero h2 {
    font-size: var(--fs-xl);
  }

  .quick-links-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--sp-sm);
  }

  .quick-link-card {
    padding: var(--sp-md);
  }

  .recent-notice-item {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ==========================================================================
   8. PAGE: CONTACTS — Telefonbuch
   ========================================================================== */

/* Suchfeld */
.contacts-search {
  max-width: 480px;
  margin: 0 auto var(--sp-lg);
}

.contacts-search .input {
  padding-left: var(--sp-lg);
  font-size: var(--fs-base);
}

/* Abteilungs-Chips */
.dept-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-lg);
  padding-bottom: var(--sp-sm);
}

.dept-chip {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-xs) var(--sp-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all var(--trans);
  white-space: nowrap;
}

.dept-chip:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.dept-chip.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
  font-weight: 600;
}

/* Kontakt-Grid */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-lg);
}

/* Kontakt-Karte */
.contact-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--sp-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--trans), transform var(--trans);
}

.contact-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.contact-card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  margin-bottom: var(--sp-md);
}

.contact-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: var(--acc-bg);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--fs-md);
  flex-shrink: 0;
}

.contact-card h4 {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--navy);
  margin: 0;
  line-height: 1.3;
}

.contact-position {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin: 2px 0 0;
}

.contact-dept {
  margin-top: var(--sp-sm);
  margin-bottom: var(--sp-md);
}

/* Kontakt-Links (Telefon, Mobil, E-Mail) */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  margin-top: var(--sp-md);
  padding-top: var(--sp-md);
  border-top: 1px solid var(--line);
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: var(--fs-md);
  color: var(--blue);
  text-decoration: none;
  transition: color var(--trans);
  word-break: break-all;
}

.contact-link:hover {
  color: var(--navy2);
  text-decoration: underline;
}

.contact-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

/* Contacts Responsive */
@media (max-width: 640px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .dept-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .dept-chips::-webkit-scrollbar {
    display: none;
  }
}


/* ==========================================================================
   9. PAGE: NOTICES — Schwarzes Brett
   ========================================================================== */

/* Kategorie-Filter */
.notices-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-lg);
}

.notices-filter .dept-chip {
  /* Gleicher Stil wie dept-chips im Telefonbuch */
}

/* Mitteilungs-Liste */
.notice-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

/* Mitteilungs-Karte */
.notice-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--sp-lg);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--blue);
  transition: box-shadow var(--trans);
}

.notice-card:hover {
  box-shadow: var(--shadow-md);
}

/* Farbiger linker Rand nach Typ */
.notice-border-info    { border-left-color: var(--blue); }
.notice-border-warn    { border-left-color: var(--warn); }
.notice-border-ok      { border-left-color: var(--ok); }
.notice-border-danger  { border-left-color: var(--danger); }

/* Gepinnte Mitteilungen */
.notice-card.pinned {
  background: #fffef5;
  border-color: var(--line);
}

/* Karten-Header */
.notice-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-md);
  margin-bottom: var(--sp-sm);
}

.notice-card-header-left {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  flex: 1;
  min-width: 0;
}

/* Titel */
.notice-card-title {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--navy);
  margin: 0;
  line-height: 1.3;
}

/* Pin-Icon */
.notice-pin-icon {
  color: var(--warn);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.notice-pin-icon svg {
  width: 16px;
  height: 16px;
}

/* Meta-Informationen (Badges) */
.notice-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-xs);
  margin-bottom: var(--sp-md);
}

.notice-card-meta .badge {
  font-size: var(--fs-xs);
}

/* Datum */
.notice-date {
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* Ablauf-Badge */
.notice-expires-badge {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 2px var(--sp-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
  border-radius: var(--r-full);
}

.notice-expires-badge.expiring-soon {
  background: var(--warn-bg);
  color: var(--warn);
}

/* Body-Bereich */
.notice-card-body {
  font-size: var(--fs-md);
  color: var(--text);
  line-height: 1.6;
  overflow: hidden;
  transition: max-height var(--trans-slow);
}

.notice-card-body.collapsed {
  max-height: 100px;
  position: relative;
}

.notice-card-body.collapsed::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, var(--white));
  pointer-events: none;
}

.notice-card.pinned .notice-card-body.collapsed::after {
  background: linear-gradient(transparent, #fffef5);
}

.notice-card-body.expanded {
  max-height: none;
}

/* Inline-HTML Styles zuruecksetzen */
.notice-card-body p {
  margin-bottom: var(--sp-sm);
}

.notice-card-body ul,
.notice-card-body ol {
  padding-left: var(--sp-lg);
  margin-bottom: var(--sp-sm);
}

.notice-card-body a {
  color: var(--blue);
  text-decoration: underline;
}

/* Mehr lesen Toggle */
.notice-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-xs) 0;
  font-size: var(--fs-sm);
  color: var(--blue);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  margin-top: var(--sp-sm);
}

.notice-toggle-btn:hover {
  color: var(--navy2);
  text-decoration: underline;
}

/* Anhang */
.notice-card-attachment {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-top: var(--sp-md);
  padding: var(--sp-sm) var(--sp-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--blue);
  background: var(--acc-bg);
  border: 1px solid transparent;
  border-radius: var(--r);
  text-decoration: none;
  transition: all var(--trans);
}

.notice-card-attachment:hover {
  background: var(--white);
  border-color: var(--blue);
}

.notice-card-attachment svg {
  width: 16px;
  height: 16px;
}

/* Karten-Footer */
.notice-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  margin-top: var(--sp-md);
  padding-top: var(--sp-md);
  border-top: 1px solid var(--line);
}

/* Notices Responsive */
@media (max-width: 640px) {
  .notice-card-header {
    flex-direction: column;
    gap: var(--sp-sm);
  }

  .notices-filter {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .notices-filter::-webkit-scrollbar {
    display: none;
  }

  .notice-card-meta {
    flex-wrap: wrap;
  }
}


/* ==========================================================================
   10. PAGE: FORMS — Formulare
   ========================================================================== */

/* -- Formular-Liste (Kategorie-Gruppen) -- */

.forms-category-group {
  margin-bottom: var(--sp-xl);
}

.forms-category-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--sp-md);
  padding-bottom: var(--sp-xs);
  border-bottom: 2px solid var(--line);
}

.forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-md);
}

/* Formular-Karte (Listenansicht) */
.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--sp-lg);
  cursor: pointer;
  transition: all var(--trans);
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.form-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--blue);
}

.form-card-title {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--navy);
  margin: 0;
}

.form-card-desc {
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.form-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  background: var(--acc-bg);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.form-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: var(--sp-sm);
}

.form-card-action {
  font-size: var(--fs-sm);
  color: var(--blue);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
}

/* -- Detail-View -- */

.form-detail {
  max-width: 640px;
  margin: 0 auto;
}

.form-detail-header {
  margin-bottom: var(--sp-xl);
}

.form-detail-title {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 var(--sp-sm);
}

.form-detail-desc {
  font-size: var(--fs-base);
  color: var(--muted);
  line-height: 1.6;
}

.form-detail-category {
  margin-top: var(--sp-sm);
}

/* Zurueck-Button */
.form-back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  font-size: var(--fs-sm);
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-xs) 0;
  margin-bottom: var(--sp-md);
  transition: color var(--trans);
}

.form-back-btn:hover {
  color: var(--blue);
}

/* -- Honeypot (Bot-Schutz) -- */
/* Visuell unsichtbar, aber im DOM vorhanden, damit Bots ihn ausfuellen.
   Bewusst kein display:none — das wuerde von Bots erkannt. */
.form-honeypot {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* -- Formular-Felder -- */

.form-fields {
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
}

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

.form-field-label {
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--text);
}

.form-field-label .required-mark {
  color: var(--danger);
  margin-left: 2px;
}

.form-field-hint {
  font-size: var(--fs-xs);
  color: var(--muted);
}

.form-field .input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: var(--sp-sm) var(--sp-md);
  font-size: var(--fs-base);
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color var(--trans), box-shadow var(--trans);
}

.form-field .input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--acc-bg);
}

.form-field textarea {
  min-height: 100px;
  resize: vertical;
}

/* Checkbox & Radio */
.form-field-checkbox,
.form-field-radio {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-sm);
}

.form-field-checkbox input[type="checkbox"],
.form-field-radio input[type="radio"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.form-radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

/* Select */
.form-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a7d9a' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* -- Zeichenzaehler -- */
.form-field-counter {
  display: flex;
  justify-content: flex-end;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.form-field-counter.warn { color: var(--danger); font-weight: 600; }

/* -- Slider -- */
.form-field input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  outline: none;
}
.form-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
  border: 2px solid var(--white);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.form-field input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
  border: 2px solid var(--white);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

/* -- Scale-Buttons -- */
.form-scale-btn {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all .15s;
  background: var(--bg);
  color: var(--navy);
}
.form-scale-btn.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* -- Matrix-Tabelle -- */
.form-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.form-matrix th {
  padding: 8px;
  text-align: center;
  border-bottom: 2px solid var(--line);
  font-weight: 600;
  color: var(--navy);
  font-size: 13px;
}
.form-matrix td {
  padding: 8px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.form-matrix td:first-child {
  text-align: left;
  font-weight: 500;
}
.form-matrix input[type="radio"],
.form-matrix input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

/* -- Produkt-Auswahl -- */
.form-product-item {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: border-color var(--trans);
}
.form-product-item:hover { border-color: var(--blue); }
.form-product-item .product-info { flex: 1; }
.form-product-item .product-name { font-weight: 600; color: var(--navy); }
.form-product-item .product-price { color: var(--blue); font-weight: 700; font-size: var(--fs-lg); }
.form-product-item .product-desc { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }
.form-product-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}
.form-product-qty button {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
}
.form-product-qty button:hover { background: var(--line); }
.form-product-qty span {
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

/* -- Columns-Layout fuer Radio/Checkbox -- */
.form-options-cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 12px; }
.form-options-cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 12px; }
.form-options-cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 12px; }

/* -- Einklappbarer Abschnitt -- */
.form-section-collapse {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  margin: var(--sp-md) 0;
}
.form-section-collapse summary {
  padding: var(--sp-sm) var(--sp-md);
  background: var(--bg);
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
  list-style: none;
}
.form-section-collapse summary::before {
  content: '▸ ';
  transition: transform var(--trans);
}
.form-section-collapse[open] summary::before { content: '▾ '; }

/* -- Readonly-Felder -- */
.form-field .input[readonly],
.form-field textarea[readonly] {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
}

/* -- Submit-Bereich -- */

.form-submit-area {
  margin-top: var(--sp-xl);
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.form-submit-btn {
  padding: var(--sp-md) var(--sp-xl);
  font-size: var(--fs-base);
  font-weight: 600;
}

/* Erfolgs-/Fehlermeldung */
.form-success-msg {
  background: var(--ok-bg);
  border: 1px solid var(--ok);
  border-radius: var(--r);
  padding: var(--sp-lg);
  text-align: center;
}

.form-success-msg h3 {
  color: var(--ok);
  margin-bottom: var(--sp-sm);
}

.form-success-msg p {
  color: var(--text);
  line-height: 1.6;
}

.form-error-msg {
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  border-radius: var(--r-sm);
  padding: var(--sp-sm) var(--sp-md);
  color: var(--danger);
  font-size: var(--fs-sm);
}

/* Forms Responsive */
@media (max-width: 640px) {
  .forms-grid {
    grid-template-columns: 1fr;
  }

  .form-detail {
    padding: 0;
  }

  .form-detail-title {
    font-size: var(--fs-xl);
  }
}


/* ==========================================================================
   11. PAGE: DOCUMENTS — Dokumente
   ========================================================================== */

/* -- Filter-Bereich -- */

.documents-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
  align-items: center;
}

.documents-search {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.documents-search .input {
  width: 100%;
  padding: var(--sp-sm) var(--sp-md);
  font-size: var(--fs-md);
}

.documents-categories {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
}

/* -- Kategorie-Gruppen -- */

.documents-category-group {
  margin-bottom: var(--sp-xl);
}

.documents-category-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--sp-md);
  padding-bottom: var(--sp-xs);
  border-bottom: 2px solid var(--line);
}

/* -- Dokument-Grid -- */

.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-md);
}

/* Dokument-Karte */
.document-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--sp-md);
  display: flex;
  gap: var(--sp-md);
  align-items: flex-start;
  transition: all var(--trans);
}

.document-card:hover {
  box-shadow: var(--shadow-md);
}

/* Dateityp-Icon */
.document-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

.document-icon.file-pdf         { background: #fef2f2; color: #dc2626; }
.document-icon.file-word        { background: #eff6ff; color: #2563eb; }
.document-icon.file-spreadsheet { background: #f0fdf4; color: #16a34a; }
.document-icon.file-presentation { background: #fefce8; color: #ca8a04; }
.document-icon.image            { background: #faf5ff; color: #9333ea; }
.document-icon.video            { background: #fff7ed; color: #ea580c; }
.document-icon.archive          { background: #f5f5f4; color: #78716c; }
.document-icon.file-text        { background: #f8fafc; color: #64748b; }
.document-icon.file             { background: #f1f5f9; color: #475569; }

/* Dokument-Info */
.document-info {
  flex: 1;
  min-width: 0;
}

.document-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 var(--sp-xs);
  word-break: break-word;
}

.document-desc {
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: var(--sp-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  align-items: center;
  font-size: var(--fs-xs);
  color: var(--muted);
}

.document-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--muted);
}

.document-size {
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* Download-Button */
.document-download {
  flex-shrink: 0;
  align-self: center;
}

.document-download-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-xs) var(--sp-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--blue);
  background: var(--acc-bg);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--trans);
  text-decoration: none;
}

.document-download-btn:hover {
  background: var(--blue);
  color: var(--white);
}

/* -- Training-Cards (Schulungsseite) -- */

.training-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card-bg, #fff);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

.training-card:not(.training-card--soon):hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  border-color: var(--acc);
}

.training-card--soon {
  cursor: default;
  border-style: dashed;
}

/* -- Internal Badge (generic, wiederverwendbar) -- */

.internal-badge,
.document-internal-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  font-size: var(--fs-xs);
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: var(--r-sm);
  white-space: nowrap;
}

/* Position absolut oben rechts in einer Card */
.form-card,
.gallery-card,
.content-card {
  position: relative;
}

.form-card .internal-badge,
.gallery-card .internal-badge,
.content-card .internal-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
}

/* Documents Responsive */
@media (max-width: 640px) {
  .documents-grid {
    grid-template-columns: 1fr;
  }

  .documents-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .documents-search {
    max-width: 100%;
  }

  .document-card {
    flex-direction: column;
  }

  .document-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .document-download {
    align-self: flex-start;
  }
}


/* ==========================================================================
   12. PAGE: MEALPLAN — Speiseplan
   ========================================================================== */

/* -- Wochennavigation -- */

.mealplan-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
  flex-wrap: wrap;
}

.mealplan-nav-center {
  text-align: center;
  flex: 1;
}

.mealplan-week-label {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--navy);
}

.mealplan-week-dates {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-top: 2px;
}

.mealplan-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  transition: all var(--trans);
  flex-shrink: 0;
}

.mealplan-nav-btn:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.mealplan-nav-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.mealplan-today-btn {
  padding: var(--sp-xs) var(--sp-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--blue);
  background: var(--acc-bg);
  border: 1px solid transparent;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all var(--trans);
}

.mealplan-today-btn:hover {
  background: var(--blue);
  color: var(--white);
}

/* -- Toolbar (Heute / PDF) -- */

.mealplan-toolbar {
  display: flex;
  gap: var(--sp-sm);
  justify-content: center;
  margin-bottom: var(--sp-lg);
}

/* -- Desktop: Tabelle -- */

.mealplan-table {
  display: none;
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--sp-lg);
}

@media (min-width: 900px) {
  .mealplan-table {
    display: table;
  }
  .mealplan-mobile {
    display: none !important;
  }
}

.mealplan-table th {
  background: var(--navy);
  color: var(--white);
  padding: var(--sp-sm) var(--sp-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.mealplan-table th small {
  display: block;
  font-weight: 400;
  opacity: 0.7;
  font-size: var(--fs-xs);
}

.mealplan-table th.row-label {
  background: var(--navy2);
  width: 100px;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mealplan-table td {
  padding: var(--sp-xs) var(--sp-sm);
  border: 1px solid var(--line);
  vertical-align: top;
  font-size: var(--fs-sm);
}

.mealplan-table {
  table-layout: fixed;
  word-wrap: break-word;
}

.mealplan-table td.row-label-cell {
  background: #f0f4f8;
  font-weight: 600;
  font-size: var(--fs-xs);
  color: var(--navy2);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.mealplan-table td.weekend {
  background: #faf8ff;
}

/* -- Gericht-Zelle -- */

.meal-cell {
  min-height: 40px;
}

.meal-cell-empty {
  color: var(--line);
  font-style: italic;
  font-size: var(--fs-xs);
}

.meal-title-text {
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 2px;
}

.meal-allergens-inline {
  font-size: var(--fs-xs);
  color: var(--muted);
  vertical-align: super;
  font-weight: 400;
}

.meal-desc-text {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: 2px;
}

.meal-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.meal-flag {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  font-size: 10px;
  border-radius: var(--r-sm);
  white-space: nowrap;
}

.meal-flag-vegan      { background: #ecfdf5; color: #065f46; }
.meal-flag-vegetarian { background: #f0fdf4; color: #166534; }
.meal-flag-pork       { background: #fef2f2; color: #991b1b; }

/* -- Inline-Allergene/Zusatzstoffe -- */

.meal-allergens-inline,
.meal-additives-inline {
  font-size: 9px;
  color: #94a3b8;
  vertical-align: super;
  font-weight: 400;
  margin-left: 2px;
  cursor: help;
  letter-spacing: 0.02em;
}

.meal-additives-inline {
  font-style: italic;
}

/* -- Beliebtheits-Sterne (1..5, Viertelstern, Touch-tauglich) -- */
/* Default = 3 Sterne (neutral). Erst ab dem Schwellenwert (Setting
   mealplan_popularity_threshold) bewegt sich der Wert. Jeder Stern
   ist ein eigener Button mit ausreichend grossem Touch-Target. */

.meal-stars {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
}

.meal-stars-label {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
  font-weight: 500;
}

.meal-stars-hint {
  color: #94a3b8;
  font-weight: 400;
  font-size: 10px;
}

.meal-stars-row {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}

.meal-star {
  position: relative;
  display: inline-block;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 6px;
  margin: 0;
  font-size: 22px;
  line-height: 1;
  font-family: Arial, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(245, 158, 11, 0.25);
  transition: background .12s, border-color .12s, transform .08s;
  min-width: 40px;
  min-height: 40px;
  text-align: center;
}

.meal-star:hover:not(:disabled),
.meal-star:focus-visible:not(:disabled) {
  background: #fffbeb;
  border-color: #fbbf24;
  outline: none;
}

.meal-star:active:not(:disabled) {
  transform: scale(0.92);
  background: #fef3c7;
}

.meal-star.is-mine {
  background: #fef3c7;
  border-color: #f59e0b;
}

.meal-star:disabled {
  cursor: default;
  opacity: 0.85;
}

/* Stern-Glyphe (grau) und Goldfuellung (per width geclippt fuer Viertelsterne) */
.meal-star-bg {
  display: inline-block;
  color: #e2e8f0;
  position: relative;
}

.meal-star-fg {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  display: inline-block;
  color: #f59e0b;
  width: calc((100% - 12px) * (var(--star-fill, 50) / 100));
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
  transition: width .25s ease-out;
  text-align: left;
}

.meal-star.is-mine .meal-star-bg { color: #fde68a; }
.meal-star.is-mine .meal-star-fg { color: #d97706; }

.meal-stars-meta {
  margin-top: 5px;
  font-size: 11px;
  color: #64748b;
}

.meal-stars-meta strong {
  color: #0f2540;
}

/* Kompakt-Variante fuer Desktop-Tabellenzellen */
.meal-stars-compact {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed #e2e8f0;
}

/* In der Desktop-Tabelle haben wir keine Touch-Bedienung, also koennen
   die Sterne deutlich schlanker werden - sonst sprengt es die Spalten. */
.meal-stars-compact .meal-stars-row {
  gap: 0;
  flex-wrap: nowrap;
}

.meal-stars-compact .meal-star {
  font-size: 14px;
  min-width: 14px;
  min-height: 14px;
  width: 14px;
  height: 14px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
}

/* Im Kompaktmodus liegt der Goldstern direkt ueber dem grauen Stern,
   ohne Innenabstand. Sonst wuerde er um 6px verschoben sein. */
.meal-stars-compact .meal-star-fg {
  top: 0;
  left: 0;
  right: 0;
  width: calc(100% * (var(--star-fill, 50) / 100));
}

.meal-stars-compact .meal-star:hover:not(:disabled),
.meal-stars-compact .meal-star:focus-visible:not(:disabled) {
  background: transparent;
  border-color: transparent;
  color: #f59e0b;
  transform: scale(1.15);
}

.meal-stars-compact .meal-star.is-mine {
  background: transparent;
  border-color: transparent;
}

.meal-stars-compact .meal-stars-meta {
  font-size: 9px;
  margin-top: 2px;
  white-space: nowrap;
  color: #94a3b8;
}

/* -- Mobile: Karten-Layout -- */

.mealplan-mobile {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.mealplan-day-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

.mealplan-day-header {
  background: var(--navy);
  color: var(--white);
  padding: var(--sp-sm) var(--sp-md);
  font-weight: 600;
  font-size: var(--fs-md);
  display: flex;
  justify-content: space-between;
}

.mealplan-day-header small {
  font-weight: 400;
  opacity: 0.7;
}

.mealplan-day-meals {
  padding: var(--sp-sm);
}

.mealplan-meal-row {
  display: flex;
  gap: var(--sp-sm);
  padding: var(--sp-sm);
  border-bottom: 1px solid var(--bg);
}

.mealplan-meal-row:last-child {
  border-bottom: none;
}

.mealplan-meal-type {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 80px;
  flex-shrink: 0;
  padding-top: 2px;
}

.mealplan-meal-content {
  flex: 1;
}

/* -- Notizen -- */

.mealplan-notes {
  background: var(--warn-bg);
  border: 1px solid rgba(217, 119, 6, 0.2);
  border-radius: var(--r);
  padding: var(--sp-md);
  font-size: var(--fs-sm);
  color: var(--text);
  margin-bottom: var(--sp-lg);
}

/* -- Allergen-Legende -- */

.allergen-legend {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--sp-md);
  margin-top: var(--sp-lg);
}

.allergen-legend h4 {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--sp-sm);
}

.allergen-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-xs) var(--sp-md);
}

.allergen-legend-item {
  font-size: var(--fs-xs);
  color: var(--muted);
}

.allergen-legend-item sup {
  font-weight: 700;
  color: var(--navy);
  margin-right: 2px;
}

/* -- Kein Plan -- */

.mealplan-empty {
  text-align: center;
  padding: var(--sp-2xl) var(--sp-lg);
  color: var(--muted);
}

.mealplan-empty-icon {
  font-size: 48px;
  margin-bottom: var(--sp-md);
  opacity: 0.4;
}

/* Mealplan Responsive */
@media (max-width: 640px) {
  .mealplan-nav {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .mealplan-nav-btn {
    align-self: center;
  }

  .mealplan-toolbar {
    flex-wrap: wrap;
  }
}


/* ==========================================================================
   13. PAGE: GALLERY — Galerie
   ========================================================================== */

/* -- Filter -- */

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-lg);
}

/* -- Bild-Grid -- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-md);
}

.gallery-item {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
  background: var(--bg);
  transition: transform var(--trans), box-shadow var(--trans);
}

.gallery-item:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  padding: var(--sp-sm);
  opacity: 0;
  transition: opacity var(--trans);
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-title {
  color: var(--white);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* -- Lightbox -- */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-lg);
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  max-height: 80dvh;
  object-fit: contain;
  border-radius: var(--r-sm);
}

.lightbox-close {
  position: fixed;
  top: var(--sp-md);
  right: var(--sp-md);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: var(--r-full);
  color: var(--white);
  font-size: 24px;
  cursor: pointer;
  transition: background var(--trans);
  z-index: 1;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: var(--r-full);
  color: var(--white);
  font-size: 20px;
  cursor: pointer;
  transition: background var(--trans);
  z-index: 1;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev {
  left: var(--sp-md);
}

.lightbox-next {
  right: var(--sp-md);
}

.lightbox-info {
  margin-top: var(--sp-md);
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
}

.lightbox-title {
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--white);
  margin-bottom: var(--sp-xs);
}

.lightbox-desc {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.6);
}

.lightbox-counter {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.5);
  margin-top: var(--sp-xs);
}

/* Gallery Responsive */
@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--sp-sm);
  }

  .lightbox-nav {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .lightbox-prev {
    left: var(--sp-sm);
  }

  .lightbox-next {
    right: var(--sp-sm);
  }
}


/* ==========================================================================
   TOOLS PAGE
   ========================================================================== */

/* Tool-Karten-Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
}

.tool-card {
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.tool-card:hover {
  border-color: var(--acc);
  box-shadow: 0 2px 12px rgba(15, 37, 64, 0.08);
  transform: translateY(-2px);
}

.tool-card-active {
  border-color: var(--blue);
  background: var(--acc-bg);
  box-shadow: 0 2px 12px rgba(37, 99, 168, 0.15);
}

.tool-card-icon {
  font-size: 2rem;
  color: var(--blue);
  margin-bottom: var(--sp-sm);
}

.tool-card-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--sp-xs);
}

.tool-card-desc {
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* Tool-Panel (Accordion-Bereich unter den Karten) */
.tool-panel {
  margin-bottom: var(--sp-lg);
}

.tool-panel .card {
  border-top: 3px solid var(--blue);
}

/* ----- Passwort-Generator ----- */
.pw-display {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 1px;
  word-break: break-all;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--sp-md);
  text-align: center;
  cursor: pointer;
  user-select: all;
  transition: background 0.15s;
}

.pw-display:hover {
  background: var(--acc-bg);
}

/* Staerke-Balken */
.pw-strength-bar {
  height: 6px;
  background: var(--bg);
  border-radius: var(--r-full);
  margin-top: var(--sp-sm);
  overflow: hidden;
}

.pw-strength-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.3s ease, background 0.3s ease;
}

.pw-strength-fill.pw-weak   { background: var(--danger); }
.pw-strength-fill.pw-medium { background: var(--warn);   }
.pw-strength-fill.pw-strong { background: var(--ok);     }

.pw-strength-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-top: var(--sp-xs);
}

.pw-strength-label.pw-weak   { color: var(--danger); }
.pw-strength-label.pw-medium { color: var(--warn);   }
.pw-strength-label.pw-strong { color: var(--ok);     }

/* Optionen */
.pw-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-sm) var(--sp-md);
  margin-top: var(--sp-md);
}

.pw-option {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  cursor: pointer;
  font-size: var(--fs-base);
  color: var(--text);
}

.pw-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  cursor: pointer;
}

/* Buttons */
.pw-actions {
  display: flex;
  gap: var(--sp-sm);
  flex-wrap: wrap;
}

/* Range-Slider */
.input-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--line);
  border-radius: var(--r-full);
  outline: none;
  margin-top: var(--sp-sm);
}

.input-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
  border: 2px solid var(--white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.input-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
  border: 2px solid var(--white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* ----- QR-Code Generator ----- */
.qr-preview {
  text-align: center;
  padding: var(--sp-md);
}

.qr-preview img {
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

/* ----- Bild-Toolkit ----- */
.img-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-xl) var(--sp-lg);
  border: 2px dashed var(--line);
  border-radius: var(--r-lg);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  min-height: 150px;
  color: var(--muted);
}

.img-dropzone:hover,
.img-dropzone-active {
  border-color: var(--blue);
  background: var(--acc-bg);
  color: var(--blue);
}

.img-info {
  font-size: var(--fs-sm);
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-xs);
}

.img-info-label {
  font-weight: 600;
  color: var(--text);
}

.img-savings {
  font-weight: 600;
}

.img-size-fields {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-sm);
  margin-top: var(--sp-md);
}

.img-size-fields .form-field {
  flex: 1;
}

.img-ratio-lock {
  padding: var(--sp-sm);
  cursor: pointer;
  color: var(--blue);
  margin-bottom: var(--sp-xs);
  font-size: 1.2rem;
  transition: color 0.15s;
}

.img-ratio-lock:hover {
  color: var(--navy);
}

.img-format-row {
  display: flex;
  gap: var(--sp-md);
  align-items: flex-start;
}

.img-format-row .form-field {
  flex: 1;
}

.img-preview {
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--sp-sm);
}

.img-preview img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: var(--r-sm);
}

.img-result {
  border-top: 1px solid var(--line);
  padding-top: var(--sp-md);
}

/* Tools Responsive */
@media (max-width: 640px) {
  .tools-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-sm);
  }

  .tool-card {
    padding: var(--sp-md);
  }

  .pw-options {
    grid-template-columns: 1fr;
  }

  .pw-display {
    font-size: 1rem;
  }

  .img-size-fields {
    flex-direction: column;
    align-items: stretch;
  }

  .img-ratio-lock {
    text-align: center;
    margin-bottom: 0;
  }

  .img-format-row {
    flex-direction: column;
  }

  .pw-actions {
    flex-direction: column;
  }

  .pw-actions .btn {
    width: 100%;
    justify-content: center;
  }
}


/* ==========================================================================
   UX IMPROVEMENTS — Scroll-to-Top, Breadcrumb, Mobile-Suche,
   groessere Touch-Targets, verbesserte Buttons
   Hinzugefuegt: 2026-04-06
   ========================================================================== */


/* ==================== Scroll-to-Top Button ==================== */

.scroll-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  border: none;
  cursor: pointer;
  z-index: var(--z-sticky);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--trans), transform var(--trans);
  touch-action: manipulation;
}

.scroll-to-top:hover {
  background: var(--navy2);
  transform: translateY(-2px);
}

@media (max-width: 600px) {
  .scroll-to-top {
    bottom: max(24px, env(safe-area-inset-bottom, 24px));
    width: 44px;
    height: 44px;
  }
}


/* ==================== Breadcrumb ==================== */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--sp-md);
  padding: 0 var(--sp-md);
  font-size: var(--fs-md);
}

.breadcrumb-home {
  color: var(--blue);
  text-decoration: none;
  font-size: var(--fs-md);
  transition: color var(--trans);
}

.breadcrumb-home:hover {
  color: var(--navy);
  text-decoration: underline;
}

.breadcrumb-sep {
  color: var(--muted);
  margin: 0 6px;
  font-size: var(--fs-md);
}

.breadcrumb-current {
  color: var(--text);
  font-size: var(--fs-md);
  font-weight: 600;
}


/* ==================== Mobile-Suche ==================== */

/* Desktop-Suche: normal sichtbar */
.hdr-search-desktop {
  position: relative;
  display: block;
}

/* Mobile-Such-Button: nur auf Mobile sichtbar */
.hdr-search-mobile-btn {
  display: none !important;
}

/* Mobile-Overlay: nur auf Mobile sichtbar */
.hdr-search-mobile-overlay {
  display: none;
}

@media (max-width: 600px) {
  /* Desktop-Suche verstecken */
  .hdr-search-desktop {
    display: none !important;
  }

  /* Mobile-Button anzeigen */
  .hdr-search-mobile-btn {
    display: flex !important;
  }

  /* Mobile-Overlay positionieren */
  .hdr-search-mobile-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    padding: var(--sp-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    z-index: var(--z-dropdown);
    border-radius: 0 0 var(--r) var(--r);
  }

  /* hdr-search braucht relative fuer Overlay-Positionierung */
  .hdr-search {
    display: flex !important;
    position: relative;
    max-width: none;
    flex: 0;
    margin-left: auto;
  }

  /* Header als Positionierungs-Kontext */
  .hdr {
    position: relative;
  }

  .hdr-search-mobile-overlay {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
  }
}


/* ==================== Globale Button-Verbesserung ==================== */

.btn {
  min-height: 44px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--r);
}

.btn-primary {
  padding: 12px 24px;
}

.btn-lg {
  min-height: 52px;
  padding: 14px 28px;
  font-size: 16px;
}

.btn-sm {
  min-height: 32px;
  padding: var(--sp-xs) var(--sp-sm);
  font-size: var(--fs-xs);
}


/* ==================== Chip/Filter Buttons groesser ==================== */

.dept-chip,
.chip {
  min-height: 40px;
  padding: 8px 16px;
  font-size: var(--fs-md);
}


/* ==================== Nav-Tabs groesser ==================== */

.nav-tab {
  min-height: 44px;
  padding: 8px 16px;
  font-size: var(--fs-md);
}


/* ==================== Input-Felder groesser ==================== */

.input,
.select,
.textarea,
input[type="text"],
input[type="email"],
input[type="search"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  min-height: 44px;
  padding: 10px 14px;
  font-size: 15px;
}


/* ==================== Kontakt-Links als Touch-Buttons ==================== */

.contact-link {
  min-height: 48px;
  padding: 12px 16px;
  font-size: 15px;
}


/* ==================== Card-Padding erhoehen ==================== */

.card,
.contact-card,
.notice-card {
  padding: 20px;
}

/* ==========================================================================
   MOBILE NAVIGATION FIX — iPhone 16 Pro Max (430px)
   13 Tabs brauchen horizontales Scrollen mit visuellem Hinweis
   ========================================================================== */

/* Nav-Bar: Scroll-Container mit Fade-Hinweis */
.nav-bar {
  position: relative;
}

/* Fade-Hinweis rechts: zeigt dass mehr Tabs kommen */
.nav-bar::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(to right, transparent, var(--white));
  pointer-events: none;
  z-index: 2;
}

@media (max-width: 600px) {

  /* Nav: Kompakter, aber erkennbar scrollbar */
  .nav-bar {
    position: relative;
  }

  .nav-tabs {
    padding: 0 8px;
    gap: 2px;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    /* Rechts Platz lassen fuer Fade */
    padding-right: 40px;
  }

  .nav-tab {
    padding: 6px 10px;
    min-height: 40px;
    min-width: 40px;
    flex-shrink: 0;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10px;
  }

  /* Auf iPhone: Label zeigen aber KURZ */
  .nav-tab .nav-label {
    display: block;
    font-size: 9px;
    line-height: 1;
    opacity: 0.7;
    max-width: 50px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-tab.active .nav-label {
    opacity: 1;
    font-weight: 600;
  }

  .nav-tab svg {
    width: 16px;
    height: 16px;
  }

  /* Aktiver Tab: Mehr sichtbar */
  .nav-tab.active {
    background: var(--acc-bg);
    border-radius: 8px;
  }

  /* Aktiver Tab automatisch ins Sichtfeld scrollen */
  .nav-tab.active {
    scroll-snap-align: center;
  }

  /* Header: Kompakt aber lesbar */
  .hdr {
    height: 48px;
    padding: 0 10px;
  }

  .hdr-logo {
    height: 24px;
  }

  .hdr-title h1 {
    font-size: 14px;
  }

  .hdr-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
  }

  /* Main: Weniger Rand */
  .main {
    padding: 8px;
  }

  .container {
    padding: 0 4px;
  }

  /* H2 etwas kleiner */
  h2 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  /* Footer: Safe Area fuer iPhone Home-Bar */
  .footer {
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  /* Scroll-to-Top: Ueber Home-Bar */
  .scroll-to-top {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    right: 16px !important;
    width: 44px !important;
    height: 44px !important;
  }

  /* Breadcrumb kleiner */
  .breadcrumb {
    font-size: 12px;
    margin-bottom: 8px;
  }

  /* Startseite: 2-Spalten-Grids auf 1 Spalte */
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   DESIGN-ERWEITERUNGEN 2026-04-12
   A) Typographie: Serifenschrift + Gold-Akzente
   B) Sehr kleine Smartphones (max-width: 360px)
   ========================================================================== */

/* ==================== A) Headings — Cormorant Garamond + Gold ==================== */

/* Seitenüberschriften im Content-Bereich */
.page h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.875rem;
  color: var(--navy);
  letter-spacing: .3px;
}

/* Goldener Unterstrich-Akzent */
.page h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: var(--gold);
  margin-top: 8px;
}

/* section-title: gleiche Serif-Behandlung */
.section-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.875rem;
  color: var(--navy);
  letter-spacing: .3px;
}

.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: var(--gold);
  margin-top: 8px;
}

/* ==================== B) Sehr kleine Smartphones (max-width: 360px) ==================== */

@media (max-width: 360px) {

  .nav-tab {
    min-width: 48px;
    padding: 6px 6px;
  }

  /* Nav-Label auf sehr kleinen Screens ausblenden — nur Icon zeigen */
  .nav-tab .nav-label,
  .nav-label {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Umlagen-Modul
═══════════════════════════════════════════════════════════════ */

/* Kostenart-Kacheln */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
}

.type-kachel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--sp-sm) var(--sp-xs);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--trans), background var(--trans);
  font-size: 0.8rem;
  color: var(--text);
  user-select: none;
}

.type-kachel:hover {
  border-color: var(--acc);
  background: var(--acc-light, rgba(0,100,200,0.06));
}

.type-kachel.selected {
  border-color: var(--acc);
  background: var(--acc-light, rgba(0,100,200,0.1));
  color: var(--acc);
  font-weight: 600;
}

.type-kachel svg {
  width: 28px;
  height: 28px;
  color: var(--muted);
  transition: color var(--trans);
}

.type-kachel.selected svg {
  color: var(--acc);
}

.type-kachel .kachel-desc {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.3;
}

/* Aufteilungs-Vorschau */
.aufteilung-vorschau {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-sm);
  margin-top: var(--sp-xs);
  max-height: 200px;
  overflow-y: auto;
}

.aufteilung-zeile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-light, #f0f0f0);
}

.aufteilung-zeile:last-child {
  border-bottom: none;
}

/* Zeile mit Alt-Hinweis (orange Tint) */
.row-alt {
  background: rgba(255, 140, 0, 0.07);
}

.row-alt:hover {
  background: rgba(255, 140, 0, 0.12);
}

/* Alt-Hinweis-Badge und Warn-Badge */
.badge-warn {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Kommentare */
.kommentar {
  padding: var(--sp-sm);
  background: var(--surface);
  border-left: 3px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: var(--sp-xs);
}

.kommentar-autor {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--navy);
}

.kommentar-zeit {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: var(--sp-xs);
}

.kommentar-text {
  margin-top: 4px;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.kommentar-eingabe {
  display: flex;
  gap: var(--sp-xs);
  margin-top: var(--sp-sm);
}

.kommentar-eingabe textarea {
  flex: 1;
  resize: vertical;
  min-height: 60px;
}

/* Alt-Hinweis-Banner */
.alt-hinweis-banner {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--radius);
  padding: var(--sp-sm) var(--sp-md);
  color: #856404;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
  font-size: 0.9rem;
}

