/* ============ Basis ============ */

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f5f7;
}

/* Globale form spacing */

form div {
    margin-bottom: .75rem;
}

label {
    font-weight: 600;
}

input,
select,
button {
    font-size: 1rem;
    box-sizing: border-box;
}

input,
select {
    padding: 8px;
    width: 100%;
    max-width: 320px;
}

button {
    padding: .5rem .75rem;
    cursor: pointer;
}

/* ============ Layout ============ */

.layout {
    display: flex;
    min-height: calc(100vh - 60px); /* ongeveer headerhoogte */
    background: #f5f5f7;
}

.main-content {
    flex: 1;
    padding: 20px 24px;
}

/* Voor oudere pagina's die nog .main-container gebruiken */
.main-container {
    flex: 1;
    max-width: 100%;
    margin: 20px;
    background: #fff;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0,0,0,.05);
}

/* ============ Header ============ */

.header {
    background: #ffffff;
    border-bottom: 1px solid #ddd;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.logo {
    height: 34px;
    display: block;
}

.app-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 14px;
    color: #555;
}

.logout-button,
.login-link {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.logout-button {
    background: #cc0000;
    color: #fff;
}

.logout-button:hover {
    background: #a80000;
}

.login-link {
    background: #0073e6;
    color: #fff;
}

.login-link:hover {
    background: #005bb5;
}

/* Oude header-user stijl laten we staan voor het geval hij nog ergens gebruikt wordt */
.header-user a {
    color: #fff;
    text-decoration: none;
}

/* ============ Sidebar ============ */

.sidebar {
    width: 220px;
    background: #1f2933;
    color: #f9fafb;
    padding: 16px 0;
    flex-shrink: 0;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-item {
    margin-bottom: 4px;
}

.sidebar-link {
    display: block;
    padding: 10px 18px;
    color: #cbd2d9;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}

.sidebar-link:hover {
    background: #323f4b;
    color: #ffffff;
    padding-left: 22px;
}

.sidebar-item.active > .sidebar-link {
    background: #111827;
    color: #ffffff;
    font-weight: 600;
}

/* ============ Tabellen ============ */

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.table th,
.table td {
    border: 1px solid #ddd;
    padding: 8px 10px;
}

.table th {
    background: #f0f0f0;
}

/* ============ Buttons ============ */

.btn {
    display: inline-block;
    padding: 8px 14px;
    background: #0073ff;
    color: #fff !important;
    text-decoration: none;
    border-radius: 5px;
    transition: .2s;
    border: none;
}

.btn:hover {
    background: #0059c9;
}

.btn-secondary {
    background: #666;
    color: #fff !important;
}

.btn-secondary:hover {
    background: #444;
}

/* Extra button-stijlen voor auth */

.btn-primary {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: #2563eb;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}

.btn-link:hover {
    text-decoration: underline;
}

/* ============ Cards & forms ============ */

.card {
    padding: 18px;
    border-radius: 8px;
    background: #fafafa;
    border: 1px solid #eee;
    margin-bottom: 20px;
}

.card h2 {
    margin-top: 0;
}

/* ============ Auth / Login pagina ============ */

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 60px); /* minus header */
}

.auth-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px 28px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.auth-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #111827;
}

.auth-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 18px;
}

.auth-field {
    margin-bottom: 14px;
}

.auth-field label {
    display: block;
    font-size: 13px;
    color: #374151;
    margin-bottom: 4px;
}

.auth-field input[type="email"],
.auth-field input[type="password"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
}

.auth-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    gap: 8px;
}

.auth-error {
    color: #b91c1c;
    background: #fee2e2;
    border: 1px solid #fecaca;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 12px;
}

/* ============ Responsive tweaks ============ */

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .header-right {
        align-self: stretch;
        justify-content: space-between;
    }

    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        display: flex;
        overflow-x: auto;
    }

    .sidebar-nav ul {
        display: flex;
        flex-wrap: nowrap;
    }

    .sidebar-item {
        margin-bottom: 0;
    }

    .sidebar-link {
        white-space: nowrap;
        padding: 10px 14px;
    }

    .auth-container {
        padding: 16px;
    }

    .main-content {
        padding: 16px;
    }
}
