:root { 
    --wp-blue: #3498db; 
    --wp-dark: #2c3e50; 
    --danger: #e74c3c; 
    --success: #27ae60; 
    --warning: #e67e22; 
    --bg: #f4f7f6; 
}

body { 
    font-family: 'Segoe UI', sans-serif; 
    background: var(--wp-dark); 
    margin: 0; 
    display: flex; 
    justify-content: center; 
    min-height: 100vh; 
    overflow-y: auto; /* Zorgt dat je kunt scrollen als het scherm klein is */
    padding: 10px; /* Zorgt voor wat ruimte aan de randen */
}

.tablet { 
    width: 100vw; 
    height: 100vh; 
    max-width: none;
    background: white; 
    border-radius: 15px; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.5); 
    display: flex; 
    flex-direction: column; 
    position: relative;

    /* VERWIJDER overflow: hidden; */
}

.header { 
    padding: 15px 25px; 
    border-bottom: 2px solid #eee; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    background: white; 
}

.content { 
    flex: 1; 
    padding: 25px; 
    overflow-y: auto; /* Dit is de belangrijkste voor je scroll-probleem */
    background: var(--bg);
    display: flex;        /* Voeg dit toe */
    flex-direction: column; /* Dit zorgt dat elementen onder elkaar blijven */
}

.screen { display: none; } 
.screen.active { display: block; }

/* Layouts */
.login-box { 
    max-width: 400px; 
    margin: 80px auto; 
    background: white; 
    padding: 30px; 
    border-radius: 12px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
}

/* Voor de ledenlijst (mogen kleinere blokjes zijn) */
.leden-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

/* Voor het barscherm (moeten breder zijn vanwege de knoppen) */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Verhoogd naar 220px */
    gap: 15px;
    margin-top: 20px;
}

.lid-card { 
    background: white; 
    padding: 20px; 
    border-radius: 10px; 
    text-align: center; 
    cursor: pointer; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); 
    font-weight: bold; 
    border: 2px solid transparent; 
    transition: 0.2s; 
    aspect-ratio: 1 / 1; 
    display: flex; 
    flex-direction: column; 
    justify-content: center;
     align-items: center;
}

.lid-voornaam {
    font-size: 1.3em;
    margin-bottom: 5px;
}

.lid-achternaam {
    font-size: 0.85em;
    color: #555;
}

/* De universele klasse voor het zweef-effect */
.hover-lift {
    border: 2px solid transparent; /* Zorgt dat de blauwe rand straks ruimte heeft */
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.hover-lift:hover {
    border-color: var(--wp-blue) !important; /* !important overschrijft de standaard knop-rand */
    transform: translateY(-2px);
}

/* Tabs & Badges */
.admin-tabs { 
    display: flex; 
    gap: 5px; 
    margin-bottom: 20px; 
    background: #ddd; 
    padding: 5px; 
    border-radius: 8px; 
}

.tab-btn { 
    flex: 1; 
    padding: 10px; 
    border: none; 
    cursor: pointer; 
    border-radius: 5px; 
    font-weight: bold; 
    position: relative; 
}

.tab-btn.active { 
    background: var(--wp-blue); 
    color: white; 
}

.badge-count { 
    position: absolute; 
    top: -5px; 
    right: -5px; 
    background: var(--danger); 
    color: white; 
    border-radius: 50%; 
    padding: 2px 6px; 
    font-size: 10px; 
    border: 2px solid white; 
}

/* UI Elements */
.btn { 
    border: 2px solid transparent; /* Vaste transparante rand voor elke knop */
    box-sizing: border-box;       /* Zorgt dat de rand netjes binnen de knop valt */
    padding: 10px 15px; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: bold; 
    color: white; 
    transition: 0.2s; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
}

.btn-blue { background: var(--wp-blue); } 
.btn-red { background: var(--danger); } 
.btn-green { background: var(--success); } 
.btn-orange { background: var(--warning); }
.btn-gray { background: #666; }
.btn-text { background: none; color: #666; }

/* Aangepaste knop groottes */
.btn-large { padding: 12px; font-size: 1.1em; }
.btn-xl { padding: 15px; font-size: 1.1em; }

/* De afbeelding binnen de knop */
.btn img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0; /* Zorgt dat het icoon nooit kan krimpen */
}

table { 
    width: 100%; 
    border-collapse: collapse; 
    background: white; 
    border-radius: 8px; 
    margin-bottom: 20px; 
}

th, td { 
    padding: 12px; 
    border-bottom: 1px solid #eee; 
}

/* Gecentreerde tabel layout */
th:nth-child(1), td:nth-child(1), th:nth-child(2), td:nth-child(2) { text-align: left; }
th:nth-child(3), td:nth-child(3), th:nth-child(4), td:nth-child(4), th:nth-child(5), td:nth-child(5) { text-align: center; }

input, select, textarea { 
    width: 100%; 
    padding: 10px; 
    margin: 5px 0 15px 0; 
    border: 1px solid #ccc; 
    border-radius: 5px; 
    box-sizing: border-box; 
}

/* Modals */
.modal { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.7); 
    display: none; 
    align-items: center; 
    justify-content: center; 
    z-index: 1000; 
}

.modal-content { 
    background: white; 
    padding: 30px; 
    border-radius: 15px; 
    width: 90%; /* Flexibel: neemt op een gsm 90% van het scherm in, laat links en rechts wat ademruimte */
    max-width: 500px; /* De normale modal (bv. "Lid Toevoegen") stopt bij 500px, mooi compact op pc */
    max-height: 85%; 
    overflow-y: auto; 
}

.modal-wide {
    max-width: 800px; /* Als je de class "modal-wide" toevoegt (bv. bij het chat/berichten scherm), mag hij uitzonderlijk 800px breed worden op de pc. */
}

.card { 
    background: white; 
    border-radius: 12px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
    aspect-ratio: 1 / 1; 
    height: auto; /* Verwijder een eventuele vaste 'height: 150px' als die erin stond */
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    padding: 15px;
    border: 2px solid transparent;

}

.clickable-saldo { 
    color: var(--wp-blue); 
    text-decoration: underline; 
    cursor: pointer; 
    font-weight: bold; 
}

.error-msg, .error-text { 
    color: var(--danger); 
}
.error-msg {
    font-size: 0.85em; 
    margin-top: -10px; 
    margin-bottom: 15px; 
    display: none;
}
.error-text {
    font-size: 12px;
}

.pulse-animation { animation: wp-pulse 1s infinite; }
@keyframes wp-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.04); box-shadow: 0 0 12px rgba(230, 126, 34, 0.7); }
    100% { transform: scale(1); }
}

/* Header styling */
.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wp-circle {
    width: 40px; 
    height: 40px; 
    background: var(--wp-dark); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: white; 
    font-weight: bold;
}

.nav-buttons {
    display: none; 
    gap: 10px;
}

/* Helper Classes voor Layout & Spacing */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-end { display: flex; justify-content: flex-end; align-items: center; }

.gap-10 { gap: 10px; }
.gap-15 { gap: 15px; }

.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mt-5 { margin-top: 5px; }
.mt-10 { margin-top: 10px; }
.mt-30 { margin-top: 30px; }
.mt-35 { margin-top: 35px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.m-auto { margin: auto; }

.text-center { text-align: center; }
.text-dark { color: var(--wp-dark); }
.w-full { width: 100%; }
.max-w-600 { max-width: 600px; }
.flex-1 { flex: 1; }

/* Beheer & Formulieren */
.admin-grid { 
    display: grid; 
    grid-template-columns: 300px 1fr; 
    gap: 20px; 
}

.admin-card { 
    background: white; 
    padding: 20px; 
    border-radius: 10px; 
}

.admin-card-interactive { 
    transition: all 0.3s ease; 
    border: 2px solid transparent; 
}

.admin-sort-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 900px) {
    .admin-grid {
        grid-template-columns: 1fr; /* Schakelt automatisch naar 1 kolom op kleinere schermen */
    }
}

.help-text { 
    color: #666; 
    display: block; 
    margin-top: -10px; 
    margin-bottom: 15px; 
    font-size: 0.85em; 
}

.select-auto { 
    width: auto; 
    margin: 0; 
    padding: 6px 12px; 
}

/* Statistieken */
.stats-header { 
    background: white; 
    padding: 15px; 
    border-radius: 10px; 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 15px; 
}

.stat-card { 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    height: 90px; 
    padding: 15px; 
    border-radius: 12px; 
    text-align: center; 
}

.stat-val { margin: 5px 0 0 0; }
.bg-dark { background: var(--wp-dark); color: white; }
.bg-success { background: var(--success); color: white; }
.bg-blue { background: var(--wp-blue); color: white; }

/* Pincode & Keypad */
#pin-display { 
    font-size: 40px; 
    letter-spacing: 15px; 
    margin: 20px 0; 
    color: var(--wp-blue); 
    font-weight: bold; 
    text-align: center;
}

#keypad { 
    display: grid; 
    grid-template-columns: repeat(3, 90px); 
    gap: 20px; 
    justify-content: center; 
}

/* Chat & Conversaties */
.chat-bubble { 
    background: #edf2f7; 
    padding: 12px; 
    border-radius: 6px; 
    margin-bottom: 15px; 
}

.chat-text { 
    font-style: italic; 
    margin: 5px 0 0 0; 
    color: #4a5568; 
}

.chat-history { 
    max-height: 400px; 
    overflow-y: auto; 
    margin-bottom: 15px; 
    border: 1px solid #e2e8f0; 
    border-radius: 6px; 
    padding: 10px; 
    background: #fff; 
}

.form-label { 
    display: block; 
    margin-bottom: 5px; 
    font-weight: bold; 
}

.textarea-chat { 
    width: 100%; 
    height: 80px; 
    padding: 10px; 
    border: 1px solid #ccc; 
    border-radius: 5px; 
    resize: none; 
    box-sizing: border-box; 
}

/* Kleuren voor status ledenfiches */
.bg-status-0 { background-color: #f0f0f0 !important; } /* Gast - Grijs */
.bg-status-5 { background-color: #ffffff !important; } /* Lid - Wit (Standaard) */
.bg-status-10 { background-color: #fff9c4 !important; } /* Beheerder - Lichtgeel */
.bg-status-15 { background-color: #ffcdd2 !important; } /* Admin - Lichtrood */
.bg-status-16 { background-color: #e1bee7 !important; } /* Hoofd Admin - Lichtpaars */

/* Winkelmandje Knoppen */
.cart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}
/* Standaard voor telefoons: iets compacter zodat de knoppen binnen de 2 kolommen passen */
.cart-btn {
    border: none;
    border-radius: 4px;
    width: 42px;
    height: 42px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Voor tablets en grotere schermen (vanaf 768px breed): de extra grote knoppen voor maximale grip */
@media (min-width: 768px) {
    .cart-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

.cart-btn-plus { background: var(--success); color: white; }
.cart-btn-min { background: var(--warning); color: white; }
.cart-btn-trash { background: var(--danger); color: white; }

.cart-qty {
    font-weight: bold;
    font-size: 1.2em;
    width: 40px;
    height: 38px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin: 0 5px; /* Wat ademruimte tussen de knoppen */
}

/* Verberg de standaard pijltjes in de number input voor een strakker design */
.cart-qty::-webkit-outer-spin-button,
.cart-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}
.cart-qty[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Badge voor aantal in mandje bij product titel */
.product-qty-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 2px solid white;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Producttekst vergroten op tablets (vanaf 768px breed) */
@media (min-width: 768px) {
    .card h4 {
        font-size: 1.3em;
        margin-bottom: 10px !important;
    }
    .card p {
        font-size: 1.2em;
    }
	.cart-qty {
        height: 48px;
	}	
}

/* ==========================================================================
   STATISTIEKEN OPMAAK (TAB-STATS)
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Mocht het scherm smaller zijn (bijv. mobiel/kleine tablet), schaal naar 1 kolom */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Opmaak voor de afzonderlijke kaarten binnen het grid */
.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.stat-card h4 {
    margin: 0 0 10px 0;
    color: var(--wp-dark);
    font-size: 1.1em;
    font-weight: 600;
}

.stat-card p {
    margin: 0;
    font-size: 1.8em;
    font-weight: bold;
    color: var(--wp-blue);
}

/* Opmaak voor de actie-knoppen container */
#stats-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    margin-bottom: 15px;
}

#poef-payment-actions {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); 
    gap: 10px;
    position: sticky; 
    top: 0; 
    z-index: 100; 
    background: var(--bg); 
    padding: 15px 0; 
    border-bottom: 2px solid #ccc; 
}

/* Unieke stijlen voor de betaalknoppen */
#poef-payment-actions .btn {
    aspect-ratio: 1 / 1; 
    white-space: normal; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    text-align: center;
}

.btn-text-top {
    font-size: 0.9em;
    font-weight: 600;
}

.btn-icon-mid {
    width: 100px;  /* Duidelijk groter formaat */
    height: 100px;
    object-fit: contain;
    flex-shrink: 0; /* Voorkomt dat de browser het icoon geforceerd kleiner maakt */
    margin: auto 0;
}

.btn-amount-bottom {
    font-size: 0.95em;
    font-weight: bold;
    opacity: 0.95;
}

/* Grote weergave van het icoon/QR-code op het bevestigingsscherm */
.confirm-qr-container {
    text-align: center;
    margin: 15px 0;
}

.confirm-qr-image {
    width: 200px;
    height: 200px;
    object-fit: contain;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

#pin-method-icon {
    text-align: center;
    margin: 15px 0;
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-icon-uniform {
    width: 150px;
    height: 150px;
    object-fit: contain;
    background: white;
    padding: 6px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.saldo-warning-banner {
    background-color: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}