/* ============================================================
   JFW INTRANET – Stylesheet
   Feuerwehr-Design: Anthrazit + Rot + Weiß
   Font: Barlow (Google Fonts)
   ============================================================ */

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

/* ─── CSS-Variablen ─────────────────────────────────────────── */
:root {
  --primary:        #CC1111;
  --primary-dark:   #A00D0D;
  --primary-light:  #e52e2e;
  --primary-glow:   rgba(204, 17, 17, 0.15);
  --secondary:      #1C2338;
  --secondary-dark: #141928;
  --accent:         #FF8C00;
  --accent-light:   #FFAD3B;
  --success:        #16a34a;
  --warning:        #d97706;
  --info:           #0ea5e9;
  --danger:         #dc2626;
  --bg:             #F0F2F7;
  --bg-dark:        #E4E8F0;
  --card:           #FFFFFF;
  --card-hover:     #FAFBFF;
  --border:         #DDE1EC;
  --border-light:   #EDF0F7;
  --text:           #1C2338;
  --text-secondary: #4B5578;
  --text-muted:     #8892AA;
  --text-white:     #FFFFFF;
  --sidebar-w:      260px;
  --topbar-h:       64px;
  --radius:         10px;
  --radius-lg:      16px;
  --radius-xl:      24px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08);
  --shadow:         0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.12);
  --shadow-red:     0 4px 20px rgba(204,17,17,.25);
  --transition:     0.2s ease;
}

/* ─── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Barlow', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

/* ─── LAYOUT ─────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--secondary);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-h);
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--primary);
  flex-shrink: 0;
}

.sidebar-logo-placeholder {
  width: 40px; height: 40px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.sidebar-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  letter-spacing: .3px;
}

.sidebar-subtitle {
  font-size: 11px;
  color: rgba(255,255,255,.45);
  font-weight: 400;
  margin-top: 2px;
}

/* Navigation */
.sidebar-nav {
  padding: 12px 0;
  flex: 1;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.3);
  padding: 12px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,.65);
  font-size: 14px;
  font-weight: 500;
  border-radius: 0;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,.06);
}

.nav-item.active {
  color: #fff;
  background: var(--primary);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #fff;
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}

.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.nav-item.active .nav-badge {
  background: rgba(255,255,255,.25);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.07);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-user-name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.sidebar-user-role {
  color: rgba(255,255,255,.4);
  font-size: 11px;
}

.sidebar-logout {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.5);
  font-size: 12px;
  padding: 6px 0;
  cursor: pointer;
  transition: color var(--transition);
}

.sidebar-logout:hover { color: var(--danger); }

/* Main Content */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--border); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-secondary);
  transition: all var(--transition);
  position: relative;
}

.topbar-btn:hover {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
}

.topbar-notif-dot {
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  position: absolute;
  top: 6px; right: 6px;
  border: 2px solid var(--card);
}

/* Page Content */
.page-content {
  padding: 28px;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header-left h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.page-header-left p {
  color: var(--text-muted);
  font-size: 14px;
}

/* ─── KARTEN ──────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 22px;
}

.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}

/* Stat-Cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--transition);
  cursor: default;
}

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

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.red   { background: var(--primary-glow); }
.stat-icon.blue  { background: rgba(14,165,233,.12); }
.stat-icon.green { background: rgba(22,163,74,.12); }
.stat-icon.amber { background: rgba(217,119,6,.12); }

.stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Barlow', sans-serif;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 16px; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--shadow-red);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}
.btn-secondary:hover {
  background: var(--secondary-dark);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}

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

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-icon { padding: 8px; border-radius: var(--radius); }

/* ─── FORMULAR ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: 'Barlow', sans-serif;
  color: var(--text);
  background: var(--card);
  transition: all var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control { min-height: 90px; resize: vertical; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236B7280' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 38px;
  cursor: pointer;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 17px; height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-section {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  background: var(--bg);
}

.form-section-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── TABELLEN ───────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover td { background: var(--card-hover); }

.td-name {
  font-weight: 600;
  color: var(--text);
}

.td-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ─── BADGES ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-red    { background: rgba(204,17,17,.12); color: var(--primary); }
.badge-blue   { background: rgba(14,165,233,.12); color: #0284c7; }
.badge-green  { background: rgba(22,163,74,.12); color: var(--success); }
.badge-orange { background: rgba(234,88,12,.12); color: #ea580c; }
.badge-amber  { background: rgba(217,119,6,.12); color: var(--warning); }
.badge-dark   { background: rgba(28,35,56,.12); color: var(--secondary); }
.badge-gray   { background: var(--bg-dark); color: var(--text-secondary); }
.badge-white  { background: rgba(255,255,255,.2); color: #fff; }

/* ─── ALERTS ─────────────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  border-left: 4px solid;
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-success { background: rgba(22,163,74,.08); border-color: var(--success); color: #166534; }
.alert-error   { background: rgba(220,38,38,.08); border-color: var(--danger); color: #991b1b; }
.alert-warning { background: rgba(217,119,6,.08); border-color: var(--warning); color: #92400e; }
.alert-info    { background: rgba(14,165,233,.08); border-color: var(--info); color: #0369a1; }

/* ─── MODAL ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
  animation: fadeIn .15s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.modal, .modal-box {
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .2s ease;
}
.modal-box.modal-lg { max-width: 760px; }
.modal-box.modal-sm { max-width: 420px; }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--card);
}

.modal-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-muted);
  transition: all var(--transition);
}

.modal-close:hover { background: var(--danger); color: #fff; }

.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ─── KALENDER ───────────────────────────────────────────────── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
}

.cal-day-header {
  background: var(--secondary);
  color: rgba(255,255,255,.7);
  text-align: center;
  padding: 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.cal-day {
  background: var(--card);
  min-height: 80px;
  padding: 8px;
  position: relative;
  transition: background var(--transition);
}

.cal-day:hover { background: var(--card-hover); }

.cal-day.other-month { background: var(--bg); }
.cal-day.other-month .cal-date { color: var(--text-muted); }

.cal-day.today { background: rgba(204,17,17,.04); }
.cal-day.today .cal-date {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 26px; height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-event {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  transition: opacity var(--transition);
}

.cal-event:hover { opacity: .8; }
.cal-event.dienst  { background: rgba(14,165,233,.15); color: #0284c7; }
.cal-event.lager   { background: var(--primary-glow); color: var(--primary); }
.cal-event.ausflug { background: rgba(22,163,74,.12); color: var(--success); }

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cal-nav-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 700;
}

/* ─── PROFIL-AVATAR ──────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-placeholder {
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: 'Barlow Condensed', sans-serif;
  flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-md { width: 44px; height: 44px; font-size: 17px; }
.avatar-lg { width: 64px; height: 64px; font-size: 24px; }
.avatar-xl { width: 96px; height: 96px; font-size: 36px; }

/* ─── MEMBER CARD ────────────────────────────────────────────── */
.member-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--card);
  transition: all var(--transition);
}

.member-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.member-info {
  flex: 1;
}

.member-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.member-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

/* ─── FAHRZEUGHALLE ──────────────────────────────────────────── */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.vehicle-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}

.vehicle-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.vehicle-img {
  height: 160px;
  object-fit: cover;
  width: 100%;
  background: linear-gradient(135deg, var(--secondary), #2d3a5e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
}

.vehicle-body {
  padding: 16px;
}

.vehicle-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.vehicle-type {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.vehicle-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}

/* ─── ABZEICHEN ──────────────────────────────────────────────── */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.achievement-card {
  text-align: center;
  padding: 20px 16px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-light);
  background: var(--card);
  transition: all var(--transition);
  position: relative;
}

.achievement-card.earned {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(255,140,0,.05), rgba(255,140,0,.02));
}

.achievement-card.earned .ach-icon { filter: none; }

.ach-icon {
  font-size: 48px;
  margin-bottom: 8px;
  display: block;
  filter: grayscale(0.7) opacity(0.4);
  transition: filter var(--transition);
}

.achievement-card.earned .ach-icon { filter: none; }

.ach-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.ach-date {
  font-size: 11px;
  color: var(--text-muted);
}

.ach-check {
  position: absolute;
  top: 8px; right: 8px;
  width: 20px; height: 20px;
  background: var(--success);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

/* ─── FLAMMEN-PROGRESS ───────────────────────────────────────── */
.flamme-progress {
  display: flex;
  gap: 8px;
  align-items: center;
}

.flamme-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.flamme-step::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 20px;
  width: 60px;
  height: 2px;
  background: var(--border);
}

.flamme-step:last-child::after { display: none; }
.flamme-step.done::after { background: var(--accent); }

.flamme-dot {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--card);
  z-index: 1;
  transition: all var(--transition);
}

.flamme-step.done .flamme-dot {
  border-color: var(--accent);
  background: rgba(255,140,0,.1);
}

.flamme-step.current .flamme-dot {
  border-color: var(--primary);
  background: var(--primary-glow);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.flamme-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ─── QUIZ ───────────────────────────────────────────────────── */
.quiz-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  padding: 32px;
  max-width: 700px;
  margin: 0 auto;
}

.quiz-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
}

.quiz-progress-dot {
  height: 4px;
  flex: 1;
  background: var(--border);
  border-radius: 2px;
  transition: background var(--transition);
}

.quiz-progress-dot.done { background: var(--success); }
.quiz-progress-dot.current { background: var(--primary); }

.quiz-question {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
  line-height: 1.3;
}

.quiz-answers {
  display: grid;
  gap: 10px;
}

.quiz-answer {
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
}

.quiz-answer:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
  color: var(--primary);
}

.quiz-answer.correct {
  border-color: var(--success);
  background: rgba(22,163,74,.08);
  color: var(--success);
}

.quiz-answer.wrong {
  border-color: var(--danger);
  background: rgba(220,38,38,.08);
  color: var(--danger);
}

.quiz-answer-letter {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ─── GALERIE ────────────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.gallery-item {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.gallery-item:hover img { transform: scale(1.05); }

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.4);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
}

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

/* ─── BEKLEIDUNG ─────────────────────────────────────────────── */
.clothing-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--card);
  margin-bottom: 8px;
}

.clothing-icon { font-size: 24px; }

.clothing-info { flex: 1; }
.clothing-name { font-weight: 600; font-size: 14px; }
.clothing-meta { font-size: 12px; color: var(--text-muted); }

/* ─── LOGIN PAGE ─────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--secondary);
  position: relative;
  overflow: hidden;
}

.login-bg-shape {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.login-bg-shape::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: var(--primary);
  border-radius: 50%;
  opacity: .08;
}

.login-bg-shape::after {
  content: '';
  position: absolute;
  bottom: -150px; left: -150px;
  width: 400px; height: 400px;
  background: var(--accent);
  border-radius: 50%;
  opacity: .05;
}

.login-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  animation: slideUp .3s ease;
}

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

.login-logo .logo-img {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  object-fit: contain;
}

.login-logo-placeholder {
  width: 72px; height: 72px;
  background: var(--primary);
  border-radius: 16px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: var(--shadow-red);
}

.login-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
}

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
  margin-bottom: 28px;
}

.login-input-icon {
  position: relative;
}

.login-input-icon .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

.login-input-icon .form-control {
  padding-left: 38px;
}

/* ─── DSGVO-BANNER ───────────────────────────────────────────── */
.dsgvo-notice {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.dsgvo-notice .icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* ─── SENSITIVE DATA ─────────────────────────────────────────── */
.sensitive-field {
  position: relative;
}

.sensitive-blur {
  filter: blur(4px);
  user-select: none;
  pointer-events: none;
}

.sensitive-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  background: rgba(255,255,255,.8);
  border-radius: var(--radius);
  cursor: pointer;
}

/* ─── TABS ───────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 24px;
}

.tab-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

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

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── DROPDOWN ───────────────────────────────────────────────── */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 200;
  animation: fadeIn .1s ease;
  overflow: hidden;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
}

.dropdown-item:hover { background: var(--bg); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border-light); }

/* ─── PAGINATION ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}

.page-link {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ─── EMPTY STATE ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  display: block;
  opacity: .4;
}

.empty-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-text {
  color: var(--text-muted);
  font-size: 14px;
}

/* ─── SEARCH BAR ─────────────────────────────────────────────── */
.search-bar {
  position: relative;
  flex: 1;
  max-width: 320px;
}

.search-bar .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

.search-bar input {
  width: 100%;
  padding: 9px 12px 9px 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: 'Barlow', sans-serif;
  background: var(--card);
  color: var(--text);
  transition: all var(--transition);
  outline: none;
}

.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ─── KINDERGRUPPE SPEZIAL ───────────────────────────────────── */
.kids-mode .card {
  border-radius: 20px;
}

.kids-mode .nav-item {
  font-size: 16px;
  padding: 14px 20px;
}

.kids-icon-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
}

.kids-icon-btn {
  background: var(--card);
  border: 2px solid var(--border-light);
  border-radius: 20px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.kids-icon-btn:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.kids-icon-btn .icon { font-size: 44px; }
.kids-icon-btn .label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text);
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .menu-toggle { display: flex; }
  
  .page-content { padding: 16px; }
  
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  
  .topbar { padding: 0 16px; }
  
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 99;
    display: none;
  }
  
  .sidebar-overlay.open { display: block; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
}

/* ─── UTILITIES ──────────────────────────────────────────────── */
.hidden { display: none !important; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.font-bold { font-weight: 700; }
.font-condensed { font-family: 'Barlow Condensed', sans-serif; }
.w-full { width: 100%; }
.overflow-hidden { overflow: hidden; }
.rounded { border-radius: var(--radius); }
.rounded-full { border-radius: 9999px; }
.border { border: 1px solid var(--border); }
.bg-card { background: var(--card); }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}

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

/* Print */
@media print {
  .sidebar, .topbar, .btn, .no-print { display: none !important; }
  .main-content { margin-left: 0; }
  .page-content { padding: 0; }
}

/* ─── FAHRZEUGHALLE (korrigierte Klassen) ──────────────────── */
.fahrzeughalle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 1.5rem;
}
.fahrzeug-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.fahrzeug-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.fahrzeug-card-inner { display: flex; flex-direction: column; }
.fahrzeug-front {
  height: 160px;
  background: linear-gradient(135deg, var(--secondary) 0%, #2d3a5e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.fahrzeug-bild {
  width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.fahrzeug-icon-large { font-size: 64px; line-height: 1; }
.fahrzeug-icon-xl { font-size: 80px; line-height: 1; }
.fahrzeug-kuerzel-badge {
  position: absolute;
  bottom: 10px; left: 10px;
  background: var(--primary);
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 1px;
}
.fahrzeug-info { padding: 16px; flex: 1; }
.fahrzeug-info h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}
.fahrzeug-typ { font-size: .8rem; color: var(--text-muted); font-weight: 500; margin-bottom: 8px; }
.fahrzeug-meta { font-size: .82rem; color: var(--text-muted); margin: 2px 0; display: flex; align-items: center; gap: 6px; }
.fahrzeug-hint { font-size: .78rem; color: var(--primary); margin-top: 10px; opacity: .7; }
.fahrzeug-edit-actions {
  position: absolute;
  top: 8px; right: 8px;
  display: flex; gap: 4px;
  opacity: 0;
  transition: opacity .2s;
}
.fahrzeug-card:hover .fahrzeug-edit-actions { opacity: 1; }
/* Detail modal */
.fahrzeug-detail-body {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  flex-wrap: wrap;
}
.fahrzeug-detail-img-wrap {
  width: 200px;
  flex-shrink: 0;
  position: relative;
  text-align: center;
}
.fahrzeug-detail-kuerzel {
  display: inline-block;
  margin-top: 8px;
  background: var(--primary);
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  padding: 4px 16px;
  border-radius: 8px;
  font-size: 1.1rem;
}
.fahrzeug-detail-info { flex: 1; min-width: 250px; }
.fd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1.5rem; }
.fd-item label { font-size: .78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: 2px; }
.fd-item span { font-size: .95rem; color: var(--text); }
.ausstattung-list { padding-left: 1.25rem; }
.ausstattung-list li { font-size: .9rem; color: var(--text); margin-bottom: 4px; }

/* ─── ABZEICHEN (korrigierte Klassen) ───────────────────────── */
.abzeichen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.abzeichen-section { margin-bottom: 2rem; }
.badge-kat-section { margin-bottom: 2rem; }
.badge-kat-section h3, .abzeichen-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--border-light);
}
.abzeichen-item {
  background: var(--card);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
  transition: all var(--transition);
  position: relative;
}
.abzeichen-item.earned {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(255,140,0,.08), rgba(255,140,0,.02));
}
.abzeichen-item.locked { opacity: .5; filter: grayscale(.5); }
.abzeichen-icon-wrap {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto .75rem;
  font-size: 1.75rem;
  border: 2px solid var(--border-light);
  transition: all var(--transition);
}
.abzeichen-item.earned .abzeichen-icon-wrap {
  border-color: var(--accent);
  background: rgba(255,140,0,.12);
  box-shadow: 0 0 0 4px rgba(255,140,0,.15);
}
.abzeichen-icon { font-size: 1.75rem; line-height: 1; }
.abzeichen-name { font-size: .85rem; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.abzeichen-desc { font-size: .78rem; color: var(--text-muted); line-height: 1.4; margin-bottom: 4px; }
.abzeichen-punkte { font-size: .75rem; color: var(--primary); font-weight: 600; }
.abzeichen-date { font-size: .75rem; color: var(--success); font-weight: 600; }
.abzeichen-notiz { font-size: .75rem; color: var(--text-muted); }
.abzeichen-check {
  position: absolute;
  top: 6px; right: 6px;
  width: 22px; height: 22px;
  background: var(--success);
  border-radius: 50%;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
}
.badge-admin-actions { display: flex; gap: 4px; justify-content: center; margin-top: .75rem; }
.empty-state-small { text-align: center; padding: 2rem; color: var(--text-muted); font-size: .9rem; }

/* ─── QUIZ (erweiterte Stile) ───────────────────────────────── */
.quiz-progress-text { font-size: .85rem; color: var(--text-muted); }
.quiz-best { color: var(--accent); font-weight: 600; }
.quiz-inactive { opacity: .6; }

/* ─── DOWNLOAD-CENTER ───────────────────────────────────────── */
.download-kat-section { margin-bottom: 2rem; }
.kat-section-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--border-light);
}
.kat-count {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: .75rem;
  color: var(--text-muted);
}
.downloads-grid { display: flex; flex-direction: column; gap: .5rem; }
.download-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1rem;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  transition: all .15s;
}
.download-item:hover { border-color: var(--primary); transform: translateX(4px); }
.download-icon { font-size: 1.75rem; flex-shrink: 0; width: 40px; text-align: center; }
.download-info { flex: 1; min-width: 0; }
.download-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.download-desc { font-size: .8rem; color: var(--text-muted); }
.download-meta { font-size: .78rem; color: var(--text-muted); display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 2px; }
.download-actions { display: flex; gap: .5rem; flex-shrink: 0; align-items: center; }
.access-badge { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 1px 6px; font-size: .72rem; color: var(--text-muted); }
.filter-bar { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.5rem; }
.search-wrap { display: flex; align-items: center; gap: .5rem; background: var(--card); border: 1px solid var(--border-light); border-radius: 8px; padding: 0 .75rem; flex: 1; min-width: 200px; max-width: 320px; }
.search-input { border: none !important; background: transparent !important; padding: .6rem 0 !important; outline: none; width: 100%; }
.kat-filter { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ─── ANMELDUNG (Event-Cards) ───────────────────────────────── */
.events-anmeldung-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.anmeldung-card { overflow: hidden; display: flex; flex-direction: column; }
.anmeldung-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
}
.event-type-badge {
  font-size: .78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--primary);
  color: #fff;
}
.event-date-badge { text-align: center; }
.event-date-badge .day { font-size: 1.5rem; font-weight: 800; display: block; line-height: 1; color: var(--primary); font-family: 'Barlow Condensed', sans-serif; }
.event-date-badge .month { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; }
.anmeldung-card-body { padding: 1rem; flex: 1; }
.anmeldung-card-body h3 { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; }
.event-ort, .event-zeit { font-size: .85rem; color: var(--text-muted); margin-bottom: 3px; }
.teilnehmer-stats { margin: .75rem 0; }
.tn-stat { font-size: .82rem; color: var(--text-muted); display: flex; align-items: center; gap: .4rem; margin-bottom: 4px; }
.tn-bar { height: 6px; background: var(--border-light); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.tn-bar-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s; }
.tn-bar-fill.full { background: var(--accent); }
.anmeldung-card-footer { padding: .75rem 1rem; background: var(--bg); border-top: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; }
.my-status { font-size: .85rem; font-weight: 600; display: flex; align-items: center; gap: .4rem; }
.status-green { color: var(--success); }
.status-orange { color: var(--accent); }
.status-red { color: var(--danger); }
.status-gray { color: var(--text-muted); }
.participant-list { border: 1px solid var(--border-light); border-radius: 8px; margin-top: .75rem; overflow: hidden; }
.participant-list-inner { max-height: 200px; overflow-y: auto; }
.participant-row { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; border-bottom: 1px solid var(--border-light); font-size: .85rem; }
.participant-row:last-child { border-bottom: none; }
.status-badge { padding: 1px 8px; border-radius: 10px; font-size: .75rem; font-weight: 600; }
.status-badge.status-green { background: rgba(22,163,74,.1); }
.status-badge.status-orange { background: rgba(255,140,0,.1); }
.status-badge.status-gray { background: var(--bg); }
.gruppenleiter-anmeldung { margin-top: .75rem; }

/* ─── GALERIE ──────────────────────────────────────────── */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.album-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  background: var(--card);
  border: 1px solid var(--border-light);
  transition: all var(--transition);
  position: relative;
}
.album-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.album-cover { height: 160px; background: var(--bg); position: relative; overflow: hidden; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-cover-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--text-muted); }
.album-count-badge {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,.65); color: #fff;
  border-radius: 20px; padding: 2px 8px; font-size: .75rem; font-weight: 600;
}
.album-private-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--primary); color: #fff;
  border-radius: 6px; padding: 2px 6px; font-size: .75rem;
}
.album-info { padding: .85rem 1rem; }
.album-info h3 { font-size: .9rem; font-weight: 700; margin-bottom: 4px; }
.album-info p { font-size: .8rem; color: var(--text-muted); }
.album-date { font-size: .78rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.album-actions { position: absolute; top: 8px; right: 8px; opacity: 0; transition: .2s; }
.album-card:hover .album-actions { opacity: 1; }
.album-nav { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.album-nav h2 { flex: 1; margin: 0; font-size: 1.3rem; font-weight: 700; }
.album-desc { color: var(--text-muted); margin-bottom: 1.5rem; font-size: .9rem; }
.galerie-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.galerie-item { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 1; cursor: pointer; }
.galerie-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.galerie-item:hover img { transform: scale(1.05); }
.galerie-caption { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,.6)); color: #fff; padding: 6px 8px 4px; font-size: .78rem; }
.galerie-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.4); opacity: 0; display: flex; align-items: center; justify-content: center; transition: .2s; }
.galerie-item:hover .galerie-overlay { opacity: 1; }
/* Lightbox */
.lightbox-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 2000; display: flex; align-items: center; justify-content: center; }
.lb-close { position: absolute; top: 20px; right: 20px; background: none; border: none; color: #fff; font-size: 2rem; cursor: pointer; z-index: 10; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.15); border: none; color: #fff; font-size: 1.5rem; cursor: pointer; padding: .75rem 1rem; border-radius: 8px; transition: .2s; }
.lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.3); }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
.lb-content { text-align: center; max-width: 90vw; }
.lb-content img { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 8px; }
.lb-caption { color: #ddd; margin-top: .75rem; font-size: .9rem; }
.lb-counter { color: #888; font-size: .8rem; margin-top: .25rem; }
.file-preview-grid { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.file-preview-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.upload-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: .2s;
  background: var(--bg);
}
.upload-drop-zone:hover, .upload-drop-zone.drag-over { border-color: var(--primary); background: var(--primary-glow); }

/* ─── SYSTEMSTEUERUNG ────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--border-light);
}
.section-header h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(204,17,17,.1);
  color: var(--primary);
  border: 1px solid rgba(204,17,17,.25);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: .8rem;
  font-weight: 700;
}

/* User Admin Cards */
.users-admin-table {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.user-admin-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
}
.user-inactive { opacity: .6; }
.uac-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}
.uac-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.uac-avatar.inactive { background: var(--text-muted); }
.uac-info { min-width: 0; }
.uac-info strong { display: block; font-size: .95rem; font-weight: 700; }
.uac-roles { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.uac-meta { font-size: .78rem; margin-top: 4px; display: flex; gap: .75rem; flex-wrap: wrap; }
.uac-actions {
  display: flex;
  gap: .4rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Automations */
.automations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.automation-card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all var(--transition);
}
.automation-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.auto-icon { font-size: 2rem; margin-bottom: .5rem; }
.auto-info h4 { font-size: .95rem; font-weight: 700; margin-bottom: .25rem; }
.auto-info p { font-size: .82rem; color: var(--text-muted); margin-bottom: .75rem; line-height: 1.4; }

/* Logs */
.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.log-list { display: flex; flex-direction: column; gap: 2px; }
.log-entry {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .65rem .75rem;
  border-radius: 8px;
  transition: background .15s;
}
.log-entry:hover { background: var(--bg); }
.log-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  flex-shrink: 0;
}
.log-details { flex: 1; min-width: 0; }
.log-action { font-size: .85rem; font-weight: 600; color: var(--text); }
.log-desc { font-size: .8rem; color: var(--text-muted); }
.log-user { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }

/* Admin Tools Grid */
.admin-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.admin-tools-grid .card { padding: 1.25rem; }
.admin-tools-grid h4 { font-size: .95rem; font-weight: 700; margin-bottom: .5rem; }
.admin-tools-grid p { font-size: .82rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.4; }

/* Rollen-Checkboxen */
.roles-checkboxes {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin: .75rem 0;
}
.roles-checkboxes-inline {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .5rem 0;
}
.role-checkbox {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
  font-size: .9rem;
}
.role-checkbox:hover { border-color: var(--primary); background: var(--primary-glow); }
.role-checkbox.role-admin { border-color: var(--primary); background: rgba(204,17,17,.05); font-weight: 700; }
.role-checkbox input[type=checkbox] { margin: 0; }

/* Broadcast Form */
.broadcast-form .form-group { margin-bottom: 1rem; }

/* ─── QUIZ SPIEL ─────────────────────────────────────────────── */
.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.quiz-card { padding: 1.25rem; }
.quiz-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.quiz-kategorie-badge {
  font-size: .75rem; font-weight: 700;
  padding: 2px 10px; border-radius: 20px;
  background: var(--primary); color: #fff;
}
.quiz-desc { font-size: .88rem; color: var(--text-muted); margin: .5rem 0; line-height: 1.4; }
.quiz-meta { display: flex; gap: .75rem; flex-wrap: wrap; font-size: .8rem; color: var(--text-muted); margin: .75rem 0; }
.quiz-meta span { display: flex; align-items: center; gap: .3rem; }
.quiz-best { color: var(--accent) !important; font-weight: 600; }
.quiz-card-footer { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border-light); align-items: center; }
.quiz-inactive { opacity: .55; }

/* Quiz Spielfeld */
.quiz-game-wrap { max-width: 760px; margin: 0 auto; padding: 0 .5rem; }
.quiz-game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.quiz-game-header h2 { margin: 0; font-size: 1.2rem; flex: 1; text-align: center; }
.quiz-timer-wrap { display: flex; align-items: center; gap: .75rem; }
.quiz-timer {
  font-size: 1.75rem; font-weight: 800;
  color: var(--primary);
  min-width: 2.5rem; text-align: center;
  font-family: 'Barlow Condensed', sans-serif;
  line-height: 1;
}
.quiz-progress-text { font-size: .85rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.quiz-progress-bar {
  height: 8px; background: var(--border-light);
  border-radius: 4px; margin-bottom: 1.5rem; overflow: hidden;
}
.quiz-progress-fill {
  height: 100%; background: var(--primary);
  border-radius: 4px; transition: width .4s ease;
  min-width: 4px;
}
.quiz-question-card {
  padding: 2rem !important;
  margin-bottom: 1rem;
}
.question-text {
  font-size: 1.2rem; font-weight: 700;
  margin-bottom: 1.5rem; line-height: 1.5;
  color: var(--text);
}
.answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
@media (max-width: 560px) { .answer-grid { grid-template-columns: 1fr; } }
.answer-btn {
  padding: 1rem 1.25rem;
  border: 2px solid var(--border);
  background: var(--bg);
  border-radius: 12px;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 500;
  text-align: left;
  transition: all .15s;
  line-height: 1.4;
  color: var(--text);
  width: 100%;
}
.answer-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-glow);
  transform: translateY(-1px);
}
.answer-btn.correct {
  border-color: #16a34a !important;
  background: #f0fdf4 !important;
  color: #15803d !important;
  font-weight: 700;
}
.answer-btn.wrong {
  border-color: #dc2626 !important;
  background: #fef2f2 !important;
  color: #b91c1c !important;
}
.answer-btn:disabled { cursor: default; }
.quiz-explanation {
  margin-top: 1rem;
  padding: .85rem 1rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  font-size: .9rem;
  color: #92400e;
  line-height: 1.5;
}
#qgNextWrap { text-align: center; margin-top: 1.5rem; }

/* Quiz Ergebnis */
.quiz-result-card {
  padding: 3rem 2rem;
  text-align: center;
  max-width: 500px;
  margin: 2rem auto;
}
.result-emoji { font-size: 5rem; margin-bottom: 1rem; display: block; }
.quiz-result-card h2 { font-size: 1.5rem; margin-bottom: 1.5rem; }
.result-score {
  display: flex; align-items: baseline;
  justify-content: center; gap: .35rem;
  margin: 1rem 0;
}
.result-points { font-size: 3.5rem; font-weight: 800; color: var(--primary); font-family: 'Barlow Condensed', sans-serif; line-height: 1; }
.result-divider { font-size: 2.5rem; color: var(--text-muted); }
.result-total { font-size: 2.5rem; font-weight: 600; color: var(--text-muted); font-family: 'Barlow Condensed', sans-serif; line-height: 1; }
.result-label { font-size: .9rem; color: var(--text-muted); align-self: flex-end; padding-bottom: .25rem; margin-left: .25rem; }
.result-percent-bar {
  height: 14px; background: var(--border-light);
  border-radius: 7px; overflow: hidden; margin: 1.25rem 0;
}
.result-bar-fill {
  height: 100%; background: var(--primary);
  border-radius: 7px; transition: width .8s ease;
}
.result-message { font-size: 1.05rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.result-actions { display: flex; gap: .75rem; justify-content: center; }

/* Quiz Editor */
.frage-editor {
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius-lg);
  background: var(--bg);
}
.frage-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 1rem;
  font-weight: 700;
}
.antworten-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
  margin-bottom: .75rem;
}
@media (max-width: 560px) { .antworten-grid { grid-template-columns: 1fr; } }
.antwort-label {
  display: flex; align-items: center; gap: .5rem;
  background: var(--card); border: 1px solid var(--border-light);
  border-radius: 8px; padding: .5rem .6rem;
  cursor: pointer; transition: .15s;
}
.antwort-label:has(input:checked) {
  border-color: #16a34a; background: #f0fdf4;
}
.antwort-label input[type=radio] { flex-shrink: 0; accent-color: #16a34a; }
.correct-hint { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }

/* ─── SYSTEMSTEUERUNG TABS (standalone) ─────────────────────── */
.sys-tab-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.sys-tab-btn:hover { color: var(--text); }
.sys-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.sys-tab-panel { margin-top: 1.5rem; }

/* ─── PROFIL ────────────────────────────────────────────────── */
.profile-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .profile-layout { grid-template-columns: 1fr; }
}

/* Linke Spalte */
.profile-sidebar-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 80px;
}

/* Avatar */
.profile-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.profile-avatar-large {
  width: 100px; height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}
.profile-avatar-placeholder {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.75rem; font-weight: 800;
  flex-shrink: 0;
  border: 3px solid var(--primary);
}
.profile-avatar-placeholder.large {
  width: 100px; height: 100px;
  font-size: 2.5rem;
  box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Name & Info */
.profile-name-block { text-align: center; margin-bottom: 1rem; }
.profile-name-block h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: .4rem; }
.profile-roles { display: flex; gap: .3rem; justify-content: center; flex-wrap: wrap; margin-bottom: .6rem; }
.profile-meta {
  display: flex; flex-direction: column; gap: .3rem;
  font-size: .82rem; color: var(--text-muted); text-align: left;
}
.profile-meta span { display: flex; align-items: center; gap: .4rem; }
.profile-meta i { color: var(--primary); width: 14px; text-align: center; }

/* Badges Mini */
.profile-badges-mini { margin-top: 1rem; border-top: 1px solid var(--border-light); padding-top: 1rem; }
.profile-badges-mini h4 { font-size: .8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: .6rem; }
.badges-mini-grid { display: flex; flex-wrap: wrap; gap: .4rem; }
.badge-mini {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; cursor: default;
  transition: transform .15s;
}
.badge-mini:hover { transform: scale(1.15); }
.badge-mini.more {
  font-size: .75rem; font-weight: 700;
  color: var(--text-muted);
  background: var(--bg);
}

/* Rechte Spalte */
.profile-main-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.profile-main-card .tab-nav {
  padding: 0 1.5rem;
  border-radius: 0;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 0;
}
.ptab-btn {
  padding: 14px 18px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  border: none; background: none; cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.ptab-btn:hover { color: var(--text); }
.ptab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.ptab-panel { padding: 1.5rem; }

/* Form sections */
.form-section { margin-bottom: 2rem; }
.form-section-title {
  font-size: .9rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 1rem;
  display: flex; align-items: center; gap: .5rem;
}
.form-section-title i { color: var(--primary); }
.form-hint { font-size: .8rem; color: var(--text-muted); margin-top: .5rem; display: flex; align-items: center; gap: .4rem; }
.form-hint i { color: var(--primary); }
.form-control.readonly { background: var(--bg); color: var(--text-muted); cursor: default; }

/* Notfall-Karte */
.notfall-card {
  display: flex; justify-content: space-between; align-items: center;
  padding: .65rem 1rem;
  background: var(--bg); border-radius: 8px;
  margin-bottom: .4rem; font-size: .9rem;
}

/* Input mit Toggle */
.input-with-toggle {
  display: flex; gap: .5rem; align-items: center;
}
.input-with-toggle .form-control { flex: 1; }
.password-toggle {
  width: 38px; height: 38px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: .15s;
}
.password-toggle:hover { border-color: var(--primary); color: var(--primary); }
.form-compact { max-width: 480px; }

/* ─── AUFNAHME ───────────────────────────────────────────────── */
.auf-section-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 1.25rem 0 .75rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--primary);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.auf-section-title:first-child { margin-top: 0; }
.form-check {
  display: flex; align-items: flex-start; gap: .5rem;
  cursor: pointer; font-size: .9rem; line-height: 1.4;
}
.form-check input[type=checkbox] { margin-top: 2px; flex-shrink: 0; accent-color: var(--primary); }

/* ─── ABZEICHEN TAB-BUTTONS ─────────────────────────────────── */
.abtab-btn {
  padding: 10px 18px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  border: none; background: none; cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.abtab-btn:hover { color: var(--text); }
.abtab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.abtab-panel { margin-top: 1.5rem; }

/* ─── MEMBER SELECT BAR ─────────────────────────────────────── */
.member-select-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.member-select-bar label { font-size: .9rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.member-select-bar .form-control { max-width: 280px; }

/* ─── FLAMMEN PROFILE CARD ──────────────────────────────────── */
.flammen-profile-card {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  overflow: visible;
}
.flammen-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.member-avatar-medium {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.5rem; font-weight: 800;
  flex-shrink: 0;
}
.flammen-member-info { flex: 1; min-width: 0; }
.flammen-member-info h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.4rem; font-weight: 800; margin-bottom: .3rem;
}
.flammen-stufe-current {
  display: flex; align-items: center; gap: .4rem; margin-bottom: .25rem;
}
.flammen-icon { font-size: 1.2rem; }
.flammen-label { font-size: .9rem; font-weight: 700; }
.punkte-display {
  font-size: .85rem; color: var(--accent); font-weight: 600;
  display: flex; align-items: center; gap: .3rem;
}
.flammen-change { flex-shrink: 0; }

/* Flammen-Fortschrittsschritte */
.flammen-progress-steps {
  display: flex;
  gap: 0;
  align-items: flex-start;
  overflow-x: visible;
  flex-wrap: nowrap;
  padding: .5rem 0;
}
.flammen-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  flex: 1;
  min-width: 70px;
  position: relative;
  text-align: center;
}
.flammen-step::before {
  content: '';
  position: absolute;
  top: 19px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--border-light);
  z-index: 0;
}
.flammen-step:first-child::before { display: none; }
.flammen-step.done::before { background: var(--accent); }
.flammen-step.active::before { background: linear-gradient(to right, var(--accent), var(--primary)); }

.step-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  position: relative; z-index: 1;
  transition: all .2s;
}
.flammen-step.done .step-icon {
  border-color: var(--accent);
  background: rgba(255,140,0,.12);
}
.flammen-step.active .step-icon {
  border-color: var(--primary);
  background: rgba(204,17,17,.1);
  box-shadow: 0 0 0 5px rgba(204,17,17,.15);
  transform: scale(1.15);
}
.step-label {
  font-size: .72rem; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .3px;
}
.flammen-step.active .step-label { color: var(--primary); }
.flammen-step.done .step-label { color: var(--accent); }

/* Rangliste */
.rangliste-list { display: flex; flex-direction: column; gap: .5rem; }
.rangliste-row {
  display: flex; align-items: center; gap: 1rem;
  padding: .75rem 1rem;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  transition: .15s;
}
.rangliste-row:hover { border-color: var(--primary); }
.rangliste-rank {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .85rem; color: var(--text-muted);
  flex-shrink: 0;
}
.rangliste-rank.gold { background: #fef9c3; border-color: #fbbf24; color: #92400e; }
.rangliste-rank.silver { background: #f1f5f9; border-color: #94a3b8; color: #475569; }
.rangliste-rank.bronze { background: #fef3c7; border-color: #d97706; color: #78350f; }
.rangliste-name { flex: 1; font-weight: 600; }
.rangliste-punkte { font-size: .85rem; color: var(--accent); font-weight: 700; }
.rangliste-badges { font-size: .8rem; color: var(--text-muted); }

/* Vergeben-Formular */
.vergeben-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .vergeben-form { grid-template-columns: 1fr; } }

/* Badge-Typen Verwaltung */
.badge-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 1rem; }
.badge-type-card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  transition: .15s;
}
.badge-type-card:hover { border-color: var(--primary); }
.badge-type-icon {
  font-size: 2rem; flex-shrink: 0;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--bg);
}
.badge-type-info { flex: 1; min-width: 0; }
.badge-type-info h4 { font-size: .9rem; font-weight: 700; margin-bottom: 2px; }
.badge-type-info p { font-size: .78rem; color: var(--text-muted); }
.badge-type-actions { display: flex; gap: .3rem; flex-shrink: 0; }

/* ─── RANGLISTE ─────────────────────────────────────────────── */
.rangliste-wrap { display: flex; flex-direction: column; gap: .6rem; }
.rangliste-row {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  transition: .15s;
}
.rangliste-row:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.rangliste-row.my-row { border-color: var(--primary); background: var(--primary-glow); }
.rank-number {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem;
}
.rank-number.top-1 { background: #fef9c3; border-color: #fbbf24; font-size: 1.2rem; }
.rank-number.top-2 { background: #f1f5f9; border-color: #94a3b8; font-size: 1.2rem; }
.rank-number.top-3 { background: #fef3c7; border-color: #d97706; font-size: 1.2rem; }
.rank-avatar {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.1rem; font-weight: 700;
}
.rank-info { flex: 1; min-width: 0; }
.rank-name { font-weight: 700; font-size: .95rem; }
.rank-stufe { font-size: .78rem; color: var(--text-muted); }
.rank-points { text-align: center; min-width: 60px; }
.points-value { display: block; font-size: 1.3rem; font-weight: 800; color: var(--accent); font-family: 'Barlow Condensed', sans-serif; line-height: 1; }
.points-label { font-size: .72rem; color: var(--text-muted); }
.rank-badges-count { font-size: .85rem; color: var(--text-muted); display: flex; align-items: center; gap: .3rem; white-space: nowrap; }

/* ─── QUIZ ADMIN BUTTONS ────────────────────────────────────── */
.quiz-admin-actions {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border-light);
}
.btn-xs {
  padding: .3rem .7rem;
  font-size: .78rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: .15s;
  display: inline-flex; align-items: center; gap: .25rem;
  white-space: nowrap;
}
.btn-xs:hover { border-color: var(--primary); background: var(--primary-glow); }
.btn-xs.active {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 2px 6px rgba(204,17,17,.3);
}
.btn-xs.btn-danger { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.btn-xs.btn-danger:hover { background: #fee2e2; }
.btn-xs.btn-warning { background: #fffbeb; border-color: #fde68a; color: #d97706; }
.btn-xs.btn-success { background: #f0fdf4; border-color: #bbf7d0; color: #16a34a; }
.btn-xs.btn-secondary { background: var(--bg); border-color: var(--border); color: var(--text-muted); }
.btn-xs.btn-secondary:hover { border-color: var(--secondary); color: var(--secondary); }

/* ─── CHAT / NACHRICHTEN ─────────────────────────────────────── */
.chat-layout {
  display: flex;
  height: calc(100vh - var(--topbar-h, 64px) - 48px);
  gap: 0;
  background: var(--bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin: -1.5rem;
  margin-top: 0;
}
.chat-sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--card);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.chat-sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chat-sidebar-header h2 { font-size: 1rem; font-weight: 700; margin: 0; }
.chat-section-label {
  font-size: .72rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
  padding: .75rem 1.25rem .25rem;
}
.chat-conv-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1.25rem;
  cursor: pointer; transition: background .15s;
  text-decoration: none; color: inherit;
  position: relative;
}
.chat-conv-item:hover { background: var(--bg); }
.chat-conv-item.active { background: var(--primary-glow); }
.chat-conv-item.active .conv-name { color: var(--primary); }
.conv-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem; font-weight: 700; flex-shrink: 0;
}
.conv-avatar.group-avatar { background: var(--secondary); font-size: 1.1rem; }
.conv-info { flex: 1; min-width: 0; }
.conv-name { font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-sub { font-size: .75rem; color: var(--text-muted); font-weight: 400; }
.conv-preview { font-size: .78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.unread-badge {
  background: var(--primary); color: #fff;
  border-radius: 10px; padding: 1px 6px;
  font-size: .72rem; font-weight: 700; flex-shrink: 0;
}
.unread-badge.small { font-size: .68rem; padding: 1px 5px; }

/* Main chat area */
.chat-main {
  flex: 1; display: flex; flex-direction: column;
  background: var(--bg); min-width: 0;
}
.chat-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text-muted); text-align: center; padding: 2rem;
}
.chat-header {
  padding: .85rem 1.25rem;
  background: var(--card);
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: .75rem;
  flex-shrink: 0;
}
.chat-header-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; flex-shrink: 0;
}
.chat-header-avatar.group-avatar { background: var(--secondary); }
.chat-header-name { font-weight: 700; font-size: .95rem; }
.chat-header-sub { font-size: .78rem; color: var(--text-muted); }
.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex; flex-direction: column; gap: .35rem;
}
.chat-date-divider {
  text-align: center; margin: .75rem 0;
}
.chat-date-divider span {
  background: var(--border-light); color: var(--text-muted);
  font-size: .75rem; padding: 2px 10px; border-radius: 10px;
}
.chat-msg { display: flex; align-items: flex-end; gap: .5rem; max-width: 75%; }
.chat-msg.me { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.them { align-self: flex-start; }
.msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--secondary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; flex-shrink: 0; margin-bottom: 4px;
}
.msg-bubble-wrap { display: flex; flex-direction: column; min-width: 60px; max-width: 100%; }
.msg-sender { font-size: .72rem; font-weight: 700; color: var(--primary); margin-bottom: 2px; padding-left: 4px; }
.msg-bubble {
  padding: .55rem .85rem;
  border-radius: 14px; font-size: .9rem; line-height: 1.45; word-break: break-word;
}
.chat-msg.them .msg-bubble {
  background: var(--card);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,.07);
}
.chat-msg.me .msg-bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 1px 3px rgba(204,17,17,.25);
}
.msg-time {
  font-size: .68rem; color: var(--text-muted);
  padding: 0 4px; margin-top: 2px;
  display: flex; gap: .2rem; align-items: center;
}
.chat-msg.me .msg-time { justify-content: flex-end; }
.msg-read { color: var(--primary); font-weight: 700; }
.chat-input-area {
  padding: .85rem 1.25rem;
  background: var(--card);
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}
.chat-input-row { display: flex; gap: .5rem; align-items: flex-end; }
.chat-textarea {
  flex: 1; border: 1.5px solid var(--border);
  border-radius: 20px; padding: .55rem 1rem;
  font-family: inherit; font-size: .9rem;
  resize: none; outline: none;
  background: var(--bg); line-height: 1.4;
  transition: border-color .15s;
  max-height: 120px; min-height: 38px;
}
.chat-textarea:focus { border-color: var(--primary); background: #fff; }
.chat-send-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: #fff;
  border: none; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0; transition: .15s;
}
.chat-send-btn:hover { background: #aa0e0e; transform: scale(1.05); }
@media (max-width: 600px) {
  .chat-sidebar { width: 100%; min-width: 0; }
  .chat-layout { flex-direction: column; height: calc(100vh - 120px); }
  .chat-sidebar { height: 200px; flex-shrink: 0; }
}

/* ─── ZEITERFASSUNG ─────────────────────────────────────────── */
.nfc-scanner-card { padding: 1.25rem; margin-bottom: 1.5rem; }
.nfc-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; flex-wrap: wrap; gap: .5rem; }
.nfc-status-badge {
  display: inline-block; padding: 3px 12px; border-radius: 20px;
  font-size: .78rem; font-weight: 700; flex-shrink: 0;
}
.nfc-off  { background: #f1f5f9; color: #64748b; }
.nfc-on   { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(22,163,74,.3); } 50% { box-shadow: 0 0 0 6px rgba(22,163,74,0); } }
.nfc-feedback {
  padding: .65rem .85rem; border-radius: 8px;
  font-size: .88rem; margin-bottom: .75rem;
  background: #eff6ff; color: #1d4ed8;
}
.zeit-card { border-radius: 10px !important; }

/* ─── SIDEBAR AVATAR IMAGE ──────────────────────────────────── */
.sidebar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem; font-weight: 700;
  flex-shrink: 0;
}

/* ─── ABZEICHEN HEADER (dunkler Hintergrund) ─────────────────── */
/* dark card overrides removed */

/* ─── CHAT: Aktive / Ungelesene Konversationen ──────────── */
.conv-unread .conv-name > span:first-child { font-weight: 700; color: var(--text); }
.conv-unread { background: var(--primary-glow); }
.conv-preview-bold { font-weight: 600; color: var(--text) !important; font-style: normal !important; }
.chat-section-label { position: sticky; top: 0; background: var(--card); z-index: 2; }
