:root {
  --thw-blue: #003399;
  --thw-light: #f3f6fb;
}

body {
  background: var(--thw-light);
}

.thw-blue {
  background: var(--thw-blue);
}

.login-bg {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #003399, #001f5c);
}

.login-card {
  background: white;
  width: min(420px, 92vw);
  padding: 2rem;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.event-box {
  border-left: 5px solid var(--thw-blue);
  background: #f8f9fa;
  padding: .75rem;
  border-radius: .5rem;
  margin-bottom: .75rem;
}

.resource-card {
  border: 1px solid #dee2e6;
  border-radius: 14px;
  padding: 14px;
  background: white;
  height: 100%;
  transition: .15s ease;
}

.resource-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}

.resource-card.unavailable {
  opacity: .55;
  background: #f8f9fa;
}

.resource-title {
  font-weight: 800;
  color: #1f2937;
}

.resource-meta {
  color: #6b7280;
  font-size: .875rem;
}

.status-pill {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
}

.status-available {
  background: #dcfce7;
  color: #166534;
}

.status-unavailable {
  background: #fee2e2;
  color: #991b1b;
}

#resourceCategoryTabs .nav-link {
  border: 1px solid #d0d7e2;
  color: #1f2937;
  background: #fff;
  font-weight: 600;
}

#resourceCategoryTabs .nav-link.active {
  background: var(--thw-blue);
  color: #fff;
  border-color: var(--thw-blue);
}

.dash-stat {
  background: white;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 8px 28px rgba(0,0,0,.06);
  border-left: 6px solid var(--thw-blue);
}

.dash-stat-danger {
  border-left-color: #dc3545;
}

.dash-stat-label {
  color: #6b7280;
  font-size: .9rem;
  font-weight: 700;
}

.dash-stat-value {
  font-size: 2rem;
  font-weight: 900;
  color: #1f2937;
}

.event-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.event-link:hover {
  background: #eef3ff;
}

.event-warning {
  border-left-color: #dc3545;
  background: #fff5f5;
}

.dash-stat {
  background: white;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 8px 28px rgba(0,0,0,.06);
  border-left: 6px solid var(--thw-blue);
}

.dash-stat-danger {
  border-left-color: #dc3545;
}

.dash-stat-label {
  color: #6b7280;
  font-size: .9rem;
  font-weight: 700;
}

.dash-stat-value {
  font-size: 2rem;
  font-weight: 900;
  color: #1f2937;
}

.event-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.event-link:hover {
  background: #eef3ff;
}

.event-warning {
  border-left-color: #dc3545;
  background: #fff5f5;
}

.osm-wrap {
  position: relative;
}

.osm-results {
  display: none;
  position: absolute;
  z-index: 3000;
  background: #fff;
  border: 1px solid #d0d7e2;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0,0,0,.16);
  width: 100%;
  max-height: 260px;
  overflow-y: auto;
  margin-top: 4px;
}

.osm-result-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #eef1f5;
}

.osm-result-item:hover {
  background: #eef3ff;
}

.osm-result-title {
  font-weight: 800;
}

.osm-result-sub {
  font-size: .85rem;
  color: #6b7280;
}

.event-map {
  width: 100%;
  height: 260px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #d0d7e2;
}

.status-timeline {
  background: #f8fafc;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: .9rem;
}

/* Dashboard kompakter */
.dashboard-grid .card {
  border-radius: 16px;
}

.dashboard-side .card-body {
  max-height: 235px;
  overflow-y: auto;
}

.dashboard-calendar .card-body {
  padding: 12px;
}

.fc {
  font-size: .92rem;
}

.fc .fc-toolbar-title {
  font-size: 1.25rem;
  font-weight: 800;
}

.fc .fc-button {
  padding: .3rem .55rem;
  font-size: .85rem;
}

/* Mobile Navigation */
@media (max-width: 991px) {
  .navbar .container-fluid {
    align-items: flex-start;
    gap: 10px;
  }

  .navbar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
  }

  .navbar-nav .nav-link {
    background: rgba(255,255,255,.12);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: .85rem;
  }

  .navbar .ms-auto {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  main.container-fluid {
    padding: 12px !important;
  }

  .dash-stat {
    padding: 12px;
    border-radius: 14px;
  }

  .dash-stat-value {
    font-size: 1.45rem;
  }

  .dash-stat-label {
    font-size: .8rem;
  }

  .event-box {
    padding: .55rem;
    margin-bottom: .5rem;
  }

  .dashboard-side .card-body {
    max-height: 180px;
  }

  .fc .fc-toolbar {
    flex-direction: column;
    gap: 8px;
  }

  .fc .fc-toolbar-title {
    font-size: 1.05rem;
  }

  .fc .fc-button {
    font-size: .78rem;
    padding: .25rem .45rem;
  }

  .modal-dialog {
    margin: .5rem;
  }

  .modal-xl,
  .modal-lg {
    max-width: calc(100vw - 1rem);
  }

  .table-responsive {
    font-size: .85rem;
  }

  .resource-card {
    padding: 10px;
  }

  .event-map {
    height: 220px;
  }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1199px) {
  .dashboard-side .card-body {
    max-height: 210px;
  }

  .fc {
    font-size: .88rem;
  }
}

/* Desktop: weniger Scrollen */
@media (min-width: 1400px) {
  .dashboard-side .card-body {
    max-height: 250px;
  }

  #calendar {
    min-height: 610px;
  }
}

/* Dashboard Desktop kompakt */
@media (min-width: 1200px) {
  main.container-fluid {
    padding: 14px 18px !important;
  }

  .dashboard-grid {
    height: calc(100vh - 205px);
    overflow: hidden;
  }

  .dashboard-side {
    height: 100%;
    overflow: hidden;
  }

  .dashboard-side .card {
    margin-bottom: 10px !important;
  }

  .dashboard-side .card-header {
    padding: 8px 12px;
    font-size: .92rem;
  }

  .dashboard-side .card-body {
    padding: 8px;
    max-height: 150px;
    overflow-y: auto;
  }

  .event-box {
    padding: .45rem .6rem;
    margin-bottom: .4rem;
    font-size: .88rem;
  }

  .event-box small {
    font-size: .76rem;
  }

  .dashboard-calendar,
  .dashboard-calendar .card,
  .dashboard-calendar .card-body {
    height: 100%;
  }

  .dashboard-calendar .card-header {
    padding: 8px 12px;
  }

  #calendar {
    height: calc(100vh - 275px) !important;
    min-height: 0 !important;
  }

  .fc {
    height: 100% !important;
    font-size: .82rem;
  }

  .fc .fc-view-harness {
    height: calc(100vh - 350px) !important;
  }

  .fc .fc-toolbar {
    margin-bottom: .35rem !important;
  }

  .fc .fc-toolbar-title {
    font-size: 1.05rem !important;
  }

  .fc .fc-button {
    padding: .22rem .45rem !important;
    font-size: .78rem !important;
  }

  .dash-stat {
    padding: 10px 14px;
    border-radius: 14px;
  }

  .dash-stat-value {
    font-size: 1.45rem;
    line-height: 1.1;
  }

  .dash-stat-label {
    font-size: .78rem;
  }

  .row.g-3.mb-4 {
    margin-bottom: 10px !important;
  }

  .d-flex.flex-wrap.justify-content-between.align-items-center.mb-4 {
    margin-bottom: 10px !important;
  }
}

/* Mobile Performance */
* {
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  overscroll-behavior-y: contain;
  text-rendering: optimizeSpeed;
}

/* Navbar schneller */
.navbar,
.navbar * {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Karten schneller rendern */
.card,
.event-box,
.resource-card,
.dash-stat {
  will-change: transform;
}

/* Tabellen */
.table-responsive {
  -webkit-overflow-scrolling: touch;
}

/* Buttons */
.btn {
  touch-action: manipulation;
}

/* Mobile Navbar sauber als echtes Klappmenü */
@media (max-width: 991px) {
  .navbar {
    padding: 8px 10px;
  }

  .navbar-brand {
    font-size: 1rem;
  }

  .navbar-toggler {
    border-color: rgba(255,255,255,.35);
    padding: 4px 8px;
  }

  .navbar-collapse {
    margin-top: 10px;
  }

  .navbar-nav {
    flex-direction: column !important;
    gap: 4px;
  }

  .navbar-nav .nav-link {
    background: rgba(255,255,255,.12);
    border-radius: 10px;
    padding: 9px 12px;
    color: #fff !important;
  }

  .navbar-nav .nav-link:active {
    background: rgba(255,255,255,.24);
  }
}

/* Desktop bleibt klassisch */
@media (min-width: 992px) {
  .navbar-nav .nav-link {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* =========================
   EVENT MODAL REDESIGN
========================= */

#eventModal .modal-dialog,
#eventEditModal .modal-dialog {
  max-width: 1180px;
}

#eventModal .modal-content,
#eventEditModal .modal-content {
  border: none;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}

#eventModal .modal-header,
#eventEditModal .modal-header {
  background: linear-gradient(135deg,#003c8f 0%, #0d5bd7 100%);
  color: #fff;
  padding: 22px 28px;
  border: none;
}

#eventModal .modal-title,
#eventEditModal .modal-title {
  font-size: 1.55rem;
  font-weight: 800;
}

#eventModal .btn-close,
#eventEditModal .btn-close {
  filter: invert(1);
  opacity: 1;
}

#eventModal .modal-body,
#eventEditModal .modal-body {
  background: #f4f7fb;
  padding: 24px;
}

#eventModal .modal-footer,
#eventEditModal .modal-footer {
  padding: 18px 24px;
  background: #fff;
  border-top: 1px solid #e3e8f0;
}

/* GRID */
.event-form-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 22px;
}

.event-main-column,
.event-side-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* CARDS */
.event-section {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid #dbe3ef;
  box-shadow: 0 4px 16px rgba(0,0,0,.04);
}

.event-section-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 14px;
  color: #003c8f;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* FORM */
#eventModal .form-control,
#eventModal .form-select,
#eventEditModal .form-control,
#eventEditModal .form-select {
  border-radius: 12px;
  border: 1px solid #cfd8e6;
  min-height: 48px;
  padding: 10px 14px;
  box-shadow: none !important;
}

#eventModal textarea.form-control,
#eventEditModal textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

#eventModal .form-label,
#eventEditModal .form-label {
  font-size: .88rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #4c5a70;
}

/* ADDRESS */
.osm-results {
  margin-top: 8px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #dbe3ef;
  box-shadow: 0 12px 24px rgba(0,0,0,.08);
}

.osm-result-item {
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid #edf1f6;
  cursor: pointer;
  transition: .15s ease;
}

.osm-result-item:hover {
  background: #edf4ff;
}

.osm-result-title {
  font-weight: 700;
  color: #1d2b42;
}

.osm-result-sub {
  font-size: .8rem;
  color: #68768d;
}

/* RESOURCE BUTTON */
.resource-open-btn {
  width: 100%;
  min-height: 52px;
  border-radius: 14px;
  font-weight: 700;
}

/* RESOURCE INFO */
.selected-resource-box {
  background: #edf4ff;
  border: 1px solid #bfd5ff;
  border-radius: 14px;
  padding: 12px;
  font-size: .9rem;
}

/* CHECKBOX */
.form-check-modern {
  background: #fff;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  padding: 14px;
}

/* SAVE BUTTON */
#eventModal .btn-primary,
#eventEditModal .btn-primary {
  min-width: 170px;
  min-height: 50px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 8px 18px rgba(13,91,215,.22);
}

/* MOBILE */
@media (max-width: 991px) {
  .event-form-grid {
    grid-template-columns: 1fr;
  }

  #eventModal .modal-dialog,
  #eventEditModal .modal-dialog {
    max-width: calc(100vw - 10px);
    margin: 5px;
  }

  #eventModal .modal-body,
  #eventEditModal .modal-body {
    padding: 14px;
  }

  .event-section {
    padding: 14px;
    border-radius: 14px;
  }
}

/* =========================
   EVENT DETAIL POLISH
========================= */

body {
  background: #f3f6fb;
}

main.container-fluid {
  max-width: 1600px;
  margin: 0 auto;
}

/* Event Header */
.event-detail-header {
  background: linear-gradient(135deg, #ffffff 0%, #eef4ff 100%);
  border: 1px solid #dbe5f3;
  border-left: 7px solid var(--thw-blue);
  border-radius: 20px;
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: 0 8px 28px rgba(0,0,0,.06);
}

.event-detail-title {
  font-size: 2rem;
  font-weight: 900;
  margin: 0;
  color: #172033;
}

.event-detail-subtitle {
  color: #5f6b7a;
  font-weight: 600;
  margin-top: 4px;
}

/* Event Cards */
.event-detail-card {
  border: none !important;
  border-radius: 20px !important;
  overflow: hidden;
  box-shadow: 0 8px 26px rgba(0,0,0,.07) !important;
}

.event-detail-card .card-header {
  background: #fff;
  border-bottom: 1px solid #e1e8f2;
  padding: 15px 18px;
  font-size: 1.05rem;
  font-weight: 900;
  color: #172033;
}

.event-detail-card .card-body {
  padding: 20px;
}

.event-info-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  margin-bottom: 14px;
  align-items: start;
}

.event-info-label {
  font-weight: 900;
  color: #1f2937;
}

.event-info-value {
  color: #2f3a4a;
}

/* Status / Helpers */
.event-status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.event-mini-stat {
  background: #f8fbff;
  border: 1px solid #dbe7f7;
  border-radius: 16px;
  padding: 14px;
}

.event-mini-stat-label {
  font-size: .78rem;
  color: #637083;
  font-weight: 800;
}

.event-mini-stat-value {
  font-size: 1.1rem;
  font-weight: 900;
  color: #172033;
}

/* Map */
.event-map {
  height: 310px !important;
  border-radius: 18px !important;
  border: 1px solid #d7e1ef !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
}

/* Action buttons */
.event-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid #e1e8f2;
  margin-top: 18px;
}

.event-action-bar .btn {
  border-radius: 12px;
  font-weight: 800;
  padding: 9px 14px;
}

/* Resource / Participant Blocks */
.table {
  --bs-table-bg: transparent;
}

.table thead th {
  color: #4b5563;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #f8fafc;
}

.table tbody td {
  vertical-align: middle;
}

/* Empty cards */
.empty-state {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  padding: 18px;
  color: #64748b;
}

/* Desktop layout */
@media (min-width: 1200px) {
  .event-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
    gap: 20px;
    align-items: start;
  }

  .event-detail-main,
  .event-detail-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
}

/* Mobile */
@media (max-width: 1199px) {
  .event-detail-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .event-detail-title {
    font-size: 1.45rem;
  }

  .event-info-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .event-status-grid {
    grid-template-columns: 1fr;
  }

  .event-map {
    height: 240px !important;
  }
}

@media (max-width: 600px) {
  .event-detail-header {
    padding: 16px;
    border-radius: 16px;
  }

  .event-detail-card .card-body {
    padding: 14px;
  }

  .event-action-bar .btn {
    width: 100%;
  }
}






/* =========================
   EVENT DETAIL ACTIONS
========================= */

.event-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.event-header-actions .btn,
.event-header-actions form .btn {
  min-height: 46px;
  border-radius: 14px;
  font-weight: 800;
  padding: 10px 16px;
}

/* STATUS BUTTON GRID */
.status-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #dbe4f0;
}

.status-action-grid form {
  margin: 0;
}

.status-action-grid .btn {
  width: 100%;
  min-height: 60px;
  border-radius: 16px;
  font-weight: 900;
  font-size: .92rem;
  border-width: 1.5px;
  transition: .18s ease;
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
}

.status-action-grid .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(15,23,42,.12);
}

.status-action-grid .btn-outline-primary {
  background: #eff6ff;
}

.status-action-grid .btn-outline-warning {
  background: #fffbeb;
}

.status-action-grid .btn-outline-success,
.status-action-grid .btn-success {
  background: #ecfdf5;
}

.status-action-grid .btn-outline-danger {
  background: #fef2f2;
}

@media (max-width: 700px) {
  .event-header-actions {
    width: 100%;
  }

  .event-header-actions .btn,
  .event-header-actions form {
    width: 100%;
  }

  .status-action-grid {
    grid-template-columns: 1fr;
  }
}

/* USER MODAL */
#userModal .modal-dialog {
  max-width: 720px;
}

#userModal .modal-content {
  border-radius: 22px;
  overflow: hidden;
  border: none;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
}

#userModal .modal-header {
  background: linear-gradient(135deg,#003c8f,#0d5bd7);
  color: #fff;
  border: none;
  padding: 22px 24px;
}

#userModal .modal-title {
  font-weight: 900;
  font-size: 1.4rem;
}

#userModal .btn-close {
  filter: invert(1);
}

#userModal .modal-body {
  background: #f4f7fb;
  padding: 24px;
}

#userModal .modal-footer {
  background: #fff;
  border-top: 1px solid #e2e8f0;
  padding: 18px 24px;
}

#userModal .form-control,
#userModal .form-select {
  min-height: 48px;
  border-radius: 14px;
}

#userModal .btn-primary {
  min-width: 160px;
  min-height: 48px;
  border-radius: 14px;
  font-weight: 800;
}

/* Abschließen-Button lesbar machen */
.status-action-grid .btn-success {
  background: #15803d !important;
  border-color: #15803d !important;
  color: #fff !important;
}

.status-action-grid .btn-success:hover {
  background: #166534 !important;
  border-color: #166534 !important;
  color: #fff !important;
}

.status-action-grid .btn-outline-success {
  color: #166534 !important;
}

/* =========================
   CUSTOMER MODAL REDESIGN
========================= */

#customerModal .modal-dialog {
  max-width: 1180px;
}

#customerModal .modal-content {
  border: none;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(15,23,42,.22);
}

#customerModal .modal-header {
  background: linear-gradient(135deg, #003c8f 0%, #0d5bd7 100%);
  color: #fff;
  border: none;
  padding: 24px 28px;
}

#customerModal .modal-title {
  font-weight: 900;
  font-size: 1.55rem;
}

#customerModal .modal-subtitle {
  font-size: .9rem;
  opacity: .85;
  margin-top: 2px;
}

#customerModal .btn-close {
  filter: invert(1);
  opacity: 1;
}

#customerModal .modal-body {
  background: #f4f7fb;
  padding: 24px;
}

#customerModal .modal-footer {
  background: #fff;
  border-top: 1px solid #e2e8f0;
  padding: 18px 24px;
}

.customer-form-grid {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 22px;
}

.customer-form-main,
.customer-form-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.customer-section {
  background: #fff;
  border: 1px solid #dbe4f0;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 6px 20px rgba(15,23,42,.045);
}

.customer-section-title {
  color: #003c8f;
  font-weight: 900;
  font-size: 1rem;
  margin-bottom: 14px;
}

#customerModal .form-label {
  font-size: .86rem;
  font-weight: 800;
  color: #4b5563;
}

#customerModal .form-control,
#customerModal .form-select {
  border-radius: 14px;
  min-height: 48px;
  border: 1px solid #cfd8e6;
  box-shadow: none !important;
}

#customerModal textarea.form-control {
  min-height: 92px;
  resize: vertical;
}

#customerModal .customer-notes {
  min-height: 150px;
}

#customerModal .btn {
  border-radius: 14px;
  min-height: 48px;
  font-weight: 800;
  padding-left: 18px;
  padding-right: 18px;
}

@media (max-width: 991px) {
  #customerModal .modal-dialog {
    max-width: calc(100vw - 10px);
    margin: 5px;
  }

  #customerModal .modal-body {
    padding: 14px;
  }

  .customer-form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .customer-section {
    padding: 14px;
    border-radius: 14px;
  }
}

.participant-choice-card {
  background: #f8fafc;
  border: 1px solid #dbe4f0;
  border-radius: 18px;
  padding: 18px;
  height: 100%;
}

.participant-choice-card .btn {
  border-radius: 14px;
  min-height: 46px;
  font-weight: 800;
}

/* Event-Bearbeiten-Modal sauber zentrieren und scrollbar machen */
#eventEditModal .modal-dialog {
  max-width: 980px;
  margin: 1.5rem auto;
}

#eventEditModal .modal-content {
  max-height: calc(100vh - 3rem);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
}

#eventEditModal .modal-header {
  flex: 0 0 auto;
}

#eventEditModal .modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  max-height: calc(100vh - 190px);
  padding: 24px;
}

#eventEditModal .modal-footer {
  flex: 0 0 auto;
}

@media (max-width: 991px) {
  #eventEditModal .modal-dialog {
    max-width: calc(100vw - 12px);
    margin: 6px;
  }

  #eventEditModal .modal-content {
    max-height: calc(100vh - 12px);
  }

  #eventEditModal .modal-body {
    max-height: calc(100vh - 160px);
    padding: 14px;
  }
}

/* Bootstrap Modal immer oberhalb und viewportbezogen */




#eventEditModal {
  position: fixed !important;
  inset: 0 !important;
}

#eventEditModal .modal-dialog {
  position: relative !important;
  margin: 1.75rem auto !important;
  max-width: 980px !important;
}

#eventEditModal .modal-content {
  max-height: calc(100vh - 3.5rem) !important;
  overflow: hidden !important;
}

#eventEditModal .modal-body {
  overflow-y: auto !important;
  max-height: calc(100vh - 190px) !important;
}

.event-tabs {
  background: #fff;
  border: 1px solid #dbe4f0;
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 8px 26px rgba(0,0,0,.05);
}

.event-tabs .nav-link {
  border-radius: 14px;
  font-weight: 900;
  color: #334155;
}

.event-tabs .nav-link.active {
  background: var(--thw-blue);
  color: #fff;
}

.participant-choice-card {
  background: #f8fafc;
  border: 1px solid #dbe4f0;
  border-radius: 18px;
  padding: 18px;
  height: 100%;
}

.participation-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.participation-actions .btn {
  min-height: 46px;
  border-radius: 14px;
  font-weight: 900;
  white-space: nowrap;
  padding-left: 10px;
  padding-right: 10px;
}

.resource-mini-row {
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
}

.resource-mini-row:last-child {
  border-bottom: none;
}

@media (max-width: 700px) {
  .participation-actions {
    grid-template-columns: 1fr;
  }

  .participation-actions .btn {
    white-space: normal;
  }
}

/* Fahrzeug-/Anhängerübersicht */

.event-resource-overview {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.event-resource-box {
  background: #f8fafc;
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  padding: 14px;
}

.event-resource-title {
  font-weight: 900;
  color: #003c8f;
  margin-bottom: 10px;
  font-size: .95rem;
}

.event-resource-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.event-resource-pill {
  background: #003c8f;
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
}

.event-resource-pill small {
  opacity: .75;
  font-size: .72rem;
}

@media (max-width: 700px) {
  .event-resource-items {
    flex-direction: column;
  }

  .event-resource-pill {
    width: 100%;
    justify-content: space-between;
  }
}

/* RESOURCE MODAL REDESIGN */

#resourceModal .modal-dialog {
  max-width: 1180px;
}

#resourceModal .modal-content {
  border: none;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(15,23,42,.22);
}

#resourceModal .modal-header {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  border: none;
  padding: 24px 28px;
}

#resourceModal .modal-title {
  font-weight: 900;
  font-size: 1.55rem;
}

#resourceModal .modal-subtitle {
  font-size: .9rem;
  opacity: .9;
}

#resourceModal .btn-close {
  filter: invert(1);
}

#resourceModal .modal-body {
  background: #f4f7fb;
  padding: 24px;
}

#resourceModal .modal-footer {
  background: #fff;
  border-top: 1px solid #e2e8f0;
  padding: 18px 24px;
}

.resource-form-grid {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 22px;
}

.resource-form-main,
.resource-form-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.resource-section {
  background: #fff;
  border: 1px solid #dbe4f0;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 6px 20px rgba(15,23,42,.045);
}

.resource-section-title {
  color: #92400e;
  font-weight: 900;
  font-size: 1rem;
  margin-bottom: 14px;
}

.resource-check-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  cursor: pointer;
}

.resource-check-card input {
  margin-top: 4px;
}

.resource-check-card b {
  display: block;
  color: #1f2937;
}

.resource-check-card small {
  display: block;
  color: #64748b;
}

.resource-notes {
  min-height: 150px;
}

#resourceModal .form-label {
  font-size: .86rem;
  font-weight: 800;
  color: #4b5563;
}

#resourceModal .form-control,
#resourceModal .form-select {
  border-radius: 14px;
  min-height: 48px;
  border: 1px solid #cfd8e6;
  box-shadow: none !important;
}

#resourceModal .btn {
  border-radius: 14px;
  min-height: 48px;
  font-weight: 800;
  padding-left: 18px;
  padding-right: 18px;
}

@media (max-width: 991px) {
  .resource-form-grid {
    grid-template-columns: 1fr;
  }

  #resourceModal .modal-body {
    padding: 14px;
  }
}

.resource-manage-tabs {
  gap: 10px;
}

.resource-manage-tabs .nav-link {
  border: none;
  border-radius: 14px;
  font-weight: 800;
  padding: 10px 16px;
  background: #eef2f7;
  color: #334155;
}

.resource-manage-tabs .nav-link.active {
  background: #003c8f;
  color: #fff;
}

.resource-mode-info {
  background: #f8fafc;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  padding: 12px 16px;
  color: #475569;
  font-weight: 600;
}

.resource-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.resource-select-card {
  background: #fff;
  border: 2px solid #dbe4f0;
  border-radius: 20px;
  padding: 18px;
  cursor: pointer;
  transition: .18s ease;
  position: relative;
  overflow: hidden;
}

.resource-select-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
}

.resource-select-card.selected {
  border-color: #003c8f;
  box-shadow: 0 10px 28px rgba(0,60,143,.16);
}

.resource-select-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.resource-select-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.resource-select-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: #0f172a;
}

.resource-select-category {
  color: #64748b;
  font-size: .85rem;
  font-weight: 700;
}

.resource-select-check {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #003c8f;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.resource-select-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resource-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: .92rem;
}

.resource-meta-row span {
  color: #64748b;
}

.resource-meta-row b {
  color: #0f172a;
}

.resource-status {
  margin-top: 6px;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: .84rem;
  font-weight: 700;
}

.resource-status.available {
  background: #dcfce7;
  color: #166534;
}

.resource-status.conflict {
  background: #fee2e2;
  color: #991b1b;
}

/* Fahrzeug-/Anhänger-Pills sauber ausrichten */
.event-resource-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  font-size: 1rem !important;
  line-height: 1.1 !important;
}

.event-resource-pill small {
  font-size: .92rem !important;
  line-height: 1 !important;
  font-weight: 800 !important;
  opacity: .95 !important;
  background: rgba(255,255,255,.18);
  padding: 4px 8px;
  border-radius: 999px;
}

.dashboard-event-card {
  display: block;
  text-decoration: none;
  color: #172033;
  background: #f8fafc;
  border-left: 5px solid #003c8f;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: .16s ease;
}

.dashboard-event-card:hover {
  background: #eef4ff;
  transform: translateY(-1px);
}

.dashboard-event-card.return {
  border-left-color: #f59e0b;
}

/* =========================
   LOGIN REDESIGN
========================= */

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(0,60,143,.12), transparent 35%),
    radial-gradient(circle at bottom left, rgba(0,60,143,.08), transparent 40%),
    #eef3f9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(18px);
  border-radius: 28px;
  padding: 38px;
  box-shadow:
    0 10px 40px rgba(15,23,42,.08),
    0 2px 10px rgba(15,23,42,.04);
  border: 1px solid rgba(255,255,255,.7);
}

.login-card h1,
.login-card h2 {
  color: #172033;
  font-size: 1.9rem;
  margin-bottom: 10px;
  font-weight: 800;
}

.login-card p {
  color: #64748b;
  margin-bottom: 24px;
}

.login-card .form-control {
  border-radius: 16px;
  border: 1px solid #d7dee8;
  padding: 14px 16px;
  min-height: 52px;
  font-size: .98rem;
  box-shadow: none !important;
}

.login-card .form-control:focus {
  border-color: #003c8f;
  box-shadow: 0 0 0 4px rgba(0,60,143,.12) !important;
}

.login-card .btn-primary {
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  font-weight: 700;
  background: linear-gradient(135deg,#003c8f,#0057d1);
  border: none;
  transition: .18s ease;
}

.login-card .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(0,60,143,.25);
}

.login-logo {
  width: 82px;
  height: 82px;
  border-radius: 22px;
  background: linear-gradient(135deg,#003c8f,#0057d1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: white;
  font-size: 2rem;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(0,60,143,.25);
}


/* =========================
   FULLCALENDAR OPTIMIERUNG
========================= */

.fc .fc-timegrid-event {
  border-radius: 14px !important;
  padding: 6px 8px !important;
  min-height: 64px !important;
  border-width: 0 !important;
  box-shadow: 0 4px 14px rgba(15,23,42,.10);
}

.fc .fc-timegrid-event-harness {
  margin-right: 4px !important;
}

.fc .fc-event-main {
  padding: 2px 4px !important;
}

.fc .fc-event-title {
  font-size: .88rem !important;
  line-height: 1.35 !important;
  font-weight: 700 !important;
  white-space: normal !important;
}

.fc .fc-event-time {
  font-size: .78rem !important;
  opacity: .9;
  margin-bottom: 4px;
}

.fc-daygrid-event {
  border-radius: 12px !important;
  padding: 5px 8px !important;
  min-height: 42px !important;
}

.fc .fc-toolbar-title {
  font-size: 1.45rem !important;
  font-weight: 800 !important;
  color: #172033;
}

.fc .fc-button {
  border-radius: 12px !important;
  border: none !important;
  background: #003c8f !important;
}

.fc .fc-button:hover {
  background: #0057d1 !important;
}

.fc .fc-scrollgrid {
  border-radius: 20px !important;
  overflow: hidden;
  border: 1px solid #dbe4f0 !important;
}


/* Navigation gruppiert */
.navbar .dropdown-menu {
  border: none;
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 18px 45px rgba(15,23,42,.18);
}

.navbar .dropdown-item {
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
}

.navbar .dropdown-item:hover {
  background: #eef4ff;
  color: #003c8f;
}

@media (max-width: 991px) {
  .navbar .dropdown-menu {
    box-shadow: none;
    border-radius: 12px;
    margin-top: 4px;
  }
}

/* Navbar immer über Karten/Modals-Vorstufen */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1040;
}

.navbar .dropdown-menu {
  z-index: 3000 !important;
}

main,
.card,
.dash-stat,
.event-detail-card {
  position: relative;
  z-index: 1;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.permission-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  font-weight: 700;
}

.permission-card:hover {
  background: #eef4ff;
}

.permission-card input {
  transform: scale(1.1);
}

.user-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.user-group-card {
  display: block;
  text-decoration: none;
  color: #172033;
  background: #fff;
  border: 1px solid #dbe4f0;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 10px 28px rgba(15,23,42,.06);
  transition: .18s ease;
}

.user-group-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(15,23,42,.1);
  border-color: #003c8f;
}

.user-group-card-top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.user-group-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #eef4ff;
  color: #003c8f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.user-group-card h4 {
  margin: 0 0 6px;
  font-weight: 900;
}

.user-group-card p {
  color: #64748b;
  margin: 0;
}

.user-group-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  color: #475569;
  font-weight: 800;
  font-size: .9rem;
}

.permission-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.permission-detail-card {
  display: flex;
  gap: 14px;
  background: #f8fafc;
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition: .15s ease;
}

.permission-detail-card:hover {
  background: #eef4ff;
}

.permission-detail-card input {
  margin-top: 5px;
  transform: scale(1.2);
}

.permission-detail-card b {
  display: block;
  color: #172033;
}

.permission-detail-card small {
  display: block;
  color: #64748b;
  margin-top: 2px;
}

.group-user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
}

.group-user-row:last-child {
  border-bottom: none;
}

/* Fix: Modals müssen klickbar über Overlay/Kalender liegen */








.fc,
.fc-view-harness,
.fc-scrollgrid,
.dashboard-event-card,
.dash-stat,
.card {
  z-index: auto !important;
}

/* Harte Modal-Klickbarkeit */








/* Event Modal sauber */
#createEventModal .modal-dialog,
#eventModal .modal-dialog {
  max-width: 1280px !important;
}

#createEventModal .modal-body,
#eventModal .modal-body {
  overflow-y: auto;
  max-height: calc(100vh - 180px);
}

#createEventModal .card,
#eventModal .card {
  border-radius: 20px;
}

/* Ressourcenmodal */
#resourceSelectionModal .modal-dialog {
  max-width: 1100px;
}

#resourceSelectionModal .modal-content {
  border-radius: 24px;
}



/* Event Modal Redesign */
.hv-event-modal .modal-body {
  background: #f4f7fb;
}

.hv-event-modal .modal-subtitle {
  font-size: .9rem;
  opacity: .85;
  margin-top: .15rem;
}

.event-section {
  background: #fff;
  border: 1px solid #d8e1ef;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
}

.event-section-title {
  font-weight: 800;
  color: #0b2d5f;
  margin-bottom: 14px;
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}


.resource-group-title {
  font-size: 1rem;
  font-weight: 800;
  color: #0b2d5f;
  margin: 20px 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid #d8e1ef;
}






/* CLEAN BOOTSTRAP MODAL STACK */
.modal {
  z-index: 1055 !important;
}

.modal.show {
  display: block !important;
}

.modal-backdrop,
.modal-backdrop.show {
  z-index: 1050 !important;
}

.modal-dialog {
  position: relative;
  z-index: 1056 !important;
}

.modal-content {
  position: relative;
  z-index: 1057 !important;
}


/* FINAL: Backdrop komplett deaktivieren */
.modal-backdrop,
.modal-backdrop.show,
div.modal-backdrop.fade.show {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.modal,
.modal.show {
  z-index: 99999 !important;
  pointer-events: auto !important;
}

.modal-dialog,
.modal-content,
.modal * {
  pointer-events: auto !important;
}

body.modal-open {
  overflow: auto !important;
  padding-right: 0 !important;
}

