/* style.css */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 12px;
    background-color: #f8f9fa;
    color: #333;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

h1 {
    color: #da251d;
    text-align: center;
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: bold;
}

/* Suchgruppe als echtes Tabellen-Layout verschmolzen */
.search-form {
    margin-bottom: 20px;
    width: 100%;
}

.search-group {
    display: flex;
    width: 100%;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-sizing: border-box;
}

.search-input {
    flex: 1;
    min-width: 0;
    padding: 14px;
    font-size: 16px;
    border: none;
    outline: none;
    -webkit-appearance: none;
}

.btn-reset {
    padding: 0 10px;
    color: #666;
    text-decoration: none;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.btn-submit {
    padding: 0 16px;
    font-size: 15px;
    font-weight: bold;
    border: none;
    background-color: #da251d;
    color: white;
    cursor: pointer;
    white-space: nowrap;
}

.btn-scan {
    padding: 0 16px;
    border: none;
    background-color: #002f6c;
    color: white;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    white-space: nowrap;
}

/* Vollbild-Scanner Overlay */
#scanner-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 40px 0;
    box-sizing: border-box;
}

.scanner-title {
    color: white;
    font-size: 20px;
    font-weight: bold;
}

/* Sicherer, nativer Video-Sucher */
.video-container {
    position: relative;
    width: 280px;
    height: 280px;
    border-radius: 16px;
    overflow: hidden;
    border: 3px solid #da251d;
    background: #000;
}

#webcam-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Visueller Roter DRK-Laser-Effekt */
.scanner-laser {
    position: absolute;
    top: 50%;
    left: 5%;
    width: 90%;
    height: 3px;
    background-color: #da251d;
    box-shadow: 0 0 8px #da251d;
    animation: laserMove 2s infinite ease-in-out;
}

@keyframes laserMove {
    0% { top: 5%; }
    50% { top: 95%; }
    100% { top: 5%; }
}

.btn-close-scanner {
    width: 85%;
    max-width: 280px;
    padding: 16px;
    background: #333;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}

/* Tabelle */
.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #eee;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

th, td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f1f3f5;
    color: #495057;
}

.badge {
    background: #edf2f7;
    color: #2b6cb0;
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: bold;
}

.badge-ort {
    background: #e9ecef;
    color: #495057;
}

/* ==========================================
   ULTRA-KOMPAKTES SMARTPHONE-CSS (MAXIMALER PLATZ)
   ========================================== */
@media screen and (max-width: 600px) {
    /* Schaltet alle störenden Breiten-Blockaden im HTML auf flexibel um */
    .stamm-details table, .sub-table, .sub-table tr, .sub-table td {
        display: block !important;
        width: 100% !important;
    }
    
    .sub-table th { display: none !important; } /* Überschriften verstecken für Platz */

    /* Macht aus jeder Tabellenzeile einen flachen, schmalen Block */
    .sub-table td {
        padding: 4px 2px !important;
        border: none !important;
        box-sizing: border-box !important;
    }

    /* Setzt die Eingabefelder (Ort, Menge, MHD, Prüf) extrem flach untereinander */
    .sub-table td select, .sub-table td input {
        width: 100% !important;
        padding: 6px !important;
        font-size: 13px !important;
        margin-bottom: 3px !important;
        height: auto !important;
    }

    /* Der graue Stammdaten-Editierbalken wird untereinander gestapelt */
    .stamm-details > div[style*="background:#f1f5f9"] {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 6px !important;
    }
    
    .stamm-details > div[style*="background:#f1f5f9"] > div {
        width: 100% !important;
        margin-bottom: 4px !important;
    }

    /* Reduziert sämtliche unnötigen Luft-Abstände */
    .container { padding: 5px !important; }
    .admin-box { padding: 8px !important; margin-bottom: 10px !important; }
    .stamm-header { padding: 6px 8px !important; font-size: 13px !important; }
}

