/* ═══════════════════════════════════════════════════════════════
   RVP 2.0 — Stylesheet
   ═══════════════════════════════════════════════════════════════ */

:root {
  --gold:         #c9a84c;
  --gold-light:   #e8c96a;
  --gold-pale:    #fdf8ee;
  --dark:         #1a1a2e;
  --dark2:        #16213e;
  --dark3:        #0f3460;
  --text:         #e0e0e0;
  --text-dark:    #333;
  --bg:           #f4f1ea;
  --white:        #fff;
  --red:          #c0392b;
  --red-light:    #fadbd8;
  --green:        #27ae60;
  --green-light:  #d5f5e3;
  --orange:       #e67e22;
  --orange-light: #fdebd0;
  --blue-light:   #d6eaf8;
  --border:       #d0c9b8;
  --shadow:       0 2px 8px rgba(0,0,0,0.12);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.16);
  --radius:       8px;
  --radius-sm:    5px;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ───────────────────────────────────────────────── */
.app-header {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark3) 100%);
  color: var(--text);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  position: relative;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: stretch;
  gap: 0;
}
.logo {
  padding: 12px 20px 12px 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid rgba(255,255,255,0.1);
  margin-right: 8px;
}
.logo-main {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 2px;
}
.logo-sub {
  font-size: 0.7rem;
  color: #aaa;
  margin-top: 2px;
  white-space: nowrap;
}

/* ── Navigation ───────────────────────────────────────────── */
.main-nav {
  flex: 1;
  display: flex;
  align-items: stretch;
  gap: 0;
}
.main-nav > a {
  color: var(--text);
  text-decoration: none;
  padding: 0 12px;
  font-size: 0.82rem;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
}
.main-nav > a:hover,
.main-nav > a.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  background: rgba(201,168,76,0.08);
}

/* Nav-Gruppen (Dropdown) */
.nav-group { position: relative; display: flex; align-items: stretch; }
.nav-group-btn {
  background: none;
  border: none;
  color: var(--text);
  padding: 0 12px;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  font-family: inherit;
}
.nav-group-btn:hover,
.nav-group-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  background: rgba(201,168,76,0.08);
}
.nav-arrow { font-size: 0.65rem; transition: transform 0.2s; }
.nav-group:hover .nav-arrow,
.nav-group.open .nav-arrow { transform: rotate(180deg); }
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--dark2);
  border-top: 2px solid var(--gold);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 200;
}
.nav-group:hover .nav-dropdown,
.nav-group.open .nav-dropdown { display: block; }
.nav-dropdown a {
  display: block;
  color: var(--text);
  text-decoration: none;
  padding: 10px 16px;
  font-size: 0.82rem;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.nav-dropdown a:hover,
.nav-dropdown a.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: rgba(201,168,76,0.1);
}
.nav-dropdown .nav-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 4px 0;
}

/* Trennlinie zwischen Top-Level Menügruppen */
.main-nav > .nav-divider-top {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.15);
  margin: 0 4px;
  align-self: center;
  flex-shrink: 0;
}
/* Mobile: horizontale Linie */
@media (max-width: 768px) {
  .main-nav > .nav-divider-top {
    width: 100%;
    height: 1px;
    margin: 2px 0;
  }
}

/* User-Info & Logout */
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 0 12px;
  font-size: 0.82rem;
  color: #aaa;
  flex-shrink: 0;
  border-left: 1px solid rgba(255,255,255,0.1);
  margin-left: 8px;
}
.user-name { color: var(--gold); font-weight: 600; }
.btn-logout {
  background: var(--red);
  color: white;
  padding: 5px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-logout:hover { background: #a93226; }

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 14px;
  color: var(--gold);
  flex-direction: column;
  gap: 5px;
  align-self: center;
  touch-action: manipulation; /* eliminiert 300ms iOS-Tap-Delay */
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px;
  background: var(--gold);
  transition: all 0.3s; border-radius: 2px;
}
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ── Main Content ─────────────────────────────────────────── */
main.main-content {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 24px 20px;
}

/* ── Footer ───────────────────────────────────────────────── */
.app-footer {
  background: var(--dark);
  color: #777;
  padding: 12px 20px;
  font-size: 0.78rem;
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.footer-links a { color: #999; text-decoration: none; }
.footer-links a:hover { color: var(--gold); }

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gold);
}
.page-header h1 { font-size: 1.4rem; color: var(--dark3); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  border: none; cursor: pointer; font-size: 0.85rem;
  text-decoration: none; transition: all 0.2s; font-weight: 500;
  font-family: inherit; line-height: 1.3;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary   { background: var(--dark3); color: white; }
.btn-primary:hover   { background: var(--dark2); }
.btn-success   { background: var(--green); color: white; }
.btn-success:hover   { background: #229954; }
.btn-danger    { background: var(--red); color: white; }
.btn-danger:hover    { background: #a93226; }
.btn-warning   { background: var(--orange); color: white; }
.btn-warning:hover   { background: #ca6f1e; }
.btn-secondary { background: #7f8c8d; color: white; }
.btn-secondary:hover { background: #6c7a7d; }
.btn-gold      { background: var(--gold); color: var(--dark); }
.btn-gold:hover      { background: var(--gold-light); }
.btn-print     { background: #2c3e50; color: white; }
.btn-print:hover     { background: #1a252f; }
.btn-pdf       { background: #8e44ad; color: white; }
.btn-pdf:hover       { background: #7d3c98; }
.btn-sm  { padding: 4px 9px; font-size: 0.78rem; }
.btn-lg  { padding: 10px 20px; font-size: 0.95rem; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-dark); }
.btn-outline:hover { background: var(--bg); }

/* ── Kacheln ──────────────────────────────────────────────── */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.tile {
  background: white;
  border-radius: var(--radius);
  padding: 20px 16px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--gold);
  text-decoration: none;
  color: var(--text-dark);
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.tile-icon  { font-size: 1.8rem; }
.tile-label { font-size: 0.88rem; font-weight: 700; color: var(--dark3); }
.tile-sub   { font-size: 0.75rem; color: #888; }
.tile-count { font-size: 1.6rem; font-weight: 800; color: var(--dark3); }
.tile.tile-warn { border-left-color: var(--red); }
.tile.tile-ok   { border-left-color: var(--green); }

/* ── Dashboard ────────────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 16px; margin-bottom: 24px; }
.dash-card { background: white; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); border-left: 4px solid var(--gold); text-decoration: none; color: var(--text-dark); transition: all 0.2s; display: block; }
.dash-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.dash-card .dc-icon  { font-size: 1.6rem; float: right; }
.dash-card .dc-value { font-size: 2rem; font-weight: bold; color: var(--dark3); }
.dash-card .dc-label { font-size: 0.78rem; color: #888; margin-top: 4px; clear: both; }
.dash-card.dc-warn   { border-left-color: var(--red); }
.dash-card.dc-ok     { border-left-color: var(--green); }

/* ── Cards ────────────────────────────────────────────────── */
.card { background: white; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 20px; }
.card-header { background: linear-gradient(135deg, var(--dark3), var(--dark2)); color: white; padding: 12px 16px; font-weight: 600; font-size: 0.95rem; display: flex; justify-content: space-between; align-items: center; }
.card-body   { padding: 16px; }

/* ── Tabellen ─────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.data-table th {
  background: var(--dark3); color: white;
  padding: 10px 12px; text-align: left;
  font-weight: 600; cursor: pointer; user-select: none; white-space: nowrap;
}
table.data-table th:hover { background: var(--dark2); }
table.data-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data-table tr:hover td { background: #f8f5ee; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr.row-invalid td { background: var(--red-light) !important; }
table.data-table tr.row-valid   td { background: var(--green-light) !important; }
table.data-table tr.row-warn    td { background: var(--orange-light) !important; }
.sort-icon { color: rgba(255,255,255,0.5); font-size: 0.7rem; margin-left: 3px; }

/* ── Badges ───────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 0.74rem; font-weight: 700; }
.badge-pilger       { background: #eee;           color: #555; }
.badge-pruefling    { background: var(--orange-light); color: var(--orange); }
.badge-schildknappe { background: #e1d5e7;         color: #6c3483; }
.badge-knappe       { background: #d5e8d4;         color: #1e8449; }
.badge-junker       { background: #dae8fc;         color: #2471a3; }
.badge-ritter       { background: #f8cecc;         color: #c0392b; }
.badge-ritterfm     { background: #f5cba7;         color: #935116; }
.badge-burgfrau     { background: #fff2cc;         color: #9a7d0a; }
.badge-verstorben   { background: #aaa;            color: #fff; }
.badge-ausgeschieden { background: #e0e0e0;        color: #555; }
.badge-wechsel      { background: var(--blue-light); color: #1a5276; }

/* Status-Farben */
.status-red    { color: var(--red);    font-weight: 600; }
.status-green  { color: var(--green);  font-weight: 600; }
.status-orange { color: var(--orange); font-weight: 600; }

/* ── Formulare ────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 0.82rem; font-weight: 600; color: #555; }
.form-group label .req { color: var(--red); }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.88rem;
  transition: border-color 0.2s; background: white;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--dark3);
  box-shadow: 0 0 0 2px rgba(15,52,96,0.12);
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.form-full { grid-column: 1 / -1; }
.form-hint { font-size: 0.75rem; color: #888; margin-top: 2px; }

/* ── Filter-Leiste ────────────────────────────────────────── */
.filter-bar {
  background: white; border-radius: var(--radius-sm);
  padding: 12px 16px; margin-bottom: 16px;
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
  box-shadow: var(--shadow);
}
.filter-bar .form-group { min-width: 140px; margin: 0; }

/* ── Modals ───────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 1000;
  align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: white; border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  max-width: 640px; width: 100%; max-height: 90vh; overflow-y: auto;
}
.modal-lg { max-width: 860px; }
.modal-header {
  background: linear-gradient(135deg, var(--dark3), var(--dark2));
  color: white; padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center;
  border-radius: 10px 10px 0 0;
  position: sticky; top: 0; z-index: 1;
}
.modal-header h3 { font-size: 1rem; }
.modal-close { background: none; border: none; color: white; font-size: 1.4rem; cursor: pointer; padding: 0 4px; line-height: 1; }
.modal-body   { padding: 18px; }
.modal-footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 0.88rem; display: flex; align-items: center; gap: 8px; }
.alert-success { background: var(--green-light);  color: #1e8449; border: 1px solid #a9dfbf; }
.alert-error   { background: var(--red-light);    color: var(--red); border: 1px solid #f1948a; }
.alert-info    { background: var(--blue-light);   color: #1a5276; border: 1px solid #85c1e9; }
.alert-warning { background: var(--orange-light); color: #935116; border: 1px solid #f0b27a; }

/* ── Mitglieder-Liste ─────────────────────────────────────── */
.member-list { background: white; border: 1px solid #e0dbd0; border-radius: 10px; overflow: hidden; }
.ml-month-header { background: #f5f2eb; padding: 7px 16px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); border-bottom: 1px solid #e8e3d8; }
.ml-item { border-bottom: 1px solid #f0ede6; }
.ml-item:last-child { border-bottom: none; }
.ml-item-highlight { background: #fffbf0; }
.ml-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; transition: background .15s; user-select: none; }
.ml-row:hover { background: #fafaf5; }
.ml-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.ml-name { font-weight: 700; font-size: .95rem; color: var(--dark3); }
.ml-sub  { font-size: .82rem; color: #888; }
.ml-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ml-count  { font-size: .82rem; color: #aaa; }
.ml-date   { font-size: .88rem; color: #555; }
.ml-bald   { font-size: 1rem; }
.ml-chevron { color: #ccc; font-size: .7rem; transition: transform .2s; }
.ml-detail { padding: 10px 14px 14px; background: #fdfbf5; border-top: 1px solid #f0ede6; }
.ml-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin-bottom: 10px; font-size: .87rem; }
.ml-detail-grid > div { display: flex; flex-direction: column; }
.ml-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #aaa; margin-bottom: 1px; }
.ml-hint  { background: #fff3cd; border-radius: 5px; padding: 5px 10px; font-size: .82rem; color: #856404; margin-bottom: 8px; }
.ml-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 6px; }
.ml-filter { display: flex; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: #fafaf7; border-bottom: 1px solid #f0ede6; }
.ml-filter input,
.ml-filter select { flex: 1; min-width: 140px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .85rem; }

/* Trennlinie zwischen Mitglieder und Interessenten */
.ml-section-header {
  background: var(--dark3); color: white;
  padding: 6px 14px; font-size: .75rem;
  font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase;
}

/* ── Besonderheiten / Archiv ──────────────────────────────── */
.bes-section { margin-bottom: 24px; }
.bes-header {
  background: var(--dark3); color: white;
  padding: 10px 16px; border-radius: var(--radius) var(--radius) 0 0;
  font-weight: 700; font-size: .95rem;
  display: flex; justify-content: space-between; align-items: center;
}
.bes-header .bes-count { font-size: .78rem; opacity: .7; }
.ahallaritt-item {
  background: white; border: 1px solid #e0dbd0;
  border-radius: var(--radius-sm); padding: 14px 16px;
  margin-bottom: 8px; border-left: 4px solid #888;
}
.ahallaritt-item .ah-name { font-weight: 700; font-size: .95rem; color: var(--dark3); }
.ahallaritt-item .ah-sub  { font-size: .82rem; color: #888; margin-top: 2px; }
.ahallaritt-item .ah-date { font-size: .82rem; color: #aaa; }
.ahallaritt-item .ah-bem  { background: #f9f7f4; border-left: 3px solid #bbb; padding: 6px 10px; border-radius: 0 4px 4px 0; font-size: .84rem; color: #555; margin-top: 8px; }

/* ── Geburtstagskalender ──────────────────────────────────── */
.bday-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.bday-month {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.bday-month-header {
  background: var(--dark3); color: white;
  padding: 8px 12px; font-weight: 700; font-size: .88rem;
  display: flex; justify-content: space-between; align-items: center;
}
.bday-month-header .bday-count { font-size: .75rem; opacity: .7; }
.bday-month.current-month .bday-month-header { background: var(--gold); color: var(--dark); }
.bday-entries { padding: 6px 0; }
.bday-entry { display: flex; gap: 8px; padding: 6px 12px; font-size: .84rem; align-items: baseline; }
.bday-entry:hover { background: #fafaf5; }
.bday-day { font-weight: 800; color: var(--dark3); min-width: 22px; font-size: .9rem; }
.bday-name { color: var(--text-dark); flex: 1; }
.bday-entry.bday-soon { background: #fffbf0; }
.bday-entry.bday-soon .bday-day { color: var(--orange); }
.bday-entry.bday-today { background: #fff3cd; }
.bday-entry.bday-today .bday-day { color: var(--red); }
.bday-month-empty { padding: 12px; text-align: center; color: #bbb; font-size: .82rem; }

/* ── Aktuelles / Magazin ──────────────────────────────────── */
.magazin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.magazin-card {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.magazin-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.magazin-img { width: 100%; height: 180px; object-fit: cover; background: #e8e3d8; }
.magazin-img-placeholder { width: 100%; height: 120px; background: linear-gradient(135deg, var(--dark3), var(--dark2)); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.magazin-body { padding: 16px; }
.magazin-date { font-size: .75rem; color: #aaa; margin-bottom: 6px; }
.magazin-title { font-size: 1rem; font-weight: 700; color: var(--dark3); margin-bottom: 8px; line-height: 1.3; }
.magazin-teaser { font-size: .84rem; color: #666; line-height: 1.5; }
.magazin-pinned { border-top: 3px solid var(--gold); }
.magazin-pinned-badge { background: var(--gold); color: var(--dark); font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; margin-bottom: 8px; display: inline-block; }

/* ── Kassenbuch-Sub-Nav ───────────────────────────────────── */
.kasse-nav {
  display: flex; align-items: center; gap: 2px;
  padding: 0 16px; background: #0a2744;
  border-bottom: 2px solid var(--gold); flex-wrap: wrap;
}
.kasse-nav a {
  color: rgba(255,255,255,.75); text-decoration: none;
  padding: 7px 14px; font-size: .83rem; font-weight: 500;
  border-radius: 4px 4px 0 0; transition: background .15s, color .15s; white-space: nowrap;
}
.kasse-nav a:hover  { background: rgba(201,168,76,.2); color: #f0d98a; }
.kasse-nav a.active { background: var(--gold); color: white; font-weight: 700; }

/* ── Funktionsträger ──────────────────────────────────────── */
.func-table td, .func-table th { padding: 6px 10px; font-size: .84rem; }
.func-select { width: 100%; padding: 4px 6px; border: 1px solid var(--border); border-radius: 4px; font-size: .82rem; }

/* ── Notizen ──────────────────────────────────────────────── */
.notiz-card { border-left: 4px solid var(--gold); margin-bottom: 12px; }
.notiz-card.erledigt { border-left-color: #bbb; opacity: 0.7; }
.notiz-frist-warn { color: var(--red); font-weight: 600; }

/* ── Zellen-Highlights ────────────────────────────────────── */
.cell-invalid { background: var(--red-light);    color: var(--red);    font-weight: 600; border-radius: 4px; padding: 2px 6px; display: inline-block; }
.cell-valid   { background: var(--green-light);  color: var(--green);  font-weight: 600; border-radius: 4px; padding: 2px 6px; display: inline-block; }
.cell-action  { background: var(--orange-light); color: var(--orange); font-weight: 600; border-radius: 4px; padding: 2px 6px; display: inline-block; }

/* ── Login-Seite ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark3) 100%);
}
.login-box {
  background: white; border-radius: 12px;
  padding: 36px 32px; width: 380px; max-width: 95%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .ll-icon  { font-size: 2.8rem; }
.login-logo .ll-title { font-size: 2rem; font-weight: 800; color: var(--gold); letter-spacing: 3px; margin-top: 4px; }
.login-logo .ll-main  { font-size: 1rem; color: var(--dark3); font-weight: 600; margin-top: 6px; }
.login-logo .ll-sub   { color: #888; font-size: 0.78rem; margin-top: 3px; }
.login-box .form-group { margin-bottom: 14px; }
.login-footer { text-align: center; margin-top: 20px; font-size: 0.74rem; color: rgba(255,255,255,0.45); }
.login-footer a { color: rgba(255,255,255,0.55); text-decoration: none; }
.maintenance-box { background: linear-gradient(135deg,#fff8e1,#fff3cd); border: 2px solid #f0a500; border-radius: 10px; padding: 20px; text-align: center; margin-bottom: 20px; }
.maintenance-icon  { font-size: 2.2rem; margin-bottom: 6px; }
.maintenance-title { font-size: 1rem; font-weight: 700; color: #b7600a; margin-bottom: 6px; }
.maintenance-text  { font-size: .85rem; color: #555; line-height: 1.5; }
.admin-login-toggle summary { cursor: pointer; font-size: .75rem; color: #aaa; text-align: center; padding: 4px; user-select: none; list-style: none; }
.admin-login-toggle summary::-webkit-details-marker { display: none; }
.admin-login-toggle[open] summary { color: #888; margin-bottom: 10px; }

/* ── Leerer Zustand ───────────────────────────────────────── */
.empty-state { padding: 48px 20px; text-align: center; color: #aaa; }
.empty-state .es-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { color: #bbb; margin-bottom: 8px; font-size: 1rem; }
.empty-state p  { font-size: .85rem; }

/* ── In Vorbereitung ──────────────────────────────────────── */
.in-prep { text-align: center; padding: 60px 20px; }
.in-prep .prep-icon { font-size: 3rem; }
.in-prep h2 { color: var(--dark3); margin: 12px 0 8px; }
.in-prep p  { color: #888; }
.badge-prep { background: var(--orange-light); color: #d35400; padding: 4px 12px; border-radius: 20px; font-size: .8rem; font-weight: 600; display: inline-block; margin-top: 10px; }

/* ── Wartungsmodus-Banner ─────────────────────────────────── */
.maintenance-banner {
  background: linear-gradient(135deg, #b7600a, var(--orange));
  color: white; padding: 10px 18px; border-radius: var(--radius);
  margin-bottom: 16px; display: flex;
  align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .app-header, .page-actions, .btn, .filter-bar, .app-footer,
  .modal-overlay, .ml-actions, .nav-group, .main-nav { display: none !important; }
  main.main-content { padding: 0; max-width: 100%; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  body { background: white; }
  table.data-table th {
    background: #333 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .ml-filter { display: none !important; }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .main-nav > a, .nav-group-btn { padding: 0 8px; font-size: .78rem; }
  .nav-dropdown { min-width: 180px; }
}

@media (max-width: 768px) {
  .header-inner { flex-wrap: nowrap; align-items: stretch; padding: 0; }
  .logo { padding: 12px 14px; }
  .logo-sub { display: none; }
  .nav-toggle { display: flex; }
  .user-info { padding: 0 14px; border-left: none; margin-left: auto; }
  .user-info > span:not(.btn-logout) { display: none; }

  .main-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    z-index: 500; background: var(--dark2);
    flex-direction: column; gap: 0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    max-height: 80vh; overflow-y: auto;
  }
  .main-nav.open { display: flex; }
  /* Overlay: schließt Nav bei Tap außerhalb — iOS-kompatibel */
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 499;
    background: transparent;
    cursor: pointer; /* iOS: macht das Element tappable */
    -webkit-tap-highlight-color: transparent;
  }
  .nav-overlay.active { display: block; }
  .main-nav > a {
    padding: 14px 18px; font-size: .92rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    border-left: 4px solid transparent; border-bottom-width: 1px;
  }
  .nav-group { flex-direction: column; }
  .nav-group-btn { padding: 14px 18px; font-size: .92rem; border-bottom: 1px solid rgba(255,255,255,0.07); border-left: 4px solid transparent; justify-content: space-between; border-bottom-width: 1px; }
  .nav-dropdown { position: static; border-top: none; border-radius: 0; box-shadow: none; background: rgba(0,0,0,0.2); }
  .nav-dropdown a { padding: 11px 18px 11px 28px; font-size: .88rem; }
  .app-header { position: relative; }

  main.main-content { padding: 14px 12px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
  .page-header h1 { font-size: 1.15rem; }
  .page-actions { width: 100%; }
  .tile-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .magazin-grid { grid-template-columns: 1fr; }
  .bday-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .ml-detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
}

@media (max-width: 480px) {
  .login-box { padding: 24px 18px; }
  .bday-grid { grid-template-columns: 1fr 1fr; }
}
