/* Sidebar + content shell.

   Alle kleuren komen uit de palette-variabelen (custom.css), die per wachtpost
   overschreven worden. Belangrijk: de sidebar kan zowel een donkere (HVRT) als
   een lichte (HWH) merkkleur dragen, dus niets mag hard op wit staan — tekst,
   iconen en lijnen leiden zich af van --on-primary of currentColor. */

.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: 248px;
    padding: 1.25rem 0.75rem 1rem;
    /* Lichte verticale verloop geeft de kolom diepte zonder een tweede kleur
       te introduceren: bovenaan de merkkleur, onderaan een fractie donkerder. */
    background-color: var(--primary-color);
    background-image: linear-gradient(180deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0) 22%,
        rgba(0, 0, 0, 0.06) 100%);
    color: var(--on-primary);
    transition: width var(--ease-slow), padding var(--ease-slow);
    z-index: 900;
    overflow-x: hidden;
    overflow-y: auto;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
}

.sidebar-collapsed {
    width: 68px;
    padding: 1.25rem 0.5rem 1rem;
}

.content {
    margin-left: 248px;
    margin-top: var(--header-height);
    padding: 2rem 2.25rem 1rem;
    transition: margin-left var(--ease-slow);
    background-color: var(--background-color);
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
}

.content-collapsed {
    margin-left: 68px;
}

/* --- Toggle ------------------------------------------------------------- */

.toggle-btn {
    background: none;
    border: none;
    color: var(--on-primary);
    opacity: 0.7;
    font-size: 1rem;
    cursor: pointer;
    align-self: flex-end;
    margin-bottom: 1.25rem;
    outline: none;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--ease), opacity var(--ease);
}

.toggle-btn:hover {
    background-color: var(--tint-strong);
    opacity: 1;
}

.sidebar-collapsed .toggle-btn {
    align-self: center;
}

/* --- Navigation --------------------------------------------------------- */

.nav-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--on-primary);
    opacity: 0.78;
    padding: 9px 12px;
    text-align: left;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: -0.005em;
    cursor: pointer;
    width: 100%;
    border-radius: 9px;
    display: flex;
    align-items: center;
    transition: background-color var(--ease), opacity var(--ease),
                transform var(--ease), box-shadow var(--ease);
    /* Staggered reveal bij het laden — één rustige beweging in plaats van
       losse micro-animaties verspreid over de pagina. */
    animation: nav-in 0.42s var(--curve) backwards;
}

.nav-btn:nth-child(1) { animation-delay: 0.02s; }
.nav-btn:nth-child(2) { animation-delay: 0.06s; }
.nav-btn:nth-child(3) { animation-delay: 0.10s; }
.nav-btn:nth-child(4) { animation-delay: 0.14s; }
.nav-btn:nth-child(5) { animation-delay: 0.18s; }
.nav-btn:nth-child(6) { animation-delay: 0.22s; }

@keyframes nav-in {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 0.78; transform: none; }
}

.nav-btn:hover {
    background-color: var(--tint);
    opacity: 1;
}

.nav-btn.active {
    background-color: var(--surface);
    color: var(--heading-color);
    font-weight: 600;
    opacity: 1;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06),
                0 4px 12px -4px rgba(16, 24, 40, 0.14);
}

/* Smal accentstreepje links van de actieve pagina. Subtieler dan een tweede
   vlak, en het houdt de plek herkenbaar wanneer de sidebar ingeklapt is. */
.nav-btn.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    border-radius: 0 3px 3px 0;
    background: var(--heading-color);
}

.nav-icon {
    margin-right: 11px;
    font-size: 0.95rem;
    width: 18px;
    flex: none;
    text-align: center;
    color: inherit;
}

.nav-btn.active .nav-icon {
    color: var(--heading-color);
}

.sidebar-collapsed .nav-text {
    display: none;
}

.sidebar-collapsed .nav-btn {
    justify-content: center;
    padding: 10px 0;
}

.sidebar-collapsed .nav-icon {
    margin-right: 0;
}

/* --- Filters ------------------------------------------------------------ */

.sidebar-filters {
    margin-top: 1.5rem;
    padding: 0 4px;
}

.sidebar-collapsed .sidebar-filters,
.sidebar-collapsed .sidebar-bottom {
    display: none;
}

.filter-group {
    margin-bottom: 14px;
}

.filter-label {
    display: block;
    color: var(--on-primary);
    opacity: 0.85;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.sidebar-dropdown {
    color: #1a1a1a;
    font-size: 0.85rem;
}

.sidebar-dropdown .Select-control {
    min-height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

/* Scheidingslijnen en bijschriften. Afgeleid van de tekstkleur, zodat ze
   meebewegen met een lichte of donkere huisstijl. */
.sidebar-rule {
    border: none;
    border-top: 1px solid currentColor;
    opacity: 0.18;
    margin: 18px 0 14px;
}

.sidebar-rule-tight {
    margin: 0 0 12px 0;
}

.sidebar-heading {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--on-primary);
    opacity: 0.62;
    margin: 0 0 12px 4px;
}

.sidebar-meta {
    font-size: 0.72rem;
    color: var(--on-primary);
    opacity: 0.72;
    margin: 0 0 8px 4px;
    white-space: normal;
}

/* --- Bottom block ------------------------------------------------------- */

.sidebar-bottom {
    margin-top: auto;
    padding: 12px 4px 0;
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 768px) {
    .sidebar {
        width: 68px;
        padding: 1.25rem 0.5rem 1rem;
    }

    .content {
        margin-left: 68px;
        padding: 1.5rem 1.25rem 1rem;
    }

    .nav-text,
    .sidebar-filters,
    .sidebar-bottom,
    .header-title {
        display: none;
    }

    .nav-btn {
        justify-content: center;
        padding: 10px 0;
    }

    .nav-icon {
        margin-right: 0;
    }

    .toggle-btn {
        display: none;
    }

    .header {
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-btn {
        animation: none;
        opacity: 0.78;
    }
}
