* { box-sizing: border-box; }

body {
    margin: 0;
    background: #ffffff;
    color: #000000;
    font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 190px;
    flex-shrink: 0;
    background: #fafafa;
    border-right: 1px solid #e2e2e2;
    padding: 20px 0;
}

.sidebar h1 {
    font-size: 17px;
    margin: 0 20px 24px;
    color: #000;
}

.sidebar a {
    display: block;
    padding: 10px 20px;
    color: #000;
    text-decoration: none;
    font-size: 15px;
    border-left: 3px solid transparent;
}

.sidebar a:hover, .sidebar a.aktiv {
    background: #eef4fb;
    border-left-color: #2f7bc9;
}

.inhalt {
    flex: 1;
    padding: 28px 36px;
    max-width: 980px;
}

h2 { margin-top: 0; }

.karten-reihe {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.karte {
    background: #fafafa;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    padding: 16px 18px;
    min-width: 170px;
    flex: 1;
}

.karte .label {
    font-size: 13px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 5px;
}

.karte .wert {
    font-size: 26px;
    font-weight: 600;
    margin-top: 4px;
}

.karte .unterzeile {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

.abschnitt {
    margin-bottom: 30px;
}

.abschnitt h3 {
    font-size: 16px;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
}

/* Tooltip fuer Berechnungs-Erklaerungen */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    color: #2f7bc9;
    font-size: 13px;
    border: 1px solid #2f7bc9;
    border-radius: 50%;
    width: 15px;
    height: 15px;
    text-align: center;
    line-height: 14px;
}

.tooltip .tooltip-text {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.15s;
    position: absolute;
    z-index: 10;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    color: #fff;
    text-align: left;
    padding: 8px 10px;
    border-radius: 6px;
    width: 240px;
    font-size: 12.5px;
    font-weight: normal;
    line-height: 1.4;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.chart { width: 100%; max-width: 680px; }
.chart-titel { font-size: 13px; font-weight: 600; fill: #333; }
.chart-label { font-size: 11px; fill: #555; }

.koerper { max-width: 260px; }

form.formular label {
    display: block;
    margin-top: 12px;
    font-size: 14px;
    color: #222;
}

form.formular input, form.formular select {
    width: 100%;
    max-width: 320px;
    padding: 7px 9px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

.button, button {
    background: #2f7bc9;
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 16px;
    text-decoration: none;
    display: inline-block;
}

.button.sekundaer, button.sekundaer {
    background: #eee;
    color: #000;
}

.sportart-auswahl {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.sportart-auswahl a {
    padding: 10px 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    text-decoration: none;
    color: #000;
}

.sportart-auswahl a.aktiv, .sportart-auswahl a:hover {
    background: #2f7bc9;
    color: #fff;
    border-color: #2f7bc9;
}

.zeilen-gruppe {
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
}

.zeile {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.zeile input, .zeile select { flex: 1; padding: 6px; min-width: 0; }
.zeile input[type="text"] { flex: 2.4; }
.zeile span.nummer { width: 26px; color: #666; font-size: 13px; }

.kalender-kopf { display: flex; justify-content: space-between; align-items: center; }
.kalender-nav { display: flex; gap: 14px; align-items: center; font-size: 14px; }
.kalender-nav a { color: #2f7bc9; text-decoration: none; margin-right: 14px; }
.kalender-nav a:last-child { margin-right: 0; }

.kalender-tabelle { width: 100%; border-collapse: collapse; margin-top: 12px; }
.kalender-tabelle th { text-align: left; font-size: 12px; color: #666; padding: 4px; }
.kalender-tabelle td { vertical-align: top; border: 1px solid #eee; height: 96px; width: 14.28%; padding: 4px; overflow: hidden; }
.kalender-tabelle td.leer { background: #fafafa; }
.kalender-tabelle td.heute { background: #eef6ff; }
.tag-nummer { font-size: 12px; color: #777; }
.kalender-eintrag {
    display: block;
    color: #fff;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 4px;
    margin-top: 3px;
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
}

.jahres-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 14px; }
.jahres-monat {
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    padding: 12px;
    text-decoration: none;
    color: #000;
    display: block;
}
.jahres-monat:hover { background: #f5f9fd; }
.jahres-monat-titel { font-weight: 600; }
.jahres-monat-info { font-size: 12px; color: #666; margin-top: 4px; }
.jahres-punkte { margin-top: 6px; }
.jahres-punkt { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 3px; }

.hinweis-box {
    background: #fff7e6;
    border: 1px solid #f0dca0;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    margin-bottom: 16px;
}

.tabelle-einfach { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabelle-einfach th, .tabelle-einfach td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #eee; }

@media print {
    .sidebar, .button, .kalender-nav { display: none; }
    .inhalt { max-width: 100%; }
}

/* Phase 2: Zeitraum-Umschalter (Trainings-pro-Tag-Chart) */
.zeitraum-umschalter { display: flex; gap: 8px; margin-bottom: 10px; }
.zeitraum-link {
    padding: 5px 12px;
    border: 1px solid #ccc;
    border-radius: 14px;
    font-size: 13px;
    text-decoration: none;
    color: #333;
}
.zeitraum-link.aktiv, .zeitraum-link:hover { background: #2f7bc9; color: #fff; border-color: #2f7bc9; }

/* Legende unter gestapelten Diagrammen */
.legende { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; color: #444; }
.legende-eintrag { display: inline-flex; align-items: center; gap: 5px; }
.legende-punkt { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Vorder-/Ruckansicht Koerpergrafik */
.koerper-teilansicht { max-width: 220px; }

/* Kraftsport: Uebungs-Bloecke mit verschachtelter Satz-fuer-Satz-Erfassung */
.uebung-block {
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
}
.uebung-block .zeile select.uebung-select { flex: 3; }
.uebung-block .zeile input.uebung-eigen-feld { flex: 2; }
.satz-liste { margin-top: 8px; }
.satz-zeile {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
    padding-left: 10px;
    border-left: 3px solid #eaf2fb;
}
.satz-zeile input { flex: 1; padding: 6px; min-width: 0; }
.satz-nummer { width: 56px; color: #666; font-size: 13px; flex-shrink: 0; }
.satz-entfernen {
    background: #eee;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    flex-shrink: 0;
}
button.sekundaer.klein, .button.sekundaer.klein {
    padding: 5px 10px;
    font-size: 12px;
    margin-top: 8px;
}

/* Trainingsdetail: Kraftsport-Uebungen mit Satz-Tabelle */
.uebung-detail {
    border-top: 1px solid #eee;
    padding: 10px 0;
}
.tabelle-einfach.klein { font-size: 12px; margin-top: 6px; max-width: 420px; }
.tabelle-einfach.klein th, .tabelle-einfach.klein td { padding: 4px 8px; }

/* Datei-Uploads in Export/Import */
form.formular input[type="file"] { max-width: 420px; padding: 6px 0; }

/* Phase 3: Schmerz-/Verletzungs-Log */
.abschnitt-klein { margin-top: 16px; }
.feld-label { font-size: 13px; color: #555; margin-bottom: 6px; font-weight: 500; }
.schmerz-zeile {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}
.schmerz-zeile select { flex: 2; padding: 6px; }
.schmerz-zeile input { flex: 1; padding: 6px; min-width: 0; }
.schmerz-entfernen {
    background: #eee;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    flex-shrink: 0;
}
.schmerz-hinweis { background: #fdecea; border-color: #f3b8b0; }
.schmerz-hinweis ul { margin: 6px 0 0 18px; padding: 0; }
.schmerz-marker { cursor: help; }
.checkbox-zeile { display: flex; align-items: center; gap: 8px; font-weight: normal; }
.checkbox-zeile input { width: auto; }

/* Kalender: Krankheitstag-Marker */
.krankheit-marker {
    background: #fdecea;
    color: #b0392b;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 4px;
    margin-top: 3px;
    overflow: hidden;
    white-space: nowrap;
    cursor: help;
}

/* Trainingsplanner */
.kachel-eingabe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.kachel-eingabe-feld { display: flex; flex-direction: column; font-size: 13px; gap: 4px; }
.kachel-anzahl-input { padding: 6px; width: 100%; }
.kachel-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 50px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 10px;
}
.plan-kachel {
    color: #fff;
    font-size: 12px;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: grab;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    touch-action: none;
}
.plan-kachel:active { cursor: grabbing; }
.kachel-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kachel-loeschen {
    background: rgba(255,255,255,0.3);
    border: none;
    border-radius: 4px;
    color: #fff;
    width: 18px;
    height: 18px;
    line-height: 1;
    flex-shrink: 0;
    cursor: pointer;
    font-size: 12px;
}
.kachel-ghost { position: fixed; z-index: 1000; pointer-events: none; opacity: 0.85; }
.kachel-erzeuger-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.kachel-erzeuger-btn {
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
}
.kachel-erzeuger-btn:hover { filter: brightness(0.92); }
.plan-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 10px;
}
.plan-tag-slot {
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    min-height: 84px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #fafafa;
}
.plan-tag-nummer { font-size: 11px; color: #888; }
.plan-tag-kacheln { display: flex; flex-direction: column; gap: 3px; }

/* Responsive: schmale Bildschirme (Smartphones) */
@media (max-width: 700px) {
    body { flex-direction: column; }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e2e2e2;
        padding: 10px 0;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }
    .sidebar h1 { margin: 0 12px; flex-basis: 100%; }
    .sidebar a { padding: 6px 12px; font-size: 13px; border-left: none; border-bottom: 3px solid transparent; }
    .sidebar a:hover, .sidebar a.aktiv { border-left-color: transparent; border-bottom-color: #2f7bc9; }
    .inhalt { padding: 16px; }
    .karten-reihe { flex-direction: column; }
    .karte { min-width: 0; }
    .zeile { flex-wrap: wrap; }
    .uebung-block .zeile select.uebung-select { flex-basis: 100%; }
    .plan-grid { grid-template-columns: repeat(3, 1fr); }
    .kachel-eingabe-grid { grid-template-columns: repeat(2, 1fr); }
    table.tabelle-einfach { display: block; overflow-x: auto; white-space: nowrap; }
    .kalender-tabelle { display: block; overflow-x: auto; }
    .jahres-grid { grid-template-columns: repeat(2, 1fr); }
    div[style*="display:flex"] { flex-wrap: wrap; }
}

/* Profil-System */
.profil-anzeige {
    display: block;
    margin: 0 20px 18px;
    font-size: 13px;
    color: #2f7bc9;
    text-decoration: none;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e2e2;
}
.profil-anzeige:hover { text-decoration: underline; }
.profil-auswahl { margin-top: 20px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.profil-karte {
    background: #2f7bc9;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 24px 36px;
    font-size: 18px;
    cursor: pointer;
}
.profil-karte:hover { background: #1c5faa; }
