/* VFFUR Vereinsverwaltung – Eigenes CSS */

html { font-size: 16px; }

/* Globale Farb-Overrides (Pico CSS v2) */
:root {
  --pico-primary: #D3832B;
  --pico-primary-hover: #b8701f;
  --pico-primary-focus: rgba(211,131,43,0.25);
  --pico-primary-inverse: #FDFDFD;
  --pico-secondary: #34495E;
  --pico-secondary-hover: #2c3e50;
  --pico-secondary-focus: rgba(52,73,94,0.25);
  --pico-secondary-inverse: #FDFDFD;
  --pico-color: #2D3436;
  --pico-font-size: 16px;
  --pico-h1-color: #34495E;
  --pico-h2-color: #FDFDFD;
  --pico-h3-color: #34495E;
  --pico-h4-color: #34495E;
  --pico-h5-color: #34495E;
  --pico-h6-color: #34495E;
}
a:not([role="button"]):not(.link-card):not(.stat-link) {
  color: #34495E;
}
a:not([role="button"]):not(.link-card):not(.stat-link):hover {
  color: #2c3e50;
}

/* Outline-Buttons (ohne secondary) → gefüllt orange */
[role="button"].outline:not(.secondary):not([target="_blank"]),
button.outline:not(.secondary):not([target="_blank"]) {
  background-color: #D3832B;
  border-color: #D3832B;
  color: #FDFDFD;
}
[role="button"].outline:not(.secondary):not([target="_blank"]):hover,
button.outline:not(.secondary):not([target="_blank"]):hover {
  background-color: #b8701f;
  border-color: #b8701f;
  color: #FDFDFD;
}

/* PDF/Download-Buttons (target="_blank") → grau */
[role="button"][target="_blank"],
button[target="_blank"] {
  background-color: #6B7C8D;
  border-color: #6B7C8D;
  color: #FDFDFD;
}
[role="button"][target="_blank"]:hover,
button[target="_blank"]:hover {
  background-color: #57687A;
  border-color: #57687A;
  color: #FDFDFD;
}

/* Text in Buttons zentrieren */
a[role="button"],
button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Einfache Buttons ohne Klasse */
button:not([class]):not(.nav-hamburger),
[type="button"]:not([class]) {
  background-color: #D3832B;
  border-color: #D3832B;
  color: #FDFDFD;
}
button:not([class]):not(.nav-hamburger):hover,
[type="button"]:not([class]):hover {
  background-color: #b8701f;
  border-color: #b8701f;
}

/* Secondary-Buttons (outline secondary + gefüllt) */
[role="button"].secondary,
[role="button"].outline.secondary,
[role="button"].secondary.outline,
button.secondary,
button.outline.secondary,
button.secondary.outline {
  background-color: transparent;
  border-color: #34495E;
  color: #34495E;
}
[role="button"].secondary:not(.outline),
button.secondary:not(.outline) {
  background-color: #34495E;
  color: #FDFDFD;
}
[role="button"].secondary:hover,
[role="button"].outline.secondary:hover,
[role="button"].secondary.outline:hover,
button.secondary:hover,
button.outline.secondary:hover,
button.secondary.outline:hover {
  background-color: #34495E;
  border-color: #34495E;
  color: #FDFDFD;
}
h2 {
  background-color: #34495E;
  color: #FDFDFD;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

/* Navigation */
.main-nav {
  background-color: #FDFDFD;
  border-bottom: 3px solid #3F4F22;
  margin-bottom: 0;
}
.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}
.nav-brand {
  display: flex;
  justify-content: center;
}
.nav-brand img {
  height: 3.5rem;
  display: block;
}

/* Overlay */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 8999;
}
.nav-overlay.nav-open { display: block; }

/* Drawer (von links nach rechts) */
.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 260px;
  background: #FDFDFD;
  border-right: 3px solid #3F4F22;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 9000;
  overflow-y: auto;
  box-shadow: 4px 0 16px rgba(0,0,0,0.12);
  padding-top: 1rem;
}
.nav-drawer.nav-open { transform: translateX(0); }

/* Nav-Links im Drawer */
.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.nav-links a {
  color: #3F4F22;
  text-decoration: none;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  transition: background-color 0.15s;
  display: block;
}
.nav-links a:hover { background-color: #edf2e4; color: #3F4F22; }
.nav-links a[aria-current="page"] { color: #D3832B; font-weight: 600; }

/* Nav-Right: User-Dropdown rechts */
.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  justify-self: end;
}

/* Hamburger-Button (immer sichtbar) */
.nav-hamburger {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  width: auto;
  margin: 0;
  justify-self: start;
}
.nav-hamburger-lines {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nav-hamburger-lines span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #3F4F22;
  border-radius: 2px;
}
.nav-hamburger-label {
  color: #3F4F22;
  font-size: 0.95rem;
  font-weight: 500;
  width: auto;
  height: auto;
  background: none;
  border-radius: 0;
}

.nav-user { position: relative; }
.nav-user details > summary {
  background-color: #3F4F22;
  color: #FDFDFD;
  cursor: pointer;
  list-style: none;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  transition: background-color 0.15s;
}
.nav-user details > summary:hover { background-color: #53662F; }
.nav-user details[open] > summary { background-color: #53662F; color: #FDFDFD; }
.nav-user details > summary:focus,
.nav-user details > summary:focus-visible { color: #FDFDFD; outline: none; }
.nav-user details > summary::marker,
.nav-user details > summary::-webkit-details-marker { display: none; }
.nav-user details > summary::after { content: ""; }
.nav-user details > ul {
  position: fixed;
  background: #FDFDFD;
  border: 1px solid #34495E;
  border-radius: 4px;
  list-style: none;
  padding: 0.4rem 0;
  margin: 0;
  min-width: 180px;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
}
.nav-user details > ul li {
  display: block;
  width: 100%;
}
.nav-user details > ul li a {
  color: #2D3436;
  display: block;
  padding: 0.4rem 1rem;
  text-decoration: none;
}
.nav-user details > ul li a:hover { background: #f5f5f5; color: #3F4F22; }
.nav-role-badge {
  font-size: 0.75rem;
  color: #34495E;
  padding: 0.25rem 1rem 0.4rem;
  display: block;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 0.25rem;
}

/* Tabellen-Header */
thead th {
  background-color: #34495E;
  color: #FDFDFD;
}

/* Löschen-Button als Link */
.btn-link-danger {
  background: none;
  border: none;
  color: #8C2D2D;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  text-decoration: none;
}
.btn-link-danger:hover { color: #721c24; background: none; border: none; }



/* Warnfarben */
.alert-danger, .alert-error {
  background-color: #fff0f0;
  border-left: 4px solid var(--pico-color-red-500, #c0392b);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}
.alert-success {
  background-color: #f0fff4;
  border-left: 4px solid var(--pico-color-green-500, #27ae60);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}
.alert-warning {
  background-color: #fffbf0;
  border-left: 4px solid var(--pico-color-amber-500, #f39c12);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

/* Tabellenzeilen */
tr.row-danger td { background-color: #fff0f0; }
tr.row-free td { background-color: #f0fff4; }

/* Detail-Tabelle */
.detail-table { width: 100%; }
.detail-table th {
  width: 40%;
  font-weight: 600;
  color: var(--pico-muted-color);
  padding: 0.25rem 0.5rem 0.25rem 0;
  vertical-align: top;
}
.detail-table td {
  padding: 0.25rem 0;
  vertical-align: top;
}

/* MB-Badges */
.mb-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
  background: #e0e0e0;
  color: #333;
}
.mb-badge.mb-JA { background: #d4edda; color: #155724; }
.mb-badge.mb-KM { background: #cce5ff; color: #004085; }
.mb-badge.mb-EM { background: #fff3cd; color: #856404; }
.mb-badge.mb-W  { background: #f8d7da; color: #721c24; }
.mb-badge.mb-Gesperrt { background: #f5c6cb; color: #721c24; }
.mb-badge.mb-Austritt  { background: #e2e3e5; color: #383d41; }

/* Inventar-Status */
.status-Aktiv { color: #155724; font-weight: 600; }
.status-Ausgeschieden { color: #721c24; }

/* Lizenz-Badge */
.lizenz-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
  background: #cce5ff;
  color: #004085;
  margin-left: 0.25rem;
}

.badge-danger {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
  background: #f8d7da;
  color: #721c24;
}

.free-text { color: var(--pico-color-green-600, #27ae60); }
.text-danger { color: #721c24; }

.role-badge {
  font-size: 0.75rem;
  color: var(--pico-muted-color);
  padding: 0 0.5rem;
}

/* Login-Karte */
.login-card {
  max-width: 400px;
  margin: 4rem auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #34495E;
}
.login-card > header {
  background-color: #3F4F22;
  color: #FDFDFD;
  text-align: center;
  padding: 2rem 1.5rem 1.5rem;
  border-bottom: 3px solid #D3832B;
}
.login-logo {
  height: 5rem;
  filter: brightness(0) invert(1);
  display: block;
  margin: 0 auto 0.75rem;
}
.login-card > header h2 {
  color: #FDFDFD;
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
}
.login-card > header p {
  color: rgba(253,253,253,0.75);
  margin: 0;
  font-size: 0.9rem;
}
.login-card > form {
  padding: 1.5rem;
}
.login-btn {
  width: 100%;
  background-color: #D3832B;
  border-color: #D3832B;
  color: #FDFDFD;
}
.login-btn:hover {
  background-color: #b8701f;
  border-color: #b8701f;
}

/* Alpine.js x-cloak versteckt Elemente vor dem Init */
[x-cloak] { display: none !important; }

/* Tab-Navigation Desktop/Mobile */
.tab-nav-mobile { display: none; }
@media (max-width: 768px) {
  .tab-nav-desktop { display: none; }
  .tab-nav-mobile { display: block; }
}

/* Pflichtfelder automatisch markieren */
label:has(+ input[required])::after,
label:has(+ select[required])::after,
label:has(+ textarea[required])::after {
  content: " *";
  color: var(--pico-del-color);
}

/* Dashboard – Details/Summary Listfelder */
details {
  border: 1px solid #d0d7de;
  border-radius: 6px;
  margin-bottom: 1rem;
  overflow: hidden;
}
details > summary {
  background-color: #34495E !important;
  color: #FDFDFD !important;
  padding: 0.6rem 1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::marker { content: ""; }
details > summary * { color: #FDFDFD !important; }
details > summary::after { content: "＋"; font-size: 1rem; opacity: 0.8; flex-shrink: 0; }
details[open] > summary::after { content: "－"; }
details > :not(summary) { padding: 1rem; }

/* Dashboard – Stat-Karten */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: #fff;
  border: 1px solid #d0d7de;
  border-top: 4px solid #34495E;
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
}
.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #34495E;
  line-height: 1.1;
}
.stat-card .stat-label {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.2rem;
}
.stat-card .stat-sub {
  font-size: 0.75rem;
  color: #999;
  margin-top: 0.15rem;
}
.stat-card .stat-link {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: #D3832B;
}

/* Kassabuch – Scan-Modal Overlay */
.scan-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scan-modal-box {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 520px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

/* Fußzeile */
footer {
  background-color: #FDFDFD;
  border-top: 3px solid #3F4F22;
  color: #3F4F22;
  text-align: center;
  padding: 0.75rem 1rem;
  margin-top: 2rem;
}
footer small { color: #3F4F22; }

/* Kompaktere Tabellen */
table { font-size: 0.9rem; }
th, td { padding: 0.4rem 0.5rem; }

/* Primär-Buttons (Neu/Speichern) immer orange */
a[role="button"]:not([class]),
a[role="button"][style*="width:auto"]:not(.outline):not(.secondary):not(.btn-cancel):not(.contrast) {
  background-color: #D3832B;
  border-color: #D3832B;
  color: #FDFDFD;
}
a[role="button"]:not([class]):hover,
a[role="button"][style*="width:auto"]:not(.outline):not(.secondary):not(.btn-cancel):not(.contrast):hover {
  background-color: #b8701f;
  border-color: #b8701f;
  color: #FDFDFD;
}

/* Formular-Buttons: gleiche Höhe, Abbrechen grau */
.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  align-items: stretch;
}
.form-actions form {
  display: contents;
}
.form-actions button,
.form-actions a[role="button"] {
  margin: 0;
  box-sizing: border-box;
}
.btn-cancel {
  background-color: #6B7C8D;
  border-color: #6B7C8D;
  color: #FDFDFD !important;
}
.btn-cancel:hover {
  background-color: #57687A;
  border-color: #57687A;
  color: #FDFDFD !important;
}
