/* ScoutBase – helles, responsives UI. Farben aus dem Vereinslogo (Grün/Gelb).
   Keine externen Abhängigkeiten (CSP-konform). */
:root {
    /* Grundflächen (hell) */
    --bg:         #f2f6f2;
    --surface:    #ffffff;
    --surface-2:  #eef3ef;
    --border:     #dde5df;
    --border-2:   #cdd8d0;

    /* Text */
    --text:       #16241c;
    --muted:      #64726a;

    /* Markenfarben aus dem Logo */
    --primary:    #07853a;   /* Vereinsgrün */
    --primary-d:  #066a2e;   /* dunkler (Hover) */
    --primary-ink:#ffffff;   /* Text auf Grün */
    --primary-soft:#e6f2ea;  /* zarte grüne Fläche */
    --accent:     #fade03;   /* Vereinsgelb (Akzent) */
    --accent-d:   #8a7500;   /* dunkles Gelb für Text auf Hell */

    /* Statusfarben (auf Hell abgestimmt) */
    --danger:     #cf2b37;
    --danger-soft:#fdeceE;
    --warn:       #b26a00;
    --warn-soft:  #fbf1de;
    --info:       #1f6fb2;
    --info-soft:  #e7f0f8;
    --ok-soft:    #e6f2ea;

    --radius:     14px;
    --radius-sm:  9px;
    --shadow:     0 1px 2px rgba(16,40,26,.05), 0 10px 28px rgba(16,40,26,.07);
    --shadow-sm:  0 1px 2px rgba(16,40,26,.05), 0 3px 10px rgba(16,40,26,.05);
    --sidebar-w:  256px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 680; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.pad { padding: 1rem 1.25rem; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    transition: transform .25s ease;
}
.brand {
    display: flex; align-items: center; gap: .7rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border);
    font-weight: 750; font-size: 1.15rem;
}
.brand-logo { font-size: 1.5rem; line-height: 1; }
.brand-logo-img { height: 40px; width: auto; display: block; }
.brand-name { letter-spacing: -.02em; }

.nav { flex: 1; padding: .75rem .6rem; overflow-y: auto; }
.nav a {
    position: relative;
    display: flex; align-items: center; gap: .7rem;
    padding: .62rem .8rem; margin-bottom: .15rem;
    border-radius: var(--radius-sm);
    color: var(--muted); font-weight: 550;
    transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary-d); font-weight: 650; }
/* Signatur: gelber Aktiv-Balken (Vereinsfarbe) */
.nav a.active::before {
    content: ""; position: absolute; left: -.6rem; top: 50%; transform: translateY(-50%);
    width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--accent);
}
.nav a .ic { width: 1.2rem; text-align: center; opacity: .9; }
.nav-section {
    padding: 1rem .8rem .35rem; font-size: .7rem;
    text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700;
}
.sidebar-foot { padding: .9rem; border-top: 1px solid var(--border); }
.user-card { display: flex; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--primary); color: var(--primary-ink);
    display: grid; place-items: center; font-weight: 700;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.user-meta strong { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-badge {
    font-size: .72rem; color: var(--primary-d);
    background: var(--primary-soft); border: 1px solid transparent;
    padding: .05rem .5rem; border-radius: 20px; width: fit-content; font-weight: 600;
}

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; gap: 1rem;
    padding: .9rem 1.5rem; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: rgba(255,255,255,.85);
    backdrop-filter: blur(8px); z-index: 30;
}
.page-title { font-size: 1.2rem; }
.menu-toggle {
    display: none; background: var(--surface); border: 1px solid var(--border-2);
    color: var(--text); font-size: 1.1rem; padding: .35rem .6rem; border-radius: var(--radius-sm); cursor: pointer;
}
.content { padding: 1.5rem; max-width: 1200px; width: 100%; }

/* ---------- Cards & grids ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 1.02rem; display: flex; align-items: center; gap: .5rem; }
.count { font-size: .78rem; background: var(--surface-2); color: var(--muted);
    border-radius: 20px; padding: .05rem .55rem; border: 1px solid var(--border); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.stat-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
    transition: box-shadow .18s ease, transform .18s ease;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
/* dezenter grüner Fußstreifen je Kennzahl */
.stat-card::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--primary);
    opacity: .9;
}
.stat-card.stat-warn::after { background: var(--warn); }
.stat-value { font-size: 2rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-card.stat-warn .stat-value { color: var(--warn); }
.stat-label { color: var(--muted); font-size: .88rem; margin-top: .15rem; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: .5rem 0; }
.list li {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .6rem 1.25rem; border-bottom: 1px solid var(--border);
}
.list li:last-child { border-bottom: 0; }
.list-main { font-weight: 600; }
.list-main:hover { color: var(--primary); }
.list-meta { color: var(--muted); font-size: .82rem; display: flex; align-items: center; gap: .5rem; white-space: nowrap; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .7rem 1rem; text-align: left; }
.table thead th {
    color: var(--muted); font-weight: 700; font-size: .74rem;
    text-transform: uppercase; letter-spacing: .05em;
    border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.table tbody tr { border-bottom: 1px solid var(--border); }
.table tbody tr:last-child { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: center; font-variant-numeric: tabular-nums; }
.link-strong { font-weight: 650; color: var(--primary-d); }
.link-strong:hover { text-decoration: underline; }
.row-actions { display: flex; gap: .4rem; justify-content: flex-end; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .55rem 1rem; border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border-2); cursor: pointer;
    font-size: .9rem; font-weight: 600; font-family: inherit;
    transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
    white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); }
.btn-danger { background: transparent; border-color: rgba(207,43,55,.45); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-block { width: 100%; }
.btn-sm { padding: .35rem .7rem; font-size: .82rem; }

/* ---------- Forms ---------- */
.form { padding: 1.25rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field-wide { grid-column: 1 / -1; }
.field > span, .field > label { font-size: .82rem; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea, .cell-input {
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border-2); border-radius: var(--radius-sm);
    padding: .6rem .7rem; font-size: .92rem; font-family: inherit; width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus, .cell-input:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(7,133,58,.15);
}
.field textarea { resize: vertical; }
.hint { color: var(--muted); font-size: .76rem; }
.form-actions { display: flex; gap: .6rem; margin-top: .5rem; }
.form-lead { margin: 0 0 1rem; color: var(--muted); }
.check { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.filter-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.filter-form input[type=search], .filter-form select {
    background: var(--surface); color: var(--text); border: 1px solid var(--border-2);
    border-radius: var(--radius-sm); padding: .5rem .7rem; font-family: inherit; font-size: .9rem;
}
.filter-form input[type=search]:focus, .filter-form select:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(7,133,58,.15);
}
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }

/* ---------- Alerts ---------- */
.alert { padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .9rem; border: 1px solid; }
.alert ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.alert-success { background: var(--ok-soft);   border-color: rgba(7,133,58,.35);  color: var(--primary-d); }
.alert-error   { background: var(--danger-soft);border-color: rgba(207,43,55,.35); color: #a11f29; }
.alert-info    { background: var(--info-soft);  border-color: rgba(31,111,178,.35);color: #185a91; }

/* ---------- Pills / status ---------- */
.pill {
    display: inline-block; font-size: .74rem; font-weight: 700;
    padding: .12rem .55rem; border-radius: 20px;
    background: var(--surface-2); border: 1px solid var(--border);
}
.pill-leicht { background: var(--ok-soft);     color: var(--primary-d); border-color: transparent; }
.pill-mittel { background: var(--warn-soft);   color: var(--warn);      border-color: transparent; }
.pill-schwer { background: var(--danger-soft); color: #a11f29;          border-color: transparent; }
.pill-rec    { background: var(--info-soft);   color: #185a91;          border-color: transparent; }
.status {
    display: inline-block; font-size: .74rem; font-weight: 700;
    padding: .14rem .6rem; border-radius: 20px; text-transform: capitalize;
    background: var(--surface-2); border: 1px solid var(--border);
}
.status-aktiv    { background: var(--ok-soft);     color: var(--primary-d); border-color: transparent; }
.status-verletzt { background: var(--danger-soft); color: #a11f29;          border-color: transparent; }
.status-gesperrt { background: var(--warn-soft);   color: var(--warn);      border-color: transparent; }
.status-leihe    { background: var(--info-soft);   color: #185a91;          border-color: transparent; }
.status-inaktiv  { background: var(--surface-2);   color: var(--muted); }

/* ---------- Player detail ---------- */
.page-back { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: 1rem; flex-wrap: wrap; }
.page-actions { display: flex; gap: .5rem; }
.player-head { display: flex; gap: 1.25rem; padding: 1.25rem; align-items: flex-start; }
.player-badge {
    width: 68px; height: 68px; flex: 0 0 auto; border-radius: 16px;
    background: var(--primary); color: var(--primary-ink); font-size: 1.8rem; font-weight: 800;
    display: grid; place-items: center;
}
.player-info h2 { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.player-facts { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: .7rem; color: var(--text); font-size: .9rem; }
.player-facts strong { color: var(--muted); font-weight: 600; }
.player-notes { margin-top: .8rem; color: var(--muted); }

.report { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.report:last-child { border-bottom: 0; }
.report-top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.ratings { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.rating { font-size: .82rem; background: var(--surface-2); border: 1px solid var(--border); padding: .12rem .6rem; border-radius: 20px; }
.rating strong { color: var(--primary-d); }
.rating-alt strong { color: var(--info); }
.report-meta { color: var(--muted); font-size: .82rem; display: flex; align-items: center; gap: .5rem; }
.report p { margin: .35rem 0; font-size: .92rem; }
.mini-link { background: none; border: 0; color: var(--info); cursor: pointer; font-size: .8rem; padding: 0; font-family: inherit; }
.mini-link:hover { text-decoration: underline; }
.mini-link.danger { color: var(--danger); }
.inline { display: inline; }

/* ---------- Strategie & Behandlungsverlauf ---------- */
.strategy-box { padding: 1rem 1.25rem; background: var(--primary-soft); border-top: 1px solid var(--border); }
.strategy-box h3 { font-size: .9rem; margin-bottom: .4rem; color: var(--primary-d); }
/* Behandlung erfassen – hervorgehoben mit grünem Akzent */
.treatment-form { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--surface-2); border-left: 3px solid var(--primary); }
.treatment-form-row { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; }
.treatment-form-row .field { margin-bottom: 0; }
.field-grow { flex: 1; min-width: 220px; }
.field-date { width: 160px; }
.timeline { list-style: none; margin: 0; padding: .5rem 1.25rem 1rem; }
.timeline li { display: flex; gap: 1rem; padding: .8rem 0; border-bottom: 1px dashed var(--border-2); position: relative; }
.timeline li:last-child { border-bottom: 0; }
.timeline-date { flex: 0 0 92px; color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; padding-top: .1rem; }
.timeline-body { flex: 1; }
.timeline-body p { margin: 0 0 .2rem; }
.timeline-meta { color: var(--muted); font-size: .8rem; display: flex; gap: .6rem; align-items: center; }

/* ---------- Foto & Datei-Anhänge ---------- */
.player-badge-photo { padding: 0; overflow: hidden; background: var(--surface-2); }
.player-badge-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-current { display: flex; align-items: center; gap: .8rem; margin-bottom: .5rem; }
.photo-thumb { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border); }
.photo-remove { margin: 0; }

/* ---------- Formular-Abschnitte, Mehrfachauswahl, Info-Spalten ---------- */
.form-section {
    font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--primary-d); margin: 1.6rem 0 .4rem; padding-bottom: .35rem;
    border-bottom: 1px solid var(--border);
}
.field-label { display: block; font-size: .82rem; font-weight: 600; color: var(--text); margin-bottom: .4rem; }
.field-label .hint { font-weight: 400; }
.check-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .35rem .8rem;
}
.check-grid .check { margin: 0; font-weight: 400; }

.info-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; padding: 1.25rem; }
.info-block h3 { font-size: .95rem; margin: 0 0 .6rem; color: var(--primary-d); }
.info-block p { margin: 0 0 .5rem; line-height: 1.5; }
.info-block a { color: var(--primary-d); }

.file-list { list-style: none; margin: 0; padding: .5rem 1.25rem 1rem; display: grid; gap: .6rem; }
.file-item { display: flex; align-items: center; gap: .9rem; padding: .5rem 0; border-bottom: 1px dashed var(--border-2); }
.file-item:last-child { border-bottom: 0; }
.file-preview {
    width: 56px; height: 56px; flex: 0 0 56px; border-radius: 10px; overflow: hidden;
    border: 1px solid var(--border); background: var(--surface-2);
    display: grid; place-items: center;
}
.file-preview img { width: 100%; height: 100%; object-fit: cover; }
.file-icon { font-size: .72rem; font-weight: 800; color: var(--danger); letter-spacing: .03em; }
.file-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-name { font-weight: 600; color: var(--primary-d); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name:hover { text-decoration: underline; }
.file-sub { color: var(--muted); font-size: .8rem; }

/* ---------- Inline-Bearbeitung (Behandlungen) ---------- */
.inline-edit { display: inline-block; }
.inline-edit > summary { cursor: pointer; list-style: none; display: inline; }
.inline-edit > summary::-webkit-details-marker { display: none; }
.inline-edit[open] > summary { font-weight: 600; }
.treatment-edit { margin-top: .6rem; padding: .75rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* ---------- Tabs (responsiv, barrierefrei; ohne JS gestapelt) ---------- */
.tab-bar { display: none; }
.js-tabs .tab-bar {
    display: flex; gap: .1rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid var(--border); margin-bottom: 1.25rem;
}
.tab {
    appearance: none; -webkit-appearance: none; background: none; border: 0; cursor: pointer;
    font: inherit; color: var(--muted); font-weight: 600; white-space: nowrap;
    padding: .7rem 1rem; border-bottom: 2px solid transparent; margin-bottom: -1px;
    display: inline-flex; align-items: center; gap: .45rem;
    transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--primary-d); border-bottom-color: var(--primary); }
.tab:focus-visible { outline: 2px solid var(--primary); outline-offset: -3px; border-radius: 6px; }
.tab-count {
    font-size: .72rem; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 20px; padding: .02rem .45rem; color: var(--muted); font-weight: 700;
}
.tab[aria-selected="true"] .tab-count { background: var(--primary-soft); color: var(--primary-d); border-color: transparent; }

/* ---------- Lightbox (Datei-Vorschau) ---------- */
.lightbox {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    background: rgba(10, 20, 14, .86); padding: 3.5rem 1rem;
}
.lightbox[hidden] { display: none; }
body.lb-open { overflow: hidden; }
.lb-stage { max-width: 94vw; max-height: 84vh; display: flex; align-items: center; justify-content: center; }
.lb-img {
    max-width: 94vw; max-height: 84vh; object-fit: contain;
    border-radius: 8px; background: #fff; box-shadow: 0 12px 44px rgba(0, 0, 0, .5);
}
.lb-frame {
    width: 94vw; height: 84vh; max-width: 1000px; border: 0;
    border-radius: 8px; background: #fff; box-shadow: 0 12px 44px rgba(0, 0, 0, .5);
}
.lb-caption {
    position: absolute; bottom: 1rem; left: 0; right: 0; text-align: center;
    color: #fff; font-size: .9rem; padding: 0 1rem; text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.lb-btn {
    position: absolute; background: rgba(255, 255, 255, .16); color: #fff; border: 0;
    width: 44px; height: 44px; border-radius: 50%; font-size: 1.7rem; line-height: 1;
    cursor: pointer; display: grid; place-items: center; transition: background .15s; text-decoration: none;
}
.lb-btn:hover { background: rgba(255, 255, 255, .32); }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-close { top: .8rem; right: 1rem; }
.lb-download { top: .8rem; left: 1rem; font-size: 1.5rem; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: .6rem; }
.lb-next { right: .6rem; }
.lb-nav[hidden] { display: none; }
@media (max-width: 560px) {
    .lb-btn { width: 40px; height: 40px; font-size: 1.4rem; }
    .lb-prev { left: .3rem; } .lb-next { right: .3rem; }
}

/* ---------- Therapieplan: Teilen-Link & Planliste ---------- */
.list-intro { margin: -.25rem 0 1rem; font-size: .9rem; }
.cell-sub { color: var(--muted); font-size: .78rem; margin-top: .15rem; }
.assign-form { display: flex; gap: .35rem; align-items: center; }
.cell-team { min-width: 128px; padding: .4rem .55rem !important; }

/* ---------- Talentepool: Beobachtungs-Stern ---------- */
.star-cell { width: 34px; text-align: center; }
.star-btn {
    background: none; border: 0; cursor: pointer; font-size: 1.15rem; line-height: 1;
    color: var(--border-2); padding: .1rem .2rem; border-radius: 6px; transition: color .15s, transform .05s;
}
.star-btn:hover { color: var(--accent-d); background: var(--surface-2); }
.star-btn.on { color: #e6b400; }
.star-btn:active { transform: scale(.9); }

/* ---------- Schattenkader: Spielfeld ---------- */
.toolbar-label { color: var(--muted); font-weight: 600; font-size: .85rem; }
.pitch {
    background:
        repeating-linear-gradient(0deg, #0b8040 0, #0b8040 44px, #0a7739 44px, #0a7739 88px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm) inset, var(--shadow-sm);
    padding: 1.25rem .75rem;
    display: flex; flex-direction: column; gap: .4rem;
    margin-bottom: 1.25rem;
}
.pitch-line { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem .75rem; }
.slot {
    display: flex; flex-direction: column; align-items: center; gap: .25rem;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 10px; padding: .4rem .5rem; min-width: 118px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}
.slot-filled { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(250, 222, 3, .55); }
.slot-pos { font-size: .7rem; font-weight: 800; letter-spacing: .04em; color: var(--primary-d); text-transform: uppercase; }
.slot-select {
    max-width: 150px; width: 100%; font-size: .82rem;
    border: 1px solid var(--border-2); border-radius: 7px; padding: .3rem .4rem;
    background: #fff; color: var(--text); font-family: inherit;
}
.slot-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(7,133,58,.2); }
.slot-name { font-size: .86rem; font-weight: 600; color: var(--text); }
.shadow-actions { margin-bottom: 1.25rem; }
@media (max-width: 560px) {
    .slot { min-width: 96px; padding: .35rem .4rem; }
    .slot-select { font-size: .78rem; }
}

/* ---------- Schattenkader: Drag & Drop (Progressive Enhancement) ---------- */
.slot-drop { display: none; }                       /* ohne JS: Selects sind sichtbar */
.dnd-on .slot-select { display: none; }             /* mit JS: Selects verstecken */
.dnd-on .slot-drop {
    display: flex; align-items: center; justify-content: center;
    min-height: 30px; width: 100%; border-radius: 7px;
    border: 1px dashed var(--border-2); background: rgba(255,255,255,.6);
    padding: .15rem; transition: border-color .12s, background .12s;
}
.slot-drop .drop-empty { color: var(--muted); font-size: .78rem; }
.slot-drop.filled { border-style: solid; border-color: transparent; background: transparent; }
.slot-drop.filled .drop-empty { display: none; }
.slot-drop.drop-hover { border-color: var(--primary); background: rgba(7,133,58,.12); }

.pool-wrap { display: none; }
.dnd-on .pool-wrap {
    display: block; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: 1.25rem; box-shadow: var(--shadow-sm);
}
.pool-head { font-weight: 650; margin-bottom: .6rem; font-size: .95rem; }
.player-pool { display: flex; flex-wrap: wrap; gap: .5rem; min-height: 40px; border-radius: 10px; padding: .35rem; transition: background .12s; }
.player-pool.drop-hover { background: rgba(7,133,58,.10); outline: 1px dashed var(--primary); }

.drag-chip {
    display: inline-flex; align-items: center; gap: .35rem;
    background: var(--primary-soft); color: var(--primary-d);
    border: 1px solid rgba(7,133,58,.25); border-radius: 20px;
    padding: .3rem .7rem; font-size: .82rem; font-weight: 600;
    cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
    white-space: nowrap;
}
.slot-drop .drag-chip { cursor: grab; }
.drag-chip.chip-source { opacity: .35; }
.chip-ghost {
    position: fixed; z-index: 1000; pointer-events: none; margin: 0;
    box-shadow: 0 8px 20px rgba(16,40,26,.28); transform: scale(1.03);
    background: var(--primary); color: #fff; border-color: var(--primary);
}
@media (prefers-reduced-motion: reduce) { .chip-ghost { transform: none; } }
.chip-animating { position: relative; z-index: 5; will-change: transform; }
.share-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .6rem; }
.share-link {
    flex: 1; min-width: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .86rem; background: var(--surface-2); border: 1px solid var(--border-2);
    border-radius: var(--radius-sm); padding: .55rem .7rem; color: var(--text);
}
.plan-list { list-style: none; margin: 0; padding: .25rem 0 .5rem; }
.plan-item {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .7rem 1.25rem; border-bottom: 1px solid var(--border);
}
.plan-item:last-child { border-bottom: 0; }
.plan-main { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

/* ---------- Öffentliche Therapieplan-Seite ---------- */
.public-body {
    background: radial-gradient(1100px 460px at 50% -10%, rgba(7,133,58,.10), transparent 60%), var(--bg);
    min-height: 100vh; padding: 1.5rem;
}
.public-wrap { max-width: 720px; margin: 0 auto; }
.public-head { display: flex; align-items: center; gap: 1rem; padding: 1rem .25rem 1.25rem; }
.public-logo { height: 56px; width: auto; display: block; }
.public-app { color: var(--muted); font-size: .85rem; font-weight: 600; }
.public-title { font-size: 1.5rem; letter-spacing: -.01em; }
.public-card { box-shadow: var(--shadow); }
.public-for { color: var(--muted); margin: 0 0 .3rem; }
.public-plan-title { font-size: 1.2rem; margin: 0 0 .6rem; }
.public-content { line-height: 1.6; margin-bottom: .5rem; }
.public-sub { font-size: .95rem; margin: 1rem 0 .5rem; color: var(--muted); }
.public-files { padding-left: 0; padding-right: 0; }
.public-foot { text-align: center; color: var(--muted); font-size: .82rem; margin-top: 1rem; }
.pos-list { padding: .5rem 1rem 1rem; }
.pos-row { display: flex; align-items: center; gap: .5rem; padding: .4rem 0; border-bottom: 1px solid var(--border); }
.pos-row:last-child { border-bottom: 0; }
.pos-head { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; padding-bottom: .5rem; font-weight: 700; }
.pos-head span:nth-child(1) { width: 90px; }
.pos-head span:nth-child(2) { flex: 1; }
.pos-head span:nth-child(3) { width: 90px; }
.pos-head span:nth-child(4) { width: 110px; }
.pos-edit { display: flex; align-items: center; gap: .5rem; flex: 1; }
.cell-input { padding: .4rem .55rem !important; }
.cell-narrow { width: 82px !important; flex: 0 0 auto; }
.pos-edit .cell-input:nth-of-type(2) { flex: 1; }

/* ---------- Auth ---------- */
.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem;
    background: #fafafa;
    background: oklch(0.985 0 0); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-brand .brand-logo { font-size: 2.5rem; }
.auth-logo-img { height: 88px; width: auto; display: inline-block; }
.auth-brand h1 { font-size: 1.5rem; margin: .6rem 0 .1rem; }

/* ---------- Fehlerseite ---------- */
.error-page { text-align: center; padding: 3rem 1rem; }
.error-code { font-size: 3.5rem; font-weight: 850; color: var(--primary); letter-spacing: -.03em; }
.error-page h2 { margin: .3rem 0 .5rem; }
.error-page .btn { margin-top: 1rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); box-shadow: none; }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-block; }
    .content { padding: 1rem; }
    .player-facts { gap: .4rem 1rem; }
    .timeline-date { flex-basis: 76px; }
}
.sidebar-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(16,40,26,.35); z-index: 39;
}
.sidebar-backdrop.show { display: block; }

/* Barrierefreiheit: sichtbarer Tastatur-Fokus & Reduced Motion */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}

/* ============================================================
   Web-Installer (install.php)
   ============================================================ */
.install-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2.5rem 1rem;
    background:
        radial-gradient(1100px 460px at 50% -10%, rgba(7,133,58,.10), transparent 60%),
        var(--bg);
}
.install-shell { width: 100%; max-width: 680px; }
.install-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem;
}
.install-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.install-logo {
    width: 54px; height: 54px; flex: 0 0 54px;
    display: grid; place-items: center;
    font-size: 1.8rem; overflow: hidden;
    background: var(--surface); color: var(--primary);
    border: 1px solid var(--border); border-radius: 14px;
}
.install-logo-img { height: 46px; width: auto; display: block; }
.install-title { margin: 0; font-size: 1.4rem; letter-spacing: -.01em; }
.install-sub { margin: .15rem 0 0; color: var(--muted); font-size: .92rem; }
.install-block {
    border-top: 1px solid var(--border);
    padding-top: 1.1rem;
    margin-top: 1.1rem;
}
.install-h2 { font-size: 1rem; margin: 0 0 .8rem; color: var(--text); }
.install-note { color: var(--muted); font-size: .9rem; margin: 1rem 0 0; line-height: 1.5; }
.install-note code, .install-summary code {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 6px; padding: .1rem .4rem; font-size: .85em;
}
.install-summary { margin: .5rem 0 0; padding-left: 1.1rem; color: var(--text); line-height: 1.7; }
.install-errors { margin: 0; padding-left: 1.1rem; line-height: 1.6; }
.install-foot { text-align: center; color: var(--muted); font-size: .82rem; margin: 1rem 0 0; }

/* Voraussetzungs-Liste */
.req-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.req-item {
    display: flex; align-items: center; gap: .6rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .55rem .8rem;
    font-size: .92rem;
}
.req-mark {
    width: 22px; height: 22px; flex: 0 0 22px;
    display: grid; place-items: center;
    border-radius: 50%; font-size: .8rem; font-weight: 700;
}
.req-ok .req-mark { background: var(--ok-soft); color: var(--primary-d); }
.req-bad .req-mark { background: var(--danger-soft); color: var(--danger); }
.req-label { flex: 1; }
.req-hint { color: var(--warn); font-size: .82rem; }

/* Datenbankauswahl */
.db-choice { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: 1rem; }
.db-opt {
    display: grid; gap: .2rem;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    padding: .8rem .9rem; cursor: pointer;
    transition: border-color .15s, background .15s;
}
.db-opt:hover { border-color: var(--primary); }
.db-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.db-opt input { margin-right: .35rem; accent-color: var(--primary); }
.db-opt-title { font-weight: 700; }
.db-opt-desc { color: var(--muted); font-size: .82rem; line-height: 1.4; }
.mysql-fields[hidden] { display: none; }
.field-narrow { max-width: 130px; }

@media (max-width: 560px) {
    .db-choice { grid-template-columns: 1fr; }
    .install-card { padding: 1.25rem; }
}
