body {
  padding-top: 4.5rem;
}

:root {
  --tvg-red: #9a141b;
  --tvg-red-dark: #741016;
  --tvg-dark: #1f1f1f;
  --tvg-bg: #f4f4f4;
  --tvg-text: #202020;
  --tvg-white: #ffffff;
}

body.tvg-theme {
  color: var(--tvg-text);
  background: linear-gradient(180deg, #f9f9f9 0%, #f2f2f2 100%);
}

.tvg-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  background: var(--tvg-dark);
  color: var(--tvg-white);
  text-align: center;
  font-size: 0.92rem;
  padding: 0.3rem 1rem;
  letter-spacing: 0.01em;
}

.tvg-navbar {
  top: 2rem;
  background: linear-gradient(135deg, #ad1a22 0%, var(--tvg-red) 55%, #7f1017 100%);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.tvg-navbar .navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}

.tvg-logo {
  height: 36px;
  width: auto;
  display: block;
}

.tvg-main {
  margin-top: 2rem;
}

.tvg-content {
  border: 1px solid #ececec;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
  background: var(--tvg-white);
}

/* Neuer Protokoll-Abschnitt: kurze grüne Highlight-Animation */
@keyframes abschnitt-highlight {
  0%   { box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.55); background-color: rgba(25, 135, 84, 0.08); }
  100% { box-shadow: none; background-color: transparent; }
}
.abschnitt-new {
  animation: abschnitt-highlight 2.5s ease-out forwards;
  border-radius: 4px;
}

/* Mobile Optimierung: Mehr Platz nutzen */
@media (max-width: 767px) {
  .container {
    padding-left: 10px;
    padding-right: 10px;
    max-width: 100%;
  }
  
  body {
    padding-top: 5.4rem;
  }

  .tvg-topbar {
    font-size: 0.84rem;
    padding: 0.25rem 0.5rem;
  }

  .tvg-navbar {
    top: 1.75rem;
  }

  .tvg-main {
    margin-top: 1.7rem;
  }
}

.starter-template {
  padding: 3rem 1.5rem;
  text-align: center;
}

.btn-navbar {
  background-color: #9a141b;
  color: white;
  border: none;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.btn-navbar:hover {
  background-color: #7a0f15; /* dunkleres Rot */
  color: white;
}

.navbar-custom {
  background-color: #9a141b;
}

/* Damit dropdown-toggle in btn-navbar auch den Pfeil zeigt */
.btn-navbar.dropdown-toggle::after {
  display: inline-block;
  margin-left: 0.255em;
  vertical-align: 0.255em;
  content: "";
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-bottom: 0;
  border-left: 0.3em solid transparent;
}

/* Mobile Optimierung für Formulare und Cards */
@media (max-width: 767px) {
  .card {
    margin-left: 0;
    margin-right: 0;
  }
  
  .form-control, .btn {
    font-size: 16px; /* Verhindert Auto-Zoom auf iOS */
  }
  
  .jumbotron {
    padding: 1.5rem 0.5rem;
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  .lead {
    font-size: 1rem;
  }
  
  /* Navbar auf mobil kompakter */
  .navbar-brand {
    font-size: 1.1rem;
  }
  
  /* Tables responsive ohne horizontales Scrollen */
  .table-responsive {
    border: 0;
  }
  
  /* Buttons in voller Breite auf mobil */
  .btn-group-vertical {
    width: 100%;
  }
}

.programmpunkt-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.programmpunkt-item {
  padding: 6px 8px;
  border: 1px solid #dcdcdc;
  border-radius: 6px;
  background: #f8f9fa;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  -webkit-user-drag: element;
}

.programmpunkt-item span {
  pointer-events: none;
}

.programmpunkt-item.assigned {
  opacity: 0.6;
  cursor: not-allowed;
}

.zeitabschnitt-cell {
  vertical-align: top;
  min-width: 180px;
}

.zeitabschnitt-cell.drop-hover {
  background-color: #f1f8f4;
}

.assigned-list {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.assigned-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  border: 1px dashed #cbd5d1;
  border-radius: 4px;
  background: #ffffff;
}

.cell-placeholder {
  color: #888;
  font-size: 0.85em;
  margin-top: 6px;
}

.btn-tvg {
  background: var(--tvg-red);
  color: #fff;
  border: 1px solid var(--tvg-red);
}

.btn-tvg:hover,
.btn-tvg:focus,
.btn-tvg:active,
.btn-check:checked + .btn-tvg,
.btn-tvg.show {
  background: var(--tvg-red-dark);
  border-color: var(--tvg-red-dark);
  color: #fff;
  box-shadow: none;
}

.user-area {
  max-width: 1200px;
}

.user-hero {
  background: radial-gradient(circle at top right, #bf2831 0%, var(--tvg-red) 45%, #5f0d11 100%);
  color: #fff;
  border-radius: 12px;
  padding: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.user-hero .text-muted {
  color: rgba(255, 255, 255, 0.9) !important;
}

.stat-card {
  border: 1px solid #ececec;
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6d6d6d;
}

.stat-value {
  font-size: 1.95rem;
  line-height: 1;
  font-weight: 700;
  color: #3b0b0e;
}

.dashboard-subtitle {
  font-size: 0.82rem;
  color: #7a7a7a;
}

.dashboard-tile-link {
  display: block;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.dashboard-tile {
  height: 100%;
  border: 1px solid #e6d9da;
  border-left: 6px solid var(--tvg-red);
  border-radius: 10px;
  background: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.dashboard-tile--compact .card-body {
  padding: 0;
}

.dashboard-tile-inner {
  padding: 0.55rem 0.75rem;
}

.dashboard-tile--compact,
.runner-card .dashboard-tile-link {
  height: auto !important;
}

.dashboard-tile--compact .stat-label {
  font-size: 0.68rem;
  margin-bottom: 0.1rem !important;
}

.dashboard-tile--compact .stat-value {
  font-size: 1.05rem;
  line-height: 1.05;
}

.dashboard-tile--compact .tile-badge {
  min-width: 28px;
  height: 28px;
  font-size: 0.78rem;
}

.dashboard-tile--runner {
  border-left-color: var(--tvg-red);
}

.dashboard-tile--dispenser {
  border-left-color: var(--tvg-dark);
}

.tile-badge {
  min-width: 42px;
  height: 42px;
  padding: 0 0.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--tvg-red);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}

.dashboard-tile--dispenser .tile-badge {
  background: var(--tvg-dark);
}

.dashboard-tile-link:hover .dashboard-tile,
.dashboard-tile-link:focus .dashboard-tile,
.dashboard-tile-link:focus-visible .dashboard-tile {
  transform: translateY(-2px);
  border-color: #c9a0a2;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.dashboard-tile-link:focus,
.dashboard-tile-link:focus-visible {
  outline: none;
}

.runner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.runner-card {
  border: 1px solid #e7e7e7;
}

.empty-state {
  border: 1px dashed #d4d4d4;
}

@media (max-width: 767px) {
  .user-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-hero .btn,
  .runner-card .btn {
    min-height: 44px;
  }
}

/* Sortierbare Tabellenspalten (event-users) */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable::after { content: ''; margin-left: 0.3em; opacity: 0.3; }
th.sort-asc::after  { content: '▲'; opacity: 1; }
th.sort-desc::after { content: '▼'; opacity: 1; }

