/* ===========================================================
   Fraktion Triaden – Design-Tokens
   =========================================================== */
:root {
  --color-bg: #0A1B3D;
  --color-panel: #0F2350;
  --color-panel-raised: #152C5E;
  --color-line: #28407A;
  --color-cream: #F4F6FA;
  --color-cream-dim: #C7CEDE;
  --color-slate: #7C8FBD;
  --color-gold: #3D7FE0;
  --color-gold-dim: #2C5FA8;
  --color-success: #5C9270;
  --color-danger: #C0392B;
  --color-warn: #3D7FE0;

  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --radius: 4px;
  --shadow-card: 0 1px 0 rgba(0,0,0,0.4), 0 8px 24px -8px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-cream);
  font-family: var(--font-body);
  min-height: 100vh;
  position: relative;
}

/* ===========================================================
   Moderner animierter Hintergrund (passend zu Navy/Orange)
   Sanft driftende Glow-Flecken + feines Raster für Tiefe -
   bewusst dezent, damit Inhalte gut lesbar bleiben.
   =========================================================== */
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

body::before {
  width: 640px;
  height: 640px;
  top: -220px;
  left: -180px;
  background: radial-gradient(circle, rgba(61,127,224,0.30) 0%, rgba(61,127,224,0) 70%);
  filter: blur(10px);
  animation: glow-drift-a 24s ease-in-out infinite;
}

body::after {
  width: 760px;
  height: 760px;
  bottom: -260px;
  right: -220px;
  background: radial-gradient(circle, rgba(40,64,122,0.55) 0%, rgba(40,64,122,0) 70%);
  filter: blur(10px);
  animation: glow-drift-b 28s ease-in-out infinite;
}

@keyframes glow-drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(70px, 50px, 0) scale(1.12); }
}

@keyframes glow-drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-60px, -40px, 0) scale(1.08); }
}

.app-shell,
.login-screen {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
}

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

button {
  font-family: var(--font-body);
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-gold);
}

/* ===========================================================
   Login-Seite
   =========================================================== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 24px;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(15,27,42,0) 0%, rgba(15,27,42,0.9) 85%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0px, rgba(255,255,255,0.025) 1px, transparent 1px, transparent 28px);
  pointer-events: none;
}

.login-watermark {
  position: absolute;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 640px;
  max-width: 92vw;
  opacity: 0.55;
  animation: watermark-pulse 6s ease-in-out infinite;
}

@keyframes watermark-pulse {
  0%, 100% { opacity: 0.45; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.65; transform: translateX(-50%) scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
  .login-watermark { animation: none; }
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: rgba(15, 35, 80, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -16px rgba(0,0,0,0.55), 0 0 40px -10px rgba(61,127,224,0.12);
  padding: 40px 36px 32px;
}

.login-wordmark {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo {
  width: 108px;
  height: auto;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 0 rgba(61,127,224,0));
  animation: logo-glow 4s ease-in-out infinite;
}

@keyframes logo-glow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(61,127,224,0)); }
  50% { filter: drop-shadow(0 0 14px rgba(61,127,224,0.45)); }
}

@media (prefers-reduced-motion: reduce) {
  .login-logo { animation: none; }
}

.login-wordmark .eyebrow {
  display: block;
  margin-bottom: 10px;
}

.login-wordmark h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 34px;
  margin: 0;
  letter-spacing: 0.01em;
}

.login-wordmark .rule {
  width: 44px;
  height: 2px;
  background: var(--color-gold);
  margin: 16px auto 0;
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-slate);
  margin-bottom: 8px;
}

.field input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-line);
  color: var(--color-cream);
  font-size: 16px;
  font-family: var(--font-body);
  padding: 8px 2px 10px;
  transition: border-color 0.15s ease;
}

.field input::placeholder { color: var(--color-slate); opacity: 0.7; }

.field input:focus {
  border-bottom-color: var(--color-gold);
  outline: none;
}

.login-error {
  background: rgba(179, 71, 63, 0.12);
  border: 1px solid rgba(179, 71, 63, 0.4);
  color: #E2A39D;
  font-size: 13px;
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 20px;
}

.btn-submit {
  width: 100%;
  background: var(--color-gold);
  color: #1A1505;
  border: none;
  border-radius: var(--radius);
  padding: 12px 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: 8px;
  transition: background 0.15s ease;
}

.btn-submit:hover { background: #D8B252; }

.login-footnote {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--color-slate);
}

/* ===========================================================
   Dashboard
   =========================================================== */
.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  min-height: 100vh;
}

.app-shell--schmal {
  grid-template-columns: 220px 1fr;
}

/* Stellt sicher dass der Main-Bereich nicht breiter als das Grid-Cell wird */
.app-shell--schmal .main {
  overflow-x: auto;
  min-width: 0;
}

.sidebar {
  background: rgba(15, 35, 80, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--color-line);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

.sidebar-wordmark {
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 38px;
  height: auto;
  flex-shrink: 0;
}

.sidebar-wordmark .eyebrow { display: block; margin-bottom: 6px; }

.sidebar-wordmark h1 {
  font-family: var(--font-display);
  font-size: 24px;
  margin: 0;
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
}

.nav-gruppe {
  margin-bottom: 22px;
}

.nav-gruppe-titel {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-slate);
  padding: 0 10px;
  margin-bottom: 6px;
}

.nav-sub {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-sub li { margin-bottom: 2px; }

.nav-sub a {
  display: block;
  color: var(--color-cream-dim);
  font-size: 14px;
  padding: 8px 10px 8px 18px;
  border-radius: var(--radius);
  text-decoration: none;
  border-left: 2px solid transparent;
}

.nav-sub a:hover {
  background: var(--color-panel-raised);
  color: var(--color-cream);
}

.nav-sub a.active {
  color: var(--color-gold);
  border-left-color: var(--color-gold);
  background: var(--color-panel-raised);
}

.sidebar-user {
  border-top: 1px solid var(--color-line);
  padding-top: 16px;
  margin-top: 16px;
}

.sidebar-user .name {
  font-size: 13px;
  color: var(--color-cream);
}

.sidebar-user .role {
  font-size: 12px;
  color: var(--color-slate);
  margin-bottom: 12px;
}

.btn-logout {
  background: none;
  border: 1px solid var(--color-line);
  color: var(--color-cream-dim);
  font-size: 12px;
  border-radius: var(--radius);
  padding: 7px 12px;
  width: 100%;
}

.btn-logout:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.main {
  padding: 36px 44px 60px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  overflow-x: hidden;
}

.main-header {
  margin-bottom: 32px;
}

.main-header h2 {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 4px 0 0;
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.card {
  background: var(--color-panel);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(61,127,224,0.3);
  box-shadow: 0 16px 32px -12px rgba(0,0,0,0.45), 0 0 0 1px rgba(61,127,224,0.06);
}

.card h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-slate);
  margin: 0 0 18px;
  font-weight: 500;
}

.seat-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.seat-gauge svg { width: 100%; max-width: 220px; }

.seat-gauge .seat-figure {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-cream-dim);
  margin-top: 4px;
  text-align: center;
}

.seat-gauge .seat-figure .fraktion-name { color: var(--color-gold); }

.list-plain {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list-plain li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-line);
  font-size: 14px;
}

.list-plain li:last-child { border-bottom: none; }

.list-plain .meta {
  color: var(--color-slate);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: auto;
}

/* Wrapper scrollt nur wenn wirklich nötig (kleine Screens) */
.table-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

table.data-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-slate);
  font-weight: 500;
  padding: 0 12px 12px 0;
  border-bottom: 1px solid var(--color-line);
  white-space: nowrap;
}

table.data-table td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--color-line);
  white-space: nowrap;
}

table.data-table td:first-child,
table.data-table th:first-child { padding-left: 0; }

table.data-table tr:last-child td { border-bottom: none; }

.pill {
  display: inline-block;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 100px;
}

.pill-beschlossen { background: rgba(92,146,112,0.15); color: var(--color-success); border: 1px solid rgba(92,146,112,0.4); }
.pill-beratung { background: rgba(61,127,224,0.15); color: var(--color-gold); border: 1px solid rgba(61,127,224,0.4); }
.pill-eingereicht { background: rgba(126,145,168,0.15); color: var(--color-slate); border: 1px solid rgba(126,145,168,0.4); }
.pill-abgelehnt { background: rgba(179,71,63,0.15); color: #E2A39D; border: 1px solid rgba(179,71,63,0.4); }

.section-spacer { margin-top: 8px; }

/* ===========================================================
   Rechte Rang-Sidebar
   =========================================================== */
.rang-sidebar {
  background: var(--color-panel);
  border-left: 1px solid var(--color-line);
  padding: 28px 22px;
}

.rang-sidebar h2 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-slate);
  margin: 0 0 20px;
  font-weight: 500;
}

.rang-gruppe {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--color-line);
}

.rang-gruppe:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.rang-gruppe .rang-titel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-cream);
  margin-bottom: 8px;
}

.rang-gruppe .rang-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-gold);
  background: rgba(61,127,224,0.12);
  border: 1px solid rgba(61,127,224,0.35);
  border-radius: 100px;
  padding: 2px 8px;
}

.rang-gruppe .rang-leer {
  font-size: 12px;
  color: var(--color-slate);
  font-style: italic;
}

.platzhalter {
  text-align: center;
  padding: 64px 24px;
  color: var(--color-slate);
}

.platzhalter .platzhalter-icon {
  font-family: var(--font-display);
  font-size: 40px;
  color: var(--color-gold-dim);
  margin-bottom: 12px;
}

.platzhalter p {
  margin: 0;
  font-size: 14px;
}

/* ===========================================================
   Ränge & Rechte / Verwaltungsformulare
   =========================================================== */
.hinweis-erfolg {
  background: rgba(92,146,112,0.12);
  border: 1px solid rgba(92,146,112,0.4);
  color: #9FC6AC;
  font-size: 13px;
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 20px;
}

.hinweistext {
  font-size: 13px;
  color: var(--color-slate);
  margin: -8px 0 20px;
  line-height: 1.5;
}

.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.btn-submit--klein {
  width: auto;
  padding: 11px 20px;
  margin-top: 0;
  white-space: nowrap;
}

.rang-rechte-block {
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
}

.rang-rechte-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.rang-rechte-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--color-cream);
}

.rang-rechte-name--klickbar {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  margin: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.rang-rechte-name--klickbar:hover,
.rang-rechte-name--klickbar:focus-visible {
  color: var(--color-gold);
}

.btn-loeschen {
  background: none;
  border: 1px solid rgba(179,71,63,0.4);
  color: #E2A39D;
  font-size: 12px;
  border-radius: var(--radius);
  padding: 6px 12px;
}

.btn-loeschen:hover {
  background: rgba(179,71,63,0.12);
}

.rang-rechte-checkboxen {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.checkbox-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-cream-dim);
  background: var(--color-panel-raised);
  border: 1px solid var(--color-line);
  border-radius: 100px;
  padding: 6px 12px;
  cursor: pointer;
}

.checkbox-pill input { accent-color: var(--color-gold); }

.hidden-form { display: none; }

.konto-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 100px;
}

.konto-badge--ja {
  background: rgba(92,146,112,0.15);
  color: var(--color-success);
  border: 1px solid rgba(92,146,112,0.4);
}

.konto-badge--nein {
  background: rgba(126,145,168,0.12);
  color: var(--color-slate);
  border: 1px solid rgba(126,145,168,0.3);
}

.select-feld {
  width: 100%;
  background: var(--color-panel);
  border: none;
  border-bottom: 1px solid var(--color-line);
  color: var(--color-cream);
  font-size: 16px;
  font-family: var(--font-body);
  padding: 8px 2px 10px;
}

.select-feld:focus {
  border-bottom-color: var(--color-gold);
  outline: none;
}

/* ===========================================================
   Fraktion Bank
   =========================================================== */
.kasse-karte {
  text-align: center;
}

.kasse-betrag {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 600;
  margin: 12px 0 6px;
}

.kasse-karte--gruen .kasse-betrag { color: var(--color-success); }
.kasse-karte--schwarz .kasse-betrag { color: var(--color-cream-dim); }

.bank-form-zeile {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 700px) {
  .bank-form-zeile { grid-template-columns: 1fr; }
}

.form-zeile-4 {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 1fr auto;
  gap: 16px;
  align-items: flex-end;
}

@media (max-width: 900px) {
  .form-zeile-4 { grid-template-columns: 1fr; }
}

/* ===========================================================
   Topbar (oben rechts: Name, Rang, Dropdown)
   =========================================================== */
.topbar {
  position: fixed;
  top: 20px;
  right: 28px;
  z-index: 200;
}

.topbar-menu {
  position: relative;
}

.topbar-menu summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 35, 80, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--color-line);
  border-radius: 100px;
  padding: 8px 16px;
  box-shadow: var(--shadow-card);
}

.topbar-menu summary::-webkit-details-marker { display: none; }

.topbar-name {
  font-size: 13px;
  color: var(--color-cream);
  font-weight: 500;
}

.topbar-rang {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-gold);
  background: rgba(61,127,224,0.12);
  border: 1px solid rgba(61,127,224,0.35);
  border-radius: 100px;
  padding: 2px 9px;
}

.topbar-caret {
  font-size: 11px;
  color: var(--color-slate);
}

.topbar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--color-panel);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-dropdown a,
.topbar-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--color-cream-dim);
  font-size: 14px;
  font-family: var(--font-body);
  padding: 9px 10px;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
}

.topbar-dropdown a:hover,
.topbar-dropdown button:hover {
  background: var(--color-panel-raised);
  color: var(--color-cream);
}

@media (max-width: 860px) {
  .topbar { top: 12px; right: 12px; }
  .topbar-name { display: none; }
}

/* ===========================================================
   Pflicht-Passwort-Popup
   =========================================================== */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,12,26,0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 16px;
  overflow-y: auto;
}

.popup-fenster {
  background: var(--color-panel);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}

.popup-fenster h3 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 10px;
  color: var(--color-cream);
}

.custom-confirm-text {
  color: var(--color-cream-dim);
  font-size: 14px;
  margin: 0 0 22px;
  line-height: 1.5;
}

.custom-confirm-aktionen {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.custom-confirm-aktionen button {
  width: auto;
  padding: 10px 18px;
}

/* ===========================================================
   Ankündigungen (Übersicht)
   =========================================================== */
.ankuendigung-form textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-line);
  color: var(--color-cream);
  font-size: 14px;
  font-family: var(--font-body);
  padding: 8px 2px 10px;
  resize: vertical;
}

.ankuendigung-form textarea:focus {
  border-bottom-color: var(--color-gold);
  outline: none;
}

.ankuendigung-liste {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ankuendigung-eintrag {
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.ankuendigung-kopf {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.ankuendigung-kopf h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-cream);
  margin: 0;
}

.ankuendigung-eintrag p {
  font-size: 14px;
  color: var(--color-cream-dim);
  margin: 0 0 8px;
  line-height: 1.5;
}

.ankuendigung-autor {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-gold);
}

.ankuendigung-fusszeile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ankuendigung-fusszeile .btn-loeschen {
  padding: 4px 10px;
  font-size: 11px;
}

/* ===========================================================
   Fraktion Lager
   =========================================================== */
.lager-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.lager-grid .lager-karte {
  margin-bottom: 0;
}

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

.lager-karte {
  margin-bottom: 24px;
}

.lager-bild-kopf {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 16px;
  border: 1px solid var(--color-line);
}

.lager-bearbeiten-details {
  margin-bottom: 18px;
}

.lager-bearbeiten-details summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-slate);
  list-style: none;
}

.lager-bearbeiten-details summary::-webkit-details-marker { display: none; }

.lager-bearbeiten-details summary:hover { color: var(--color-gold); }

/* ===========================================================
   Bestellung
   =========================================================== */
.bestellung-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bestellung-form input[type="number"] {
  width: 70px;
  background: var(--color-panel-raised);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  color: var(--color-cream);
  padding: 7px 8px;
  font-size: 13px;
}

.hinweis-schwarzgeld {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--color-line);
  color: var(--color-cream-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 20px;
  text-align: center;
}

.bestellung-rang-liste {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

/* ===========================================================
   Sanktions-Warnung (Übersicht, ganz oben)
   =========================================================== */
.sanktion-warnung {
  background: rgba(179,71,63,0.12);
  border: 1px solid rgba(179,71,63,0.45);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  color: #E2A39D;
}

.sanktion-warnung strong {
  color: #F2C9C4;
  font-size: 14px;
}

.sanktion-warnung ul {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 13px;
}

.sanktion-warnung li { margin-bottom: 2px; }

/* ===========================================================
   Tab-Navigation
   =========================================================== */
.tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-line);
  padding-bottom: 0;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--color-slate);
  text-decoration: none;
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -1px;
  transition: color 0.15s, background 0.15s;
}

.tab-btn:hover { color: var(--color-cream); text-decoration: none; }

.tab-btn--aktiv {
  color: var(--color-cream);
  background: var(--color-panel);
  border-color: var(--color-line);
}

.tab-badge {
  background: rgba(179,71,63,0.25);
  color: #E2A39D;
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 1px 6px;
  border-radius: 100px;
}

.tab-badge--grau {
  background: rgba(124,143,189,0.2);
  color: var(--color-slate);
}

/* Überfällige Sanktions-Zeile */
.zeile-warnung td { background: rgba(179,71,63,0.06); }

/* ===========================================================
   Wocheneinzahlung: KW-Header und Checkbox-Toggle
   =========================================================== */
.kw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.kw-badge {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--color-cream);
}

.checkbox-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 2px solid var(--color-line);
  background: transparent;
  color: transparent;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.checkbox-toggle--an {
  border-color: var(--color-gold);
  background: rgba(61,127,224,0.18);
  color: var(--color-gold);
}

.checkbox-toggle:hover { border-color: var(--color-gold); }

.lager-item-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--color-line);
}

.lager-item-form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 16px;
  align-items: flex-end;
}

@media (max-width: 700px) {
  .lager-item-form-grid { grid-template-columns: 1fr; }
}

.lager-item-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.lager-item-thumb {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--color-line);
  background: var(--color-panel-raised);
}

.lager-item-thumb--leer {
  display: inline-block;
}

.lager-item-bild-gross {
  width: 100%;
  max-width: 220px;
  border-radius: var(--radius);
  border: 1px solid var(--color-line);
  margin-bottom: 20px;
  display: block;
}

/* ===========================================================
   Datensatz (Item-Katalog)
   =========================================================== */
.datensatz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.datensatz-karte {
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}

.datensatz-bild {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 10px;
  background: var(--color-panel-raised);
}

.datensatz-bild--platzhalter {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-slate);
  font-size: 12px;
}

.datensatz-name {
  font-size: 13px;
  color: var(--color-cream);
  margin-bottom: 10px;
}

.datensatz-karte--link {
  display: block;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.datensatz-karte--link:hover {
  border-color: var(--color-gold);
}

.datensatz-karte--link .datensatz-name {
  margin-bottom: 0;
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 220px 1fr; }
  .rang-sidebar {
    grid-column: 1 / -1;
    border-left: none;
    border-top: 1px solid var(--color-line);
  }
}

/* ── Desktop-only: Mobile-Elemente vollständig ausblenden ── */
.hamburger-btn   { display: none; }
.sidebar-close-btn { display: none; }
.sidebar-overlay { display: none; }   /* Verhindert, dass der Dimmer auf Desktop sichtbar ist */

/* ===========================================================
   Mobile – Hamburger-Drawer ab 860px
   =========================================================== */
@media (max-width: 860px) {

  /* Hamburger einblenden */
  .hamburger-btn {
    display: flex;
  }

  /* Schließen-Button im Drawer */
  .sidebar-close-btn {
    display: block;
    background: none;
    border: none;
    color: var(--color-slate);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-bottom: 20px;
    text-align: right;
    align-self: flex-end;
  }
  .sidebar-close-btn:hover { color: var(--color-cream); }

  /* App-Shell: kein Grid-Sidebar, alles auf eine Spalte */
  .app-shell,
  .app-shell--schmal {
    display: block;
    padding-top: 0;
  }

  /* Sidebar wird zum Fullscreen-Drawer */
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(280px, 88vw);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    flex-direction: column;
    padding: 28px 20px;
    overflow-y: auto;
    border-right: 1px solid var(--color-line);
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0,0,0,.45);
  }

  /* Overlay-Dimmer hinter dem Drawer */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 199;
    backdrop-filter: blur(2px);
  }

  .sidebar-overlay.is-open { display: block; }

  /* Hamburger-Button (oben links) */
  .hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px; height: 20px;
    padding: 0; margin: 0;
    background: none; border: none;
    cursor: pointer;
    position: fixed;
    top: 18px; left: 18px;
    z-index: 198;
  }

  .hamburger-btn span {
    display: block;
    height: 2px;
    background: var(--color-cream);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
  }

  /* Main: Abstand für den Hamburger-Button */
  .main {
    padding: 68px 16px 56px;
    max-width: 100%;
  }

  .main-header h2 { font-size: 22px; }

  /* Topbar: nach rechts versetzt, kompakter */
  .topbar { top: 8px; right: 10px; }
  .topbar-name { display: none; }
  .topbar-menu summary { padding: 6px 12px; gap: 6px; }

  /* Grids auf eine Spalte */
  .grid { grid-template-columns: 1fr; }
  .lager-grid { grid-template-columns: 1fr; }
  .bank-form-zeile { flex-direction: column; }
  .form-zeile-4 { grid-template-columns: 1fr !important; }

  /* Karten kein Hover-Lift auf Touch */
  .card:hover { transform: none; box-shadow: none; }

  /* Alle Tabellen horizontal scrollbar */
  .data-table { width: 100%; overflow-x: auto; display: block; -webkit-overflow-scrolling: touch; }

  /* Popup: volle Breite mit Abstand */
  .popup-fenster {
    width: calc(100vw - 32px) !important;
    max-width: 100% !important;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* Login-Karte */
  .login-card { padding: 28px 20px; }

  /* Bestandskontrolle scrollbar */
  .bk-wrap { -webkit-overflow-scrolling: touch; }

  /* Lager-Karte */
  .lager-karte { margin-bottom: 0; }

  /* KW-Header */
  .kw-header { flex-wrap: wrap; gap: 12px; }

  /* Wocheneinzahlung-Tabelle */
  .data-table td, .data-table th { white-space: nowrap; }

  /* Inline-Form stapeln */
  .inline-form { flex-direction: column; }
  .inline-form .field { flex: none; width: 100%; }

  /* Rang-Rechte-Checkboxen */
  .rang-rechte-checkboxen { grid-template-columns: 1fr 1fr; }

  /* Tab-Navigation horizontal scrollbar */
  .tab-nav { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 1px; }
  .tab-btn { white-space: nowrap; }

  /* list-plain: kein Flex-Row auf kleinen Screens */
  .list-plain li { flex-wrap: wrap; gap: 8px; }
}

/* Extra-small: sehr schmale Screens */
@media (max-width: 380px) {
  .main { padding: 64px 12px 48px; }
  .card { padding: 16px; }
  .popup-fenster { padding: 20px 16px; }
  .datensatz-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ===========================================================
   Memberliste — modernes Layout mit Rang-Gruppen
   =========================================================== */
.ml-rang-header {
  padding: 8px 24px 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-gold);
  background: rgba(61,127,224,.04);
  border-top: 1px solid rgba(61,127,224,.15);
}

.ml-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 24px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  transition: background .1s;
}
.ml-row:hover { background: rgba(61,127,224,.04); }
.ml-row:last-child { border-bottom: none; }

.ml-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(61,127,224,.15);
  border: 1px solid rgba(61,127,224,.3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600;
  color: var(--color-gold);
  flex-shrink: 0;
}

.ml-info { flex: 1; min-width: 0; }

.ml-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ml-name-link {
  color: var(--color-cream);
  text-decoration: none;
  transition: color .15s;
}
.ml-name-link:hover { color: var(--color-gold); text-decoration: none; }

.ml-zusatz {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-slate);
  margin-top: 2px;
  letter-spacing: .04em;
}

.ml-meta-col {
  font-size: 12px;
  color: var(--color-slate);
  white-space: nowrap;
  font-family: var(--font-mono);
}

.ml-badges { display: flex; align-items: center; gap: 6px; }

.ml-konto {
  font-size: 10px;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.ml-konto--ja  { color: #27ae60; }
.ml-konto--nein { color: rgba(124,143,189,.4); }

.ml-akte-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--color-slate);
  border: 1px solid var(--color-line);
  border-radius: 4px;
  padding: 3px 8px;
  text-decoration: none;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
}
.ml-akte-btn:hover { color: var(--color-gold); border-color: rgba(61,127,224,.4); text-decoration: none; }

@media (max-width: 860px) {
  .ml-meta-col { display: none; }
  .ml-row { padding: 11px 16px; gap: 10px; }
}

/* ===========================================================
   Fraktion Lager — verbesserte Karten
   =========================================================== */
.lager-karte { transition: transform .2s, box-shadow .2s; }
.lager-karte .lager-item-liste { margin-top: 12px; }
.lager-item-zeile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.lager-item-zeile:last-child { border-bottom: none; }
.lager-item-bild-klein {
  width: 40px; height: 40px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--color-line);
  flex-shrink: 0;
}
.lager-item-name { flex: 1; font-size: 13px; color: var(--color-cream); }
.lager-item-menge {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-gold);
  background: rgba(61,127,224,.1);
  border: 1px solid rgba(61,127,224,.2);
  border-radius: 4px;
  padding: 2px 8px;
}

/* ===========================================================
   Fraktion Bank — bessere Transaktionszeilen
   =========================================================== */
.bank-betrag-positiv { color: #27ae60; font-family: var(--font-mono); font-weight: 600; }
.bank-betrag-negativ { color: #E2A39D; font-family: var(--font-mono); font-weight: 600; }
.bank-kontostand {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--color-cream);
}
.bank-kontostand-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-slate);
  margin-bottom: 6px;
}

/* ===========================================================
   Datensatz — schönere Item-Karten
   =========================================================== */
.datensatz-karte {
  border-radius: var(--radius);
  border: 1px solid var(--color-line);
  background: var(--color-panel-raised);
  padding: 12px;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.datensatz-karte:hover {
  transform: translateY(-2px);
  border-color: rgba(61,127,224,.35);
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.4);
}
.datensatz-bild {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--color-line);
}
.datensatz-bild--platzhalter {
  width: 100%;
  aspect-ratio: 1;
  background: rgba(124,143,189,.08);
  border: 1px dashed rgba(124,143,189,.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--color-slate);
}

/* ===========================================================
   Gangwar — bessere Gebiets-Blöcke
   =========================================================== */
.gw-gebiet-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-cream);
}
.gw-felder {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
}
@media (max-width: 860px) {
  .gw-felder { grid-template-columns: 1fr; }
}
