:root {
  --cat-verein:   #6e5e00;
  --cat-privat:   #3498db;
  --cat-schule:   #e67e22;
  --cat-sonst:    #9b59b6;
  --cal-bg:       #fff;
  --cal-border:   #e0e0e0;
  --cal-today:    #ffe082;
  --cal-hover:    #f1f8e9;
  --cal-shadow:   0 4px 24px rgba(60,60,60,0.08);
  --cal-radius:   7px;
  --cal-header:   #222;
  --cal-header-bg:#f5f5f5;
}

* {
  box-sizing: border-box;
}

.buskalender {
  margin-bottom:50px;
}

.buskalender body, .buskalender html {
  font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
  margin: 0;
  padding: 3%;
  background: transparent;
  color: #222;
  font-size: 1rem;
  min-width: 360px;
}
@media (max-width: 359px) {
  .buskalender body, .buskalender html {
    padding: 0 !important;
  }
}
.buskalender h1, .buskalender h2, .buskalender h3 {
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.buskalender form, .buskalender .card, .buskalender .table-container {
  background: #fff;
  border-radius: var(--cal-radius);
  padding: 1.5em 1.2em;
  margin: 1.5em auto;
  max-width: 820px;
}
.buskalender .table-container {
  max-width: 100%;
  overflow-x: auto;
}
.buskalender table.cal {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  max-width: 820px;
  background: var(--cal-bg);
  border-radius: var(--cal-radius);
  margin: 1.5em auto;
  overflow: hidden;
  cursor:default;
}

.buskalender table.cal,
.buskalender .table-container {
  height: 480px;
  min-height: 480px;
}

.buskalender .cal th, .buskalender .cal td {
  border: 1px solid var(--cal-border);
  text-align: center;
  padding: 1rem 0.2rem;
  min-width: 2.5em;
  font-size: 1.2em;
  background: #fff;
  transition: background 0.2s, color 0.2s;
  min-height: 1rem;
  text-shadow: 0 0 1px #000;
}
.buskalender .cal th {
  background: #fbe7a2;
  color: #413929;
  font-weight: 700;
  font-size: 1.13em;
  letter-spacing: 0.04em;
  border-bottom: 2px solid #e0c080;
  box-shadow: 0 2px 6px rgba(247, 200, 115, 0.08);
}
.buskalender .cal th.sat {
  filter: brightness(95%);
}
.buskalender .cal th.sun {
  filter: brightness(90%);
}
.buskalender .cal .empty {
  background: #f4f4f4;
}
.buskalender .cal .free {
  background: #fff;
  cursor:default;
  transition: background 0.2s;
}
.buskalender .cal .free:hover {
  background: var(--cal-hover);
  box-shadow: 0 2px 8px rgba(60,60,60,0.07);
  z-index: 2;
  position: relative;
}
.buskalender .cal .today {
  border: 2.5px solid #ff9800 !important;
  box-shadow: 0 0 0 2px #ffe0b2;
  position: relative;
  z-index: 2;
}
.buskalender .cal .booked {
  color: #fff;
  font-weight: 700;
  background: linear-gradient(90deg, var(--cat-verein) 0%, var(--cat-privat) 100%);
  box-shadow: 0 2px 8px rgba(60,60,60,0.10);
}
.buskalender .cal .requested {
  opacity: .7;
  background: var(--cat-schule);
  color: #fff;
}
.buskalender .cal .approved {
  background: var(--cat-verein);
  color: #fff;
}
.buskalender .cal .denied {
  background: #eee;
  color: #aaa;
  text-decoration: line-through;
}
.buskalender .cal td.day {
  padding: 0;
}

.buskalender input, select, textarea, button {
  font-size: 1em;
  padding: 0.6em;
  border-radius: 6px;
  border: 1px solid #444444;
  margin-top: 0.2em;
  width: 100%;
  box-sizing: border-box;
  background: #fafbfc;
  transition: border 0.2s;
  font-weight: bold;
}
.buskalender input:focus, select:focus, textarea:focus {
  border: 1.5px solid var(--cat-verein);
  outline: none;
}
.buskalender button {
  background: linear-gradient(90deg, var(--cat-verein) 0%, var(--cat-privat) 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 8px rgba(60,60,60,0.07);
  transition: background 0.2s, box-shadow 0.2s;
}
.buskalender button:hover {
  background: linear-gradient(90deg, var(--cat-privat) 0%, var(--cat-verein) 100%);
  box-shadow: 0 4px 16px rgba(60,60,60,0.13);
}

.buskalender .card {
  display: flex;
  flex-direction: column;
  gap: 0.7em;
  margin-bottom: 1em;
  border-left: 6px solid var(--cat-verein);
  box-shadow: var(--cal-shadow);
}

.buskalender .category-verein   { background: var(--cat-verein);   color: #fff; border-radius: 6px; padding: 0.2em 0.7em; }
.buskalender .category-privat   { background: var(--cat-privat);   color: #fff; border-radius: 6px; padding: 0.2em 0.7em; }
.buskalender .category-schule   { background: var(--cat-schule);   color: #fff; border-radius: 6px; padding: 0.2em 0.7em; }
.buskalender .category-sonst    { background: var(--cat-sonst);    color: #fff; border-radius: 6px; padding: 0.2em 0.7em; }

.buskalender .table-container {
  border-radius: var(--cal-radius);
  box-shadow: var(--cal-shadow);
  background: #fff;
  padding: 1em;
}
.buskalender table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1em;
  background: #fff;
  border-radius: var(--cal-radius);
  overflow: hidden;
}
.buskalender td, th {
  padding: 0.5em 0.7em;
  border-bottom: 1px solid #eee;
}

.buskalender .table-container table th, .buskalender .table-container table td {
  text-align: center;
  line-height: 22px;
}

@media (max-width: 900px) {
  table.cal {
    font-size: 0.95em;
    max-width: 99vw;
  }
  .buskalender .table-container, form, .buskalender .card {
    max-width: 99vw;
    padding: 0.7em;
  }
}

.buskalender .cal-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  max-width: 38px;
  max-height: 38px;
  border-radius: 8px;
  background: #fff;
  border: 1.7px solid #bbb;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  box-shadow: 0 1px 4px rgba(60,60,60,0.07);
  transition: border 0.18s, box-shadow 0.18s, background 0.18s;
  cursor: pointer;
}
.buskalender .cal-btn:hover, .buskalender .cal-btn:focus {
  border: 1.7px solid var(--cat-verein);
  background: #f1f8e9;
  box-shadow: 0 2px 8px rgba(60,60,60,0.13);
}
.buskalender .cal-btn svg {
  display: block;
  margin: auto;
}

.buskalender .footer-flex {
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: flex-start;
  gap: 2.5em;
  width: 100%;
  padding: 0 40px;
}
.buskalender .legend-box {
  display: inline-block;
  width: auto;
  min-width: 1.5em;
  height: 1.5em;
  border-radius: 4px;
  margin-right: 0.5em;
  vertical-align: middle;
}
.buskalender .legend-col {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  border: 1px solid #717162;
  border-width: 0 0 0 4px;
  padding: 2px 0 2px 6px;
}
.buskalender .legend-row-item {
  display: flex;
  align-items: center;
  font-size: 1.07em;
}
.buskalender .footer-links {
  display: flex;
  flex-direction: column;
  gap: 1.1em;
  align-items: flex-end;
}

/* Modal Styles */
.buskalender .modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.25);
  align-items: center;
  justify-content: center;
}
.buskalender .modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 700px;
  width: 95vw;
  margin: 2em auto;
  padding: 0;
  box-shadow: 0 8px 32px rgba(60,60,60,0.18);
  position: relative;
  overflow: hidden;
}
.buskalender .close-modal {
  position: absolute;
  top: 0.5em;
  right: 1em;
  font-size: 2em;
  color: #888;
  cursor: pointer;
  z-index: 10;
  font-weight: bold;
  background: none;
  border: none;
}
@media (max-width: 600px) {
  .buskalender .footer-legend {
    max-width: 99vw;
    padding: 0.7em 0.2em 0.5em 0.2em;
  }
  .buskalender .modal-content {
    max-width: 99vw;
    width: 99vw;
    margin: 0.5em auto;
  }
}

.buskalender .footer-btn {
  background: #f4f6fa;
  color: #222;
  border: 1.5px solid #bbb;
  border-radius: 8px;
  font-size: 1.08em;
  font-weight: 600;
  padding: 0.7em 1.7em;
  box-shadow: 0 1px 4px rgba(60,60,60,0.07);
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s, border 0.18s;
  display: flex;
  align-items: center;
  gap: 0.7em;
}
.buskalender .footer-btn:hover {
  background: #e0e7ef;
  border: 1.5px solid var(--cat-verein);
  color: #111;
  box-shadow: 0 2px 8px rgba(60,60,60,0.13);
}

#calendar-view, #list-view {
  min-height: 520px;
}
.buskalender .calendar-header-bar {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(60,60,60,0.07);
  padding: 1.2em 1em;
  margin-bottom: 1.2em;
  display: flex;
  align-items: center;
  gap: 0.7em;
  justify-content: space-between;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}
.buskalender .calendar-header-bar h2 {
  margin: 0 0 0 15px;
  font-size: 1.25em;
  font-weight: 600;
  flex: 1 1 auto;
  text-align: left;
}
.buskalender .calendar-header-bar .cal-btn {
  margin-left: auto;
}

#calendar-controls, .buskalender .calendar-header-bar, .buskalender .table-container, table.cal {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.calendar-header-bar {
  height: 77px;
}

#toggle-calendar {
  margin-top: 2px;
}


#calendar-controls,
.buskalender .calendar-header-bar,
.buskalender .table-container,
.buskalender .footer-btn,
table.cal,
.bus-form,
.bookings-table {
  box-shadow: 1px 1px 3px rgba(0,0,0,0.77);
}

/* --- Bus-Reservierungsformular --- */
.bus-form {
  background: #fff;
  border-radius: var(--cal-radius);
  padding: 1.5em 1.2em;
  margin: 1.5em auto;
  max-width: 820px;
  position: relative;
}
.bus-form-grid {
  display: flex;
  gap: 2em;
  flex-wrap: wrap;
}
.bus-form-col {
  flex: 1 1 0;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 1.1em;
}
.bus-form-col.left {
  padding-right: 1em;
}
.bus-form-col.right {
  padding-left: 1em;
}
.bus-form label {
  font-weight: 600;
  margin: 0 0 -1em 2px;
  display: block;  
}
.bus-form input[type="text"],
.bus-form input[type="email"],
.bus-form input[type="date"],
.bus-form select,
.bus-form textarea {
  width: 100%;
  padding: 0.55em 0.7em;
  border-radius: 6px;
  background: #fff;
  font-size: 1em;
  margin-top: 0.15em;
  margin-bottom: 0.1em;
  transition: border 0.2s;
}
.bus-form input:focus,
.bus-form select:focus,
.bus-form textarea:focus {
  border-color: #b48a3c;
  outline: none;
}
.bus-form textarea {
  min-height: 80px;
  resize: vertical;
}
.required-star {
  color: #d32f2f;
  font-weight: bold;
  margin-left: 0.2em;
}
.agb-row {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-top: 0.5em;
}
.agb-label {
  font-weight: 400;
  color: #7a5a1e;
  margin: 0;
}
.bus-form button[type="submit"] {
  background: #f4f6fa;
  color: #222;
  border: 1.5px solid #bbb;
  border-radius: 8px;
  font-size: 1.08em;
  font-weight: 600;
  padding: 0.7em 1.7em;
  box-shadow: 0 1px 4px rgba(60,60,60,0.07);
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s, border 0.18s;
  display: flex;
  align-items: center;
  gap: 0.7em;
  width: 100%;
  margin-top: 1.2em;
  letter-spacing: 0.03em;
}
.bus-form button[type="submit"]:hover {
  background: #e0e7ef;
  border: 1.5px solid var(--cat-verein);
  color: #111;
  box-shadow: 0 2px 8px rgba(60,60,60,0.13);
}
.required-hint {
  margin-top: 1.5em;
  color: #d32f2f;
  font-size: 0.9em;
  text-align: left;
}
@media (max-width: 700px) {
  .bus-form {
    padding: 1.2em 0.5em 1em 0.5em;
  }
  .bus-form-grid {
    flex-direction: column;
    gap: 0.5em;
  }
  .bus-form-col.left, .bus-form-col.right {
    padding: 0;
  }
  .bus-form-col.right {
    display: flex;
    flex-direction: column;
  }
  .bus-form-col.right .agb-row {
    order: 10;
    margin-bottom: 0.7em;
    margin-top: 1.2em;
  }
  .bus-form-col.left .agb-row {
    order: unset;
    margin-bottom: 0;
  }
  .bus-form-col.right button[type="submit"] {
    order: 11;
  }
}

select#category_id,
.bus-form-grid input,
.bus-form-grid textarea {
  font-weight:500;
}

.compact-agb {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin: 0.7em 0 0.2em 0;
}
.compact-agb input[type="checkbox"] {
  width: 1.1em;
  height: 1.1em;
  min-width: 1.1em;
  min-height: 1.1em;
  margin: 0 0.3em 0 0;
  accent-color: #b48a3c;
}
.compact-agb .agb-label {
  font-size: 1em;
  font-weight: 600;
  color: #7a5a1e;
  margin: 0;
  line-height: 1.2;
}

.agb-label a,
.agb-label a:link,
.agb-label a:visited {
  color: #66561d;
}

.agb-label a:hover {
  color: #7e752a;
}

.calendar-tooltip-toggle {
  display: none;
}
.calendar-tooltip-label {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  cursor: pointer;
  box-sizing: border-box;
  padding: 0.7em 0;
  margin: 0;
}
.buskalender .cal .free .calendar-tooltip-label {
  cursor: default;
}
.calendar-tooltip {
  display: none;
  position: fixed;
  left: 50%;
  top: 37%;
  transform: translate(-50%, -50%) scale(0.98);
  min-width: 275px;
  max-width: 350px;
  background: #fffbe9;
  color: #222;
  border: 1.5px solid #e2c88d;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(180,138,60,0.13);
  padding: 0.7em 1em 0.7em 1em;
  font-size: 1em;
  z-index: 20;
  white-space: pre-line;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.calendar-tooltip-toggle:checked ~ .calendar-tooltip {
  display: block;
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
  padding-top: 0;
}
.close-tooltip {
  display: block;
  width: 30px;
  margin: 0 auto;
  color: #b48a3c;
  background: none;
  font-size: 1.3em;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  padding: 1px 6px;
  margin-top: 3px;
  border: 1px solid #691717;
  border-radius: 5px;
  transition: color 0.15s;
}
.close-tooltip:hover, .close-tooltip:focus {
  color: #d32f2f;
  outline: none;
}

.calendar-tooltip-anchor {
  display: flex;
  height: 100%;
  width: 100%;
  align-items: stretch;
  justify-content: stretch;
}

#feedback-modal {
  position: fixed;
  left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.25);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
#feedback-modal .modal-content {
  background: #fffbe9;
  border-radius: 14px;
  max-width: 420px;
  width: 92vw;
  margin: 2em auto;
  padding: 2.2em 1.5em 1.5em 1.5em;
  box-shadow: 0 8px 32px rgba(60,60,60,0.18);
  position: relative;
  text-align: center;
  font-size: 1.13em;
  color: #222;
  border: 2px solid #e2c88d;
}
#feedback-modal .close-modal {
  position: absolute;
  top: 0.7em;
  right: 1.1em;
  font-size: 2em;
  color: #b48a3c;
  cursor: pointer;
  z-index: 10;
  font-weight: bold;
  background: none;
  border: none;
  transition: color 0.15s;
}
#feedback-modal .close-modal:hover, #feedback-modal .close-modal:focus {
  color: #d32f2f;
  outline: none;
}
#feedback-modal .modal-message {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  word-break: break-word;
}

.svg-btn-icon {
  margin-right: 0.6em;
}

.error-msg {
  color: red;
}

.hidden {
  display: none !important;
}

.daynum {
  display: block;
  width: 100%;
  text-align: center;
  color: #111 !important;
  text-shadow: none !important;
}

.list-td-center {
  text-align: center;
  padding: 0.7em 0.5em;
}
.list-td-category {
  text-align: center;
  color: #000;
  border-radius: 6px;
  padding: 0.5em 1.2em;
  margin: 0 0.2em;
  background: var(--cat-verein); /* Fallback, wird per JS überschrieben */
}
.list-th-center {
  text-align: center;
}
.list-status-genehmigt {
  color: #2e7d32;
  font-weight: bold;
}
.list-status-abgelehnt {
  color: #b32d2d;
  font-weight: bold;
}
.list-status-angefragt {
  color: #b48a3c;
  font-weight: bold;
}

/* Gemeinsame Tabellen-Styles für Admin-Tabellen */
.bookings-table, .audit-table {
  border-radius: var(--cal-radius);
  box-shadow: var(--cal-shadow);
  background: #fff;
  font-size: 1em;
  border-collapse: collapse;
  width: 100%;
  overflow: hidden;
}
.bookings-table th, .bookings-table td,
.audit-table th, .audit-table td {
  padding: 0.5em 0.7em;
  border: 1px solid var(--cal-border);
  text-align: left;
}
.bookings-table th, .audit-table th {
  background: #fbe7a2;
  color: #413929;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-bottom: 2px solid #e0c080;
  box-shadow: 0 2px 6px rgba(247, 200, 115, 0.08);
}
.bookings-table tbody tr:nth-child(even), .audit-table tbody tr:nth-child(even) {
  background: #fff;
}
.bookings-table tbody tr:nth-child(odd), .audit-table tbody tr:nth-child(odd) {
  background: #faf6e7;
}
/* Einzigartigkeiten für bookings-table und audit-table können darunter stehen */

/* Statusfarben und abgelaufene Zeilen für Admin-Tabelle */
.status-genehmigt { color: #219a00; }
.status-abgelehnt { color: #c62828; }
.status-angefragt { color: #e67e22; }
.row-past { background: #f3f3f3 !important; color: #aaa; }

/* Spinner-Overlay für das blockierte Formular */
.form-spinner-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.form-spinner {
  width: 48px;
  height: 48px;
  border: 5px solid #e2c88d;
  border-top: 5px solid #bfa14a;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- Audit-Log SPA --- */
.audit-table-wrapper {
  margin: 2em auto 0 auto;
  border-radius: 12px;
  box-shadow: 0 2px 12px #0001;
  overflow: hidden;
  background: #fff;
}
.audit-table-scroll {
  max-height: 480px;
  overflow-y: auto;
}
.audit-details {
  font-size: 0.95em;
  max-width: 320px;
  word-break: break-all;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.audit-details pre {
  margin: 0;
  font-size: inherit;
  font-family: inherit;
  max-width: 320px;
  word-break: break-all;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.booking-phone {
  font-size: 0.93em;
  color: #888;
}

.booking-phone::before {
  content: "Tel.: ";
}

.icon-animate {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw-in 2s cubic-bezier(.77,0,.18,1) forwards;
}
@keyframes draw-in {
  to {
    stroke-dashoffset: 0;
  }
}

/* Utility-Klassen für SPA-Header und Buttons */
.header-flex {
  display: flex;
  align-items: center;
  gap: 1em;
}
.header-title {
  margin: 0;
  flex: 1 1 auto;
  font-size: 1.25em;
  display: flex;
  align-items: center;
}
.header-gap {
  display: flex;
  gap: 0.5em;
}
.centered-message {
  text-align: center;
  padding: 2em;
}
.margin-right-04em {
  margin-right: 0.4em;
}
.margin-left-auto {
  margin-left: auto;
}
.gap-05em {
  gap: 0.5em;
}
.margin-top-12em {
  margin-top: 1.2em;
}
.margin-top-1em {
  margin-top: 1em;
}
.bold-red {
  color: #b32d2d;
  font-weight: bold;
}

@media (max-width: 555px) {
  .buskalender .footer-flex {
    flex-direction: column;
    align-items: stretch;
  }
  .buskalender .footer-links {
    margin-top: 1em;
    align-items: stretch;
  }
}