:root {
    --primary: #1a56db;
    --primary-dark: #1e429f;
    --secondary: #f3f4f6;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --success: #059669;
    --error: #dc2626;
    --warning: #d97706;
    --white: #ffffff;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f8fafc;
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; width: 100%; }
.main-content { flex: 1; padding: 2rem 0; }

/* Header */
.main-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}
.main-nav ul {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 0.5rem;
}
.main-nav a,
.main-nav .dropbtn {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s;
}
.main-nav a:hover, .main-nav a.active,
.main-nav .dropbtn:hover {
    background: var(--secondary);
    color: var(--primary);
}
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border);
}
.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-light);
}
.btn-logout {
    font-size: 0.875rem;
    color: var(--error) !important;
}

/* Dropdown - alleen zichtbaar bij .open */
.dropdown { position: relative; }
.dropdown-content {
    display: none !important;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    list-style: none;
    padding: 0.5rem 0;
    z-index: 200;
}
.dropdown.open .dropdown-content {
    display: block !important;
}
.dropdown-content a {
    padding: 0.5rem 1rem;
    display: block;
}
.dropdown-content a:hover {
    background: var(--secondary);
}

/* Login */
.login-page {
    background: linear-gradient(135deg, #1a56db 0%, #1e429f 100%);
    justify-content: center;
    align-items: center;
}
.login-container {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}
.login-box {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.login-box h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: var(--primary-dark);
}
.login-box .subtitle {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}
.login-info {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-light);
}
.login-info a { color: var(--primary); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--white);
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-primary {
    background: var(--primary);
    color: var(--white);
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; }
.btn-secondary {
    background: var(--secondary);
    color: var(--text);
}
.btn-danger {
    background: var(--error);
    color: var(--white);
}
.btn-success {
    background: var(--success);
    color: var(--white);
}
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }

/* Alerts */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}
.alert-error {
    background: #fef2f2;
    color: var(--error);
    border: 1px solid #fecaca;
}
.alert-success {
    background: #ecfdf5;
    color: var(--success);
    border: 1px solid #a7f3d0;
}
.alert-warning {
    background: #fffbeb;
    color: var(--warning);
    border: 1px solid #fde68a;
}

/* Cards */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.card-title {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}
.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}
.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--primary);
}

/* Tables */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
}
th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: var(--text-light);
}
tr:hover td { background: #f9fafb; }
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-green { background: #d1fae5; color: #065f46; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-gray { background: #f3f4f6; color: #4b5563; }
.badge-blue { background: #dbeafe; color: #1e40af; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

/* Footer */
.main-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Mobile */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .main-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }
    .main-nav.open { display: block; }
    .main-nav ul {
        flex-direction: column;
        padding: 0.5rem;
        gap: 0;
    }
    .main-nav a { width: 100%; }
    .user-menu {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid var(--border);
        padding-top: 0.5rem;
        flex-direction: column;
        align-items: flex-start;
    }
    .dropdown-content {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 1rem;
        display: none !important;
    }
    .dropdown.open .dropdown-content {
        display: block !important;
    }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
}

/* Print / PDF */
@media print {
    .main-header, .main-footer, .menu-toggle, .btn, .no-print { display: none !important; }
    .main-content { padding: 0; }
    body { background: white; }
    .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
    table { font-size: 10pt; }
}
