*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface2: #22263a;
    --border: #2e3350;
    --text: #e2e8f0;
    --text-muted: #64748b;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 10px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; }

#app { min-height: 100vh; }

/* Layout */
.page { max-width: 600px; margin: 0 auto; padding: 1rem; min-height: 100vh; }
.page-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0 1.5rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.page-title { font-size: 1.2rem; font-weight: 700; }
.page-subtitle { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 0.75rem; }
.card-clickable { cursor: pointer; transition: border-color .15s, background .15s; }
.card-clickable:hover { border-color: var(--primary); background: var(--surface2); }
.card-title { font-weight: 600; margin-bottom: 0.25rem; }
.card-meta { font-size: 0.8rem; color: var(--text-muted); display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Status badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.badge-gepland    { background: #1e293b; color: #94a3b8; }
.badge-monstername { background: #1c2a4a; color: #60a5fa; }
.badge-analyse    { background: #1c3a2a; color: #4ade80; }
.badge-afgerond   { background: #2a1c3a; color: #c084fc; }
.badge-gepubliceerd { background: #1a2e1a; color: #86efac; }

/* Forms */
.form-group { margin-bottom: 1rem; }
label { display: block; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.35rem; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], select, textarea {
    width: 100%; padding: .7rem .85rem; background: var(--surface2); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-size: 1rem; font-family: var(--font);
    -webkit-appearance: none; appearance: none;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
input[readonly] { color: var(--text-muted); }
input[type=file] { padding: .5rem; font-size: 0.9rem; }

.numpad-input { cursor: pointer; caret-color: transparent; }
.numpad-input:focus { border-color: var(--primary); }
.numpad-open { font-size: .85rem; flex-shrink: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .75rem 1.25rem; border-radius: 8px; font-size: 1rem; font-weight: 600;
    border: none; cursor: pointer; transition: opacity .15s, transform .1s; width: 100%; margin-bottom: .5rem; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-ghost   { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }
.btn-sm { padding: .45rem .85rem; font-size: .85rem; width: auto; margin-bottom: 0; }
.btn-row { display: flex; gap: .5rem; }

/* Fractie tabel */
.fractie-tabel { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.fractie-tabel th { font-size: .78rem; color: var(--text-muted); padding: .4rem .5rem; text-align: left; border-bottom: 1px solid var(--border); font-weight: 500; }
.fractie-tabel td { padding: .4rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.fractie-naam { font-size: .9rem; }
.fractie-gewicht { font-size: 1rem; font-weight: 600; min-width: 80px; }
.foto-btn { font-size: 1.2rem; background: none; border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; cursor: pointer; color: var(--text-muted); }
.foto-btn.heeft-foto { color: var(--success); border-color: var(--success); }

/* Resultaten */
.resultaten-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1rem; }
.resultaat-item { background: var(--surface2); border-radius: 8px; padding: .75rem; text-align: center; }
.resultaat-waarde { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.resultaat-label  { font-size: .72rem; color: var(--text-muted); margin-top: .25rem; }
.pmd-pct { color: var(--success); }
.verlies-pct { color: var(--warning); }

/* Sectie scheidingen */
.sectie-titel { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 1.5rem 0 .75rem; }

/* Info rijen */
.info-rij { display: flex; justify-content: space-between; align-items: baseline; padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.info-rij:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); font-size: .82rem; }
.info-waarde { font-weight: 500; text-align: right; max-width: 60%; word-break: break-word; }

/* Login */
.login-wrap {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 1rem;
    background: url('https://platform.vang.eu/images/auth/verpakkingen_01.jpeg') center/cover no-repeat;
    position: relative;
}
.login-wrap::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(0,30,60,.82) 0%, rgba(0,15,35,.92) 100%);
}
.login-card {
    position: relative;
    background: rgba(15,17,23,.88);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--radius); padding: 2rem;
    width: 100%; max-width: 380px;
    backdrop-filter: blur(12px);
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo img { height: 52px; margin-bottom: 1rem; filter: brightness(0) invert(1); }
.login-logo h1 { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.login-logo p  { font-size: .78rem; color: var(--text-muted); margin-top: .2rem; }

/* Alert */
.alert { padding: .75rem 1rem; border-radius: 8px; font-size: .9rem; margin-bottom: 1rem; }
.alert-error   { background: #2d1515; color: #fca5a5; border: 1px solid #7f1d1d; }
.alert-success { background: #142d1a; color: #86efac; border: 1px solid #14532d; }
.alert-info    { background: #1a2535; color: #93c5fd; border: 1px solid #1e3a5f; }

/* Radio akkoord */
.radio-groep { display: flex; gap: .75rem; }
.radio-optie { flex: 1; }
.radio-optie input { display: none; }
.radio-optie label { display: flex; align-items: center; justify-content: center; padding: .75rem; border-radius: 8px; border: 2px solid var(--border); cursor: pointer; font-weight: 600; transition: all .15s; }
.radio-optie input:checked + label.ja  { border-color: var(--success); background: #142d1a; color: var(--success); }
.radio-optie input:checked + label.nee { border-color: var(--danger);  background: #2d1515; color: var(--danger);  }

/* Numpad overlay */
#numpad-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 100; display: flex; align-items: flex-end; }
#numpad-overlay.hidden { display: none; }
.numpad { background: var(--surface); border-top: 1px solid var(--border); width: 100%; padding: 1rem; }
.numpad-display { background: var(--surface2); border-radius: 8px; padding: .75rem 1rem; font-size: 1.6rem; font-weight: 700; text-align: right; margin-bottom: .75rem; min-height: 3rem; word-break: break-all; }
.numpad-label { font-size: .8rem; color: var(--text-muted); margin-bottom: .5rem; }
.numpad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.np-btn { padding: 1rem; font-size: 1.3rem; font-weight: 600; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); cursor: pointer; text-align: center; transition: background .1s; }
.np-btn:active { background: var(--border); }
.np-btn.ok      { background: var(--primary); color: #fff; border-color: var(--primary); }
.np-btn.del     { background: var(--surface); color: var(--warning); }
.np-btn.clear-btn { background: var(--surface); color: var(--danger); font-size: 1rem; }

/* Fab knop */
.fab { position: fixed; bottom: 1.5rem; right: 1.5rem; width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 1.6rem; border: none; cursor: pointer; box-shadow: 0 4px 16px rgba(59,130,246,.4); display: flex; align-items: center; justify-content: center; }

/* Leeg */
.leeg { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.leeg-icon { font-size: 2.5rem; margin-bottom: .75rem; }

/* Foto preview */
.foto-preview { width: 100%; border-radius: 8px; margin-top: .5rem; max-height: 200px; object-fit: cover; }

.hidden { display: none !important; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
