* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0f172a;
    color: #111827;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 1rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid #e5e7eb;
}

.app-title {
    margin: 0;
    font-size: 1.4rem;
    color: #111827;
}

.app-tagline {
    margin: 0;
    font-size: .85rem;
    color: #6b7280;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.user-label {
    font-size: .85rem;
    color: #4b5563;
}

.role-pill {
    display: inline-block;
    padding: .1rem .4rem;
    border-radius: 999px;
    font-size: .7rem;
    background: #e5e7eb;
    margin-left: .3rem;
}

.menu-wrapper {
    position: relative;
}

.menu-button {
    border: none;
    background: #111827;
    color: #f9fafb;
    padding: .35rem .55rem;
    border-radius: .375rem;
    cursor: pointer;
}

.menu-dropdown {
    position: absolute;
    right: 0;
    top: 110%;
    background: #111827;
    color: #e5e7eb;
    border-radius: .5rem;
    padding: .4rem 0;
    min-width: 190px;
    box-shadow: 0 10px 25px rgba(15,23,42,0.35);
    display: none;
    z-index: 50;
}

.menu-wrapper.open .menu-dropdown {
    display: block;
}

.menu-dropdown a {
    display: block;
    padding: .45rem .9rem;
    font-size: .85rem;
    color: #e5e7eb;
}

.menu-dropdown a:hover {
    background: #1f2937;
}

/* Cards & layout */

.card {
    background: #f9fafb;
    border-radius: .75rem;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(15,23,42,0.15);
}

.login-page {
    background: radial-gradient(circle at top, #1d4ed8, #020617);
    min-height: 100vh;
}

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

.login-card {
    max-width: 380px;
    width: 100%;
}

/* Buttons */

.btn {
    display: inline-block;
    padding: .45rem .9rem;
    border-radius: .375rem;
    border: none;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 500;
}

.btn-primary {
    background: #2563eb;
    color: #f9fafb;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-outline {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #111827;
}

.btn-outline:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: #dc2626;
    color: #f9fafb;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Forms */

label {
    display: block;
    margin-top: .75rem;
    font-size: .85rem;
    color: #374151;
}

input[type="text"],
input[type="password"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: .4rem .5rem;
    border-radius: .375rem;
    border: 1px solid #d1d5db;
    font-size: .85rem;
    margin-top: .2rem;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

.inline-field-group {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.inline-field-group input[type="text"] {
    max-width: 110px;
}

/* Messages */

.errors {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: .5rem .6rem;
    border-radius: .5rem;
    font-size: .85rem;
    margin-bottom: .7rem;
}

.note {
    font-size: .8rem;
    color: #4b5563;
}

/* Incident list */

.incident-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.incident-item {
    padding: .7rem;
    border-radius: .65rem;
    border: 1px solid #e5e7eb;
    margin-bottom: .6rem;
    background: #ffffff;
}

.incident-open {
    border-left: 4px solid #22c55e;
}

.incident-onderweg {
    border-left: 4px solid #f97316;
}

.incident-afgerond {
    border-left: 4px solid #9ca3af;
    opacity: 0.8;
}

.incident-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .3rem;
}

.badge {
    display: inline-block;
    padding: .2rem .5rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.badge-open {
    background: #dcfce7;
    color: #166534;
}

.badge-onderweg {
    background: #ffedd5;
    color: #9a3412;
}

.badge-afgerond {
    background: #e5e7eb;
    color: #374151;
}

.map-thumb-wrapper {
    margin-top: .4rem;
    border-radius: .5rem;
    overflow: hidden;
    height: 160px;
}

.map-thumb-wrapper iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.map-wrapper {
    margin-top: .5rem;
    border-radius: .75rem;
    overflow: hidden;
    height: 360px; /* groter gemaakt voor nieuwe incidentmelding */
    border: 1px solid #e5e7eb;
}

/* Incident details */

.meta-line {
    font-size: .8rem;
    color: #4b5563;
}

.times-line {
    font-size: .8rem;
    color: #6b7280;
    margin-top: .3rem;
}

.creator-line {
    font-size: .8rem;
    color: #4b5563;
    margin-top: .2rem;
}

.incident-description {
    margin-top: .35rem;
    font-size: .85rem;
    color: #111827;
}

.incident-photo {
    max-width: 160px;
    max-height: 160px;
    border-radius: .5rem;
    margin-top: .3rem;
}

.incident-actions {
    margin-top: .4rem;
    display: flex;
    gap: .35rem;
}

.drivers-note {
    margin-top: .3rem;
}

.small {
    font-size: .75rem;
    color: #6b7280;
}

/* User table */

.user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
}

.user-table th,
.user-table td {
    border: 1px solid #e5e7eb;
    padding: .3rem .4rem;
    vertical-align: top;
}

.user-table th {
    background: #f3f4f6;
}

/* Companies table */

.company-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
}

.company-table th,
.company-table td {
    border: 1px solid #e5e7eb;
    padding: .3rem .4rem;
}

.company-table th {
    background: #f3f4f6;
}

/* Notification toast */

.notification-panel {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    max-width: 420px;
    width: calc(100% - 2rem);
    background: #111827;
    color: #e5e7eb;
    border-radius: .75rem;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    padding: .75rem .85rem;
    z-index: 1000;
    display: none;
}

.notification-panel.visible {
    display: block;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .3rem;
}

.notification-title {
    font-size: .9rem;
    font-weight: 600;
}

.notification-meta {
    font-size: .75rem;
    color: #9ca3af;
}

.notification-map {
    margin-top: .4rem;
    border-radius: .5rem;
    overflow: hidden;
    height: 140px;
    background: #020617;
}

.notification-actions {
    margin-top: .4rem;
    display: flex;
    gap: .35rem;
    justify-content: flex-end;
}

.notification-actions .btn {
    font-size: .8rem;
}

/* Responsive */

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: .5rem;
    }

    .user-menu {
        width: 100%;
        justify-content: space-between;
    }

    .incident-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: .25rem;
    }

    .user-table, .company-table {
        font-size: .75rem;
    }
}
