* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: #f4f5f7;
    color: #1c1c1e;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 12px 48px;
}

@media (min-width: 640px) {
    .container { padding: 24px 16px 60px; }
}

.container.schmal {
    max-width: 420px;
    padding-top: 60px;
}

@media (max-width: 480px) {
    .container.schmal { padding-top: 24px; }
}

h1 { font-size: 1.6rem; margin: 0 0 16px; }
h2 { font-size: 1.2rem; margin: 32px 0 12px; }
h3 { font-size: 1rem; margin: 0 0 14px; }

.kassierer-aktion-raster {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 24px;
}

@media (min-width: 640px) {
    .kassierer-aktion-raster { grid-template-columns: 1fr 1fr; }
}

.kassierer-aktion-karte {
    background: #fff;
    border-radius: 10px;
    padding: 18px 20px;
}

.kassierer-aktion-karte form {
    gap: 12px;
}

.kassierer-aktion-karte input {
    text-align: center;
    letter-spacing: 4px;
    font-size: 1.3rem;
}

.kassierer-aktion-karte .btn {
    width: 100%;
}

.muted { color: #6b7280; font-size: 0.85rem; }

.kasse-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .kasse-header {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
        padding: 14px 16px;
    }

    .admin-aktionen {
        flex-wrap: wrap;
        justify-content: space-between;
    }
}

.kassenstand {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

form { display: flex; flex-direction: column; gap: 14px; }

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

input {
    padding: 12px 14px;
    font-size: 1.1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    max-width: 100%;
}

canvas { max-width: 100%; }

.btn {
    display: inline-block;
    text-align: center;
    padding: 14px 20px;
    font-size: 1.05rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
}

.btn-primary { background: #2563eb; }
.btn-danger { background: #dc2626; }

.btn-option {
    background: #111827;
    padding: 20px 10px;
    min-height: 90px;
    font-size: 1rem;
    line-height: 1.4;
}

@media (min-width: 640px) {
    .btn-option {
        padding: 28px 12px;
        min-height: 110px;
        font-size: 1.15rem;
    }
}

.btn-option:disabled {
    background: #d1d5db;
    color: #6b7280;
    cursor: not-allowed;
}

.preis { font-size: 0.95rem; font-weight: 400; opacity: 0.85; }

.optionen {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 640px) {
    .optionen { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

@media (min-width: 960px) {
    .optionen { grid-template-columns: repeat(4, 1fr); }
}

.tabelle-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabelle {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.tabelle th, .tabelle td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid #e5e7eb;
}

.tabelle tfoot td { font-weight: 700; }

.fehler {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.hinweis {
    background: #fef3c7;
    color: #92400e;
    padding: 14px 16px;
    border-radius: 8px;
}

.link {
    display: inline-block;
    margin-top: 16px;
    color: #2563eb;
}

.uebersicht {
    background: #fff;
    border-radius: 10px;
    padding: 4px 20px;
    margin-bottom: 20px;
}

.uebersicht-zeile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 1.05rem;
    flex-wrap: wrap;
}

.uebersicht-zeile:last-child { border-bottom: none; }

.admin-aktionen {
    display: flex;
    align-items: center;
    gap: 16px;
}

.live-feed {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.live-feed li {
    padding: 10px 14px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9rem;
    font-family: monospace;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.live-feed li:last-child { border-bottom: none; }

.live-feed li.neu {
    background: #dcfce7;
    animation: aufblitzen 2s ease-out;
}

@keyframes aufblitzen {
    from { background: #86efac; }
    to { background: #dcfce7; }
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

@media (max-width: 640px) {
    .admin-nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .admin-nav .btn {
        width: 100%;
        padding: 10px 8px;
        font-size: 0.85rem;
    }
}

.btn-sekundaer {
    background: #fff;
    color: #111827;
    border: 1px solid #d1d5db;
    padding: 10px 18px;
    font-size: 0.95rem;
}

.gratis-hinweis {
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #15803d;
    color: #fff;
    border-radius: 16px;
    padding: 32px 20px;
    margin: 16px 0 24px;
}

.gratis-hinweis-titel {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.gratis-hinweis-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.gratis-hinweis-text {
    font-size: 1.05rem;
    opacity: 0.9;
}

.kassa-zusatz-buttons {
    margin: 8px 0 28px;
}

.kassa-zusatz-buttons .btn-breit {
    margin: 0 0 12px;
}

.kassa-zusatz-buttons .btn-breit:last-child {
    margin-bottom: 0;
}

.btn-breit {
    display: block;
    width: 100%;
    padding: 16px;
    margin: 8px 0 28px;
    font-size: 1.05rem;
}

.btn:disabled {
    cursor: not-allowed;
    filter: grayscale(0.6) opacity(0.55);
    pointer-events: none;
}

.steuerung {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.modus-tasten {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modus-tasten .modus-aktiv {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.tabelle-klickbar tbody tr { cursor: pointer; }
.tabelle-klickbar tbody tr:hover { background: #f3f4f6; }

.btn-klein {
    padding: 8px 14px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.status-bezahlt { color: #15803d; font-weight: 600; }
.status-offen { color: #b45309; font-weight: 600; }

.schmal-form { max-width: 320px; }

.chip-liste {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.chip {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
}

.chip:hover { background: #f3f4f6; }

.steller {
    display: flex;
    align-items: center;
    gap: 12px;
    touch-action: manipulation;
}

.steller button {
    touch-action: manipulation;
}

.pin-seite {
    text-align: center;
}

.pin-seite .fehler {
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
}

.pin-punkte {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin: 8px 0 28px;
}

.pin-punkt {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #9ca3af;
    background: transparent;
}

.pin-punkt.gefuellt {
    background: #111827;
    border-color: #111827;
}

.pin-punkte.shake {
    animation: pin-schuetteln 0.4s;
}

@keyframes pin-schuetteln {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.pin-tastatur {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 260px;
    margin: 0 auto;
}

.pin-tastatur, .pin-taste {
    touch-action: manipulation;
}

.pin-taste {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid #d1d5db;
    background: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
}

.pin-taste:active { background: #e5e7eb; }

.pin-loeschen {
    font-size: 1.2rem;
    border: none;
    background: transparent;
}

.betrag-gross {
    font-size: 1.7rem;
    color: #111827;
}

/* Pause-Anzeige ist bewusst komplett inline gestylt (siehe index.php,
   eingabe.php, bestaetigung.php) statt hier über eine Klasse, damit die
   Sperre auch dann zuverlässig funktioniert, wenn diese CSS-Datei mal
   veraltet im Browser-Cache eines Geräts hängt. */

/* ---------- Handy-Ansicht: Tabellen werden zu Karten (kein seitliches Wischen mehr) ---------- */
/* Die Beschriftungen (data-label) setzt assets/mobil.js automatisch aus den Tabellenköpfen. */
@media (max-width: 700px) {
    .tabelle-wrapper { overflow-x: visible; }

    .tabelle,
    .tabelle thead,
    .tabelle tbody,
    .tabelle tfoot,
    .tabelle tr,
    .tabelle td {
        display: block;
        width: 100%;
    }

    .tabelle { background: transparent; border-radius: 0; overflow: visible; }
    .tabelle thead { display: none; }

    .tabelle tbody tr,
    .tabelle tfoot tr {
        background: #fff;
        border-radius: 12px;
        padding: 4px 14px;
        margin-bottom: 10px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    }

    .tabelle th, .tabelle td { padding: 0; }

    .tabelle td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 6px 12px;
        padding: 9px 0;
        border-bottom: 1px solid #f0f1f3;
        text-align: right;
        word-break: break-word;
    }

    .tabelle td:last-child { border-bottom: none; }

    .tabelle td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        max-width: 45%;
        font-size: 0.8rem;
        font-weight: 600;
        color: #6b7280;
        text-align: left;
    }

    .tabelle td[data-label=""]::before { display: none; }
    .tabelle td[data-label=""] { justify-content: flex-start; text-align: left; }

    /* Eingabefelder und Knöpfe in Tabellenzellen: volle Breite, gut antippbar */
    .tabelle td input[type="text"],
    .tabelle td input[type="number"] {
        width: 100% !important;
        flex: 1 1 100%;
    }

    .tabelle td form { width: 100%; }
    .tabelle td .btn { flex: 1 1 auto; padding: 11px 14px; }
    .tabelle td[data-label=""] .btn,
    .tabelle td[data-label=""] form { width: 100%; }

    .tabelle td input[type="checkbox"] { width: 24px; height: 24px; }

    /* Kopfzeile, Knöpfe und Formulare auf dem Handy etwas großzügiger */
    .btn { min-height: 44px; }
    .btn-klein { min-height: 40px; }
    .uebersicht { padding: 2px 14px; }
    .live-feed li { font-size: 0.82rem; }
    h1 { font-size: 1.4rem; }
}

/* ---------- Mini-Shop ---------- */
.shop-gesperrt {
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #111827;
    color: #fff;
    border-radius: 16px;
    padding: 32px 20px;
    margin: 16px 0 24px;
}
.shop-gesperrt strong { font-size: 1.7rem; margin-bottom: 8px; }
.shop-gesperrt span { color: #d1d5db; }

.shop-kacheln {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 640px) { .shop-kacheln { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.shop-kacheln .btn-option { min-height: 120px; font-size: 1.15rem; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.shop-kacheln .preis { font-size: 1.05rem; margin-top: 4px; }

.schnellgeld { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.schnellgeld .btn { flex: 1 1 60px; padding: 12px 8px; }

.shop-storniert td { color: #9ca3af; text-decoration: line-through; }
.shop-storniert td:last-child, .shop-storniert td[data-label=""] { text-decoration: none; }
.badge-storno { display: inline-block; background: #fee2e2; color: #991b1b; border-radius: 6px; padding: 2px 8px; font-size: 0.75rem; font-weight: 700; text-decoration: none; }
