@import url('https://fonts.googleapis.com/css2?family=Saira:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg-0: #0a0a0d;
    --bg-1: #101015;
    --bg-2: #17171e;
    --panel-border: rgba(255, 255, 255, 0.08);
    --blue: #5b9dff;
    --blue-soft: rgba(91, 157, 255, 0.14);
    --gold: #fbbf24;
    --green: #4ade80;
    --red: #f87171;
    --text-hi: #fff;
    --text-mid: rgba(255, 255, 255, 0.66);
    --text-low: rgba(255, 255, 255, 0.4);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Saira', sans-serif; }

html, body {
    min-height: 100vh;
    background: radial-gradient(ellipse 900px 500px at 20% -10%, rgba(91, 157, 255, 0.08), transparent), var(--bg-0);
    color: var(--text-hi);
}

.hidden { display: none !important; }

button { cursor: pointer; font-family: 'Saira', sans-serif; }
input, select, textarea { font-family: 'Saira', sans-serif; }

/* ================================================================
   LOGIN
   ================================================================ */

#login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#login-card {
    width: 380px;
    padding: 34px 30px;
    background: linear-gradient(165deg, var(--bg-2), var(--bg-0));
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: fadeUp 0.3s var(--ease-out);
}

@keyframes fadeUp {
    0% { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

#login-logo {
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 1px;
    color: var(--blue);
    text-shadow: 0 0 30px rgba(91, 157, 255, 0.4);
}

#login-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-low);
    margin-bottom: 26px;
}

#login-error {
    padding: 10px 13px;
    border-radius: 8px;
    background: rgba(248, 113, 113, 0.14);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #fca5a5;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 14px;
    text-align: left;
}

.field-label {
    display: block;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-low);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin: 12px 0 6px;
}

#login-code {
    width: 100%;
    padding: 14px;
    text-align: center;
    letter-spacing: 4px;
    font-size: 18px;
    font-weight: 800;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.035);
    color: #fff;
    outline: none;
    text-transform: uppercase;
}

#login-code:focus { border-color: rgba(91, 157, 255, 0.5); }

#login-submit-btn {
    width: 100%;
    margin-top: 16px;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--blue), #3b7ee0);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 10px 26px rgba(91, 157, 255, 0.28);
    transition: transform 0.15s var(--ease-out), filter 0.15s ease;
}

#login-submit-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }

#login-hint {
    margin-top: 18px;
    font-size: 10.5px;
    color: var(--text-low);
    line-height: 1.5;
}

/* ================================================================
   APP SHELL
   ================================================================ */

#app-shell {
    display: flex;
    min-height: 100vh;
}

#sidebar {
    width: 250px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    background: rgba(0, 0, 0, 0.25);
    border-right: 1px solid var(--panel-border);
}

#sidebar-header { padding: 0 8px 18px; border-bottom: 1px solid var(--panel-border); margin-bottom: 14px; }
#sidebar-logo { font-size: 18px; font-weight: 900; color: var(--blue); letter-spacing: 0.5px; }
#sidebar-job { margin-top: 3px; font-size: 11px; color: var(--text-low); font-weight: 600; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 12px;
    border-radius: 9px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-mid);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s var(--ease-out);
}

.nav-item i { width: 15px; text-align: center; color: var(--blue); }
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; transform: translateX(3px); }
.nav-item.active { background: linear-gradient(180deg, rgba(91, 157, 255, 0.16), rgba(91, 157, 255, 0.04)); color: #fff; box-shadow: 1px 0 0 var(--blue) inset; }

#sidebar-status-wrap { margin-top: 20px; padding: 14px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--panel-border); }

#my-status-select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    outline: none;
}

#logout-btn {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(248, 113, 113, 0.25);
    border-radius: 9px;
    background: rgba(248, 113, 113, 0.1);
    color: #fca5a5;
    font-size: 12px;
    font-weight: 700;
}

#logout-btn:hover { background: rgba(248, 113, 113, 0.18); }

#main-content {
    flex: 1;
    padding: 34px 40px;
    max-width: 1100px;
}

.view-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.view-title { font-size: 22px; font-weight: 900; letter-spacing: -0.3px; }

.view-header button, #new-incident-btn, #new-report-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border: 1px solid rgba(91, 157, 255, 0.32);
    border-radius: 9px;
    background: rgba(91, 157, 255, 0.14);
    color: #93c5fd;
    font-size: 12px;
    font-weight: 800;
    transition: background-color 0.15s ease, transform 0.15s var(--ease-out);
}

.view-header button:hover { background: rgba(91, 157, 255, 0.24); transform: translateY(-2px); }

/* ================================================================
   EENHEDEN
   ================================================================ */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.unit-card {
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    animation: fadeUp 0.24s var(--ease-out) backwards;
}

.unit-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.unit-callsign { font-size: 15px; font-weight: 900; color: var(--blue); }
.unit-status-dot { width: 9px; height: 9px; border-radius: 50%; }
.unit-name { font-size: 12.5px; font-weight: 700; }
.unit-status-text { margin-top: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }

.status-beschikbaar { color: var(--green); } .dot-beschikbaar { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-onderweg { color: var(--gold); } .dot-onderweg { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.status-bezig { color: var(--red); } .dot-bezig { background: var(--red); box-shadow: 0 0 8px var(--red); }
.status-pauze { color: var(--text-low); } .dot-pauze { background: var(--text-low); }
.status-niet_storen { color: var(--text-low); } .dot-niet_storen { background: #888; }

.empty-state { padding: 50px; text-align: center; color: var(--text-low); font-size: 12.5px; }

/* ================================================================
   MELDINGEN
   ================================================================ */

.incident-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    margin-bottom: 8px;
    animation: fadeUp 0.22s var(--ease-out) backwards;
}

.incident-priority-bar { width: 4px; align-self: stretch; border-radius: 4px; margin-right: 14px; }
.prio-laag { background: var(--text-low); }
.prio-normaal { background: var(--blue); }
.prio-hoog { background: var(--gold); }
.prio-kritiek { background: var(--red); }

.incident-main { flex: 1; display: flex; }
.incident-title { font-size: 13.5px; font-weight: 800; }
.incident-meta { margin-top: 3px; font-size: 11px; color: var(--text-low); }
.incident-desc { margin-top: 6px; font-size: 11.5px; color: var(--text-mid); }

.incident-actions { display: flex; gap: 8px; align-items: center; }

.incident-status-select {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.assign-btn {
    padding: 9px 14px;
    border-radius: 8px;
    border: 1px solid rgba(91, 157, 255, 0.3);
    background: var(--blue-soft);
    color: #93c5fd;
    font-size: 11px;
    font-weight: 700;
}

/* ================================================================
   OPZOEKEN
   ================================================================ */

.lookup-tabs { display: flex; gap: 8px; margin-bottom: 18px; }

.lookup-tab {
    padding: 10px 18px;
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-mid);
    font-size: 12px;
    font-weight: 700;
}

.lookup-tab.active { background: linear-gradient(135deg, var(--blue), #3b7ee0); border-color: transparent; color: #06101f; }

.search-row { display: flex; gap: 8px; margin-bottom: 18px; }

.search-row input {
    flex: 1;
    padding: 13px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.035);
    color: #fff;
    font-size: 13px;
    outline: none;
}

.search-row input:focus { border-color: rgba(91, 157, 255, 0.5); }

.search-row button {
    width: 48px;
    border: 1px solid rgba(91, 157, 255, 0.3);
    border-radius: 10px;
    background: var(--blue-soft);
    color: #93c5fd;
}

.result-card {
    padding: 20px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    margin-bottom: 8px;
    animation: fadeUp 0.22s var(--ease-out);
}

.result-title { font-size: 16px; font-weight: 800; margin-bottom: 10px; }
.result-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 12.5px; }
.result-row:last-child { border-bottom: none; }
.result-label { color: var(--text-low); font-weight: 600; }
.result-value { font-weight: 700; }

/* ================================================================
   RAPPORTEN
   ================================================================ */

.report-row {
    padding: 16px 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    margin-bottom: 8px;
    animation: fadeUp 0.22s var(--ease-out) backwards;
}

.report-title { font-size: 13.5px; font-weight: 800; }
.report-meta { margin-top: 3px; font-size: 11px; color: var(--text-low); }
.report-content { margin-top: 8px; font-size: 12px; color: var(--text-mid); line-height: 1.5; white-space: pre-wrap; }
.report-badge { display: inline-block; padding: 2px 9px; border-radius: 20px; background: var(--blue-soft); color: #93c5fd; font-size: 10px; font-weight: 800; margin-right: 8px; }

/* ================================================================
   POPUPS
   ================================================================ */

#callsign-popup, #incident-popup, #report-popup {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
}

.popup-card {
    width: 400px;
    padding: 24px;
    background: linear-gradient(165deg, var(--bg-2), var(--bg-0));
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
    animation: fadeUp 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.popup-title { font-size: 15px; font-weight: 800; margin-bottom: 6px; }

.popup-card input, .popup-card select, .popup-card textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.035);
    color: #fff;
    font-size: 12.5px;
    outline: none;
    resize: vertical;
}

.popup-card textarea { min-height: 90px; }

.popup-buttons { display: flex; gap: 8px; margin-top: 18px; }
.popup-buttons button { flex: 1; padding: 12px; border: none; border-radius: 9px; font-size: 12px; font-weight: 700; }
.popup-cancel { background: rgba(255, 255, 255, 0.06); color: var(--text-mid); }
#incident-submit-btn, #report-submit-btn, #callsign-confirm-btn {
    background: linear-gradient(135deg, var(--blue), #3b7ee0);
    color: #fff;
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 9px;
    font-size: 12.5px;
    font-weight: 800;
    margin-top: 6px;
}

/* ================================================================
   "100000000x beter" -- glasmorfisme + rijkere animaties
   (dit is een echte browser, geen CEF/NUI -- backdrop-filter mag hier wel)
   ================================================================ */

html, body {
    background:
        radial-gradient(ellipse 1000px 600px at 15% -10%, rgba(91, 157, 255, 0.12), transparent),
        radial-gradient(ellipse 800px 500px at 90% 110%, rgba(91, 157, 255, 0.06), transparent),
        var(--bg-0);
    background-attachment: fixed;
}

#login-card, .popup-card, #sidebar {
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
}

#login-card {
    background: linear-gradient(165deg, rgba(23, 23, 30, 0.75), rgba(10, 10, 13, 0.85));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(91, 157, 255, 0.06) inset;
}

@keyframes glowPulse {
    0%, 100% { text-shadow: 0 0 30px rgba(91, 157, 255, 0.35); }
    50%      { text-shadow: 0 0 50px rgba(91, 157, 255, 0.6); }
}

#login-logo { animation: glowPulse 3s ease-in-out infinite; }

.nav-item, .unit-card, .incident-row, .report-row, .result-card {
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.unit-card:hover, .incident-row:hover, .report-row:hover {
    transform: translateY(-3px);
    border-color: rgba(91, 157, 255, 0.28);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
}

.result-card.clickable { cursor: pointer; }
.result-card.clickable:hover {
    transform: translateY(-3px);
    border-color: rgba(91, 157, 255, 0.35);
    box-shadow: 0 16px 34px rgba(91, 157, 255, 0.12);
}

.result-open-hint {
    margin-top: 10px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--blue);
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.result-card.clickable:hover .result-open-hint { opacity: 1; }

.view-header button:hover, #new-incident-btn:hover, #new-report-btn:hover {
    box-shadow: 0 12px 28px rgba(91, 157, 255, 0.22);
}

#login-submit-btn, #incident-submit-btn, #report-submit-btn, #callsign-confirm-btn {
    position: relative;
    overflow: hidden;
}

#login-submit-btn::before, #incident-submit-btn::before, #report-submit-btn::before, #callsign-confirm-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 30%; height: 100%;
    background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-160%) skewX(-15deg);
    transition: transform 0.5s ease;
}

#login-submit-btn:hover::before, #incident-submit-btn:hover::before, #report-submit-btn:hover::before, #callsign-confirm-btn:hover::before {
    transform: translateX(360%) skewX(-15deg);
}

/* ---- persoonsprofiel ---- */

.profile-card {
    width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(91, 157, 255, 0.4) transparent;
}

.profile-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-mid);
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.profile-close:hover { background: rgba(248, 113, 113, 0.18); color: #fca5a5; transform: rotate(90deg); }

.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 35% 30%, rgba(91, 157, 255, 0.35), rgba(91, 157, 255, 0.1));
    color: var(--blue);
    font-size: 22px;
    box-shadow: 0 0 20px rgba(91, 157, 255, 0.25);
}

.profile-name { font-size: 18px; font-weight: 900; }
.profile-meta { margin-top: 3px; font-size: 11.5px; color: var(--text-low); }

.profile-report-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 13px;
    margin-bottom: 22px;
    border: 1px solid rgba(91, 157, 255, 0.32);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(91, 157, 255, 0.22), rgba(91, 157, 255, 0.08));
    color: #93c5fd;
    font-size: 12.5px;
    font-weight: 800;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.profile-report-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(91, 157, 255, 0.22); }

.profile-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-low);
    margin: 18px 0 8px;
}

.profile-vehicle-list, .profile-report-list { display: flex; flex-direction: column; gap: 6px; }

.profile-vehicle-row, .profile-report-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    font-size: 12px;
    font-weight: 600;
}

.vehicle-plate {
    padding: 3px 9px;
    border-radius: 6px;
    background: rgba(251, 191, 36, 0.14);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--gold);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.profile-report-sub { margin-left: auto; color: var(--text-low); font-size: 10.5px; font-weight: 500; }

.empty-state-small { padding: 14px; text-align: center; color: var(--text-low); font-size: 11.5px; }

/* ---- rapport-subject-badge ---- */

#report-subject-badge, .report-subject-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 20px;
    background: rgba(91, 157, 255, 0.14);
    border: 1px solid rgba(91, 157, 255, 0.3);
    color: #93c5fd;
    font-size: 10.5px;
    font-weight: 800;
    margin-bottom: 10px;
}

.report-subject-badge { margin-right: 8px; margin-bottom: 0; }

/* ================================================================
   SIDEBAR v2 -- rijker logo-blok, sectielabel, sterkere diepte
   ================================================================ */

#sidebar {
    background:
        radial-gradient(ellipse 280px 400px at 0% 0%, rgba(91, 157, 255, 0.1), transparent),
        rgba(0, 0, 0, 0.3);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.25);
}

#sidebar-logo-row {
    display: flex;
    align-items: center;
    gap: 11px;
}

#sidebar-logo-mark {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(150deg, var(--blue), #3b7ee0);
    color: #06101f;
    font-weight: 900;
    font-size: 16px;
    box-shadow: 0 6px 16px rgba(91, 157, 255, 0.35);
}

#sidebar-logo { font-size: 17px; font-weight: 900; letter-spacing: 0.5px; }

#sidebar-job {
    margin-top: 10px;
    display: inline-flex;
    padding: 4px 11px;
    border-radius: 20px;
    background: var(--blue-soft);
    border: 1px solid rgba(91, 157, 255, 0.28);
    color: #93c5fd;
    font-size: 10.5px;
    font-weight: 800;
}

.nav-section-label {
    padding: 0 12px;
    margin: 4px 0 8px;
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-low);
}

.nav-item {
    position: relative;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 20%;
    bottom: 20%;
    width: 3px;
    border-radius: 3px;
    background: var(--blue);
    box-shadow: 0 0 10px rgba(91, 157, 255, 0.6);
}

#sidebar-status-wrap {
    position: relative;
    overflow: hidden;
}

#sidebar-status-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 140px 60px at 100% 0%, rgba(91, 157, 255, 0.08), transparent);
    pointer-events: none;
}