/* ═══════════════════════════════════════════════════════════════════
   portal.css v1.3 — Vereinsportal Fasnetgilde Markgröningen
   Cross-browser: Edge, Chrome, Firefox, Safari, Opera
   Responsive:    Desktop, Tablet, Smartphone (iOS/Android/Windows)
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800;900&family=Barlow:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Themes (Fresh Sport = Standard, Royal Classic = rot) ── */
:root {
  --p:         #0D47A1;
  --p-hell:    #1565C0;
  --p-dunkel:  #0A3578;
  --p-tint:    #E3F2FD;
  --p-tint2:   #BBDEFB;
  --akzent:    #FFC107;
  --akzent-h:  #FFD451;
  --akzent-d:  #E0A800;
  --creme:     #F4F6F9;
  --creme-d:   #E2E8F0;
  --dunkel:    #1A2332;
  --grau:      #64748B;
  --grau-h:    #EEF2F7;
  --weiss:     #FFFFFF;
  --shadow-s:  0 1px 3px rgba(13,71,161,0.08);
  --shadow-m:  0 4px 16px rgba(13,71,161,0.13);
  --shadow-l:  0 8px 32px rgba(13,71,161,0.18);
  --gruen:     #16A34A;
  --gruen-h:   #DCFCE7;
  --orange:    #EA580C;
  --orange-h:  #FFEDD5;
  --rot:       #DC2626;
  --rot-h:     #FEE2E2;
  --r:         12px;
  --r-sm:      8px;
  --r-xs:      5px;
  --f-head:    'Barlow Condensed', Arial, sans-serif;
  --f-body:    'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --f-mono:    'JetBrains Mono', 'Courier New', monospace;
  --sidebar-w: 240px;
}

[data-theme="classic"] {
  --p:         #9B1C1C;
  --p-hell:    #B52020;
  --p-dunkel:  #6B0F0F;
  --p-tint:    #FFF0F0;
  --p-tint2:   #FECACA;
  --akzent:    #D4A820;
  --akzent-h:  #EDCA50;
  --akzent-d:  #9C7A12;
  --creme:     #FDFAF0;
  --creme-d:   #F2E8CC;
  --dunkel:    #1A0A0A;
  --grau:      #6B6060;
  --grau-h:    #F2EDE0;
  --shadow-s:  0 1px 3px rgba(107,15,15,0.08);
  --shadow-m:  0 4px 16px rgba(107,15,15,0.14);
  --shadow-l:  0 8px 32px rgba(107,15,15,0.20);
}

@media (prefers-color-scheme: dark) {
  :root {
    --p:        #4D8EDB;
    --p-hell:   #5B9FE8;
    --p-dunkel: #3A7BC8;
    --p-tint:   #0D1F3C;
    --p-tint2:  #1A3460;
    --akzent:   #FFB300;
    --creme:    #131B27;
    --creme-d:  #1E2A3B;
    --dunkel:   #EEF2F7;
    --grau:     #94A3B8;
    --grau-h:   #1A2535;
    --weiss:    #1D2840;
    --shadow-s: 0 1px 3px rgba(0,0,0,0.25);
    --shadow-m: 0 4px 16px rgba(0,0,0,0.40);
    --shadow-l: 0 8px 32px rgba(0,0,0,0.55);
    --gruen:    #22C55E;
    --gruen-h:  #052E16;
    --orange:   #FB923C;
    --orange-h: #431407;
    --rot:      #F87171;
    --rot-h:    #450A0A;
  }
  [data-theme="classic"] {
    --p:        #D97070;
    --p-hell:   #E08080;
    --p-dunkel: #A04040;
    --p-tint:   #2A0A0A;
    --p-tint2:  #3D1010;
    --creme:    #1A100A;
    --creme-d:  #261810;
    --dunkel:   #F2EDE0;
    --grau:     #9A8A80;
    --grau-h:   #261810;
  }
}

/* ── Reset ── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--f-body);
  background: var(--creme);
  color: var(--dunkel);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--p-hell); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }

/* ════════════════════════════════════════════════════════════════
   TOPBAR (Dashboard + öffentliche Seiten)
   ════════════════════════════════════════════════════════════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: linear-gradient(100deg, var(--p-dunkel) 0%, var(--p) 55%, var(--p-hell) 100%);
  box-shadow: var(--shadow-m);
  padding-top: env(safe-area-inset-top, 0px);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 58px;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  gap: 0.75rem;
}

.topbar-brand {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  min-width: 0;
  flex-shrink: 0;
}

/* Logo — wie MV: feste Höhe, drop-shadow, kein Hintergrund */
.topbar-logo {
  height: 42px;
  width: auto;
  -o-object-fit: contain;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  display: block;
}

.topbar-title {
  font-family: var(--f-head);
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.topbar-btn {
  display: -webkit-inline-box;
  display: -webkit-inline-flex;
  display: inline-flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  gap: 0.35rem;
  color: rgba(255,255,255,0.88);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.topbar-btn:hover { background: rgba(255,255,255,0.22); text-decoration: none; }
.topbar-btn.gold  { background: var(--akzent); color: var(--dunkel); border-color: var(--akzent-d); font-weight: 700; }
.topbar-btn.gold:hover { background: var(--akzent-h); }

.topbar-name {
  color: rgba(255,255,255,0.9);
  font-size: 0.875rem;
  white-space: nowrap;
}

.role-badge {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border-radius: var(--r-xs);
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.95);
  border: 1px solid rgba(255,255,255,0.28);
  white-space: nowrap;
}

.theme-toggle {
  background: none;
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.85);
  border-radius: var(--r-sm);
  padding: 0.28rem 0.5rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.15s;
  white-space: nowrap;
  line-height: 1;
}
.theme-toggle:hover { background: rgba(255,255,255,0.18); }

/* ════════════════════════════════════════════════════════════════
   ADMIN-LAYOUT: Sidebar + Content
   ════════════════════════════════════════════════════════════════ */
.admin-layout {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  min-height: calc(100vh - 58px);
}

/* ── Sidebar ── */
.admin-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--weiss);
  border-right: 1px solid var(--creme-d);
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  flex-direction: column;
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-s);
  z-index: 100;
  transition: -webkit-transform 0.25s ease;
  transition: transform 0.25s ease;
}

.sidebar-group {
  padding: 0.6rem 0 0.4rem;
  border-bottom: 1px solid var(--creme-d);
}
.sidebar-group:last-child { border-bottom: none; }

.sidebar-group-label {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grau);
  padding: 0 1rem 0.4rem;
}

.sidebar-link {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--dunkel);
  text-decoration: none;
  border-radius: 0;
  transition: background 0.12s, color 0.12s;
  position: relative;
}
.sidebar-link:hover { background: var(--creme); text-decoration: none; }
.sidebar-link.active {
  background: var(--p-tint);
  color: var(--p);
  font-weight: 700;
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--p);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
}
.sidebar-icon { font-size: 1rem; width: 1.2rem; text-align: center; flex-shrink: 0; }

.sidebar-badge {
  margin-left: auto;
  background: var(--orange);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
  min-width: 1.2rem;
  text-align: center;
}

/* Hamburger-Button (nur Mobil) */
.sidebar-toggle {
  display: none;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: var(--r-sm);
  padding: 0.28rem 0.5rem;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99;
}

/* ── Admin-Content ── */
.admin-content {
  flex: 1;
  min-width: 0;
  padding: 1.5rem;
  max-width: calc(100% - var(--sidebar-w));
}

.admin-page-title {
  font-family: var(--f-head);
  font-weight: 900;
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  color: var(--dunkel);
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  gap: 0.5rem;
}

/* ════════════════════════════════════════════════════════════════
   KARTEN (Cards)
   ════════════════════════════════════════════════════════════════ */
.card {
  background: var(--weiss);
  border: 1px solid var(--creme-d);
  border-radius: var(--r);
  box-shadow: var(--shadow-s);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.card-header {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--creme-d);
  background: var(--grau-h);
}

.card-title {
  font-family: var(--f-head);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.01em;
  color: var(--dunkel);
  flex: 1;
}

.card-body { padding: 1.25rem; }
.card-body-sm { padding: 0.85rem 1.25rem; }

/* Grid für Cards */
.card-grid {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.card-grid .card { flex: 1 1 320px; margin-bottom: 0; }

/* ════════════════════════════════════════════════════════════════
   KACHEL-GRID (Dashboard)
   ════════════════════════════════════════════════════════════════ */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem;
  padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
}

.tile-grid {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.tile {
  background: var(--weiss);
  border: 1px solid var(--creme-d);
  border-radius: var(--r);
  box-shadow: var(--shadow-s);
  overflow: hidden;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  flex-direction: column;
  transition: box-shadow 0.15s, -webkit-transform 0.15s;
  transition: box-shadow 0.15s, transform 0.15s;
  flex: 1 1 280px;
  min-width: 260px;
  max-width: 400px;
}
.tile:hover { box-shadow: var(--shadow-m); -webkit-transform: translateY(-2px); transform: translateY(-2px); }

.tile-header {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: flex-start;
  -webkit-align-items: flex-start;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem 0.8rem;
  border-bottom: 1px solid var(--creme-d);
  position: relative;
}

.tile-icon-wrap {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: var(--r-sm);
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

.tile-title-group { min-width: 0; flex: 1; }

.tile-module-name {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--grau);
  margin-bottom: 2px;
}

.tile-headline {
  font-family: var(--f-head);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--dunkel);
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tile-status {
  position: absolute;
  top: 0.9rem;
  right: 0.85rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tile-status.status-ok        { background: var(--gruen); }
.tile-status.status-attention { background: var(--orange); }
.tile-status.status-warn      { background: var(--rot); }

.tile-body {
  padding: 0.8rem 1rem;
  flex: 1;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  flex-direction: column;
  gap: 0.6rem;
}

.tile-stats {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 0.4rem 1.3rem;
}

.tile-stat { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -webkit-flex-direction: column; flex-direction: column; }
.tile-stat-value { font-family: var(--f-head); font-weight: 800; font-size: 1.45rem; line-height: 1.1; color: var(--p); }
.tile-stat-label { font-size: 0.73rem; color: var(--grau); font-weight: 500; }

.tile-items { border-top: 1px solid var(--creme-d); padding-top: 0.5rem; display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -webkit-flex-direction: column; flex-direction: column; gap: 0.28rem; }
.tile-item  { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-pack: justify; -webkit-justify-content: space-between; justify-content: space-between; -webkit-box-align: baseline; -webkit-align-items: baseline; align-items: baseline; gap: 0.5rem; font-size: 0.875rem; }
.tile-item-title    { color: var(--dunkel); font-weight: 500; }
.tile-item-subtitle { color: var(--grau); white-space: nowrap; font-size: 0.8rem; }

.tile-actions {
  margin-top: auto;
  padding: 0.65rem 1rem 0.8rem;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  gap: 0.5rem;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  border-top: 1px solid var(--creme-d);
}

.tile-stale-note { font-size: 0.73rem; color: var(--grau); font-style: italic; padding: 0 1rem 0.4rem; }

/* ════════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════════ */
.btn {
  display: -webkit-inline-box;
  display: -webkit-inline-flex;
  display: inline-flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--r-sm);
  border: none;
  font-family: var(--f-body);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition: opacity 0.15s, -webkit-transform 0.1s;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
}
.btn:active { -webkit-transform: translateY(1px); transform: translateY(1px); }
.btn:hover  { opacity: 0.88; text-decoration: none; }
.btn:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary   { background: var(--p);      color: #fff; }
.btn-akzent    { background: var(--akzent); color: var(--dunkel); }
.btn-secondary { background: var(--weiss);  color: var(--p); border: 1.5px solid var(--creme-d); }
.btn-secondary:hover { background: var(--creme); opacity: 1; }
.btn-danger    { background: var(--rot);    color: #fff; }
.btn-ghost     { background: transparent;   color: var(--p); border: 1.5px solid var(--p-tint2); }
.btn-block     { width: 100%; }
.btn-sm        { font-size: 0.8rem; padding: 0.35rem 0.7rem; }
.btn-lg        { font-size: 1rem;   padding: 0.65rem 1.3rem; }

/* ════════════════════════════════════════════════════════════════
   FORMULARE
   ════════════════════════════════════════════════════════════════ */
.field { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -webkit-flex-direction: column; flex-direction: column; gap: 0.3rem; margin-bottom: 0.9rem; }
.field-label { font-size: 0.82rem; font-weight: 600; color: var(--grau); }
.field-hint  { font-size: 0.78rem; color: var(--grau); margin-top: 0.2rem; }

input[type="text"], input[type="password"], input[type="email"],
input[type="search"], input[type="number"], input[type="tel"],
input[type="url"], select, textarea {
  font-family: var(--f-body);
  font-size: 0.9rem;
  padding: 0.55rem 0.8rem;
  border: 1.5px solid var(--creme-d);
  border-radius: var(--r-sm);
  background: var(--creme);
  color: var(--dunkel);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.7rem center; padding-right: 2rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--p-hell); box-shadow: 0 0 0 3px var(--p-tint); }
textarea { resize: vertical; min-height: 100px; }

.input-group { display: -webkit-box; display: -webkit-flex; display: flex; gap: 0.5rem; }
.input-group input, .input-group select { flex: 1; }

/* Logo-Vorschau */
.logo-preview {
  width: 100%;
  max-width: 300px;
  height: 80px;
  border: 1.5px solid var(--creme-d);
  border-radius: var(--r-sm);
  background: var(--creme);
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.logo-preview img {
  max-height: 64px;
  max-width: 260px;
  width: auto;
  height: auto;
  -o-object-fit: contain;
  object-fit: contain;
}

/* ════════════════════════════════════════════════════════════════
   TABELLEN
   ════════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; min-width: 480px; }
th {
  text-align: left;
  padding: 0.5rem 0.85rem;
  background: var(--grau-h);
  color: var(--grau);
  font-weight: 700;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--creme-d);
  white-space: nowrap;
}
td { padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--creme-d); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--creme); }

code {
  font-family: var(--f-mono);
  font-size: 0.82em;
  background: var(--grau-h);
  padding: 0.1rem 0.4rem;
  border-radius: var(--r-xs);
  color: var(--p);
}

/* ════════════════════════════════════════════════════════════════
   TABS
   ════════════════════════════════════════════════════════════════ */
.tab-bar {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--creme-d);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-btn {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.65rem 1.2rem;
  border: none;
  background: none;
  color: var(--grau);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  -webkit-appearance: none;
}
.tab-btn:hover { color: var(--p); }
.tab-btn.active { color: var(--p); border-bottom-color: var(--p); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ════════════════════════════════════════════════════════════════
   ALERTS
   ════════════════════════════════════════════════════════════════ */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border-left: 4px solid transparent;
}
.alert-error { background: var(--rot-h);    color: var(--rot);    border-color: var(--rot); }
.alert-info  { background: var(--p-tint);   color: var(--p);      border-color: var(--p); }
.alert-ok    { background: var(--gruen-h);  color: var(--gruen);  border-color: var(--gruen); }
.alert-warn  { background: var(--orange-h); color: var(--orange); border-color: var(--orange); }

/* ════════════════════════════════════════════════════════════════
   STATUS-BADGES
   ════════════════════════════════════════════════════════════════ */
.badge {
  display: -webkit-inline-box;
  display: -webkit-inline-flex;
  display: inline-flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-green  { background: var(--gruen-h);  color: var(--gruen); }
.badge-orange { background: var(--orange-h); color: var(--orange); }
.badge-red    { background: var(--rot-h);    color: var(--rot); }
.badge-gray   { background: var(--grau-h);   color: var(--grau); }
.badge-blue   { background: var(--p-tint);   color: var(--p); }

/* ════════════════════════════════════════════════════════════════
   AUTH-SEITEN (Login, Gast)
   ════════════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(155deg, var(--p-dunkel) 0%, var(--p) 55%, var(--p-hell) 100%);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--weiss);
  border-radius: var(--r);
  box-shadow: var(--shadow-l);
  overflow: hidden;
}

.auth-card-header {
  background: linear-gradient(100deg, var(--p-dunkel), var(--p));
  padding: 1.8rem 1.5rem 1.4rem;
  text-align: center;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  gap: 0.75rem;
}

/* Logo im Auth-Header — proportional, kein Strecken */
.auth-logo {
  height: 64px;
  width: auto;
  max-width: 200px;
  -o-object-fit: contain;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.35));
}

.auth-title    { font-family: var(--f-head); font-weight: 900; font-size: 1.3rem; color: #fff; }
.auth-subtitle { color: rgba(255,255,255,0.78); font-size: 0.875rem; }
.auth-card-body { padding: 1.5rem; }
.auth-links    { margin-top: 1rem; text-align: center; font-size: 0.875rem; color: var(--grau); }
.auth-links a  { color: var(--p-hell); }
.auth-hint     { font-size: 0.84rem; color: var(--grau); margin-bottom: 0.9rem; }

/* ════════════════════════════════════════════════════════════════
   UPLOAD-ZONE
   ════════════════════════════════════════════════════════════════ */
.upload-zone {
  border: 2px dashed var(--creme-d);
  border-radius: var(--r);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  color: var(--grau);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--p-hell);
  background: var(--p-tint);
  color: var(--p);
}
.upload-zone-icon { font-size: 2.5rem; margin-bottom: 0.5rem; opacity: 0.5; }

.progress-bar  { height: 8px; background: var(--creme-d); border-radius: 99px; overflow: hidden; margin: 0.8rem 0; }
.progress-fill { height: 100%; background: var(--p); border-radius: 99px; width: 0; transition: width 0.3s; }

/* ════════════════════════════════════════════════════════════════
   EMPTY + SKELETON
   ════════════════════════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--grau); }
.empty-state h3 { font-family: var(--f-head); font-weight: 800; font-size: 1.3rem; margin-bottom: 0.5rem; color: var(--dunkel); }

.skeleton {
  background: linear-gradient(90deg, var(--creme-d) 25%, var(--grau-h) 50%, var(--creme-d) 75%);
  background-size: 200% 100%;
  -webkit-animation: shimmer 1.4s ease-in-out infinite;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r);
  min-height: 160px;
}
@-webkit-keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { -webkit-animation: none; animation: none; } }

/* ════════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════════ */
.portal-footer {
  text-align: center;
  padding: 1.25rem 1rem;
  font-size: 0.78rem;
  color: var(--grau);
  border-top: 1px solid var(--creme-d);
  margin-top: 2rem;
}
.portal-footer a { color: var(--grau); }
.portal-footer a:hover { color: var(--p); }

/* ════════════════════════════════════════════════════════════════
   CONTENT-SEITEN (Impressum, Datenschutz)
   ════════════════════════════════════════════════════════════════ */
.content-body { line-height: 1.8; }
.content-body h1,.content-body h2,.content-body h3 { font-family: var(--f-head); font-weight: 800; margin-top: 1.5rem; margin-bottom: 0.4rem; }
.content-body h1 { font-size: 1.8rem; }
.content-body h2 { font-size: 1.3rem; color: var(--p); }
.content-body h3 { font-size: 1.1rem; }
.content-body hr  { border: none; border-top: 1px solid var(--creme-d); margin: 1.5rem 0; }
.content-body a   { color: var(--p-hell); }
.content-body strong { font-weight: 700; }

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile First
   ════════════════════════════════════════════════════════════════ */

/* Tablet & kleiner: Sidebar versteckt, Hamburger sichtbar */
@media (max-width: 900px) {
  :root { --sidebar-w: 260px; }

  .sidebar-toggle { display: block; }

  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 300;
    -webkit-transform: translateX(-100%);
    transform: translateX(-100%);
    box-shadow: var(--shadow-l);
    padding-top: 58px;
  }
  .admin-sidebar.open {
    -webkit-transform: translateX(0);
    transform: translateX(0);
  }
  .sidebar-overlay.open { display: block; }

  .admin-content { max-width: 100%; padding: 1rem; }
  .admin-layout  { display: block; }

  .tile { flex: 1 1 100%; max-width: 100%; }
}

/* Smartphone */
@media (max-width: 640px) {
  .topbar-inner  { padding: 0 0.85rem; height: 52px; }
  .topbar-title  { font-size: 1.05rem; }
  .topbar-logo   { height: 30px; }
  .topbar-name   { display: none; }
  .role-badge    { display: none; }

  .page          { padding: 0.75rem; }
  .tile-grid     { gap: 0.75rem; }

  .auth-page     { padding: 0.85rem; }
  .auth-logo     { height: 50px; }
  .auth-title    { font-size: 1.1rem; }

  .card-grid .card { flex: 1 1 100%; }
  .tab-btn       { font-size: 0.85rem; padding: 0.55rem 0.85rem; }
}

/* Safe Area (iPhone Notch/Dynamic Island) */
@supports (padding: max(0px)) {
  .topbar { padding-left: max(0px, env(safe-area-inset-left)); padding-right: max(0px, env(safe-area-inset-right)); }
  body { padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* ════════════════════════════════════════════════════════════════
   KOMPATIBILITÄTS-ALIASE
   Alte Klassen auf neue Klassen mappen damit ältere Admin-Seiten
   und neue Seiten gleichzeitig funktionieren.
   ════════════════════════════════════════════════════════════════ */

/* admin-section → card */
.admin-section               { background:var(--weiss); border:1px solid var(--creme-d); border-radius:var(--r); box-shadow:var(--shadow-s); overflow:hidden; margin-bottom:1.25rem; }
.admin-section-title         { font-family:var(--f-head); font-weight:800; font-size:1rem; letter-spacing:.01em; padding:.85rem 1.25rem; border-bottom:1px solid var(--creme-d); background:var(--grau-h); color:var(--dunkel); margin:0; display:flex; align-items:center; gap:.5rem; }
.admin-section-body          { padding:1.25rem; }

/* table-responsive → table-wrap */
.table-responsive            { overflow-x:auto; -webkit-overflow-scrolling:touch; }

/* topbar-user → topbar-actions (alte Seiten) */
.topbar-user                 { display:flex; align-items:center; gap:.5rem; flex-shrink:0; }
.topbar-user a               { color:rgba(255,255,255,.88); font-size:.875rem; font-weight:600; padding:.28rem .65rem; border-radius:var(--r-sm); background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.22); cursor:pointer; transition:background .15s; white-space:nowrap; text-decoration:none; }
.topbar-user a:hover         { background:rgba(255,255,255,.22); text-decoration:none; }
.topbar-admin                { background:var(--akzent) !important; color:var(--dunkel) !important; border-color:var(--akzent-d) !important; font-weight:700 !important; }

/* space-Variable Fallback (alte Seiten nutzen var(--space-8)) */
:root { --space-8: 2rem; }

/* portal-footer falls auf alten Seiten fehlend */
.portal-footer               { text-align:center; padding:1.25rem 1rem; font-size:.78rem; color:var(--grau); border-top:1px solid var(--creme-d); margin-top:2rem; }
.portal-footer a             { color:var(--grau); }
.portal-footer a:hover       { color:var(--p); }
