/* ================================================================
   CdF-Leihsystem – Hauptstylesheet
   Design-Farben werden über CSS-Variablen gesteuert (admin/settings)
   ================================================================ */

/* ── Reset & Basis ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* Twemoji-SVGs inline skalieren */
img.emoji {
  height: 1em; width: 1em;
  margin: 0 .05em 0 .1em;
  vertical-align: -0.1em;
  display: inline-block;
}
/* overflow-x: clip verhindert horizontales Scrollen OHNE neuen Scroll-Kontext zu erstellen.
   Wichtig: "hidden" auf body/html würde position:sticky am Header brechen. */
html { overflow-x: clip; }
body {
  overflow-x: clip;    /* Kein horizontales Scrollen – bricht NICHT position:sticky */
  /* Emoji-Font-Stack: sorgt für farb-konsistente Emoji-Darstellung auf allen Betriebssystemen */
  font-family: var(--font, Inter, system-ui, sans-serif),
               'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
}

:root {
  --primary:     #2563eb;
  --secondary:   #10b981;
  --accent:      #f59e0b;
  --bg:          #f0f4f8;
  --text:        #1e293b;
  --header-bg:   #1e293b;
  --header-text: #ffffff;
  --footer-bg:        #1e293b;
  --footer-text:      #94a3b8;
  --footer-link:      #cbd5e1;
  --header-link:      rgba(255,255,255,.85);
  --header-hover-bg:  rgba(255,255,255,.15);
  --header-hover-clr: #ffffff;
  --link-color:  #2563eb;
  --success:     #10b981;
  --radius:      10px;
  --font:        'Inter', system-ui, sans-serif;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow:      0 4px 16px rgba(0,0,0,.1);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.14);
  --transition:  .2s ease;
  --card-bg:     #ffffff;
  --border:      #e2e8f0;
  --muted:       #64748b;
  --danger:      #ef4444;
  --success-bg:  #d1fae5;
  --success-fg:  #065f46;
  --error-bg:    #fee2e2;
  --error-fg:    #991b1b;
  --warning-bg:  #fef3c7;
  --warning-fg:  #92400e;
  --info-bg:     #dbeafe;
  --info-fg:     #1e40af;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Container ─────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
@media (max-width: 1024px) {
  .container { padding: 0 2rem; }
}
@media (max-width: 480px) {
  .container { padding: 0 1.25rem; }
}

/* ── Header ────────────────────────────────────────────────────── */
.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--header-text);
  text-decoration: none;
  flex-shrink: 0;
}
.logo-icon { font-size: 1.6rem; }
.logo-name  { display: block; font-size: 1.1rem; font-weight: 700; line-height: 1.2; }
.logo-tagline { display: block; font-size: .7rem; opacity: .7; font-weight: 400; }
.site-logo-img { height: 40px; max-width: 180px; object-fit: contain; display: block; width: auto; }

.site-nav { display: flex; align-items: center; gap: .25rem; }

.nav-link {
  color: var(--header-link);
  padding: .4rem .8rem;
  border-radius: calc(var(--radius) - 4px);
  font-size: .9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.nav-link:hover { background: var(--header-hover-bg); color: var(--header-hover-clr); text-decoration: none; }
.nav-register { background: var(--nav-register-bg, var(--primary)); color: var(--nav-register-color, #fff) !important; }
.nav-register:hover { background: color-mix(in srgb, var(--nav-register-bg, var(--primary)) 85%, #000); }
.nav-admin { background: var(--nav-admin-bg, var(--accent)); color: var(--nav-admin-color, #1e293b) !important; }
.nav-admin:hover { background: var(--nav-admin-hover, #d97706) !important; }
.nav-logout { color: rgba(255,150,150,.9) !important; }
.nav-logout:hover { background: rgba(239,68,68,.2); color: #fca5a5 !important; }

.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: #ef4444; color: #fff;
  font-size: .65rem; font-weight: 700;
  min-width: 1.15rem; height: 1.15rem;
  border-radius: 100px; padding: 0 .3rem;
  margin-left: .35rem; vertical-align: middle; line-height: 1;
  animation: badge-pop .25s ease;
}
@keyframes badge-pop { from { transform: scale(0); } to { transform: scale(1); } }

/* Overflow-triggered mobile nav (JS adds .nav-overflow to .header-inner) */
.header-inner.nav-overflow .mobile-menu-btn { display: flex; }
.header-inner.nav-overflow .site-nav {
  display: none;
  position: absolute;
  top: 64px; left: 0; right: 0;
  background: var(--header-bg);
  flex-direction: column;
  padding: 1rem; gap: .25rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  z-index: 99;
}
.header-inner.nav-overflow .site-nav.open { display: flex; }
.header-inner.nav-overflow .nav-link { width: 100%; border-radius: 8px; }

.mobile-menu-btn {
  display: none;
  background: none;
  border: 1.5px solid rgba(255,255,255,.3);
  color: var(--header-text);
  padding: .4rem .7rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

/* ── Main ──────────────────────────────────────────────────────── */
.site-main { flex: 1; padding: 2rem 0 4rem; }

/* ── Footer ────────────────────────────────────────────────────── */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 1rem 0;
  font-size: .85rem;
}
.site-footer a { color: var(--footer-link); text-decoration: none; }
.site-footer a:hover { opacity: 1; text-decoration: underline; }

/* ── Alerts ────────────────────────────────────────────────────── */
.alert {
  padding: .85rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: .9rem;
  border-left: 4px solid transparent;
}
.alert-success { background: var(--success-bg); color: var(--success-fg); border-color: #10b981; }
.alert-error   { background: var(--error-bg);   color: var(--error-fg);   border-color: #ef4444; }
.alert-warning { background: var(--warning-bg); color: var(--warning-fg); border-color: #f59e0b; }
.alert-info    { background: var(--info-bg);    color: var(--info-fg);    border-color: #2563eb; }

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card-title  { font-size: 1.05rem; font-weight: 700; margin: 0; }
.card-body   { padding: 1.5rem; }
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); background: #f8fafc; }

.admin-page-header { margin-bottom: 1.75rem; }
.admin-page-header h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: .2rem; }
.admin-page-subtitle { color: var(--muted); font-size: .9rem; margin: 0; }

/* ── Artikel-Grid ──────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-title { font-size: 1.6rem; font-weight: 700; }

.filter-bar {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.filter-btn {
  padding: .4rem 1rem;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  font-size: .875rem;
  font-weight: 500;
  color: var(--muted);
  transition: all var(--transition);
}
.filter-btn:hover, .filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.item-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}
.item-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.item-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #f1f5f9;
}
.item-card-img-placeholder {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, #e0f2fe, #bfdbfe);
}

.item-card-body { padding: 1.1rem; flex: 1; }
.item-card-name { font-size: 1rem; font-weight: 600; margin-bottom: .4rem; }
.item-card-category { font-size: .8rem; color: var(--muted); margin-bottom: .5rem; }

.item-card-footer {
  padding: .85rem 1.1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .4rem;
  background: #fafbfc;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: .25rem .65rem;
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 600;
}
.badge-available { background: #d1fae5; color: #065f46; }
.badge-booked    { background: #fee2e2; color: #991b1b; }
.badge-pending   { background: #fef3c7; color: #92400e; }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .55rem 1.2rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: .9rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.4;
  touch-action: manipulation;   /* entfernt 300ms Tap-Delay auf Mobile */
}
.btn:hover { text-decoration: none; opacity: .9; }
.btn-primary  { background: var(--primary);   color: #fff; border-color: var(--primary); }
.btn-primary:hover  { background: #1d4ed8; border-color: #1d4ed8; }
.btn-secondary{ background: var(--secondary); color: #fff; border-color: var(--secondary); }
.btn-accent   { background: var(--accent);    color: #1e293b; border-color: var(--accent); }
.btn-danger   { background: var(--danger);    color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.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(--muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--border); }
.btn-sm       { padding: .3rem .7rem; font-size: .8rem; }
.btn-lg       { padding: .75rem 1.75rem; font-size: 1rem; }
.btn-block    { display: flex; width: 100%; }

/* ── Formulare ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .35rem;
}
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: .6rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  font-size: 1rem;        /* ≥16px verhindert Auto-Zoom auf iOS Safari */
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-control::placeholder { color: #a0aec0; }
.form-control.is-invalid { border-color: var(--danger); }

select.form-control { appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .9rem center; padding-right: 2.5rem; }

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

.form-text { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.form-error { font-size: .8rem; color: var(--danger); margin-top: .3rem; }

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

.form-check { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.form-check-input { width: 1.1rem; height: 1.1rem; cursor: pointer; accent-color: var(--primary); }
.form-check-label { font-size: .9rem; cursor: pointer; }

/* ── Auth-Seiten ───────────────────────────────────────────────── */
.auth-wrap {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
}
.auth-card {
  background: var(--card-bg);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
}
.auth-card-header {
  background: var(--primary);
  color: #fff;
  padding: 2rem;
  text-align: center;
}
.auth-card-header h1 { font-size: 1.5rem; margin-bottom: .25rem; }
.auth-card-header p  { opacity: .8; font-size: .9rem; }
.auth-card-body { padding: 2rem; }
.auth-links { text-align: center; margin-top: 1.5rem; font-size: .875rem; color: var(--muted); }
.auth-links a { color: var(--primary); font-weight: 600; }

/* ── CAPTCHA ───────────────────────────────────────────────────── */
.captcha-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1rem;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.captcha-question { font-size: 1.1rem; font-weight: 700; color: var(--text); flex: 1; }
.captcha-input { width: 90px; text-align: center; font-size: 1.1rem; font-weight: 700; }

/* ── Artikel-Detail & Kalender ─────────────────────────────────── */
.item-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.item-detail-img {
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, #e0f2fe, #bfdbfe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  min-height: 240px;
}
.item-detail-img img { width: 100%; height: 100%; object-fit: cover; }
.item-detail-title { font-size: 1.75rem; font-weight: 700; margin-bottom: .5rem; }
.item-detail-category { color: var(--muted); margin-bottom: 1rem; }
.item-detail-desc { color: var(--text); margin-bottom: 1.5rem; line-height: 1.7; }

/* Buchungskalender */
.booking-calendar { margin-bottom: 1.5rem; }
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
}
.calendar-month { font-weight: 700; font-size: 1rem; }
.calendar-nav { background: none; border: 1.5px solid var(--border); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font-size: .9rem; display: flex; align-items: center; justify-content: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.calendar-day-name { text-align: center; font-size: .7rem; font-weight: 700; color: var(--muted); padding: .3rem 0; }
.cal-day {
  text-align: center;
  padding: .35rem .1rem;
  border-radius: 6px;
  font-size: .8rem;
  cursor: default;
}
.cal-day.empty { }
.cal-day.past      { color: #cbd5e1; }
.cal-day.booked    { background: #fee2e2; color: #991b1b; font-weight: 600; }
.cal-day.today     { background: var(--primary); color: #fff; font-weight: 700; }
.cal-day.available { cursor: pointer; }
.cal-day.available:hover { background: #dbeafe; color: var(--primary); font-weight: 600; }
.cal-day.selected  { background: var(--secondary); color: #fff; font-weight: 700; }

/* ── Buchungs-Verlauf ──────────────────────────────────────────── */
.history-list { list-style: none; }
.history-item {
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.history-item:last-child { border-bottom: none; }
.history-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: .1rem; }

/* ── Tabellen ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table.data-table { width: 100%; border-collapse: collapse; background: var(--card-bg); font-size: .9rem; }
.data-table thead { background: var(--header-bg); color: #fff; }
.data-table th { padding: .75rem 1rem; text-align: left; font-weight: 600; white-space: nowrap; }
.data-table td { padding: .7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Status-Badges */
.status-pending   { background: #fef3c7; color: #92400e; padding: .2rem .6rem; border-radius: 100px; font-size: .78rem; font-weight: 600; }
.status-confirmed { background: var(--confirmed-bg, #fed7aa); color: var(--confirmed-color, #9a3412); padding: .2rem .6rem; border-radius: 100px; font-size: .78rem; font-weight: 600; }
.status-reserved  { background: #dbeafe; color: #1e40af; padding: .2rem .6rem; border-radius: 100px; font-size: .78rem; font-weight: 600; }
.status-returned  { background: #e2e8f0; color: #475569; padding: .2rem .6rem; border-radius: 100px; font-size: .78rem; font-weight: 600; }
.status-cancelled { background: #fee2e2; color: #991b1b; padding: .2rem .6rem; border-radius: 100px; font-size: .78rem; font-weight: 600; }

/* ── Admin ─────────────────────────────────────────────────────── */
.admin-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; align-items: start; }

.admin-sidebar {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
}

/* Toggle-Button: nur auf Desktop versteckt */
.admin-sidebar-toggle { display: none; }

/* Nav-Inhalt: auf Desktop immer sichtbar */
.admin-sidebar-nav { display: block; }

.admin-sidebar-heading {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  padding: .5rem .5rem .25rem;
}
.admin-sidebar-sep {
  border-top: 1px solid var(--border);
  margin: .75rem 0;
}
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .75rem;
  border-radius: calc(var(--radius) - 4px);
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  margin-bottom: .15rem;
}
.admin-nav-link:hover, .admin-nav-link.active { background: var(--primary); color: #fff; text-decoration: none; }
.admin-nav-link .nav-count {
  margin-left: auto;
  background: #ef4444 !important;
  color: #fff !important;
  font-size: .72rem;
  font-weight: 700;
  min-width: 1.35rem;
  height: 1.35rem;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 .35rem;
  line-height: 1;
  flex-shrink: 0;
}
.admin-nav-link:hover .nav-count, .admin-nav-link.active .nav-count {
  background: rgba(255,255,255,.25) !important;
  color: #fff !important;
}
.admin-nav-logout { color: var(--danger) !important; }
.admin-nav-logout:hover { background: rgba(239,68,68,.1); color: var(--danger) !important; }

.admin-content { min-width: 0; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon { font-size: 2rem; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .8rem; color: var(--muted); }
.stat-card--link { text-decoration: none; color: inherit; cursor: pointer; transition: box-shadow var(--transition), transform var(--transition); }
.stat-card--link:hover { box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; color: inherit; }

/* Farb-Picker */
.color-picker-wrap { display: flex; align-items: center; gap: .6rem; }
.color-picker-wrap input[type="color"] { width: 40px; height: 40px; border: none; border-radius: 8px; cursor: pointer; padding: 2px; }
.color-picker-wrap input[type="text"] { flex: 1; font-family: monospace; }

/* ── Profil ────────────────────────────────────────────────────── */
.profile-grid { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; align-items: start; }
.profile-sidebar {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  text-align: center;
}
.profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.profile-name  { font-size: 1.1rem; font-weight: 700; }
.profile-email { color: var(--muted); font-size: .875rem; }
.profile-badge { margin: .75rem auto 0; }

/* ── Pagination ────────────────────────────────────────────────── */
.pagination {
  margin-top: 1.75rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.page-btn:hover { background: #f1f5f9; text-decoration: none; color: var(--text); }
.page-btn-active { background: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important; }
.page-btn-active:hover { background: var(--primary) !important; color: #fff !important; }
.page-btn-disabled { opacity: .4; cursor: default; pointer-events: none; background: #f8fafc; }

/* ── Sonstige ──────────────────────────────────────────────────── */
.section-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: .5rem;
  margin: 1.5rem 0 1rem;
}
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}
.empty-state .icon { font-size: 3.5rem; margin-bottom: 1rem; }
.empty-state p { font-size: 1.05rem; }

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}
.tab-btn {
  padding: .6rem 1.1rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  white-space: nowrap;
}
.tab-btn.active, .tab-btn:hover { color: var(--primary); border-color: var(--primary); }

@media (max-width: 640px) {
  .tab-bar { gap: 0; border-bottom: none; background: var(--bg); border-radius: var(--radius); padding: .35rem; margin-bottom: 1rem; }
  .tab-btn {
    flex: 1 1 auto;
    text-align: center;
    font-size: .78rem;
    padding: .45rem .4rem;
    border-radius: calc(var(--radius) - 4px);
    border-bottom: none;
    margin-bottom: 0;
  }
  .tab-btn.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .item-detail  { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }

  /* Admin: Sidebar wird Accordion oben */
  .admin-wrap {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .admin-sidebar {
    position: static;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 0;
    box-shadow: var(--shadow-sm);
    margin-bottom: 0;
    overflow: hidden;
  }
  .admin-sidebar-toggle {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .75rem 1rem;
    background: var(--card-bg);
    border: none;
    border-bottom: 1px solid var(--border);
    font-size: .92rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    text-align: left;
  }
  .admin-sidebar-toggle:hover { background: #f8fafc; }
  .admin-sidebar-toggle .toggle-icon { font-size: 1rem; }
  .admin-sidebar-nav {
    display: none;           /* standardmäßig eingeklappt auf Mobile */
    padding: .5rem .75rem .75rem;
    background: var(--card-bg);
    border-bottom: 2px solid var(--border);
  }
  .admin-sidebar-nav.open { display: block; }
  .admin-sidebar-heading { display: none; }
  .admin-sidebar-sep { margin: .5rem 0; }
  .admin-nav-link { font-size: .88rem; padding: .55rem .75rem; }
  .admin-content {
    padding-top: 1.25rem;
  }
}

@media (max-width: 640px) {
  .mobile-menu-btn { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--header-bg);
    flex-direction: column;
    padding: 1rem;
    gap: .25rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    z-index: 99;
  }
  .site-nav.open { display: flex; }
  .nav-link { width: 100%; border-radius: 8px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-title { font-size: 1.2rem; }
  .page-header { flex-direction: column; align-items: flex-start; gap: .5rem; }
}

/* ── Buchungstabelle kompakt (Desktop) ────────────────────────── */
.booking-table th { padding: .55rem .65rem; font-size: .75rem; }
.booking-table td { padding: .55rem .65rem; font-size: .85rem; }
.booking-table .booking-user-name { font-size: .875rem; font-weight: 500; }

/* ── Admin-Verbesserungen ──────────────────────────────────────── */

/* Sidebar auf großen Screens schmaler */
@media (min-width: 901px) {
  .admin-wrap { grid-template-columns: 210px 1fr; }
}

/* Tabellen: kein horizontales Scrollen wenn vermeidbar */
.data-table th { font-size: .8rem; letter-spacing: .03em; white-space: nowrap; }
.data-table td { word-break: normal; }
.status-nowrap { white-space: nowrap; }

/* Stat-Cards kompakter */
.stat-card { padding: 1rem; gap: .75rem; }
.stat-icon { font-size: 1.6rem; }
.stat-value { font-size: 1.35rem; }

/* Admin-Nav aktiver Link */
.admin-nav-link.active { background: var(--primary); color: #fff; }

/* Settings-Tabs */
.tab-btn { border-radius: 8px 8px 0 0; }

/* Formular in Admin */
.admin-content .form-row { gap: .85rem; }

/* Scrollbare Tabellen */
.table-wrap { border-radius: var(--radius); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 480px; }

/* Kompakte Buttons in Tabellen */
.data-table .btn { padding: .25rem .55rem; font-size: .78rem; }

/* User-Card-Grid responsive */
@media (max-width: 700px) {
  .user-cards { grid-template-columns: 1fr; }
}

/* Kein horizontales Overflow – clip statt hidden damit position:sticky funktioniert */
html, body { overflow-x: clip; }
main { overflow-x: clip; }
.admin-wrap, .admin-content, .admin-sidebar { max-width: 100%; overflow-x: clip; }

/* ── Wartungs-Karten ───────────────────────────────────────────── */
.cache-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.cache-card-primary {
  border-color: var(--primary);
  background: #eff6ff;
}
.cache-card-icon { font-size: 2rem; flex-shrink: 0; }
.cache-card-body { flex: 1; min-width: 0; }
.cache-card-body strong { display: block; font-size: .95rem; margin-bottom: .2rem; }
.cache-card-body p { font-size: .83rem; color: var(--muted); margin-bottom: .4rem; line-height: 1.4; }
.cache-card-body code { font-size: .78rem; background: #f1f5f9; padding: 1px 5px; border-radius: 4px; }
.cache-card form { flex-shrink: 0; }

@media (max-width: 640px) {
  .cache-card { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .cache-card form { width: 100%; }
  .cache-card form .btn { width: 100%; }
}


/* ═══════════════════════════════════════════════════════════════
   ADMIN – MOBILE RESPONSIVE (Buchungen, Protokoll, Export)
   ═══════════════════════════════════════════════════════════════ */

/* ── Buchungs-Filter-Tabs ─────────────────────────────────────── */
.booking-filters {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.booking-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.booking-tab {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: var(--card-bg);
  white-space: nowrap;
}
.booking-tab:hover { background: #f1f5f9; text-decoration: none; }
.booking-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.booking-tab-count { font-size: .78rem; opacity: .75; }
.booking-tab-count--alert {
  background: #dc2626;
  color: #fff;
  border-radius: 100px;
  padding: .05rem .4rem;
  opacity: 1;
  font-weight: 700;
}

/* Überfällig-Tab */
.booking-tab--overdue {
  border-color: #fca5a5;
  color: #dc2626;
}
.booking-tab--overdue:hover { background: #fef2f2; }
.booking-tab--overdue.active { background: #dc2626; border-color: #dc2626; color: #fff; }

/* Archiv-Tab */
.booking-tab--archive {
  border-color: #cbd5e1;
  color: var(--muted);
}
.booking-tab--archive:hover { background: #f8fafc; }
.booking-tab--archive.active { background: #64748b; border-color: #64748b; color: #fff; }

/* Trennstrich zwischen Tabs */
.booking-tab-sep {
  display: inline-block;
  width: 1px;
  height: 1.5rem;
  background: var(--border);
  margin: 0 .25rem;
  align-self: center;
}

/* Überfällig-Zeile */
.booking-row--overdue { background: #fff5f5; }
.booking-row--overdue:hover { background: #fee2e2 !important; }
.booking-row--overdue td:first-child { border-left: 3px solid #dc2626; }

/* Archiv-Zeile */
.booking-row--archive { opacity: .75; }
.booking-row--archive:hover { opacity: 1 !important; }

/* Überfällig Status-Badge */
.status-overdue {
  background: #fee2e2;
  color: #dc2626;
  padding: .2rem .6rem;
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 600;
}
.booking-search-form {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.booking-search-form .form-control { flex: 1; min-width: 140px; }

/* ── Buchungs-Edit-Formular ───────────────────────────────────── */
.booking-edit-form {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.booking-edit-form .form-group { margin: 0; }

/* ── Admin-Tabellen allgemein ─────────────────────────────────── */
.status-nowrap { white-space: nowrap; }
.empty-cell { text-align: center; color: var(--muted); padding: 2rem; }

/* Auf Mobile: Tabellen als Karten darstellen */
@media (max-width: 700px) {

  /* Booking-Tabelle als Karten */
  .booking-table thead { display: none; }
  .booking-table,
  .booking-table tbody { display: block; width: 100%; }
  .booking-table .booking-row {
    display: block;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: .85rem;
    background: var(--card-bg);
    overflow: hidden;
  }
  .booking-table .booking-row td {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .5rem .85rem;
    border-bottom: 1px solid var(--border);
    font-size: .875rem;
    line-height: 1.4;
  }
  .booking-table .booking-row td:last-child { border-bottom: none; }
  .booking-table .booking-row td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: .78rem;
    color: var(--muted);
    min-width: 80px;
    flex-shrink: 0;
    padding-top: .1rem;
  }
  .booking-table .empty-cell {
    display: block;
    text-align: center;
    padding: 2rem;
    border: none;
  }
  .booking-table .empty-cell::before { display: none; }

  /* ── Gemeinsame Mixin-Stile für responsive Card-Tabellen ───── */
  .dash-table, .dash-table tbody,
  .items-mgmt-table, .items-mgmt-table tbody,
  .login-log-table, .login-log-table tbody { display: block; width: 100%; }

  .dash-table thead, .items-mgmt-table thead, .login-log-table thead { display: none; }

  .dash-table tr, .items-mgmt-table tr, .login-log-table tr {
    display: block;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: .85rem;
    background: var(--card-bg);
    overflow: hidden;
  }
  .dash-table td, .items-mgmt-table td, .login-log-table td {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .5rem .85rem;
    border-bottom: 1px solid var(--border);
    font-size: .875rem;
    line-height: 1.4;
  }
  .dash-table td:last-child,
  .items-mgmt-table td:last-child,
  .login-log-table td:last-child { border-bottom: none; }

  .dash-table td::before,
  .items-mgmt-table td::before,
  .login-log-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: .78rem;
    color: var(--muted);
    min-width: 90px;
    flex-shrink: 0;
    padding-top: .15rem;
  }
  /* Zellen ohne Label (Checkbox, leere Spalten) ausblenden */
  .items-mgmt-table td[data-label=""] { display: none; }
  /* User-Agent auf Mobile ausblenden (zu technisch/lang) */
  .login-log-table .col-ua { display: none; }

  /* Export / Backup – Karten stapeln */
  .export-grid { grid-template-columns: 1fr !important; }
  .booking-edit-form { flex-direction: column; }
  .booking-edit-form .form-group,
  .booking-edit-form .form-control { width: 100%; }
  .booking-edit-form .btn { width: 100%; }
}

@media (max-width: 480px) {
  .booking-tab { font-size: .78rem; padding: .35rem .65rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { gap: .5rem; }
}

/* ═══════════════════════════════════════════════════════════════
   STATISTIKEN (stats.php)
═══════════════════════════════════════════════════════════════ */
.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stats-kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
}
.kpi-icon  { font-size: 1.75rem; margin-bottom: .35rem; }
.kpi-value { font-size: 2rem; font-weight: 700; color: var(--primary); line-height: 1; }
.kpi-label { font-size: .8rem; color: var(--muted); margin-top: .35rem; }

.stats-chart-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.stats-chart-wrap {
  position: relative;
  height: 260px;
}
.stats-chart-wrap--doughnut { height: 220px; }

.stats-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stats-table-mobile { display: none; }

.stats-rank-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
}
.stats-rank-row:last-child { border-bottom: none; }
.rank-num  { width: 1.5rem; font-weight: 700; color: var(--muted); text-align: right; }
.rank-name { flex: 1; }
.rank-count { font-weight: 600; color: var(--primary); }

.stats-legend { display: flex; flex-direction: column; gap: .4rem; margin-top: 1rem; }
.stats-legend-item {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  padding: .25rem 0;
  border-bottom: 1px solid var(--border);
}
.stats-legend-item:last-child { border-bottom: none; }

@media (max-width: 900px) {
  .stats-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-two-col  { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .stats-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: .65rem; }
  .kpi-value { font-size: 1.5rem; }
  .stats-chart-wrap { height: 200px; }
  .stats-chart-wrap--doughnut { height: 180px; }
  /* Auf Mobile: Canvas ausblenden, Tabelle zeigen */
  #topItemsChart { display: none; }
  .stats-table-mobile { display: block; }
}

/* ═══════════════════════════════════════════════════════════════
   KALENDER (calendar.php)
═══════════════════════════════════════════════════════════════ */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: .5rem;
}
.cal-nav-title {
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  flex: 1;
}
.cal-card { overflow: hidden; margin-bottom: 1rem; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.cal-head {
  background: var(--bg);
  color: var(--muted);
  font-size: .75rem;
  font-weight: 600;
  text-align: center;
  padding: .5rem .25rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
}
.cal-cell {
  min-height: 90px;
  padding: .35rem .4rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: .8rem;
  background: var(--card-bg);
  position: relative;
}
.cal-cell--empty { background: var(--bg); }
.cal-cell--today { background: color-mix(in srgb, var(--primary) 8%, var(--card-bg)); }
.cal-cell--today .cal-day-num { color: var(--primary); font-weight: 700; }
.cal-cell--busy  { }

.cal-day-num { font-size: .8rem; color: var(--text); margin-bottom: .3rem; }

.cal-event {
  display: block;
  border-radius: 3px;
  padding: .15rem .35rem;
  font-size: .7rem;
  margin-bottom: .2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}
.cal-event--pending   { background: #fef3c7; color: #92400e; }
.cal-event--confirmed { background: var(--confirmed-bg, #fed7aa); color: var(--confirmed-color, #9a3412); }
.cal-event--returned  { background: #d1fae5; color: #065f46; }

.cal-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: .3rem;
}

.cal-more {
  font-size: .68rem;
  color: var(--muted);
  padding: .1rem .35rem;
}

.cal-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  font-size: .8rem;
}
.cal-legend-item { display: flex; align-items: center; }

.cal-list-section { margin-top: .5rem; }
.cal-list-title { font-size: 1rem; font-weight: 600; margin-bottom: .75rem; }
.cal-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .25rem;
  padding: .4rem 0;
  border-top: 1px solid var(--border);
  font-size: .85rem;
}
.cal-tag {
  display: inline-block;
  border-radius: 4px;
  padding: .15rem .5rem;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .cal-cell { min-height: 64px; padding: .25rem .2rem; }
  .cal-event { font-size: .65rem; padding: .1rem .25rem; }
  .cal-day-num { font-size: .75rem; }
}
@media (max-width: 480px) {
  .cal-grid { grid-template-columns: repeat(7, 1fr); }
  .cal-head { font-size: .65rem; padding: .3rem .1rem; }
  .cal-cell { min-height: 52px; padding: .2rem .1rem; }
  .cal-event { display: none; }
  .cal-cell--busy::after {
    content: '●';
    font-size: .55rem;
    color: var(--primary);
    position: absolute;
    bottom: 3px;
    right: 4px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   AKTIVITÄTSLOG (activity-log.php)
═══════════════════════════════════════════════════════════════ */
.log-filter-bar {
  margin-bottom: 1rem;
}
.log-search-form {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}
.log-search-form .form-control { max-width: 220px; }
.log-search-form select.form-control { max-width: 180px; }

.log-action-badge {
  display: inline-block;
  font-size: .8rem;
  white-space: nowrap;
}

.log-table { font-size: .875rem; }

@media (max-width: 700px) {
  .log-table thead { display: none; }
  .log-table,
  .log-table tbody { display: block; width: 100%; }
  .log-row {
    display: block;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: .75rem;
    background: var(--card-bg);
    overflow: hidden;
  }
  .log-row td {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .45rem .85rem;
    border-bottom: 1px solid var(--border);
    font-size: .84rem;
  }
  .log-row td:last-child { border-bottom: none; }
  .log-row td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: .75rem;
    color: var(--muted);
    min-width: 70px;
    flex-shrink: 0;
    padding-top: .1rem;
  }
  .log-search-form .form-control,
  .log-search-form select.form-control { max-width: 100%; width: 100%; }
}

/* Schadensmeldung im Buchungsformular */
.return-damage-fields { display: contents; }

/* ═══════════════════════════════════════════════════════════════
   GRUPPEN & BERECHTIGUNGEN (groups.php)
═══════════════════════════════════════════════════════════════ */

/* Sidebar: Gruppen-Badge */
.sidebar-user-badge {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0 .5rem .75rem;
  padding: .35rem .65rem;
  border-radius: 20px;
  background: color-mix(in srgb, var(--badge-color) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--badge-color) 40%, transparent);
  font-size: .78rem;
  font-weight: 600;
  color: var(--badge-color);
}
.sidebar-user-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--badge-color);
  flex-shrink: 0;
}

/* Gruppen-Grid */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.group-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  border-top: 3px solid var(--gcolor, #6b7280);
}
.group-card-header {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}
.group-card-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gcolor, #6b7280);
  flex-shrink: 0;
  margin-top: .3rem;
}
.group-card-title {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  flex: 1;
}
.group-card-meta {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  font-size: .8rem;
  color: var(--muted);
}
.group-card-actions {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: .25rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  align-items: center;
}

/* Berechtigungs-Chips */
.group-perm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .25rem;
}
.perm-chip {
  display: inline-block;
  font-size: .72rem;
  padding: .15rem .5rem;
  border-radius: 4px;
  border: 1px solid;
  font-weight: 500;
}
.perm-chip--on  { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.perm-chip--off { background: #f8fafc; color: #94a3b8; border-color: #e2e8f0; }

/* Berechtigungs-Badges */
.perm-badge {
  display: inline-block;
  font-size: .72rem;
  padding: .15rem .5rem;
  border-radius: 4px;
  font-weight: 600;
}
.perm-badge--admin  { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }
.perm-badge--system { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* Formular-Oberteil */
.groups-form-top {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: .5rem;
}

/* Berechtigungs-Matrix */
.perm-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .75rem;
}
.perm-category {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.perm-cat-label {
  background: var(--border);
  padding: .4rem .75rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.perm-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.perm-row:last-child { border-bottom: none; }
.perm-row:hover { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.perm-row input[type=checkbox] { display: none; }
.perm-check {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--card-bg);
  transition: all .15s;
}
.perm-row--on .perm-check {
  background: var(--primary);
  border-color: var(--primary);
}
.perm-row--on .perm-check::after {
  content: '✓';
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  height: 100%;
}
.perm-label-text { font-size: .85rem; line-height: 1.3; }
.perm-row--on .perm-label-text { color: var(--primary); font-weight: 500; }

@media (max-width: 700px) {
  .groups-grid { grid-template-columns: 1fr; }
  .perm-matrix { grid-template-columns: 1fr; }
  .groups-form-top { flex-direction: column; }
  .groups-form-top .form-group { min-width: unset !important; }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE – Anti-Zoom & Touch-Fixes
   iOS Safari zoomt automatisch rein wenn font-size < 16px.
   Diese Regeln stellen sicher dass ALLE Eingabefelder ≥16px haben.
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Alle nativen Input-Typen – Sicherheitsnetz zusätzlich zu .form-control */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  input[type="date"],
  input[type="time"],
  input[type="datetime-local"],
  input[type="month"],
  input[type="week"],
  input[type="file"],
  select,
  textarea {
    font-size: 16px !important;  /* verhindert iOS-Safari-Zoom */
  }

  /* Inline-Grids im Admin-Bereich auf Mobile einspaltig */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 2fr"],
  [style*="grid-template-columns: 1fr 2fr"],
  [style*="grid-template-columns:280px"],
  [style*="grid-template-columns: 280px"] {
    grid-template-columns: 1fr !important;
  }

  /* Email-Template-Splitview (Editor + Vorschau) */
  [style*="grid-template-columns:1fr 1fr"] > *,
  .tpl-split { min-width: 0; }

  /* Karten-Grids (Header-Editor, etc.) */
  .card + .card { margin-top: 1rem; }

  /* Tabellen: horizontal scrollbar statt Overflow */
  .data-table th, .data-table td { font-size: .8rem; padding: .5rem .6rem; }

  /* Buttons in Tabellen vollbreite auf sehr kleinen Screens */
  .data-table .btn { padding: .3rem .5rem; }

  /* Captcha-Box */
  .captcha-box { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .captcha-input { width: 100% !important; }

  /* Auth-Card volle Breite ohne seitliche Margins */
  .auth-wrap { padding: 1rem !important; }
  .auth-card { margin: 0; }

  /* Color-Picker nebeneinander bleibt – kein Umbruch nötig */

  /* Stat-Grid: 2 Spalten auf Mobile */
  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* Größere Touch-Targets für Checkboxen und Radios */
  input[type="checkbox"], input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;
  }
}

/* ── Wartungsmodus-Banner (Admin-Bereich, volle Seitenbreite) ──────────── */
.maintenance-admin-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(90deg, #d97706 0%, #f59e0b 60%, #fbbf24 100%);
  color: #1c1917;
  padding: .65rem 1.5rem;
  font-size: .875rem;
  box-shadow: 0 3px 14px rgba(217,119,6,.35);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 990;
}
.maintenance-banner-left {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}
.maintenance-banner-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  animation: maintenance-pulse 2.4s ease-in-out infinite;
}
@keyframes maintenance-pulse {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25%       { transform: rotate(-12deg) scale(1.1); }
  75%       { transform: rotate(10deg) scale(1.05); }
}
.maintenance-banner-text {
  display: flex;
  flex-direction: column;
  gap: .05rem;
  line-height: 1.35;
}
.maintenance-banner-text strong {
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .01em;
}
.maintenance-banner-text span {
  font-size: .78rem;
  opacity: .75;
}
.maintenance-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
  background: rgba(0,0,0,.18);
  color: #1c1917;
  padding: .38rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: background .15s, transform .1s;
  border: 1.5px solid rgba(0,0,0,.12);
}
.maintenance-banner-btn:hover {
  background: rgba(0,0,0,.28);
  text-decoration: none;
  transform: translateY(-1px);
}
.maintenance-banner-btn svg {
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .maintenance-admin-banner {
    padding: .6rem 1rem;
    gap: .6rem;
  }
  .maintenance-banner-text span { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   FRONTEND DESIGN UPGRADE – Professional Edition
   ═══════════════════════════════════════════════════════════════ */

/* ── Header verfeinert ───────────────────────────────────────── */
.site-header {
  background: linear-gradient(135deg, var(--header-bg, #1e293b) 0%, var(--header-bg-to, #1e3a6e) 100%);
  border-bottom: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 2px 20px rgba(0,0,0,.35);
  height: var(--header-height, 66px);
}
.header-inner { height: var(--header-height, 66px); }

.logo-name { font-size: var(--header-logo-size, 1.15rem); font-weight: var(--header-logo-weight, 800); letter-spacing: -.02em; }
.logo-tagline { font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; opacity: .55; }

.nav-link {
  font-size: .875rem;
  font-weight: 500;
  padding: .45rem .9rem;
  border-radius: 8px;
  letter-spacing: .01em;
  transition: background .18s, color .18s;
}
.nav-link:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
  text-decoration: none;
}
.nav-register {
  background: linear-gradient(135deg, var(--nav-register-bg, #2563eb), color-mix(in srgb, var(--nav-register-bg, #2563eb) 80%, #000)) !important;
  color: var(--nav-register-color, #fff) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.nav-register:hover {
  background: color-mix(in srgb, var(--nav-register-bg, #2563eb) 80%, #000) !important;
}
.nav-admin {
  background: var(--nav-admin-bg, #f59e0b) !important;
  color: var(--nav-admin-color, #1e293b) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.nav-admin:hover {
  background: var(--nav-admin-hover, #d97706) !important;
  color: var(--nav-admin-color, #1e293b) !important;
}

/* ── Hero-Banner ─────────────────────────────────────────────── */
.catalog-hero {
  background: linear-gradient(135deg, var(--hero-bg-from, #0f172a) 0%, var(--header-bg, #1e293b) 50%, var(--hero-bg-to, #1e3a6e) 100%);
  padding: 3.5rem 1.25rem 3rem;
  margin: -2rem calc(-1 * ((100vw - 100%) / 2)) 2.5rem;
  position: relative;
  overflow: hidden;
}
.catalog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 100% at 80% 50%, rgba(37,99,235,.18) 0%, transparent 70%),
              radial-gradient(ellipse 40% 80% at 10% 80%, rgba(16,185,129,.12) 0%, transparent 60%);
  pointer-events: none;
}
.catalog-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  position: relative;
  z-index: 1;
}
.catalog-hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--hero-text, #ffffff);
  line-height: 1.15;
  letter-spacing: -.03em;
  margin-bottom: .65rem;
}
.catalog-hero-sub {
  font-size: 1.05rem;
  color: var(--hero-sub, rgba(255,255,255,0.65));
  line-height: 1.6;
  max-width: 420px;
}
.catalog-search-form { display: flex; flex-direction: column; gap: .75rem; }
.catalog-search-wrap {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.95);
  border-radius: 14px;
  padding: .3rem .3rem .3rem 1.1rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.15);
  gap: .5rem;
}
.catalog-search-icon { font-size: 1.1rem; flex-shrink: 0; opacity: .5; }
.catalog-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-family: var(--font);
  color: var(--text);
  outline: none;
  min-width: 0;
  padding: .4rem 0;
}
.catalog-search-input::placeholder { color: #9ca3af; }
.catalog-search-btn {
  background: linear-gradient(135deg, var(--hero-btn, #2563eb), color-mix(in srgb, var(--hero-btn, #2563eb) 80%, #000));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .65rem 1.4rem;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 2px 10px rgba(37,99,235,.4);
  font-family: var(--font);
}
.catalog-search-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(37,99,235,.5); }
.catalog-reset-link {
  font-size: .82rem;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  text-align: right;
  transition: color .15s;
}
.catalog-reset-link:hover { color: rgba(255,255,255,.85); text-decoration: none; }

@media (max-width: 840px) {
  .catalog-hero { padding: 2.5rem 1.25rem 2rem; }
  .catalog-hero-inner { grid-template-columns: 1fr; gap: 1.75rem; }
  .catalog-hero-title { font-size: 1.9rem; }
  .catalog-hero-sub { max-width: 100%; }
}
@media (max-width: 480px) {
  .catalog-hero { padding: 2rem 1rem 1.75rem; margin-bottom: 1.75rem; }
  .catalog-hero-title { font-size: 1.6rem; }
  .catalog-hero-sub { font-size: .93rem; }
}

/* ── Filter-Bar verfeinert ───────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1.5px solid var(--border);
}
.filter-btn {
  padding: .45rem 1.1rem;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  color: #64748b;
  transition: all .18s;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  letter-spacing: .01em;
}
.filter-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  box-shadow: 0 2px 8px rgba(37,99,235,.1);
  text-decoration: none;
  transform: translateY(-1px);
}
.filter-btn.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border-color: #2563eb;
  box-shadow: 0 4px 14px rgba(37,99,235,.3);
  transform: translateY(-1px);
}

/* ── Items Grid ──────────────────────────────────────────────── */
.items-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
@media (max-width: 1024px) { .items-grid { grid-template-columns: repeat(3, 1fr); gap: var(--card-gap-mobile, 2rem); } }
@media (max-width: 768px)  { .items-grid { grid-template-columns: repeat(2, 1fr); gap: var(--card-gap-mobile, 2rem); } }
@media (max-width: 480px)  { .items-grid { grid-template-columns: 1fr; gap: var(--card-gap-mobile, 2rem); } }

@media (max-width: 560px) {
  .item-card-img,
  .item-card-img-placeholder { height: 220px; }
}

/* ── Item-Card vollständig überarbeitet ──────────────────────── */
.item-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.05);
  border: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .22s ease;
  text-decoration: none !important;
  color: inherit !important;
}
.item-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,.12), 0 8px 16px rgba(37,99,235,.08);
  text-decoration: none !important;
}

/* Bild-Container mit Overlay */
.item-card-media {
  position: relative;
  overflow: hidden;
  margin-bottom: 4px;
}
.item-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.item-card:hover .item-card-img { transform: scale(1.06); }

.item-card-img-placeholder {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 50%, #d1fae5 100%);
  transition: transform .35s ease;
}
.item-card:hover .item-card-img-placeholder { transform: scale(1.04); }

/* Hover-Overlay */
.item-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(37,99,235,.85), rgba(16,185,129,.75));
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .22s ease;
}
.item-card:hover .item-card-overlay { opacity: 1; }
.item-card-overlay span {
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .02em;
  transform: translateY(8px);
  transition: transform .22s ease;
}
.item-card:hover .item-card-overlay span { transform: translateY(0); }

/* Status-Bar – weißer Streifen zwischen Bild und Card-Body, immer gleich hoch */
.item-card-status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .35rem .75rem;
  min-height: 3rem;       /* fixe Höhe: grün (1 Zeile) = rot (2 Zeilen) */
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .01em;
  text-align: center;
  line-height: 1.3;
}
.item-card-status-bar--free {
  background: #ecfdf5;
  color: #065f46;
  border-top: 1.5px solid rgba(16,185,129,.25);
  border-bottom: 1.5px solid rgba(16,185,129,.25);
}
.item-card-status-bar--booked {
  background: #fff7f7;
  color: #991b1b;
  border-top: 1.5px solid rgba(239,68,68,.2);
  border-bottom: 1.5px solid rgba(239,68,68,.2);
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.item-card-status-bar--free .status-dot {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16,185,129,.3);
  animation: dot-pulse 2s ease infinite;
}
.item-card-status-bar--booked .status-dot { background: #ef4444; }
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,.4); }
  50%       { box-shadow: 0 0 0 4px rgba(16,185,129,0); }
}

/* Card Body */
.item-card-body {
  padding: 1.1rem 1.25rem .75rem;
  flex: 1;
}
.item-card-category {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--primary);
  margin-bottom: .35rem;
  opacity: .8;
}
.item-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: .4rem;
  letter-spacing: -.01em;
}
.item-card-desc {
  font-size: .82rem;
  color: #94a3b8;
  line-height: 1.5;
}

/* Card Footer */
.item-card-footer {
  padding: .85rem 1.25rem;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.item-card-cta {
  font-size: .82rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: .01em;
  transition: color .15s, gap .15s;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.item-card:hover .item-card-cta { color: #1d4ed8; gap: .4rem; }

/* ── Seiteninfo & Pagination ──────────────────────────────────── */
.catalog-page-info {
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  margin-top: 2rem;
  margin-bottom: .75rem;
}

/* ── Empty State aufgewertet ─────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 5rem 1rem;
  color: var(--muted);
  background: #fff;
  border-radius: 16px;
  border: 1.5px dashed var(--border);
}
.empty-state .icon { font-size: 4rem; margin-bottom: 1.25rem; opacity: .7; }
.empty-state p { font-size: 1.1rem; color: #64748b; }

/* ── Footer verfeinert ───────────────────────────────────────── */
.site-footer {
  background: linear-gradient(135deg, var(--footer-bg, #0f172a), color-mix(in srgb, var(--footer-bg, #1e293b) 85%, #000));
  color: var(--footer-text, #94a3b8);
  padding: 1.5rem 0;
  font-size: .85rem;
  border-top: 1px solid rgba(255,255,255,.05);
}
.site-footer a { color: var(--footer-link, #cbd5e1); }
.site-footer a:hover { color: #fff; }

/* ═══════════════════════════════════════
   ITEM DETAIL PAGE – Professional Design
   ═══════════════════════════════════════ */

.item-back-link {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .875rem; color: var(--muted); font-weight: 500;
  padding: .4rem .9rem; border-radius: 8px;
  border: 1.5px solid var(--border); background: #fff;
  transition: all .18s; text-decoration: none;
}
.item-back-link:hover { color: var(--primary); border-color: var(--primary); background: #eff6ff; text-decoration: none; }

.item-hero-header { margin-bottom: 1.5rem; }
.item-hero-meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.item-hero-cat { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); background: #eff6ff; padding: .25rem .75rem; border-radius: 100px; }
.item-hero-title { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); line-height: 1.2; }

/* ── Item Grid: 2-Spalten Layout ─────────────────────────────── */
.item-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(360px, 1fr);
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}
.item-gallery { min-width: 0; }
.item-sidebar { min-width: 0; display: flex; flex-direction: column; gap: 1rem; }

/* Gallery */
.item-gallery-main {
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%);
  position: relative;
  cursor: zoom-in;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  width: 100%;
  height: 220px;
}
.item-gallery-main img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .35s ease;
}
.item-gallery-main:hover img { transform: scale(1.04); }
.item-gallery-main-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 7rem;
}
.item-gallery-zoom-hint {
  position: absolute; bottom: .85rem; right: .85rem;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: .72rem; font-weight: 700; letter-spacing: .03em;
  padding: .3rem .75rem; border-radius: 100px;
  backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.item-gallery-main:hover .item-gallery-zoom-hint { opacity: 1; }

.item-gallery-thumbs { display: flex; gap: .6rem; margin-top: .75rem; flex-wrap: wrap; }
.item-thumb {
  width: 80px; height: 80px; border-radius: 10px; overflow: hidden;
  cursor: pointer; border: 2.5px solid transparent;
  transition: border-color .18s, transform .18s, box-shadow .18s;
  flex-shrink: 0; box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.item-thumb:hover { transform: scale(1.06); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.item-thumb.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.2); }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Sidebar */
.item-sidebar .card {
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,.07);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* Status-Block */
.item-status-block {
  display: flex; align-items: center; gap: .85rem;
  padding: 1rem 1.25rem; border-radius: 12px;
}
.item-status-block--available { background: linear-gradient(135deg,#ecfdf5,#d1fae5); border: 1.5px solid #6ee7b7; }
.item-status-block--booked    { background: linear-gradient(135deg,#fef2f2,#fee2e2); border: 1.5px solid #fca5a5; }
.item-status-block--inactive  { background: #f8fafc; border: 1.5px solid var(--border); }
.item-status-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.item-status-dot--available {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16,185,129,.25);
  animation: dot-pulse 2s ease infinite;
}
.item-status-dot--booked   { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.2); }
.item-status-dot--inactive { background: #94a3b8; }
.item-status-label { font-weight: 700; font-size: .95rem; line-height: 1.3; }

/* Buchungs-Card – nur sticky wenn keine Rückgabe-Card daneben sichtbar ist */
.item-book-card { position: sticky; top: 82px; }
.item-book-card .card-header {
  background: linear-gradient(135deg, var(--primary,#2563eb) 0%, #1d4ed8 100%);
  color: #fff; padding: 1rem 1.25rem;
  border-bottom: none;
}
.item-book-card .card-title { color: #fff; font-size: 1rem; margin: 0; }

/* Leihhistorie */
.item-history-card { border-radius: 16px; overflow: hidden; margin-top: 1.5rem; }
.item-history-card .card-header {
  background: #f8fafc;
  border-bottom: 1.5px solid var(--border);
  padding: 1rem 1.5rem;
}
.item-history-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.item-history-item:last-child { border-bottom: none; }
.item-history-item:hover { background: #f8fafc; }
.item-history-icon {
  font-size: 1.4rem; flex-shrink: 0; margin-top: .1rem;
  width: 2.25rem; height: 2.25rem;
  display: flex; align-items: center; justify-content: center;
  background: #f1f5f9; border-radius: 50%;
}
.item-history-body { flex: 1; min-width: 0; }
.item-history-name {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  font-weight: 700; font-size: .95rem; margin-bottom: .25rem;
}
.item-history-dates { font-size: .83rem; color: var(--muted); line-height: 1.5; }
.item-history-note {
  font-size: .8rem; color: var(--muted);
  margin-top: .25rem; font-style: italic;
  background: #f8fafc; padding: .25rem .6rem;
  border-radius: 6px; border-left: 3px solid var(--border);
  display: inline-block; margin-top: .35rem;
}

/* Lightbox */
.item-lightbox {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.item-lightbox-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.93);
  backdrop-filter: blur(8px);
}
.item-lightbox-content {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: .75rem;
  padding: 0 .5rem;
}
.item-lightbox-img {
  max-width: min(80vw, 1000px);
  max-height: 85vh;
  width: auto; height: auto;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  object-fit: contain;
}
.item-lightbox-close {
  position: absolute; top: -3rem; right: 0;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.2);
  color: #fff; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.item-lightbox-close:hover { background: rgba(255,255,255,.32); }
.item-lightbox-prev, .item-lightbox-next {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2);
  color: #fff; width: 3rem; height: 3rem; border-radius: 50%;
  font-size: 1.6rem; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; line-height: 1;
}
.item-lightbox-prev:hover, .item-lightbox-next:hover { background: rgba(255,255,255,.3); }
.item-lightbox-prev:disabled, .item-lightbox-next:disabled { opacity: .25; cursor: default; }
.item-lightbox-counter {
  position: absolute; bottom: -2.25rem; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.6); font-size: .8rem; white-space: nowrap;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 960px) {
  .item-main-grid { grid-template-columns: 1fr; }
  .item-book-card { position: static; }
  .item-hero-title { font-size: 1.65rem; }
  .item-sidebar { order: -1; }  /* Sidebar auf Mobile VOR Gallery */
}
@media (max-width: 560px) {
  .item-hero-title { font-size: 1.35rem; }
  .item-gallery-main { height: 240px; }
  .item-thumb { width: 64px; height: 64px; }
  .item-history-item { padding: .85rem 1rem; }

  /* Lightbox auf Mobile: Bild zentrieren, Buttons absolut darüberlegen */
  .item-lightbox-content {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 96vw;
    padding: 0;
    position: relative;
  }
  .item-lightbox-img { max-width: 88vw; max-height: 72vh; width: auto; }
  .item-lightbox-prev, .item-lightbox-next {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    width: 2.25rem; height: 2.25rem; font-size: 1.2rem;
    z-index: 2;
  }
  .item-lightbox-prev { left: .5rem; }
  .item-lightbox-next { right: .5rem; }
}
