/* ── rettACADEMY – Grundlayout (angelehnt an rettManager: fixer Header 50px,
   Sidebar 250px / eingeklappt 70px, Inhalt rechts daneben) ─────────────── */
:root {
  --ac-header-bg: #454b50;
  --ac-sidebar-bg: #495057;
  --ac-sidebar-hover: #3e444a;
  --ac-sidebar-active: #2f3438;
  --ac-primary: #0f3b40;
  --bs-primary: #0f3b40;
  --bs-primary-rgb: 15, 59, 64;
  --bs-link-color: #0f3b40;
  --bs-link-color-rgb: 15, 59, 64;
}

body { background: #f5f5f5; }
body.ac-app { padding-top: 50px; }

.btn-primary { --bs-btn-bg: var(--ac-primary); --bs-btn-border-color: var(--ac-primary); --bs-btn-hover-bg: #0a2b2f; --bs-btn-hover-border-color: #0a2b2f;
  --bs-btn-active-bg: #0a2b2f; --bs-btn-disabled-bg: var(--ac-primary); --bs-btn-disabled-border-color: var(--ac-primary); }
.btn-outline-primary { --bs-btn-color: var(--ac-primary); --bs-btn-border-color: var(--ac-primary); --bs-btn-hover-bg: var(--ac-primary);
  --bs-btn-hover-border-color: var(--ac-primary); --bs-btn-active-bg: var(--ac-primary); }
.nav-tabs .nav-link { color: #495057; }
.nav-tabs .nav-link.active { color: var(--ac-primary); font-weight: 600; }
.form-check-input:checked { background-color: var(--ac-primary); border-color: var(--ac-primary); }

/* Header */
.ac-header {
  position: fixed; top: 0; left: 0; right: 0; height: 50px; z-index: 1100;
  background: var(--ac-header-bg); color: #fff;
  display: flex; align-items: center; justify-content: space-between; padding: 0 16px;
}
.ac-header .ac-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ac-header .ac-brand img { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; background: #fff; }
.ac-header .ac-brand h4 { margin: 0; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-header .ac-brand small { opacity: .7; font-size: .8rem; }
.ac-header .ac-user { display: flex; align-items: center; gap: 12px; }
.modal { z-index: 1150; }
.modal-backdrop { z-index: 1140; }
.modal-dialog-centered { margin-top: 20px; }
.toast-container { z-index: 1200; }

/* Sidebar */
.ac-sidebar {
  position: fixed; top: 50px; bottom: 0; left: 0; width: 250px; z-index: 1000;
  background: var(--ac-sidebar-bg); color: #fff; display: flex; flex-direction: column; transition: width .3s;
}
.ac-sidebar .nav-items { flex: 1; overflow-y: auto; }
.ac-sidebar .nav-link {
  color: #fff; display: flex; align-items: center; padding: 10px 20px; min-height: 44px; text-decoration: none; cursor: pointer; transition: background-color .2s;
}
.ac-sidebar .nav-link i { font-size: 1.2rem; margin-right: 10px; }
.ac-sidebar .nav-link:hover { background: var(--ac-sidebar-hover); }
.ac-sidebar .nav-link.active { background: var(--ac-sidebar-active); box-shadow: inset 4px 0 0 rgba(255,255,255,.85); }
.ac-sidebar .nav-link .badge { margin-left: auto; }
.ac-sidebar .jump-link { border-top: 1px solid rgba(255,255,255,.15); }
.ac-sidebar .toggle-btn { padding: 10px 20px; }
.ac-sidebar.collapsed { width: 70px; }
.ac-sidebar.collapsed .nav-link span, .ac-sidebar.collapsed .nav-link .badge { display: none; }
.ac-content { margin-left: 250px; padding: 14px 20px 30px 18px; transition: margin-left .3s; min-height: calc(100vh - 50px); }
.ac-sidebar.collapsed ~ .ac-content { margin-left: 70px; }
@media (max-width: 768px) {
  .ac-sidebar { width: 70px; }
  .ac-sidebar .nav-link span, .ac-sidebar .nav-link .badge { display: none; }
  .ac-content { margin-left: 70px; padding: 12px; }
  .ac-header .ac-user .ac-user-name { display: none; }
}

/* Seitenelemente */
.ac-page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.ac-page-head h2 { margin: 0; font-size: 1.45rem; font-weight: 600; }
.ac-card { background: #fff; border: 1px solid #e3e5e8; border-radius: 10px; padding: 16px; }
.ac-kpi { background: #fff; border: 1px solid #e3e5e8; border-radius: 10px; padding: 14px 16px; height: 100%; }
.ac-kpi .v { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.ac-kpi .l { color: #6c757d; font-size: .85rem; }
.ac-muted { color: #6c757d; }
.ac-clickable { cursor: pointer; }
.table-ac { background: #fff; }
.table-ac th { white-space: nowrap; font-size: .85rem; color: #495057; background: #f8f9fa; }
.table-ac th.sortable { cursor: pointer; user-select: none; }
.table-ac th.sortable::after { content: " \2195"; opacity: .35; font-size: .8em; }
.table-ac th.sort-asc::after { content: " \2191"; opacity: .9; }
.table-ac th.sort-desc::after { content: " \2193"; opacity: .9; }
.table-ac td { vertical-align: middle; }
.table-ac tr.ac-clickable:hover td { background: #f1f6f6; }
.ac-empty { text-align: center; color: #6c757d; padding: 30px 10px; }

/* Status-Badges */
.st { display: inline-block; padding: .2em .6em; border-radius: 20px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.st-draft { background: #e9ecef; color: #495057; }
.st-planned { background: #cfe2ff; color: #084298; }
.st-open { background: #d1e7dd; color: #0f5132; }
.st-closed { background: #fff3cd; color: #664d03; }
.st-done { background: #d3d3e9; color: #2e2e6b; }
.st-cancelled { background: #f8d7da; color: #842029; }
.st-published { background: #d1e7dd; color: #0f5132; }
.st-reserved { background: #e2e3f3; color: #3d3f7a; }
.st-confirmed { background: #d1e7dd; color: #0f5132; }
.st-waitlist { background: #fff3cd; color: #664d03; }
.st-attended { background: #cfe2ff; color: #084298; }
.st-absent { background: #f8d7da; color: #842029; }
.st-pending { background: #fff3cd; color: #664d03; }
.st-active { background: #d1e7dd; color: #0f5132; }
.st-locked { background: #f8d7da; color: #842029; }

.ac-status-flow { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: .8rem; }
.ac-status-flow .step { padding: 3px 10px; border-radius: 20px; background: #eef0f2; color: #6c757d; }
.ac-status-flow .step.done { background: #d1e7dd; color: #0f5132; }
.ac-status-flow .step.current { background: var(--ac-primary); color: #fff; font-weight: 600; }
.ac-status-flow .sep { color: #adb5bd; }

.ac-seatbar { height: 8px; border-radius: 4px; background: #e9ecef; overflow: hidden; display: flex; min-width: 80px; }
.ac-seatbar > div { height: 100%; }
.ac-seatbar .taken { background: #198754; }
.ac-seatbar .blocked { background: #adb5bd; }

/* Kalender */
.ac-cal { display: grid; grid-template-columns: repeat(7, 1fr); border-left: 1px solid #dee2e6; border-top: 1px solid #dee2e6; background: #fff; }
.ac-cal .dow { padding: 6px; font-size: .8rem; font-weight: 600; background: #f8f9fa; border-right: 1px solid #dee2e6; border-bottom: 1px solid #dee2e6; text-align: center; }
.ac-cal .day { min-height: 110px; padding: 4px; border-right: 1px solid #dee2e6; border-bottom: 1px solid #dee2e6; overflow: hidden; }
.ac-cal .day.other { background: #fafafa; color: #adb5bd; }
.ac-cal .day.today .num { background: var(--ac-primary); color: #fff; border-radius: 50%; }
.ac-cal .num { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; font-size: .8rem; }
.ac-cal .ev { display: block; font-size: .74rem; padding: 2px 5px; margin-top: 2px; border-radius: 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 768px) { .ac-cal .day { min-height: 70px; } .ac-cal .ev { font-size: .65rem; } }

/* Formulare / Editoren */
.ac-repeat-row { display: flex; gap: 6px; align-items: start; margin-bottom: 6px; flex-wrap: wrap; }
.ac-chip { display: inline-flex; align-items: center; gap: 6px; background: #eef2f3; border-radius: 16px; padding: 3px 6px 3px 10px; margin: 2px; font-size: .85rem; }
.ac-chip button { border: 0; background: transparent; color: #6c757d; padding: 0 4px; line-height: 1; }
.ac-section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: #6c757d; font-weight: 600; margin: 18px 0 8px; }
.ac-hint { font-size: .85rem; color: #6c757d; }
.ac-copy { cursor: pointer; }
.ac-wizard-steps { display: flex; gap: 6px; margin-bottom: 14px; }
.ac-wizard-steps .s { flex: 1; text-align: center; padding: 6px; border-radius: 6px; background: #eef0f2; font-size: .85rem; color: #6c757d; }
.ac-wizard-steps .s.active { background: var(--ac-primary); color: #fff; font-weight: 600; }

/* Ladeanzeige */
.ac-loading { position: fixed; top: 50px; left: 0; right: 0; height: 3px; z-index: 1300; background: linear-gradient(90deg, transparent, var(--ac-primary), transparent);
  background-size: 50% 100%; animation: ac-load 1s linear infinite; display: none; }
.ac-loading.on { display: block; }
@keyframes ac-load { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* Anmelde-/Fehlerseiten */
.ac-auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f3b40, #454b50); padding: 16px; }
.ac-auth-card { background: #fff; border-radius: 14px; padding: 28px; width: 100%; max-width: 420px; box-shadow: 0 18px 40px rgba(0,0,0,.25); text-align: center; }
.ac-auth-card form, .ac-auth-card .text-start { text-align: left; }
.ac-auth-logo { width: 64px; height: 64px; object-fit: contain; margin-bottom: 10px; }
.ac-auth-app { font-size: .95rem; color: #6c757d; margin-bottom: 18px; }
.ac-auth-app b { color: var(--ac-primary); }
