:root {
    --sidebar-width: 250px;

    /* Semantic tokens */
    --sidebar-bg: var(--primary-color);
    --sidebar-text: rgba(255, 255, 255, 0.8);
    --sidebar-text-strong: #ffffff;
    --sidebar-border: rgba(255, 255, 255, 0.1);
    --sidebar-border-strong: rgba(255, 255, 255, 0.12);
    --sidebar-hover: rgba(255, 255, 255, 0.1);

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* Sidebar container */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;

    width: var(--sidebar-width);
    height: 100vh;

    display: flex;
    flex-direction: column;

    background-color: var(--sidebar-bg);
    color: var(--sidebar-text-strong);
    box-shadow: var(--shadow);
}

/* Scrollable content */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;

    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-content::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* Header */
.sidebar-header {
    padding: 0 1.25rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
}

/* Branding */
.sidebar-app-branding {
    display: block;
    text-decoration: none;
    cursor: pointer;
    transition: opacity var(--transition-normal);
}

.sidebar-app-branding:hover {
    opacity: 0.8;
}

.sidebar-app-acronym {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--sidebar-text-strong);
}

.sidebar-app-name {
    margin-top: 0.25rem;

    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.5px;

    color: var(--sidebar-text);
}

/* Navigation */
.sidebar-nav {
    margin-top: 0.6rem;
}

.sidebar-nav>ul {
    margin-top: 1rem;
    list-style: none;
}

/* Sections */
.sidebar-section {
    border-top: 1px solid var(--sidebar-border-strong);
}

.sidebar-section:last-of-type {
    border-bottom: 1px solid var(--sidebar-border-strong);
}

/* Section toggle */
.sidebar-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0.62rem 1.25rem;

    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;

    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    user-select: none;
}

.sidebar-section-toggle::-webkit-details-marker {
    display: none;
}

.sidebar-section-toggle::after {
    content: '▾';
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
    transition: transform var(--transition-fast);
}

.sidebar-section[open] .sidebar-section-toggle::after {
    transform: rotate(0);
}

.sidebar-section:not([open]) .sidebar-section-toggle::after {
    transform: rotate(-90deg);
}

/* Section list */
.sidebar-section-list {
    margin: 0;
    padding: 0 0 0.25rem;
    list-style: none;
}

/* Links */
.sidebar-nav-link,
.sidebar-auth-link {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;

    width: 100%;
    padding: 0.5rem 1.25rem;

    font-size: 0.95rem;
    font-weight: 500;

    color: var(--sidebar-text);
    text-decoration: none;

    transition: background-color var(--transition-normal),
        color var(--transition-normal);
}

.sidebar-nav-link:hover,
.sidebar-auth-link:hover {
    background-color: var(--sidebar-hover);
    color: var(--sidebar-text-strong);
}

.sidebar-nav-link.active {
    background-color: var(--accent-color);
    color: var(--sidebar-text-strong);
}

/* Separator */
.sidebar-separator {
    display: flex;
    justify-content: center;
    margin: 0.2rem 0;
}

.sidebar-separator::before {
    content: '';
    width: 80%;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.2);
}

/* Footer */
.sidebar-footer {
    margin-top: auto;
    padding: 0.35rem;

    display: flex;
    flex-direction: column;
    gap: 0.15rem;

    border-top: 1px solid var(--sidebar-border);
}

/* Icons */
.sidebar-auth-link svg,
.sidebar-footer-icon-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Footer icon buttons */
.sidebar-footer-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    color: var(--sidebar-text);
    border-radius: 4px;

    text-decoration: none;
    transition: background-color var(--transition-normal),
        color var(--transition-normal);
}

.sidebar-footer-icon-link:hover {
    background-color: var(--sidebar-hover);
    color: var(--sidebar-text-strong);
}

.sidebar-auth-label {
    font-size: 0.95rem;
}