body {
  font-family: Arial, Helvetica, sans-serif;
  background: #f5f6f8;
  color: #222;
  margin: 0;
}
header {
  background: #b03a48;
  color: #fff;
  padding: 18px 24px;
}
header a {
  color: #fff;
  text-decoration: none;
  margin-right: 14px;
}
.container {
  max-width: 1400px;
  margin: 24px auto;
  padding: 0 16px;
}
.card {
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
label {
  display: block;
  margin: 10px 0 6px;
  font-weight: bold;
}
input, select, textarea, button {
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  border: 1px solid #c7cbd1;
  border-radius: 6px;
  font: inherit;
}
textarea {
  min-height: 90px;
}
button, .button {
  display: inline-block;
  width: auto;
  background: #b03a48;
  color: #fff;
  border: none;
  text-decoration: none;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 6px;
  margin-right: 8px;
}
.button.secondary {
  background: #6b7280;
}
.button.danger {
  background: #b42318;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}
.stat-value {
  font-size: 28px;
  font-weight: bold;
  margin-top: 8px;
}
.flash-success, .flash-error {
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.flash-success {
  background: #dcfce7;
  color: #166534;
}
.flash-error {
  background: #fee2e2;
  color: #991b1b;
}
.muted {
  color: #6b7280;
  font-size: 0.95rem;
}
.inactive {
  font-style: italic;
  color: #6b7280;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.actions-cell {
  white-space: nowrap;
}
.compact-stat .stat-value {
  font-size: 22px;
}


.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.header-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.header-user {
  margin-left: 0;
}

.header-logo-wrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.header-logo {
  height: 72px;
  width: auto;
  display: block;
}

@media (max-width: 700px) {
  .header-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-logo {
    height: 56px;
  }
}


/* --- TuS Design Anpassung --- */
body {
  background: #f4f7fb;
  font-family: Arial, sans-serif;
}

header {
  background: #b03a48;
  color: white;
  padding: 15px 20px;
}

nav a {
  color: white;
  margin-right: 15px;
  text-decoration: none;
  font-weight: bold;
}

.container {
  max-width: 1400px;
  margin: 20px auto;
}

.card {
  background: white;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

h2, h3 {
  color: #b03a48;
}

button {
  background: #b03a48;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
}

button:hover {
  opacity: 0.9;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  background: #e6eef9;
  text-align: left;
  padding: 8px;
}

table td {
  padding: 8px;
  border-bottom: 1px solid #eee;
}


.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: bold;
}

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

.status-warning {
  background: #fef3c7;
  color: #92400e;
}

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

.status-neutral {
  background: #e5e7eb;
  color: #374151;
}

.status-neutral {
  background: #e5e7eb;
  color: #374151;
}
.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.plain-list {
  margin: 0;
  padding-left: 18px;
}
.plain-list li {
  margin-bottom: 8px;
}


.welcome-card {
  text-align: center;
  padding: 40px;
}

.welcome-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.welcome-logo {
  height: 92px;
  width: auto;
  display: block;
}


.site-title strong {
  font-size: 2.05rem;
  line-height: 1.15;
}

.system-title {
  font-size: 1.15rem;
  line-height: 1.25;
  opacity: 0.97;
}

.system-title strong {
  font-size: 1.15rem;
  font-weight: 700;
}

.system-user {
  font-size: 0.9em;
  font-weight: 400;
}

.welcome-card h2 {
  margin-top: 0;
  line-height: 1.3;
}


.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: bold;
}

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

.status-offline {
  background: #e5e7eb;
  color: #374151;
}

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


.traffic-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.traffic-red {
  background: #dc2626;
}

.traffic-yellow {
  background: #f59e0b;
}

.traffic-green {
  background: #16a34a;
}

.overview-row.traffic-red td {
  background: #fef2f2;
}

.overview-row.traffic-yellow td {
  background: #fffbeb;
}

.overview-row.traffic-green td {
  background: #f0fdf4;
}


.pf11-warning {
  background: #fee2e2;
  border: 1px solid #b42318;
  color: #991b1b;
  padding: 12px 14px;
  border-radius: 6px;
  margin: 12px 0;
  font-weight: bold;
}

.pf11-warning-inline {
  display: inline-block;
  background: #b42318;
  color: #fff;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: bold;
  font-size: 0.9rem;
}

.stats-tabbar {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:16px 0;
}

.stats-tab {
  display:inline-block;
  padding:10px 14px;
  border-radius:8px;
  background:#eef2f7;
  color:#123;
  text-decoration:none;
  font-weight:600;
}

.stats-tab.active {
  background:#0b4f7a;
  color:#fff;
}

.stats-kpi-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
  gap:12px;
  margin:12px 0;
}

.stats-kpi-card {
  min-height:88px;
}

.stats-kpi-value {
  font-size:26px;
  font-weight:700;
  margin-top:8px;
}

.stats-table td,
.stats-table th {
  white-space:nowrap;
}

.stats-table .summary-row td {
  background:#f4f7fa;
}


.button.success {
  background: #14833b;
  color: #fff;
}
.button.success:hover {
  opacity: 0.92;
}
nav a.admin-green-link {
  color: #a6f3b9;
}
nav a.admin-green-link:hover {
  color: #d6ffe0;
}
.locked-quarter-row td {
  background: #fef2f2;
}


header { color: #f0f0f0 !important; }


nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

nav a {
  margin-right: 0;
}

.nav-group {
  position: relative;
  display: inline-block;
}

.nav-group summary {
  list-style: none;
  cursor: pointer;
  color: #fff;
  text-decoration: none;
  padding: 0;
  margin: 0;
  font: inherit;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary::after {
  content: " ▾";
  font-size: 0.9em;
}

.nav-group[open] .nav-group-menu {
  display: block;
}

.nav-group-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 210px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  padding: 8px;
  z-index: 1000;
}

.nav-group-menu a {
  display: block;
  color: #222;
  padding: 10px 12px;
  border-radius: 6px;
  text-decoration: none;
}

.nav-group-menu a:hover {
  background: #f3f4f6;
}


.nav-group-note {
  color: #9aa0a6;
  font-size: 0.9em;
  padding: 8px 12px 4px 12px;
  font-style: italic;
  cursor: default;
}


.button-link {
  display: inline-block;
  padding: 10px 16px;
  background: #1f4e79;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
}

.button-link:hover {
  opacity: 0.92;
}


.ki-hilfe-box {
  background: #f7f9fc;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  padding: 18px;
  line-height: 1.6;
}

.ki-hilfe-box ul {
  margin-top: 10px;
  margin-bottom: 10px;
}

.flash-warning {
    padding: 10px 16px;
    border-radius: 6px;
    margin: 8px 0;
    font-weight: bold;
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #f9a825;
}

/* 26-103-test: Online-Anzeige im roten Header */
.online-header-status {
  margin-left: auto;
  margin-right: 18px;
  max-width: 52%;
  font-size: 12px;
  line-height: 1.35;
  color: #ffffff;
  text-align: right;
  align-self: center;
  white-space: normal;
}

.online-header-status .online-block {
  display: block;
  margin: 2px 0;
}

.online-header-status .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  margin-right: 5px;
  vertical-align: middle;
}

.online-header-status .dot.green {
  background: #23c552;
}

.online-header-status .dot.yellow {
  background: #ffd54f;
}

.online-header-status .online-sep {
  opacity: 0.75;
}

.online-header-status .online-more,
.online-header-status .online-header-muted,
.online-header-status .online-header-none {
  opacity: 0.85;
}

@media (max-width: 900px) {
  .online-header-status {
    max-width: 100%;
    margin: 8px 0 0 0;
    text-align: left;
    order: 3;
    flex-basis: 100%;
  }
}


/* 26-103-test Feinjustierung: Online-Anzeige rechtsbündig vor festem Logo */
.header-top {
  position: relative;
  min-height: 72px;
}

.header-logo {
  position: absolute !important;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
}

.online-header-status {
  position: absolute;
  right: 105px;
  top: 50%;
  transform: translateY(-50%);
  width: 75ch;
  max-width: calc(100% - 360px);
  margin: 0;
  text-align: right;
  font-size: 12px;
  line-height: 1.35;
  z-index: 2;
}

.online-header-status .online-block {
  display: block;
  white-space: normal;
}

.online-header-status strong {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .header-top {
    min-height: 96px;
  }

  .header-logo {
    right: 18px;
    top: 24px;
    transform: none;
  }

  .online-header-status {
    position: static;
    transform: none;
    width: auto;
    max-width: 100%;
    margin-top: 8px;
    text-align: left;
  }
}


/* 26-104: dauerhafte blinkende Bankdaten-Warnung */
.bankdaten-warning-banner {
  background: #b00020;
  color: #ffffff;
  padding: 10px 18px;
  text-align: center;
  font-weight: 800;
  border-bottom: 2px solid #7a0016;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.bankdaten-warning-banner a {
  color: #ffffff;
  text-decoration: underline;
  margin-left: 10px;
  white-space: nowrap;
  font-weight: 800;
}

.bankdaten-warning-banner::before {
  content: "⚠ ";
}

@keyframes bankdatenHardBlink {
  0% {
    background: #8b0018;
    outline: 4px solid #ffcc00;
    box-shadow: 0 0 0 0 rgba(255,204,0,0.0);
  }
  50% {
    background: #ff0033;
    outline: 4px solid #ffffff;
    box-shadow: 0 0 0 6px rgba(255,204,0,0.45);
  }
  100% {
    background: #8b0018;
    outline: 4px solid #ffcc00;
    box-shadow: 0 0 0 0 rgba(255,204,0,0.0);
  }
}

.bankdaten-warning-banner {
  animation: bankdatenHardBlink 0.85s linear infinite !important;
}

@media (max-width: 700px) {
  .bankdaten-warning-banner {
    text-align: left;
    line-height: 1.4;
  }

  .bankdaten-warning-banner a {
    display: block;
    margin-left: 0;
    margin-top: 4px;
  }
}

/* Wappen-Wasserzeichen auf leeren Rahmenseiten (Login, Trainingsplan,
   Auslagen, KI-Hilfe). Fest im Fenster zentriert, sehr blass, liegt HINTER
   allem und faengt keine Klicks ab. Nur aktiv, wenn <body class="hat-wappen">. */
body.hat-wappen::before {
  content: "";
  position: fixed;
  left: 50%;
  top: 55%;
  width: min(46vw, 520px);
  height: min(46vw, 520px);
  transform: translate(-50%, -50%);
  background: url("/static/logo_tus.png") center/contain no-repeat;
  opacity: 0.05;
  filter: grayscale(30%);
  pointer-events: none;
  z-index: 0;
}
/* Inhalt bleibt ueber dem Wappen */
body.hat-wappen .container { position: relative; z-index: 1; }

/* ipv64-Abschaltungs-Hinweisbalken (vollbreit oben, vor dem Header) */
.ipv64-hinweis {
  background: #fff3cd;
  color: #664d03;
  border-bottom: 2px solid #e0a526;
  padding: 10px 16px;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}
.ipv64-hinweis.ipv64-rot {
  background: #f8d7da;
  color: #842029;
  border-bottom-color: #b02a37;
}
.ipv64-hinweis a { color: inherit; text-decoration: underline; }
.ipv64-knopf {
  display: inline-block;
  margin: 8px 8px 0;
  padding: 8px 16px;
  background: #2e7d32;
  color: #ffffff !important;
  text-decoration: none !important;
  border-radius: 6px;
  font-weight: bold;
}
.ipv64-klein { display: block; margin-top: 6px; font-size: 12px; opacity: 0.85; }
@media (max-width: 600px) {
  .ipv64-hinweis { font-size: 13px; padding: 8px 12px; }
  .ipv64-knopf { display: block; margin: 8px auto 0; max-width: 260px; }
}

/* Abrechnungssperre (fehlende UL-Erklaerung): Zeile in der Uebersicht kraeftig rot,
   uebertuencht die Ampel-Farblogik. */
tr.overview-row.trainer-gesperrt > td {
  background: #d32f2f !important;
  color: #ffffff !important;
  font-weight: bold !important;
}
tr.overview-row.trainer-gesperrt > td a {
  color: #ffffff !important;
  text-decoration: underline !important;
}
tr.overview-row.trainer-gesperrt .traffic-dot {
  background: #ffffff !important;
}
tr.overview-row.trainer-gesperrt .status-badge {
  background: #fff !important;
  color: #b02a37 !important;
}
.gesperrt-badge {
  display: inline-block;
  background: #b02a37;
  color: #fff;
  font-size: 0.78em;
  font-weight: bold;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 6px;
  white-space: nowrap;
}
