/* ==========================================================================
   BuchPilot – Basis-Stylesheet
   Klar, nuechtern, schulgeeignet. iPad + Desktop optimiert.
   ========================================================================== */

/* Reset & Grundlagen */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.bp-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.bp-header {
    background: #2c3e50;
    color: #fff;
    padding: 12px 0;
}

.bp-header .bp-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.bp-logo {
    font-size: 1.3rem;
    font-weight: 700;
}

.bp-logo a {
    color: #fff;
    text-decoration: none;
}

.bp-badge {
    background: #e74c3c;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 3px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Navigation */
.bp-nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    margin-left: 18px;
    font-size: 0.95rem;
}

.bp-nav a:hover {
    color: #fff;
}

/* Main */
.bp-main {
    flex: 1;
    padding: 30px 20px;
}

/* Footer */
.bp-footer {
    background: #2c3e50;
    color: rgba(255,255,255,0.6);
    text-align: center;
    padding: 12px 0;
    font-size: 0.85rem;
    margin-top: auto;
}

/* Karten */
.bp-card {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 16px 18px;
    margin-bottom: 12px;
}

.bp-card h2 {
    margin-bottom: 8px;
    font-size: 1.1rem;
    color: #2c3e50;
}

/* Tabellen */
.bp-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.bp-table th,
.bp-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.bp-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.bp-table tr:hover {
    background: #f8f9fa;
}

/* Status-Badges */
.bp-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.bp-status--offen { background: #ffeaa7; color: #856404; }
.bp-status--bezahlt { background: #d4edda; color: #155724; }
.bp-status--storniert { background: #f8d7da; color: #721c24; }
.bp-status--archiviert { background: #e2e3e5; color: #6c757d; }
.bp-status--protokoll-aktion { background: #e8eaf6; color: #283593; font-size: 0.82rem; }
.bp-status--admin-geaendert { background: #fff3e0; color: #e65100; font-size: 0.78rem; font-weight: 600; }

/* Buttons */
.bp-btn {
    display: inline-block;
    padding: 8px 20px;
    font-size: 0.95rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.bp-btn--primary {
    background: #2c3e50;
    color: #fff;
}

.bp-btn--primary:hover {
    background: #34495e;
}

.bp-btn--danger {
    background: #e74c3c;
    color: #fff;
}

.bp-btn--danger:hover {
    background: #c0392b;
}

.bp-btn--small {
    padding: 4px 12px;
    font-size: 0.82rem;
}

/* Formulare */
.bp-form-group {
    margin-bottom: 16px;
}

.bp-form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}

.bp-form-group input[type="text"],
.bp-form-group input[type="password"],
.bp-form-group input[type="email"],
.bp-form-group input[type="number"],
.bp-form-group input[type="date"],
.bp-form-group input[type="datetime-local"],
.bp-form-group input[type="search"],
.bp-form-group select,
.bp-form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
}

.bp-form-group input:focus,
.bp-form-group select:focus,
.bp-form-group textarea:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 2px rgba(44,62,80,0.15);
}

/* Formular-Hinweistext */
.bp-form-hint {
    font-size: 0.82rem;
    color: #888;
    margin-top: 3px;
}

/* Fehler- und Erfolgsmeldungen */
.bp-error {
    background: #fee;
    border: 1px solid #c00;
    padding: 10px;
    margin: 10px 0;
    color: #c00;
    border-radius: 4px;
}

.bp-success {
    background: #efe;
    border: 1px solid #0a0;
    padding: 10px;
    margin: 10px 0;
    color: #060;
    border-radius: 4px;
}

/* Info-Box (Schueler/Eltern Hinweis) */
.bp-info-box {
    background: #e8f4fd;
    border: 1px solid #b8daff;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
    color: #004085;
}

/* Admin-Login-Hinweis auf oeffentlicher Startseite */
.bp-admin-login-hint {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.bp-admin-login-hint p {
    color: #888;
    font-size: 0.85rem;
    margin: 0;
}

/* Scan-Infoseiten */
.bp-scan-info {
    text-align: center;
    padding: 40px 20px;
}

.bp-scan-info h2 {
    margin-bottom: 16px;
}

.bp-scan-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
}

.bp-scan-info--success { border-left: 4px solid #28a745; }
.bp-scan-info--warning { border-left: 4px solid #ffc107; }
.bp-scan-info--error { border-left: 4px solid #dc3545; }

/* ==========================================================================
   Warnbanner (Zeitfenster abgelaufen – Elternseite)
   Spec: fett, groß, rot, oberhalb aller Inhalte
   ========================================================================== */
.bp-warning-banner {
    background: #d32f2f;
    color: #fff;
    padding: 16px 24px;
    font-size: 1.15rem;
    font-weight: 700;
    border-radius: 0;
    margin-bottom: 0;
    width: 100%;
    box-sizing: border-box;
    display: block;
    /* Erzwingt Sichtbarkeit oberhalb aller Inhalte */
}

.bp-warning-banner + .bp-warning-banner {
    margin-top: 4px;
}

/* ==========================================================================
   Paket-Optionen im Bestellformular (Elternseite)
   ========================================================================== */
.bp-paket-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.bp-paket-option:hover {
    border-color: #2c3e50;
    background: #f8f9fa;
}

.bp-paket-option input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

.bp-paket-option input[type="checkbox"]:checked ~ .bp-paket-info {
    color: #2c3e50;
}

.bp-paket-option:has(input:checked) {
    border-color: #2c3e50;
    background: #f0f4f8;
}

.bp-paket-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bp-paket-preis {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

.bp-paket-buecher {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.85rem;
    color: #666;
    margin-top: 2px;
}

/* ==========================================================================
   Paket-Buchdetails (Einzelpreise + Bilder in der Elternansicht)
   ========================================================================== */
.bp-paket-buecher-detail table tr:last-child {
    border-bottom: none;
}

.bp-paket-buecher-detail table td {
    vertical-align: middle;
}

/* ==========================================================================
   Zusaetzliche Status-Badges
   ========================================================================== */
/* Klickbarer Klassen-Badge (Klassenübersicht -> Klassen-Detail) */
.bp-klasse-link {
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.bp-klasse-link:hover {
    background: #d0e8fb !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}
.bp-klasse-link:focus {
    outline: 2px solid #2980b9;
    outline-offset: 2px;
}
.bp-klasse-link:active {
    transform: translateY(0);
}

.bp-status--teilweise   { background: #fff3cd; color: #856404; }
.bp-status--gedruckt    { background: #d4edda; color: #155724; }
.bp-status--nicht-gedr  { background: #e2e3e5; color: #6c757d; }

/* ==========================================================================
   Druckansicht
   ========================================================================== */
@media print {
    .no-print,
    .bp-header,
    .bp-footer,
    .bp-nav,
    .bp-btn,
    form {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
        font-size: 11pt;
        line-height: 1.4;
    }

    .bp-main {
        padding: 0;
    }

    .bp-card {
        box-shadow: none;
        border: 1px solid #bbb;
        page-break-inside: avoid;
        break-inside: avoid;
        margin-bottom: 12pt;
    }

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

    .bp-table th,
    .bp-table td {
        border: 1px solid #999;
        padding: 5pt 7pt;
        font-size: 10pt;
    }

    .bp-table thead {
        display: table-header-group; /* Tabellenheader auf jeder Seite */
    }

    /* Status-Badges beim Drucken: Rahmen statt Hintergrundfarbe */
    .bp-status {
        background: none !important;
        color: #000 !important;
        border: 1px solid #000;
        padding: 1pt 4pt;
        font-size: 9pt;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    /* Warnbanner auch beim Drucken anzeigen */
    .bp-warning-banner {
        background: #fff !important;
        color: #000 !important;
        border: 2px solid #000;
        font-weight: 700;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    /* Admin-Sidebar beim Drucken ausblenden */
    .bp-sidebar {
        display: none !important;
    }

    .bp-admin-wrapper {
        display: block;
    }

    .bp-admin-content {
        padding: 0;
    }

    /* Seitenumbruch-Hinweise */
    h2, h3 {
        page-break-after: avoid;
        break-after: avoid;
    }

    tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

/* ==========================================================================
   Admin-Layout: Sidebar + Content
   ========================================================================== */

/* Topbar fuer Admin */
.bp-header--admin .bp-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 100%;
    padding: 0 20px;
}

.bp-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.bp-schuljahr-badge {
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 0.82rem;
    padding: 3px 10px;
    border-radius: 3px;
}

.bp-schuljahr-badge--leer {
    background: rgba(231,76,60,0.3);
    color: #fdd;
}

.bp-admin-user {
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
}

.bp-btn--logout {
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding: 5px 14px;
    font-size: 0.85rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s;
}

.bp-btn--logout:hover {
    background: rgba(255,255,255,0.25);
}

/* Wrapper: Sidebar + Inhalt nebeneinander */
.bp-admin-wrapper {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 110px);
}

/* Sidebar */
.bp-sidebar {
    width: 220px;
    min-width: 220px;
    background: #2c3e50;
    padding: 16px 0;
    flex-shrink: 0;
}

.bp-sidenav {
    display: flex;
    flex-direction: column;
}

.bp-sidenav-group {
    margin-bottom: 8px;
}

.bp-sidenav-heading {
    color: #e67e22;
    font-size: 0.92rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 14px 18px 6px;
}

/* Dashboard-Link: größer und rot */
.bp-sidenav-link--dashboard {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e74c3c !important;
}

.bp-sidenav-link--dashboard:hover {
    color: #ff6b6b !important;
}

.bp-sidenav-link--dashboard.bp-nav-active {
    color: #ff6b6b !important;
    border-left-color: #e74c3c;
}

.bp-sidenav-link {
    display: block;
    color: rgba(255,255,255,0.78);
    text-decoration: none;
    padding: 8px 18px;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.bp-sidenav-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.bp-sidenav-link.bp-nav-active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-left-color: #3498db;
    font-weight: 600;
}

/* Admin-Inhaltsbereich */
.bp-admin-content {
    flex: 1;
    padding: 28px 30px;
    overflow-x: auto;
}

.bp-admin-content h2 {
    margin-bottom: 20px;
    font-size: 1.4rem;
    color: #2c3e50;
}

/* Schueler/Eltern-Hinweisblock auf der Anmeldeseite */
.bp-schueler-hinweis {
    background: #c62828;
    color: #fff;
    border-radius: 6px;
    padding: 16px 20px;
    margin-top: 24px;
    font-size: 0.88rem;
    line-height: 1.55;
    max-width: 420px;
    width: 100%;
    box-sizing: border-box;
}

.bp-schueler-hinweis strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 6px;
}

/* Login-Seite */
.bp-login-wrap {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.bp-login-card {
    width: 100%;
    max-width: 420px;
}

.bp-login-sub {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* Platzhalter-Banner fuer noch nicht implementierte Seiten */
.bp-placeholder-banner {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 6px;
    padding: 16px 20px;
    color: #795548;
    font-size: 0.92rem;
    margin-bottom: 20px;
}

/* ==========================================================================
   Statistik-Karten (Dashboard + Zahlungen)
   ========================================================================== */
.bp-stat-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.bp-stat-card {
    flex: 0 0 200px;
    max-width: 260px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 16px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

.bp-stat-zahl {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.1;
}

.bp-stat-label {
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bp-stat-card--rot   { border-top: 3px solid #c0392b; }
.bp-stat-card--rot   .bp-stat-zahl { color: #c0392b; }
.bp-stat-card--orange { border-top: 3px solid #e67e22; }
.bp-stat-card--orange .bp-stat-zahl { color: #e67e22; }
.bp-stat-card--gruen  { border-top: 3px solid #27ae60; }
.bp-stat-card--gruen  .bp-stat-zahl { color: #27ae60; }

/* Klickbare Stat-Cards */
.bp-stat-card--clickable {
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.1s;
    position: relative;
}
.bp-stat-card--clickable:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.13);
    transform: translateY(-1px);
}
.bp-stat-card--clickable:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,0,0,0.10);
}
.bp-stat-card--clickable::after {
    content: "\25B6";
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.6rem;
    color: #bbb;
}
.bp-stat-card--clickable:hover::after { color: #888; }

/* ==========================================================================
   Dashboard-Modals (Schülerlisten)
   ========================================================================== */
.bp-dash-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.bp-dash-modal {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bp-dash-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: #2c3e50;
    color: #fff;
    flex-shrink: 0;
}
.bp-dash-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bp-dash-modal-count {
    font-size: 0.85rem;
    opacity: 0.85;
    white-space: nowrap;
}
.bp-dash-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bp-dash-modal-close:hover { opacity: 0.7; }

.bp-dash-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

/* Schülerliste im Modal */
.bp-modal-student-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.bp-modal-student-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.92rem;
}
.bp-modal-student-list li:last-child { border-bottom: none; }
.bp-modal-student-list li:nth-child(even) { background: #fafafa; }
.bp-modal-student-name {
    font-weight: 500;
    color: #333;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bp-modal-student-class {
    color: #888;
    font-size: 0.82rem;
    white-space: nowrap;
    margin-left: 12px;
    flex-shrink: 0;
}

/* Mobile: Modal fast fullscreen */
@media (max-width: 600px) {
    .bp-dash-overlay { padding: 8px; }
    .bp-dash-modal {
        width: 100%;
        max-width: none;
        max-height: 92vh;
        border-radius: 8px;
    }
    .bp-dash-modal-header { padding: 14px 16px; }
    .bp-dash-modal-header h3 {
        font-size: 0.9rem;
        white-space: normal;
    }
    .bp-modal-student-list li {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 16px;
        gap: 2px;
    }
    .bp-modal-student-class { margin-left: 0; }
}

/* iPad Querformat */
@media (min-width: 768px) and (max-width: 1024px) {
    .bp-dash-modal {
        width: 80%;
        max-width: 560px;
    }
}

/* --------------------------------------------------------------------------
   Schüler-Link (Name → Detailseite)
   -------------------------------------------------------------------------- */
.bp-schueler-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted #999;
    transition: border-color 0.15s, color 0.15s;
}
.bp-schueler-link:hover,
.bp-schueler-link:focus {
    color: #004085;
    border-bottom-color: #004085;
    outline: none;
}
/* In Modals: etwas kraeftigere Grundfarbe */
.bp-dash-modal .bp-schueler-link {
    color: #333;
}
.bp-dash-modal .bp-schueler-link:hover {
    color: #004085;
}
/* Druck: kein Link-Styling */
@media print {
    .bp-schueler-link {
        border-bottom: none !important;
        color: inherit !important;
        pointer-events: none;
    }
}

/* ==========================================================================
   Dashboard-Karten (Jahrgang / Klasse)
   ========================================================================== */
.bp-dashboard-karte {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 16px;
    min-width: 110px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

.bp-dashboard-karte-titel {
    font-weight: 700;
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 4px;
}

.bp-karten-zahl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.bp-karten-zahl:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.bp-karten-zahl--rot    { background: #fde8e8; color: #c0392b; }
.bp-karten-zahl--orange { background: #fef3e2; color: #e67e22; }
.bp-karten-zahl--gruen  { background: #e8f8ee; color: #27ae60; }

/* ==========================================================================
   Popup-Modal (Dashboard SuS-Liste)
   ========================================================================== */
#bp-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#bp-popup-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#bp-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #2c3e50;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

#bp-popup-body {
    overflow-y: auto;
    padding: 0;
    flex: 1;
}

/* ==========================================================================
   Zahlungs-Info-Boxen (Scan Fall A + Zahlungen Admin)
   ========================================================================== */
.bp-zahlung-info-box {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 16px;
    min-width: 130px;
    text-align: center;
}

.bp-zahlung-info-label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.bp-zahlung-info-wert {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
}

.bp-zahlung-info-box--gruen { border-color: #27ae60; background: #e8f8ee; }
.bp-zahlung-info-box--gruen .bp-zahlung-info-wert { color: #27ae60; }
.bp-zahlung-info-box--rot   { border-color: #c0392b; background: #fde8e8; }
.bp-zahlung-info-box--rot   .bp-zahlung-info-wert { color: #c0392b; }

/* ==========================================================================
   Tab-Navigation (Zahlungsaktionen)
   ========================================================================== */
.bp-tab-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: none;
    padding: 7px 16px;
    font-size: 0.88rem;
    cursor: pointer;
    color: #555;
    border-radius: 4px 4px 0 0;
    margin-right: 3px;
    transition: background 0.15s;
}

.bp-tab-btn:hover {
    background: #e9ecef;
}

.bp-tab-btn--active {
    background: #fff;
    color: #2c3e50;
    font-weight: 600;
    border-bottom: 2px solid #fff;
    margin-bottom: -2px;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Markierte Tabellenzeile (ausgewählte Bestellung)
   ========================================================================== */
.bp-row-selected {
    background: #e8f4fd !important;
}

/* ==========================================================================
   Responsive (iPad + Desktop)
   ========================================================================== */
@media (max-width: 768px) {
    .bp-container {
        padding: 0 12px;
    }

    .bp-header .bp-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .bp-nav a {
        margin-left: 0;
        margin-right: 12px;
    }

    /* Sidebar auf schmalen Bildschirmen oben statt seitlich */
    .bp-admin-wrapper {
        flex-direction: column;
    }

    .bp-sidebar {
        width: 100%;
        min-width: 0;
        padding: 8px 10px;
        overflow-x: visible;
    }

    .bp-sidenav {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }

    .bp-sidenav-group {
        margin-bottom: 0;
        display: contents;
    }

    .bp-sidenav-heading {
        display: none;
    }

    .bp-sidenav-link {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px 6px;
        font-size: 0.82rem;
        border-left: none;
        border-radius: 4px;
        border: 1px solid rgba(255,255,255,0.12);
        background: rgba(255,255,255,0.06);
        white-space: normal;
        text-align: center;
        word-break: break-word;
        min-height: 40px;
    }

    .bp-sidenav-link.bp-nav-active {
        border-left-color: transparent;
        border-color: #3498db;
        background: rgba(52,152,219,0.15);
    }

    .bp-admin-content {
        padding: 16px;
    }
}

/* ==========================================================================
   Mail-Einstellungen (Stufe 11)
   ========================================================================== */

/* Grid fuer SMTP-Formular auf kleinen Bildschirmen einspaltrig */
@media (max-width: 600px) {
    .bp-card form [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   Mobile / Handy Hochformat (< 480px)
   ========================================================================== */
@media (max-width: 480px) {
    html { font-size: 14px; }

    .bp-header--admin .bp-header-inner {
        padding: 0 10px;
        gap: 6px;
    }

    .bp-logo { font-size: 1.1rem; }

    .bp-header-right {
        gap: 6px;
        font-size: 0.8rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .bp-schuljahr-badge { font-size: 0.72rem; padding: 2px 8px; }
    .bp-admin-user { font-size: 0.78rem; }
    .bp-btn--logout { padding: 4px 10px; font-size: 0.78rem; }

    .bp-help-controls {
        display: flex;
        gap: 4px;
    }

    .bp-help-toggle,
    .bp-tour-start {
        font-size: 0.72rem !important;
        padding: 3px 8px !important;
    }

    /* Sidebar: kompakt als Wrap-Grid */
    .bp-sidebar {
        padding: 6px 8px;
        overflow-x: visible;
    }

    .bp-sidenav {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        padding: 0;
        gap: 4px;
    }

    .bp-sidenav-link {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px 6px;
        font-size: 0.72rem;
        white-space: normal;
        text-align: center;
        border-left: none;
        border-radius: 4px;
        border: 1px solid rgba(255,255,255,0.12);
        background: rgba(255,255,255,0.06);
        min-width: 0;
        word-break: break-word;
        hyphens: auto;
        line-height: 1.2;
        min-height: 38px;
    }

    .bp-sidenav-link.bp-nav-active {
        border-left-color: transparent;
        border-color: #3498db;
        background: rgba(52,152,219,0.15);
    }

    .bp-sidenav-link--dashboard {
        font-size: 0.76rem;
    }

    /* Admin Content */
    .bp-admin-content {
        padding: 12px 10px;
    }

    .bp-admin-content h2 {
        font-size: 1.15rem;
        margin-bottom: 12px;
    }

    /* Karten */
    .bp-card {
        padding: 12px 10px;
        margin-bottom: 10px;
    }

    /* Tabellen: horizontal scrollbar */
    .bp-table th,
    .bp-table td {
        padding: 6px 8px;
        font-size: 0.82rem;
    }

    /* Stat-Cards mobil: 2 pro Zeile, gleichmäßig verteilt */
    .bp-stat-grid {
        gap: 8px;
    }

    .bp-stat-card {
        flex: 1 1 calc(50% - 8px);
        max-width: none;
        padding: 10px 10px;
    }

    .bp-stat-zahl { font-size: 1.3rem; }
    .bp-stat-label { font-size: 0.7rem; }

    /* Buttons */
    .bp-btn {
        padding: 6px 14px;
        font-size: 0.85rem;
    }

    .bp-btn--small {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    /* Formularfelder */
    .bp-form-group label {
        font-size: 0.82rem;
    }

    .bp-form-group input[type="text"],
    .bp-form-group input[type="password"],
    .bp-form-group input[type="email"],
    .bp-form-group input[type="number"],
    .bp-form-group input[type="date"],
    .bp-form-group input[type="datetime-local"],
    .bp-form-group input[type="search"],
    .bp-form-group select,
    .bp-form-group textarea {
        padding: 6px 10px;
        font-size: 0.88rem;
    }

    /* Inline-Grids einspaltrig */
    [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Flex-Filter-Leisten stapeln */
    form[style*="display:flex"][style*="gap"] {
        flex-direction: column;
        align-items: stretch !important;
    }

    /* Popup */
    #bp-popup-box {
        max-width: 95vw;
        max-height: 85vh;
    }

    /* Dashboard-Karten */
    .bp-dashboard-karte {
        min-width: 90px;
        padding: 10px 12px;
    }

    /* Zahlungs-Info-Boxen */
    .bp-zahlung-info-box {
        min-width: 100px;
        padding: 10px 12px;
    }

    .bp-zahlung-info-wert { font-size: 1.1rem; }

    /* Login */
    .bp-login-wrap { padding: 20px 12px; }
    .bp-login-card { max-width: 100%; }
}

/* ==========================================================================
   Tablet Portrait (481px - 768px) – Verbesserungen
   ========================================================================== */
@media (min-width: 481px) and (max-width: 768px) {
    .bp-admin-content {
        padding: 16px 14px;
    }

    .bp-stat-card {
        flex: 0 0 160px;
        max-width: 220px;
    }

    .bp-card {
        padding: 14px;
        margin-bottom: 10px;
    }

    /* Grids max 2 Spalten */
    [style*="grid-template-columns: 2fr 1fr"],
    [style*="grid-template-columns:2fr 1fr"] {
        grid-template-columns: 1fr 1fr !important;
    }

    [style*="grid-template-columns: 1fr 1fr 1fr"],
    [style*="grid-template-columns:1fr 1fr 1fr"] {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* ==========================================================================
   Bestellrunden-Kontext: Kontextleiste + Tab-Navigation
   ========================================================================== */

/* Bestellrunden-Kontextmenü: verwendet AdminLTE card + btn-group */

/* Bestellrunden-Übersicht: Karten */
.bp-runde-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 18px;
    transition: box-shadow 0.15s;
}
.bp-runde-card:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.bp-runde-card--offen {
    border-left: 4px solid #27ae60;
}
.bp-runde-card--vorbereitung {
    border-left: 4px solid #f39c12;
}
.bp-runde-card--geschlossen {
    border-left: 4px solid #c0392b;
}
.bp-runde-card--archiviert {
    border-left: 4px solid #95a5a6;
}

/* Responsive: Bestellrunden-Kontextmenü btn-group wrap */
@media (max-width: 768px) {
    .card-body .btn-group-sm .btn {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
    .card-body .btn-group-sm .btn > span.d-none-xs {
        display: none;
    }
}

/* ==========================================================================
   Datenschutz-Zustimmungs-Modal (Mobile-first, iPhone Safari safe)
   ========================================================================== */
.bp-privacy-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    /* Safe-Area fuer iPhones mit Notch / Home-Indicator */
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    padding-top: max(16px, env(safe-area-inset-top));
}

.bp-privacy-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    /* Fallback fuer aeltere Browser */
    max-height: 85vh;
    /* dvh = dynamic viewport height, beruecksichtigt Safari-Browserleiste */
    max-height: 85dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bp-privacy-modal-header {
    padding: 20px 28px;
    background: #2c3e50;
    color: #fff;
    flex-shrink: 0;
}

.bp-privacy-modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.bp-privacy-modal-body {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    padding: 24px 28px;
    -webkit-overflow-scrolling: touch;
    /* Scroll-Indikator am unteren Rand des Textbereichs */
    overscroll-behavior: contain;
}

.bp-privacy-text {
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
    word-wrap: break-word;
}

.bp-privacy-modal-footer {
    flex-shrink: 0;
    padding: 20px 28px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.bp-privacy-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 16px;
    color: #333;
}

.bp-privacy-checkbox-label input[type="checkbox"] {
    width: 24px;
    height: 24px;
    min-width: 24px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #2c3e50;
}

.bp-privacy-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.bp-btn--lg {
    padding: 12px 28px;
    font-size: 1rem;
    min-height: 48px;
}

#bp-privacy-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile / kleine Geraete */
@media (max-width: 600px) {
    .bp-privacy-overlay {
        padding: 8px;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        padding-top: max(8px, env(safe-area-inset-top));
        /* Auf kleinen Displays: Modal am unteren Rand ausrichten,
           damit der Aktionsbereich naeher am Daumen liegt */
        align-items: flex-end;
    }
    .bp-privacy-modal {
        width: 100%;
        max-width: none;
        /* Fallback */
        max-height: calc(100vh - 16px);
        /* dvh beruecksichtigt die dynamische Safari-Toolbar */
        max-height: calc(100dvh - 16px);
        border-radius: 12px 12px 0 0;
    }
    .bp-privacy-modal-header {
        padding: 16px 20px;
    }
    .bp-privacy-modal-body {
        padding: 16px 20px;
    }
    .bp-privacy-modal-footer {
        padding: 16px 20px;
        /* Extra Abstand unten fuer iPhone Home-Indicator */
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    .bp-privacy-checkbox-label {
        /* Groesserer Touch-Bereich auf Mobilgeraeten */
        padding: 4px 0;
    }
    .bp-privacy-checkbox-label input[type="checkbox"] {
        width: 28px;
        height: 28px;
        min-width: 28px;
    }
    .bp-privacy-buttons {
        flex-direction: column;
    }
    .bp-privacy-buttons .bp-btn {
        width: 100%;
        text-align: center;
        min-height: 50px;
    }
}

/* iPad Querformat */
@media (min-width: 768px) and (max-width: 1024px) {
    .bp-privacy-modal {
        width: 85%;
        max-width: 800px;
    }
}

/* ==========================================================================
   E-Mail-Erinnerungs-Modal (Bestellseite)
   ========================================================================== */
.bp-email-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    padding-top: max(16px, env(safe-area-inset-top));
}

.bp-email-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 540px;
    max-height: 85vh;
    max-height: 85dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bp-email-modal-header {
    padding: 20px 28px;
    background: #e67e22;
    color: #fff;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bp-email-modal-header h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
}

.bp-email-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.bp-email-modal-close:hover {
    color: #fff;
}

.bp-email-modal-body {
    padding: 24px 28px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
}

.bp-email-modal-footer {
    flex-shrink: 0;
    padding: 20px 28px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .bp-email-overlay {
        padding: 8px;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        padding-top: max(8px, env(safe-area-inset-top));
        align-items: flex-end;
    }
    .bp-email-modal {
        width: 100%;
        max-width: none;
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
        border-radius: 12px 12px 0 0;
    }
    .bp-email-modal-header {
        padding: 16px 20px;
    }
    .bp-email-modal-body {
        padding: 16px 20px;
    }
    .bp-email-modal-footer {
        padding: 16px 20px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        flex-direction: column;
    }
    .bp-email-modal-footer .bp-btn {
        width: 100%;
        text-align: center;
        min-height: 50px;
    }
}

/* ==========================================================================
   Footer-Links (Datenschutz / Impressum)
   ========================================================================== */
.bp-footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.bp-footer-links {
    display: flex;
    gap: 16px;
}

.bp-footer-links a {
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.15s;
}

.bp-footer-links a:hover {
    color: #333;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .bp-footer-inner {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================================================
   Kontextbezogene Datenschutzhinweise
   ========================================================================== */
.bp-datenschutz-hinweis {
    font-size: 0.82rem;
    color: #666;
    line-height: 1.5;
    margin-top: 16px;
    text-align: center;
}

.bp-datenschutz-hinweis a {
    color: #004085;
    text-decoration: underline;
}

.bp-datenschutz-hinweis--prominent {
    background: #eef6ff;
    border: 1px solid #b8d4f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    text-align: left;
    font-size: 0.85rem;
    color: #333;
}

.bp-datenschutz-hinweis--prominent small {
    color: #666;
    display: block;
    margin-top: 4px;
}

@media print {
    .bp-datenschutz-hinweis,
    .bp-footer-links {
        display: none;
    }
}

/* ==========================================================================
   Sicherheit – Admin-Bereich
   ========================================================================== */

/* Security-Grid: Kachel-Layout fuer Sicherheits-Abschnitte */
.bp-security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.bp-security-grid .bp-card--full {
    grid-column: 1 / -1;
}

/* Btn-Varianten */
.bp-btn--secondary {
    background: #95a5a6;
    color: #fff;
}
.bp-btn--secondary:hover {
    background: #7f8c8d;
}

.bp-btn--sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

/* Text-Farben */
.bp-text-danger { color: #e74c3c; }
.bp-text-success { color: #27ae60; }

/* Dezenter Link (z.B. "Passwort vergessen?") */
.bp-link-muted {
    color: #888;
    text-decoration: none;
    font-size: 0.88rem;
}
.bp-link-muted:hover {
    color: #2c3e50;
    text-decoration: underline;
}

/* Checkbox-Label inline */
.bp-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
}
.bp-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Hilfstext unter Feldern/Abschnitten */
.bp-help-text {
    font-size: 0.85rem;
    color: #888;
    line-height: 1.4;
}

/* Disabled Input (z.B. Benutzername) */
.bp-input-disabled {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #f5f5f5;
    color: #888;
}

/* Tabelle responsive */
.bp-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Kompakte Tabelle */
.bp-table--compact th,
.bp-table--compact td {
    padding: 6px 10px;
    font-size: 0.85rem;
}

/* Re-Auth-Overlay */
.bp-reauth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.bp-reauth-modal {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.bp-reauth-modal h3 {
    margin-bottom: 8px;
    color: #2c3e50;
}

.bp-reauth-modal p {
    margin-bottom: 15px;
    color: #666;
    font-size: 0.9rem;
}

@media (max-width: 500px) {
    .bp-security-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    .bp-security-grid,
    .bp-reauth-overlay {
        display: none;
    }
}

/* ==========================================================================
   Lizenzzuweisung – Kacheln, Chips, Sticky-Bar (Tablet-optimiert)
   ========================================================================== */

/* Jahrgang-Kacheln */
.bp-kachel-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 4px 0;
}

.bp-kachel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    min-height: 56px;
    padding: 10px 18px;
    border: 2px solid #d0d0d0;
    border-radius: 10px;
    background: #fff;
    color: #555;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.bp-kachel:hover {
    border-color: #3498db;
    background: #eaf4fd;
}

.bp-kachel--active {
    background: #3498db;
    border-color: #2980b9;
    color: #fff;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.bp-kachel--active:hover {
    background: #2980b9;
    border-color: #2471a3;
}

/* Klassen-Chips */
.bp-chip-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
}

.bp-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border: 2px solid #d0d0d0;
    border-radius: 20px;
    background: #fff;
    color: #555;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.bp-chip:hover {
    border-color: #27ae60;
    background: #eafaf1;
}

.bp-chip--active {
    background: #27ae60;
    border-color: #219a52;
    color: #fff;
}

.bp-chip--active:hover {
    background: #219a52;
}

/* Buch-Kacheln */
.bp-buch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
    padding: 4px 0;
}

.bp-buch-kachel {
    display: flex;
    flex-direction: column;
    border: 2px solid #d0d0d0;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.bp-buch-kachel:hover {
    border-color: #8e44ad;
    box-shadow: 0 2px 8px rgba(142, 68, 173, 0.15);
}

.bp-buch-kachel--active {
    border-color: #8e44ad;
    background: #f9f0fc;
    box-shadow: 0 2px 8px rgba(142, 68, 173, 0.25);
}

.bp-buch-kachel__img {
    width: 100%;
    height: 80px;
    object-fit: contain;
    background: #f8f8f8;
    padding: 6px;
}

.bp-buch-kachel__img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 80px;
    background: #f0f0f0;
    color: #bbb;
    font-size: 2rem;
}

.bp-buch-kachel__body {
    padding: 10px 12px;
    flex: 1;
}

.bp-buch-kachel__titel {
    font-size: 0.88rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bp-buch-kachel__stats {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.78rem;
    color: #777;
}

.bp-buch-kachel__stat {
    display: flex;
    justify-content: space-between;
}

.bp-buch-kachel__stat--offen {
    color: #e67e22;
    font-weight: 600;
}

/* Aktionsleiste (sticky) */
.bp-lizenz-sticky {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #2c3e50;
    color: #fff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
}

.bp-lizenz-sticky__info {
    font-size: 0.88rem;
    color: #bdc3c7;
    margin-left: auto;
}

.bp-lizenz-sticky .bp-btn {
    min-height: 44px;
    padding: 8px 20px;
    font-size: 0.95rem;
}

/* Schülerliste – Touch-optimierte Checkboxen */
.bp-lizenz-table {
    width: 100%;
    border-collapse: collapse;
}

.bp-lizenz-table th,
.bp-lizenz-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e8e8e8;
    text-align: left;
    vertical-align: middle;
}

.bp-lizenz-table thead th {
    background: #f8f8f8;
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    position: sticky;
    top: 0;
    z-index: 10;
}

.bp-lizenz-table tbody tr:hover {
    background: #f5f9ff;
}

.bp-lizenz-table .bp-cb-cell {
    width: 44px;
    text-align: center;
}

.bp-lizenz-table input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: #3498db;
}

/* Zahlungs-Badge */
.bp-zahlung-warnung {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f8d7da;
    color: #721c24;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Lizenz-Balken (kompakt) */
.bp-lizenz-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.bp-lizenz-bar__fill {
    display: inline-block;
    width: 60px;
    height: 8px;
    border-radius: 4px;
    background: #e0e0e0;
    overflow: hidden;
    position: relative;
}

.bp-lizenz-bar__fill-inner {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.bp-lizenz-bar__fill-inner--full {
    background: #27ae60;
}

.bp-lizenz-bar__fill-inner--partial {
    background: #f39c12;
}

.bp-lizenz-bar__fill-inner--none {
    background: #e74c3c;
}

/* Ergebnis-Modal */
.bp-lizenz-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.bp-lizenz-modal {
    background: #fff;
    border-radius: 10px;
    padding: 24px 28px;
    max-width: 520px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.bp-lizenz-modal h3 {
    margin-bottom: 16px;
    color: #2c3e50;
}

.bp-lizenz-modal__result {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.92rem;
}

.bp-lizenz-modal__result:last-child {
    border-bottom: none;
}

.bp-lizenz-modal__warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 0.88rem;
    color: #856404;
}

.bp-lizenz-modal__actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Sektions-Label */
.bp-lizenz-section {
    margin-bottom: 20px;
}

.bp-lizenz-section__label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* Loading-Spinner */
.bp-lizenz-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    color: #888;
    font-size: 0.9rem;
}

.bp-lizenz-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: bp-spin 0.6s linear infinite;
}

@keyframes bp-spin {
    to { transform: rotate(360deg); }
}

/* Leerer Zustand */
.bp-lizenz-empty {
    text-align: center;
    padding: 30px 20px;
    color: #aaa;
    font-size: 0.95rem;
}

/* Responsive: Tablet Landscape */
@media (max-width: 1024px) {
    .bp-buch-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .bp-buch-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .bp-lizenz-sticky {
        padding: 10px 12px;
        gap: 8px;
    }

    .bp-kachel {
        min-width: 52px;
        padding: 8px 14px;
        font-size: 1rem;
    }
}

/* Handy Hochformat (< 480px) */
@media (max-width: 480px) {
    /* Jahrgaenge: kompaktere Kacheln, 4 pro Reihe */
    .bp-kachel-grid {
        gap: 6px;
    }

    .bp-kachel {
        min-width: 44px;
        min-height: 44px;
        padding: 6px 10px;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    /* Chips: kleiner, enger */
    .bp-chip-bar {
        gap: 6px;
    }

    .bp-chip {
        padding: 6px 12px;
        font-size: 0.82rem;
        border-radius: 16px;
    }

    /* Buecher: 2 Spalten oder 1 bei sehr schmal */
    .bp-buch-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    .bp-buch-kachel__img,
    .bp-buch-kachel__img--placeholder {
        height: 60px;
    }

    .bp-buch-kachel__body {
        padding: 8px 10px;
    }

    .bp-buch-kachel__titel {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }

    .bp-buch-kachel__stats {
        font-size: 0.72rem;
    }

    /* Schuelerliste: kompakter */
    .bp-lizenz-table th,
    .bp-lizenz-table td {
        padding: 8px 6px;
        font-size: 0.82rem;
    }

    .bp-lizenz-table .bp-cb-cell {
        width: 36px;
    }

    .bp-lizenz-table input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    /* Sticky-Bar: vertikal stapeln */
    .bp-lizenz-sticky {
        padding: 10px 10px;
        gap: 6px;
        flex-direction: column;
        align-items: stretch;
        border-radius: 8px 8px 0 0;
    }

    .bp-lizenz-sticky .bp-btn {
        min-height: 40px;
        padding: 8px 14px;
        font-size: 0.85rem;
        width: 100%;
        text-align: center;
    }

    .bp-lizenz-sticky__info {
        text-align: center;
        margin-left: 0;
        font-size: 0.8rem;
    }

    /* Sektions-Label kleiner */
    .bp-lizenz-section__label {
        font-size: 0.75rem;
    }

    /* Fortschrittsbalken kuerzer */
    .bp-lizenz-bar__fill {
        width: 40px;
    }

    .bp-lizenz-bar {
        font-size: 0.78rem;
    }

    /* Modal: fast fullscreen */
    .bp-lizenz-modal-overlay {
        padding: 8px;
    }

    .bp-lizenz-modal {
        width: 100%;
        max-width: 100%;
        padding: 18px 16px;
        border-radius: 8px;
    }

    .bp-lizenz-modal h3 {
        font-size: 1rem;
    }

    .bp-lizenz-modal__result {
        font-size: 0.82rem;
    }

    /* Zahlungs-Badge */
    .bp-zahlung-warnung {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}

    /* Bottom-Padding damit Sticky-Bar den letzten Schueler nicht verdeckt */
    #schueler-section {
        padding-bottom: 160px;
    }
}

/* Sehr kleine Geraete (< 360px) */
@media (max-width: 360px) {
    .bp-buch-grid {
        grid-template-columns: 1fr;
    }

    .bp-kachel {
        min-width: 38px;
        padding: 5px 8px;
        font-size: 0.85rem;
    }

    .bp-lizenz-table th,
    .bp-lizenz-table td {
        padding: 6px 4px;
        font-size: 0.78rem;
    }
}

@media print {
    .bp-lizenz-sticky,
    .bp-kachel-grid,
    .bp-chip-bar,
    .bp-buch-grid {
        display: none;
    }

    .bp-lizenz-table input[type="checkbox"] {
        display: none;
    }
}
