/* ============================================
   TRAININGSBUCH – Modern Mobile-First CSS
   Akzente: Königsblau #1A3FA0 + Grelles Grün #39FF14
   ============================================ */

/* ============================================
   CSS VARIABLEN
   ============================================ */
:root {
  /* Hauptfarben */
  --royal-blue:      #1A3FA0;
  --royal-blue-dark: #122d78;
  --royal-blue-mid:  #2954c8;
  --royal-blue-soft: #e8eeff;

  --green:           #39FF14;
  --green-dark:      #28cc0e;
  --green-soft:      #efffea;

  /* Neutrale Töne */
  --white:           #ffffff;
  --bg:              #f4f6fb;
  --surface:         #ffffff;
  --surface-2:       #f0f3fa;
  --border:          #dde3f0;
  --border-focus:    #1A3FA0;

  --text-primary:    #0f1d3a;
  --text-secondary:  #4a5578;
  --text-muted:      #8a93b0;

  /* Feedback */
  --success-bg:      #efffea;
  --success-text:    #1a6b0a;
  --success-border:  #39FF14;
  
  --error-bg:        #fff0f0;
  --error-text:      #8b0000;
  --error-border:    #ff4444;
  
  --warning-bg:      #fff8e1;
  --warning-text:    #8a5a00;
  --warning-border:  #ff9800;

  /* Abstände & Radien */
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-xl:   28px;

  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;

  /* Schatten */
  --shadow-sm:  0 2px 8px rgba(26,63,160,0.08);
  --shadow-md:  0 4px 20px rgba(26,63,160,0.12);
  --shadow-lg:  0 8px 40px rgba(26,63,160,0.16);
  --shadow-card: 0 2px 12px rgba(26,63,160,0.10), 0 1px 3px rgba(0,0,0,0.04);

  /* Typografie */
  --font-display: 'Outfit', sans-serif;
  --font-body:    'DM Sans', sans-serif;
}

/* ============================================
   DARK MODE VARIABLEN
   ============================================ */

html.dark {
  
  --royal-blue:      #6b95ff;
  --royal-blue-dark: #4668c7;
  --royal-blue-mid:  #86aaff;
  --royal-blue-soft: #26365f;

  --green:           #63e84f;
  --green-dark:      #35c92a;
  --green-soft:      #17351d;

  --white:           #f8fafc;

  --bg:              #111827;
  --surface:         #1b2433;
  --surface-2:       #243044;

  --border:          #394861;
  --border-focus:    #6b95ff;

  --text-primary:    #f1f5f9;
  --text-secondary:  #c4cee0;
  --text-muted:      #94a3b8;

  --success-bg:      #12351a;
  --success-text:    #8bea7c;
  --success-border:  #63e84f;

  --error-bg:        #3a1d23;
  --error-text:      #ff9b9b;
  --error-border:    #ff5555;
  
  --warning-bg:      #3a2a12;
  --warning-text:    #ffc266;
  --warning-border:  #ff9800;

  --shadow-sm:       0 2px 8px rgba(0,0,0,.45);
  --shadow-md:       0 4px 20px rgba(0,0,0,.55);
  --shadow-lg:       0 8px 40px rgba(0,0,0,.65);
  --shadow-card:     0 2px 12px rgba(0,0,0,.55),
                     0 1px 3px rgba(0,0,0,.35);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: light dark;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  padding: var(--space-md) var(--space-sm);
  line-height: 1.6;
}

/* ============================================
   LAYOUT CONTAINER
   ============================================ */
.container,
.form-box,
center > div,
#menu,
.section,
#loginForm {
  width: 100%;
  max-width: 620px;
  margin: 0 auto var(--space-lg);
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}

/* ============================================
   TYPOGRAFIE
   ============================================ */
h1 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: 700;
  color: var(--royal-blue);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
  line-height: 1.2;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 4vw, 1.4rem);
  font-weight: 600;
  color: var(--text-primary);
  margin: var(--space-lg) 0 var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--royal-blue-soft);
  position: relative;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--green);
  border-radius: 2px;
}

h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--royal-blue);
  margin: var(--space-md) 0 var(--space-sm);
}

p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: var(--space-sm);
}

/* ============================================
   BUTTONS
   ============================================ */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 12px 20px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  background: var(--royal-blue);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(26,63,160,0.25);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:hover,
.btn:hover {
  background: var(--royal-blue-mid);
  box-shadow: 0 4px 16px rgba(26,63,160,0.35);
  transform: translateY(-1px);
}

button:active,
.btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(26,63,160,0.2);
}

/* Primär-Button (Grün) */
button[type="submit"],
button[name="submit_ergebnisse"],
button[name="login"],
.btn-primary {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%);
  color: var(--text-primary);
  box-shadow: 0 2px 10px rgba(57,255,20,0.3);
}

button[type="submit"]:hover,
button[name="submit_ergebnisse"]:hover,
button[name="login"]:hover,
.btn-primary:hover {
  box-shadow: 0 4px 18px rgba(57,255,20,0.45);
  transform: translateY(-1px);
}

/* Back-Button */
.backBtn {
  background: var(--surface-2);
  color: var(--royal-blue);
  border: 1.5px solid var(--border);
  box-shadow: none;
}

.backBtn:hover {
  background: var(--royal-blue-soft);
  border-color: var(--royal-blue);
  box-shadow: none;
}

/* Kleine Hilfs-Buttons (GPS, Wetter) */
#getLocationBtn,
#getWeatherBtn,
button[type="button"]:not(#editModeBtn):not(.backBtn):not(.edit-btn):not(.delete-btn) {
  padding: 8px 14px;
  font-size: 0.85rem;
  background: var(--royal-blue-soft);
  color: var(--royal-blue);
  border: 1.5px solid var(--royal-blue);
  box-shadow: none;
  margin-top: var(--space-xs);
}

#getLocationBtn:hover,
#getWeatherBtn:hover,
button[type="button"]:not(#editModeBtn):not(.backBtn):hover {
  background: var(--royal-blue);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(26,63,160,0.25);
}

/* Edit-Mode Button */
#editModeBtn {
  background: transparent;
  color: var(--royal-blue);
  border: 2px solid var(--royal-blue);
  box-shadow: none;
}

#editModeBtn:hover {
  background: var(--royal-blue);
  color: var(--white);
}

/* Button-Gruppe oben */
.form-box > button,
body > center > div > button {
  margin: 0 var(--space-xs) var(--space-sm) 0;
}

/* ============================================
   Benachrichtigungsbox
   ============================================ */

.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;

    display: flex;
    justify-content: center;
    align-items: center;
}

.notification-box {
    background: var(--surface);
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    text-align: left;
    box-sizing: border-box;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

/* ============================================
   TABELLEN IN FORM-BOX IMMER SCROLLBAR + STICKY HEADER
   ============================================ */
.form-box {
  overflow: hidden;
}

.table-container {
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-height: 450px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin: var(--space-md) 0 var(--space-lg);
}

.table-container table {
  display: table;
  width: auto;
  min-width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.table-container th,
.table-container td {
  white-space: nowrap;
  padding: 10px 14px;
  vertical-align: middle;
}

.table-container thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--royal-blue);
  color: var(--white);
  box-shadow: 0 2px 4px rgba(26,63,160,0.2);
}

/* ============================================
   NAVIGATIONS-BUTTONS (index.php)
   ============================================ */
#menu button,
.menu button {
  width: 100%;
  margin: var(--space-xs) 0;
  padding: 14px 20px;
  font-size: 1rem;
  text-align: left;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  box-shadow: none;
  transition: all 0.2s;
}

#menu button:hover,
.menu button:hover {
  background: var(--royal-blue-soft);
  border-color: var(--royal-blue);
  color: var(--royal-blue);
  transform: translateX(4px);
  box-shadow: none;
}

/* ============================================
   FORMULAR-ELEMENTE
   ============================================ */
label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  margin-top: var(--space-xs);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  border-color: var(--royal-blue);
  box-shadow: 0 0 0 3px rgba(26,63,160,0.12);
  background: var(--surface);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231A3FA0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--royal-blue);
  cursor: pointer;
  margin-right: var(--space-xs);
  vertical-align: middle;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 1rem 0;
}

.checkbox-row .form-check-input {
    margin: 0;
    flex-shrink: 0;
}

.checkbox-row .form-check-label {
    margin: 0;
    line-height: 1.2;
}und vor 

/* Checkbox-Label inline */
label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  margin-top: var(--space-sm);
}

/* ============================================
   NACHRICHTEN / ALERTS
   ============================================ */
.message,
.alert-success {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: var(--space-md);
  border-left: 4px solid;
}

.message.success,
.success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: var(--green-dark);
}

.message.error,
.error {
  background: var(--error-bg);
  color: var(--error-text);
  border-color: #ff4444;
}

/* ============================================
   TABELLE
   ============================================ */
.table-container,
.table-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 600px;
  -webkit-overflow-scrolling: touch;
  margin-top: var(--space-md);
  margin-bottom: var(--space-xl);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

th {
  background: var(--royal-blue);
  color: var(--white);
  padding: 12px 14px;
  text-align: left;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

th:first-child { border-radius: var(--radius-sm) 0 0 0; }
th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--royal-blue-soft);
}

tr.ergebnis-row:nth-child(even) td {
  background: var(--surface-2);
}

tr.ergebnis-row:nth-child(even):hover td {
  background: var(--royal-blue-soft);
}

/* Aktions-Spalte */
.action-col {
  white-space: nowrap;
  min-width: 120px;
}

.action-col button,
.details-btn,
.edit-btn,
.delete-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  margin: 2px;
  box-shadow: none;
  text-decoration: none;
}

.details-btn {
  background: var(--royal-blue-soft);
  color: var(--royal-blue);
  border: 1px solid var(--royal-blue);
}

.details-btn:hover {
  background: var(--royal-blue);
  color: var(--white);
  transform: none;
}

.edit-btn {
  background: var(--green-soft);
  color: var(--green-dark);
  border: 1px solid var(--green-dark);
}

.edit-btn:hover {
  background: var(--green-dark);
  color: var(--white);
  transform: none;
}

.delete-btn {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid #ffaaaa;
}

.delete-btn:hover {
  background: #ff4444;
  color: var(--white);
  transform: none;
}

.edit-delete-buttons {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* ============================================
   OVERLAY / MODAL
   ============================================ */
#overlay,
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(10, 20, 50, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: var(--space-md);
}

#overlay-content,
.modal-content {
  position: relative;
  background: var(--surface);
  padding: var(--space-xl);
  border-radius: var(--radius-xl);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

#overlay-content h3 {
  margin-top: 0;
  font-size: 1.1rem;
  color: var(--royal-blue);
}

#overlay-content .close-btn {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
    border: none; background: var(--royal-blue-mid); color: white;
    font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; line-height: 1;
}

#overlay-content .close-btn:hover {
  color: #ff4444;
  background: var(--error-bg);
}

#overlay-content p {
  font-size: 0.9rem;
  margin-bottom: 6px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: var(--space-sm);
}

#overlay-content p:last-child {
  border-bottom: none;
}

#overlay-content p strong {
  color: var(--text-secondary);
  min-width: 140px;
  flex-shrink: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#overlay-content hr {
  border: none;
  border-top: 2px solid var(--royal-blue-soft);
  margin: var(--space-md) 0;
}

.modal-buttons {
  margin-top: var(--space-lg);
  display: flex;
  justify-content: center;
  gap: var(--space-md);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  box-shadow: none;
}

.btn-secondary:hover {
  background: var(--border);
}

.hidden-view {
    display:none;
}

.clickable-name {
    cursor:pointer;
    font-weight:bold;
}

/* ============================================
   HIDDEN FORM
   ============================================ */
.hidden-form {
  display: none;
}

/* Eingetragenes Formular-Layout */
#ergebnisseForm {
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-top: var(--space-lg);
  border: 1px solid var(--border);
}

/* ============================================
   LOGIN BOX
   ============================================ */
.login-box,
#loginForm {
  max-width: 400px;
  margin: var(--space-xl) auto;
}

#loginForm h1 {
  text-align: center;
  margin-bottom: var(--space-lg);
}

/* ============================================
   ABSCHNITTE (index.php)
   ============================================ */
.menu,
.section {
  background: var(--surface);
  padding: var(--space-lg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}

.section {
  display: none;
}

.section.active {
    display: block;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.tab {
    flex: 1;
    padding: 10px 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    background: var(--surface-2);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* Hover = deutlich interaktiver */
.tab:hover {
    background: var(--royal-blue-soft);
    border-color: #bbb;
}

.tab-button-active {
    background: var(--green);
    border-color: var(--border);
    font-weight: 600;
}

/* AKTIVER TAB */
.tab.active {
    background: #1A3FA0;
    color: #fff;
    border-color: #1A3FA0;
    box-shadow: 0 3px 10px rgba(26, 63, 160, 0.25);
}

/* kleine optische Trennung im Inhalt */
.tab-content {
    flex: 1;
    overflow-y: auto;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ============================================
   LADEN-INDIKATOREN
   ============================================ */
#loading {
  text-align: center;
  color: var(--text-muted);
  padding: var(--space-md);
  font-size: 0.9rem;
}

#loading::before {
  content: '⟳ ';
  animation: spin 1s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#noMore {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: var(--space-md);
}

/* ============================================
   RESPONSIVE – TABLET (≥ 600px)
   ============================================ */
@media (min-width: 600px) {
  body {
    padding: var(--space-xl) var(--space-lg);
  }

  .container,
  .form-box,
  center > div,
  #menu,
  .section {
    padding: var(--space-xl);
  }

  /* Zwei-Spalten für Formular-Felder */
  .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 var(--space-md);
  }

  .form-grid .full-width {
    grid-column: 1 / -1;
  }
}

/* ============================================
   RESPONSIVE – DESKTOP (≥ 900px)
   ============================================ */
@media (min-width: 900px) {
  body {
    padding: var(--space-2xl) var(--space-xl);
  }

  .container,
  .form-box,
  center > div,
  #menu,
  .section {
    max-width: 1080px;
    padding: var(--space-2xl);
    border-radius: var(--radius-xl);
  }

  #menu button,
  .menu button {
    display: inline-flex;
    width: auto;
    margin: 0 var(--space-xs) var(--space-sm) 0;
  }

  .table-container {
    max-height: 700px;
  }

  textarea {
    min-height: 120px;
  }

  #overlay-content,
  .modal-content {
    max-width: 680px;
  }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--surface-2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: var(--royal-blue-mid);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--royal-blue);
}

/* ============================================
   UTILITY
   ============================================ */
.positive { color: #1a6b0a; font-weight: 600; }
.negative { color: #8b0000; font-weight: 600; }

.clickable {
  cursor: pointer;
  transition: background 0.15s;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-md) 0;
}

/* ============================================
   TOUCH-OPTIMIERUNGEN
   ============================================ */
@media (hover: none) and (pointer: coarse) {
  button,
  .btn {
    min-height: 48px;
    min-width: 48px;
    margin-top: 10px;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px; /* verhindert Auto-Zoom auf iOS */
    padding: 14px;
  }

  button:hover {
    transform: none;
  }
}

/* =========================
   Footer
========================= */
.menu-footer {
    margin-top: 32px;
    padding: 16px 20px 12px;
    border-top: 1px solid rgba(26, 63, 160, 0.15);
    font-size: 0.82rem;
    color: var(--text-muted, #888);
    line-height: 1.8;
}

.menu-footer a {
    font-weight: 700;
    color: var(--royal-blue, #1A3FA0);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

.menu-footer a:hover {
    color: var(--green-dark, #28a80e);
}

.menu-footer small {
    display: block;
    margin-top: 4px;
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

/* ============================================
   MESSAGES (global – fehlt in style.css)
   ============================================ */
.message {
    padding: 10px 14px;
    margin-bottom: var(--space-md);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
}
.message.success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}
.message.error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
}


/* ============================================
   TABELLEN (global – fehlt in style.css)
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--space-md);
    font-size: 0.9rem;
}
table, th, td {
    border: 1px solid var(--border);
}
th, td {
    padding: 8px 12px;
    text-align: left;
    vertical-align: middle;
}
thead th {
    background: var(--royal-blue);
    color: var(--white);
    font-family: var(--font-display);
    font-weight: 600;
}


/* ============================================
   EDIT-MODUS BUTTONS (global)
   ============================================ */
.edit-delete-buttons {
    display: none;
    gap: 6px;
    flex-wrap: wrap;
}
.action-col, .action-buttons {
    white-space: nowrap;
}
.edit-btn {
    background: var(--royal-blue-soft);
    color: var(--royal-blue);
    border: 1.5px solid var(--royal-blue);
    font-size: 0.82rem;
    padding: 5px 10px;
}
.delete-btn {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1.5px solid var(--error-border);
    font-size: 0.82rem;
    padding: 5px 10px;
}
.edit-btn:hover  { background: var(--royal-blue); color: var(--white); }
.delete-btn:hover { background: #ff4444; color: var(--white); }


/* ============================================
   ADMIN.PHP
   ============================================ */
.badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}
.badge-active   { background: var(--success-bg); color: var(--success-text); }
.badge-inactive { background: var(--error-bg);   color: var(--error-text);   }
.badge-perm     { background: var(--royal-blue-soft); color: var(--royal-blue); }

#userOverlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
#userOverlayBox {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    max-width: 480px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}
.overlay-close-x {
    position: absolute; right: 14px; top: 14px;
    width: 34px; height: 34px; border-radius: 50%;
    border: none;
    font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.perm-checkboxes {
    display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px;
}
.perm-checkboxes label {
    display: flex; align-items: center; gap: 5px; font-weight: 400;
}


/* ============================================
   HILFE.PHP
   ============================================ */
.hilfe-toc {
    background: var(--royal-blue-soft);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: var(--space-lg);
    font-size: 0.88rem;
}
.hilfe-toc a {
    color: var(--royal-blue);
    text-decoration: none;
    display: block;
    padding: 3px 0;
}
.hilfe-toc a:hover { text-decoration: underline; }

.hilfe-topic {
    border-top: 2px solid var(--royal-blue-soft);
    padding-top: var(--space-lg);
    margin-top: var(--space-lg);
}
.hilfe-topic h2 {
    color: var(--royal-blue);
    font-size: 1.1rem;
    margin: 0 0 10px;
}
.hilfe-topic h3 {
    color: var(--text-primary);
    font-size: 0.97rem;
    margin: var(--space-md) 0 6px;
    border-left: 3px solid var(--royal-blue);
    padding-left: 8px;
}
.hilfe-topic p,
.hilfe-topic li {
    font-size: 0.92rem;
    line-height: 1.75;
    color:var(--text-secondary);
    margin: 0 0 6px;
}
.hilfe-topic ul {
    padding-left: 20px;
    margin: 0 0 10px;
}

.tag {
    display: inline-block;
    background: var(--royal-blue-soft);
    color: var(--royal-blue);
    border-radius: var(--radius-sm);
    padding: 1px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}

.hilfe-toc .toc-sub {
    margin-left: 20px;
    font-size: 0.9rem;
}

.hilfe-toc a {
    display: block;
    margin-bottom: 6px;
}


/* ============================================
   VISIER.PHP
   ============================================ */
.auto-grow {
    width: 100%;
    resize: none;
    overflow: hidden;
    box-sizing: border-box;
    min-height: 60px;
}


/* ============================================
   OFFLINE.HTML
   ============================================ */
.offline-icon { font-size: 4rem; margin-bottom: var(--space-md); }
.offline-box  { text-align: center; padding: 40px 20px; }

.cached-section {
    text-align: left;
    margin-top: var(--space-lg);
    border-top: 2px solid var(--border);
    padding-top: var(--space-md);
}
.cached-section h3 {
    color: var(--royal-blue);
    margin: 0 0 10px;
    font-size: 1rem;
}
.cached-item {
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 8px;
    font-size: 0.85rem;
}
.cached-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.offline-box{
    max-width:600px;
    margin:30px auto;
    padding:25px;
}

.offline-icon{
    font-size:60px;
    margin-bottom:15px;
}

.offline-section{
    text-align:left;
    margin-top:20px;
    padding:15px 18px;
    border-radius:10px;
}

.offline-ok{
    border-left:5px solid #2e8b57;
}

.offline-no{
    border-left:5px solid #d9534f;
}

.offline-section h2{
    margin:0 0 10px;
    font-size:1.05rem;
}

.offline-section ul{
    margin:0;
    padding-left:20px;
}

.offline-section li{
    margin:8px 0;
}

.offline-note{
    margin-top:14px;
    font-size:.88rem;
    color:var(--text-muted);
}

/* ============================================
   REGISTER.PHP
   ============================================ */
/* Zeigt .section auf register.php trotz display:none in style.css */
.section--visible {
    display: block !important;
}
#registerForm input {
    width: 100%;
    margin: 5px 0;
}


/* ============================================
   ERGEBNISSE.PHP – Schusszettel-Overlay
   ============================================ */
#schussOverlay {
    position: fixed; inset: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85); display: none;
    backdrop-filter: blur(4px);
    z-index: 99998; overflow: hidden;
}
#schussContent {
    width: 100%; height: 100%; background:var(--bg);
    padding: 8px 10px; box-sizing: border-box;
    display: flex; flex-direction: column;
}
#grid {
    flex: 1; display: grid; grid-template-columns: repeat(6,1fr);
    gap: 5px; overflow-y: auto; padding: 5px;
    align-content: start; min-height: 0;
}
.cell {
    background:var(--surface); border-radius: 6px; border:1px solid var(--border);
    display: flex; justify-content: center; align-items: center;
    font-size: 15px; font-weight: bold; aspect-ratio: 1;
}
.score-buttons {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    grid-template-areas: "x ten nine ." "eight seven six five"
                         "four three two one" "m back . .";
    gap: 6px; margin-top: 6px; flex-shrink: 0;
}
.score-buttons button {
    font-size: 16px; font-weight: bold; border-radius: 8px;
    border: 2px solid transparent; cursor: pointer; padding: 10px 0;
}
.btn-x    { grid-area: x; }    .btn-10   { grid-area: ten; }
.btn-9    { grid-area: nine; } .btn-8    { grid-area: eight; }
.btn-7    { grid-area: seven; }.btn-6    { grid-area: six; }
.btn-5    { grid-area: five; } .btn-4    { grid-area: four; }
.btn-3    { grid-area: three; }.btn-2    { grid-area: two; }
.btn-1    { grid-area: one; }  .btn-m    { grid-area: m; }
.btn-back { grid-area: back; }

.btn--gold  { background: linear-gradient(#f6d365,#f2b705); color:#000; border-color:#b88800; }
.btn--red   { background: linear-gradient(#ff9a9e,#ff4d4d); color:#fff; border-color:#b02e2e; }
.btn--blue  { background: linear-gradient(#a0c4ff,#4682b4); color:#fff; border-color:#2f6b9a; }
.btn--black { background: #222; color:#fff; border-color:#000; }
.btn--white { background: #fff; color:#000; border: 2px solid #bbb; }
.btn--green { background: #8fd694; color:#000; border-color:#2e9a3a; }

.untereZeile {
    display:flex;
    align-items:flex-start;
    gap:10px;
}

.aktionLinks {
    display:flex;
    flex-direction:column;
}

.mZurueck {
    display:flex;
    gap:4px;
}

.mZurueck .btn--green,
.mZurueck .btn-back {
    width: 90px;
    height: 45px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    border: 2px solid transparent;
    padding: 10px 0;
    cursor: pointer;
}

#visierBox {
    border:1px solid #aaa;
    border-radius:6px;
    padding:4px 8px;
    font-size:0.75rem;
    line-height:1.2;
}


.schuss-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 4px;
    flex-shrink: 0; gap: 8px;
}
.schuss-header h1 { font-size: 1.1rem; margin: 0; }
.schuss-close-x {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
    border: none; background: var(--royal-blue-mid); color: white;
    font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; line-height: 1;
}
.schuss-close-x:hover { background: var(--royal-blue-soft); }
.cell-stech { outline: 3px solid red; background: #fff3f3 !important; }

/* Override: Schusszettel-Buttons dürfen kleiner sein als 48px */
@media (hover: none) and (pointer: coarse) {
    .score-buttons button { min-height: 21px !important; }
}
@media (min-width: 1024px) {
    #schussContent { max-width:900px; height:90vh; margin:auto; border-radius:12px; padding:16px 20px; }
    .cell { height:35px; font-size:16px; aspect-ratio:auto; }
    .score-buttons button { padding:16px 0; font-size:16px; }
}
@media (max-width: 480px) {
    .cell { font-size:13px; }
    #grid { gap:4px; padding:3px; }
}

/* Schussbild-Overlay */
#sbViewOverlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
    display: none; z-index: 199998;
    align-items: center; justify-content: center;
}
#sbViewContainer {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    max-width: 500px; width: 95%;
    max-height: 90vh; overflow-y: auto;
}

/* Setup-Sub-Overlay */
#setupSubOverlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center;
    z-index: 19999;
}


/* ============================================
   ERGEBNISSE_STATISTIK.PHP
   ============================================ */
.info-box {
    background: var(--royal-blue-soft);
    border-left: 4px solid var(--royal-blue);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.section-title { margin-top: var(--space-xl); }
.chart-container {
    position: relative; width: 100%;
    margin: var(--space-md) 0 var(--space-xl);
}
.weather-grid {
    display: grid; grid-template-columns: 1fr;
    gap: var(--space-lg); margin-bottom: var(--space-xl);
}
@media (min-width: 700px) { .weather-grid { grid-template-columns: 1fr 1fr; } }
.weather-card {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: var(--space-lg);
}
.weather-card h4 {
    font-family: var(--font-display); font-size: 1rem; font-weight: 600;
    color: var(--royal-blue); margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--royal-blue-soft);
}
.weather-card canvas { max-height: 220px; }
.stat-nav {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin: var(--space-md) 0 var(--space-lg);
    padding: var(--space-md); background: var(--surface-2);
    border-radius: var(--radius-lg); border: 1px solid var(--border);
}
.stat-nav a {
    display: inline-block; padding: 6px 12px;
    font-size: 0.82rem; font-weight: 600; font-family: var(--font-body);
    color: var(--white); background: var(--royal-blue-mid);
    border: 1.5px solid var(--royal-blue); border-radius: 20px;
    text-decoration: none; transition: all 0.2s; white-space: nowrap;
}
.stat-nav a:hover { background: var(--royal-blue); color: var(--white); }
.stat-nav-sep { width: 100%; height: 1px; background: var(--border); margin: 2px 0; }
.best-hint {
    background: linear-gradient(135deg, #efffea 0%, #f0f8ff 100%);
    border-left: 4px solid var(--green-dark);
    border-radius: var(--radius-md); padding: var(--space-md);
    margin: var(--space-sm) 0 var(--space-md);
    font-size: 0.9rem; color: var(--text-primary);
}
.best-hint strong { color: var(--green-dark); }
.sz-full-grid {
    display: flex; flex-direction: column;
    gap: var(--space-lg); margin-bottom: var(--space-xl);
}
.sz-full-card {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: var(--space-lg);
    width: 100%; box-sizing: border-box;
}
.sz-full-card h4 {
    font-family: var(--font-display); font-size: 1rem; font-weight: 600;
    color: var(--royal-blue); margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--royal-blue-soft);
}
.sz-chart-wrap { position: relative; width: 100%; height: 220px; }
.sz-chart-wrap canvas { width: 100% !important; height: 100% !important; }

/* ============================================
   KI-EMPFEHLUNG.PHP
   ============================================ */
.output-box {
    background: var(--surface-2);
    border-left: 4px solid var(--royal-blue);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    font-size: 1rem;
    margin-bottom: var(--space-xl);
    line-height: 1.7;
}
.output-box h2 {
    margin-top: var(--space-xl);
    border-bottom: 2px solid var(--royal-blue);
    padding-bottom: 6px;
    color: var(--text-primary);
    scroll-margin-top: 20px;
}
.output-box h3 { margin-top: var(--space-lg); color: var(--royal-blue); }
.output-box ul { padding-left: var(--space-lg); margin-bottom: var(--space-md); }
.output-box li { margin-bottom: var(--space-xs); }
.output-box strong { color: var(--royal-blue); }
.btn-container {
    display: flex; gap: var(--space-sm);
    flex-wrap: wrap; margin-bottom: var(--space-lg);
}
.api-alert {
    background: #fff3cd; border-left: 4px solid #ffc107;
    color: #856404; padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg); font-size: 0.9rem;
}
.analysis-nav {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: var(--space-md);
    margin-bottom: var(--space-md);
}
.analysis-nav p { margin: 0 0 var(--space-sm) 0; font-weight: bold; color: var(--text-primary); }
.analysis-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px,1fr));
    gap: var(--space-xs);
}
.analysis-nav-btn {
    background: var(--surface); border: 1px solid var(--royal-blue);
    color: var(--royal-blue); text-align: center;
    padding: 10px 6px; border-radius: 6px;
    font-size: 0.82rem; font-weight: bold;
    cursor: pointer; transition: all 0.2s;
    width: 100%; box-sizing: border-box;
}
.analysis-nav-btn:hover { background: var(--royal-blue); color: var(--white); }
.loading-box {
    text-align: center; padding: var(--space-xl);
    color: var(--text-secondary);
}
.sofort-box {
    border-left: 4px solid var(--green-dark);
    border-radius: var(--radius-md);
    padding: var(--space-lg); margin: var(--space-md) 0;
}
.meta-info {
    font-size: 0.85rem; color: var(--text-muted);
    margin-bottom: var(--space-sm); font-style: italic;
}
.history-table tbody tr { cursor: pointer; transition: background 0.2s; }
.history-table tbody tr:hover { background: var(--royal-blue-soft); }

/* ============================================
   ki-empfehlungen.PHP
   ============================================ */

.table-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 15px 0;
}

.table-scroll-wrapper table {
    min-width: 700px;
}

/* ============================================
   todo.PHP
   ============================================ */
   
#todoOverlayBeschreibung {
    white-space: normal;
    word-break: break-word;
}

.kategorie-abstand td {
    height: 15px;
    background: transparent !important;
    border: none !important;
}

/* ============================================
   TODO BADGES
   ============================================ */

.badge-prio-hoch,
.badge-status-offen {
    background: var(--error-bg);
    color: var(--error-text);
}

.badge-prio-normal,
.badge-status-bearbeitung {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.badge-prio-niedrig,
.badge-status-erledigt {
    background: var(--success-bg);
    color: var(--success-text);
}


.todo-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
}

.todo-stat-box {
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid;
}

.todo-stat-gesamt {
    background: var(--royal-blue-soft);
    color: var(--royal-blue);
    border-color: var(--royal-blue);
}

.todo-stat-offen {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: var(--error-border);
}

.todo-stat-bearbeitung {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-color: var(--warning-border);
}

.todo-stat-erledigt {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
}