/* ── ParkingSpot V2 — app.css ── */
:root {
    --primary:      #1b4842;   /* donker petrol/teal — sidebar, knoppen */
    --primary-light:#256158;
    --accent:       #2aa88c;   /* groen — highlights, focus, links */
    --header-bg:    #f8cda6;   /* perzik — kaart-headers */
    --header-text:  #6b4423;   /* donkerbruin tekst op perzik */
    --brand-red:    #e8533f;   /* rood accent uit logo */
    --success:      #22c55e;
    --danger:       #e74c3c;
    --warning:      #f59e0b;
    --bg:           #f1f5f4;
    --surface:      #ffffff;
    --border:       #e2e8e6;
    --text:         #0f1f1d;
    --text-muted:   #647571;
    --radius:       10px;
    --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-lg:    0 4px 24px rgba(0,0,0,.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Admin layout ── */
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: 220px; min-width: 220px;
    background: var(--primary);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { padding: 20px 16px 16px; border-bottom: 1px solid rgba(255,255,255,.1); border-left: 3px solid var(--brand-red); }
.brand-name { font-size: 16px; font-weight: 800; color: #fff; letter-spacing: .5px; text-transform: uppercase; }
.brand-tagline { font-size: 10px; color: var(--brand-red); font-style: italic; font-weight: 600; margin-top: 1px; }
.brand-sub  { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 5px; }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 16px; color: rgba(255,255,255,.7);
    font-size: 13px; font-weight: 500; transition: background .15s, color .15s;
    text-decoration: none;
}
.nav-item .icon { width: 18px; text-align: center; font-style: normal; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--header-bg); color: var(--header-text); font-weight: 600; }
.nav-item.active .icon { filter: none; }
.sidebar-footer { padding: 12px 16px; font-size: 11px; color: rgba(255,255,255,.3); border-top: 1px solid rgba(255,255,255,.08); }

.admin-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 0 24px; height: 56px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
}
.admin-topbar h1 { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.admin-main { flex: 1; padding: 24px; }

/* ── Cards ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; background: var(--header-bg); border-bottom: 1px solid rgba(0,0,0,.05); }
.card-header h2 { font-size: 14px; font-weight: 700; color: var(--header-text); }
.card-header .btn-outline { border-color: rgba(107,68,35,.25); color: var(--header-text); }
.card-body { padding: 18px; }

/* ── Stats grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-value { font-size: 28px; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: opacity .15s, background .15s; text-decoration: none; }
.btn:hover { opacity: .88; text-decoration: none; }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-accent   { background: var(--accent);  color: #fff; }
.btn-success  { background: var(--success); color: #fff; }
.btn-danger   { background: var(--danger);  color: #fff; }
.btn-warning  { background: var(--warning); color: #1c1917; }
.btn-outline  { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.form-control { width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: 7px; font-size: 13px; background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s; }
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
select.form-control { cursor: pointer; }
.mono { font-family: 'Courier New', monospace; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { background: #1e293b; color: #e2e8f0; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 9px 12px; text-align: left; white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
tbody td { padding: 9px 12px; vertical-align: middle; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.badge-active   { background: #dcfce7; color: #15803d; }
.badge-pending  { background: #fef9c3; color: #a16207; }
.badge-inactive { background: #f1f5f9; color: #64748b; }
.badge-blue     { background: #dbeafe; color: #1d4ed8; }

/* ── Plate badge ── */
.plate-badge { font-family: 'Courier New', monospace; font-weight: 700; font-size: 12px; background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 5px; padding: 2px 7px; letter-spacing: .05em; color: #0f172a; white-space: nowrap; }

/* ── Flash messages ── */
.flash { padding: 11px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; margin-bottom: 16px; }
.flash-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.flash-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-icon  { font-size: 36px; margin-bottom: 12px; }

/* ── Lang dropdown (knop in btn-stijl) ── */
.lang-dd { position: relative; display: inline-block; }
.lang-dd summary { list-style: none; }
.lang-dd summary::-webkit-details-marker { display: none; }
.lang-dd summary svg { transition: transform .2s; opacity: .6; }
.lang-dd[open] summary svg { transform: rotate(180deg); }
.lang-dd-menu {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 160px; z-index: 100;
    background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
    box-shadow: var(--shadow-lg); overflow: hidden; padding: 4px;
}
.lang-dd-menu button {
    display: block; width: 100%; text-align: left; padding: 8px 12px; border: none;
    background: none; font-size: 13px; cursor: pointer; border-radius: 6px; color: var(--text);
    transition: background .12s;
}
.lang-dd-menu button:hover { background: var(--bg); }
.lang-dd-menu button.active { background: var(--primary); color: #fff; font-weight: 600; }

/* ── User webapp ── */
.user-layout { min-height: 100vh; background: var(--bg); }
.user-topbar {
    background: var(--primary); color: #fff;
    padding: 0 24px; height: 56px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
    /* Notch / safe-area op iPhone in standalone (home-screen) modus */
    padding-top: env(safe-area-inset-top);
    height: calc(56px + env(safe-area-inset-top));
}
.user-topbar .app-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; margin-right: 10px; }
.user-topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.user-main { max-width: 760px; margin: 0 auto; padding: 28px 16px; }
.user-nav { display: flex; gap: 4px; margin-bottom: 24px; flex-wrap: wrap; }
.user-nav-item {
    padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500;
    color: var(--text-muted); border: 1px solid var(--border); background: var(--surface);
    text-decoration: none; transition: background .15s, color .15s;
}
.user-nav-item:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.user-nav-item.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Login screens ── */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 20px; }
.login-card { background: var(--surface); border-radius: 14px; padding: 36px 32px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-icon { font-size: 36px; display: block; margin-bottom: 8px; }
.login-logo h1 { font-size: 20px; font-weight: 700; color: var(--primary); }
.login-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── Invite screen ── */
.invite-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 20px; }
.invite-card { background: var(--surface); border-radius: 14px; padding: 36px 32px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); }
.invite-card h2 { font-size: 20px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.invite-card .subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }

/* ── Grid helpers ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
@media (max-width: 768px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; }
}

/* ── Bottom navigatie (smartphone) ── */
.user-bottom-nav { display: none; }
.bottom-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 9px 4px 7px; text-decoration: none; color: var(--text-muted);
    font-size: 10.5px; font-weight: 600; transition: color .15s;
}
.bottom-nav-item:hover { text-decoration: none; }
.bottom-nav-item .bn-icon { font-size: 21px; line-height: 1; }
.bottom-nav-item .bn-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active .bn-icon {
    transform: translateY(-1px);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.12));
}

/* ── Smartphone: WebApp (eindgebruiker) ── */
@media (max-width: 640px) {
    /* Tabs bovenaan verbergen, onderbalk tonen */
    .user-nav { display: none; }
    .user-name { display: none; }

    .user-bottom-nav {
        display: flex;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
        background: var(--surface);
        border-top: 1px solid var(--border);
        box-shadow: 0 -2px 14px rgba(0,0,0,.07);
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* Ruimte onderaan zodat content niet onder de balk verdwijnt */
    .user-main { padding: 16px 14px calc(80px + env(safe-area-inset-bottom)); }

    /* Formuliervelden in de WebApp altijd op volle breedte (overschrijft inline widths) */
    .user-main .form-control { width: 100% !important; }
    .user-main form > div[style*="flex"] { flex-direction: column; align-items: stretch !important; }
    .user-main .form-group { width: 100%; }
    .user-main .btn { width: 100%; justify-content: center; }

    /* Kaarten en titels wat luchtiger */
    .user-main .card-header { padding: 14px 16px; }
    .user-main .card-body { padding: 16px; }

    /* Stat-kaarten compacter */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
    .stat-value { font-size: 24px; }

    /* Topbar iets compacter */
    .user-topbar { padding-left: 16px; padding-right: 12px; }
    .app-name { font-size: 14px; }
}
