:root {
    --primary: #123456;
    --primary-dark: #0e293d;
    --primary-light: #315a89;
    --bg-body: #f5f7fb;
    --text-main: #1e293b;
    --border-soft: #e2e8f0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-main);
    background-color: var(--bg-body);
}

/* Global loader */

#global-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    z-index: 1200;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

    #global-loader.loader-hidden {
        opacity: 0;
        visibility: hidden;
    }

.loader-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 5px solid rgba(18, 52, 86, 0.14);
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

.loader-text {
    margin: 0;
    font-weight: 500;
    color: var(--primary-dark);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Layout */

.topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-soft);
    position: sticky;
    top: 0;
    z-index: 50;
}

.advice-content {
    white-space: pre-line; /* behoud nieuwe regels, maar wrap tekst */
    overflow-wrap: break-word; /* lange woorden knakken */
    max-height: 400px; /* scrollen als het echt veel is */
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.5;
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo-area {
    flex: 0 0 auto;
}

.logo-text {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.logo-mark {
    background: var(--primary);
    color: #fff;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.logo-name {
    font-size: 1.15rem;
}

.main-nav {
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
}

.menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
}

    .menu li a {
        text-decoration: none;
        color: var(--text-main);
        font-size: 0.95rem;
        padding: 0.35rem 0.6rem;
        border-radius: 999px;
        transition: background-color 0.15s ease, color 0.15s ease;
    }

        .menu li a:hover {
            background-color: rgba(18, 52, 86, 0.08);
            color: var(--primary-dark);
        }

        .menu li a.logout-link {
            color: #b91c1c;
        }

/* User pill */

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: #f3f4f6;
    color: #111827;
    text-decoration: none;
    font-size: 0.9rem;
}

.text-success {
    color: #16a34a;
}

.text-danger {
    color: #dc2626;
}

.user-pill:hover {
    background: #e5e7eb;
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-avatar-img {
    object-fit: cover;
    border: 2px solid #123456; /* jouw hoofdkleur */
}

.user-name {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Page container */

.page-main {
    min-height: calc(100vh - 140px);
    padding: 1.5rem 1rem 2.5rem;
}

.page-container {
    max-width: 1100px;
    margin: 0 auto;
}

/* Footer */

.page-footer {
    border-top: 1px solid var(--border-soft);
    background: #ffffff;
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
    color: #64748b;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
}

.footer-right {
    text-align: right;
}

/* Buttons & forms */

.btn,
button[type=submit],
input[type=submit] {
    display: inline-block;
    border: none;
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
    background-color: var(--primary);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.05s ease;
}

    .btn:hover,
    button[type=submit]:hover,
    input[type=submit]:hover {
        background-color: var(--primary-dark);
    }

.btn-outline-secondary {
    background: transparent;
    border: 1px solid var(--primary-light);
    color: var(--primary-dark);
}

    .btn-outline-secondary:hover {
        background: var(--primary-light);
        color: #ffffff;
    }

input[type=text],
input[type=password],
input[type=email],
input[type=number],
textarea,
select {
    width: 100%;
    border-radius: 0.55rem;
    border: 1px solid var(--border-soft);
    padding: 0.5rem 0.7rem;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

    input:focus,
    textarea:focus,
    select:focus {
        border-color: var(--primary-light);
        box-shadow: 0 0 0 1px rgba(18, 52, 86, 0.15);
    }

/* Cards / tables */

.card {
    border-radius: 0.9rem;
    background: #ffffff;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
    background: #ffffff;
    border-radius: 0.9rem;
    overflow: hidden;
}

    .table thead {
        background: #f1f5f9;
    }

    .table th,
    .table td {
        padding: 0.55rem 0.75rem;
        border-bottom: 1px solid #e5e7eb;
    }

    .table tbody tr:nth-child(even) {
        background: #f9fafb;
    }

/* Mobile menu */

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    margin-right: 0.5rem;
}

    .menu-toggle span {
        width: 20px;
        height: 2px;
        background: var(--primary-dark);
    }

@media (max-width: 768px) {
    .topbar-inner {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .main-nav {
        justify-content: flex-end;
        align-items: flex-end;
        flex-direction: column;
        flex: 1 1 100%;
        gap: 0.35rem;
    }

    .menu-toggle {
        display: flex;
    }

    .menu {
        flex-direction: column;
        align-items: flex-start;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.2s ease;
        width: 100%;
        margin-top: 0.25rem;
        background-color: #ffffff;
    }

        .menu.menu-open {
            max-height: 400px;
        }

    .page-container {
        padding: 0 0.25rem;
    }

    .footer-inner {
        flex-direction: column;
        gap: 0.25rem;
        text-align: left;
    }
}
