/* ==========================================================
   NAVIGATION
========================================================== */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;

    padding: 8px 30px; /* <-- FIX: missing px */

    background: #fefefe;
    border-bottom: 2px solid black;

    position: relative;   /* REQUIRED */
    z-index: 1000;        /* REQUIRED */
}

.top-nav a {
    color: #333;
    font-weight: bold;
}

.top-nav a,
.top-nav span {
    line-height: 1.2;
}    
    
.top-nav a:hover {
    text-decoration: underline;
    color: #b22222;
}

/* ==========================================================
   USER MENU
========================================================== */
/* Avatar circle */
.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #b22222;
    color: white;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Username */
.username {
    font-weight: bold;
}

/* Chevron */
.chevron {
    font-size: 12px;
}



/* Dropdown User Menu */
.user-menu {
    position: relative;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Dropdown */
.dropdown-menu {
    position: absolute;
    top: 110%;
    right: 0;

    min-width: 160px;
    padding: 8px 0;

    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 6px;

    box-shadow: 0 8px 20px rgba(0,0,0,0.15);

    /* HIDDEN STATE */
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;

    transition: all 0.25s ease;

    z-index: 2000;
}

/* ACTIVE STATE */
.user-menu.open .dropdown-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-menu a {
    display: block;
    padding: 10px 14px;
    text-decoration: none;
    color: #333;
}

.dropdown-menu a:hover {
    background: #f5f5f5;
}

/* Show dropdown */

.user-menu:hover .dropdown-menu {
    display: block;
}

/* ==============================
   SIDEBAR
============================== */

.sidebar {
    background: #f8f4e6;
    padding: 20px;
    min-height:
        calc(
            100vh - 4rem
        );
    overflow-y:
        auto;
}

/* Sidebar Section Title */
.sidebar-section {
    margin-top: 18px;
    font-weight: bold;
    color: #1f2a44;
    position: relative;
    padding-bottom: 6px;
}

/* Divider under section */
.sidebar-section::after {
    content: "";
    display: block;
    width: 70%;
    height: 2px;
    margin-top: 6px;

    background: linear-gradient(
        to right,
        transparent,
        #c9a227,
        #e0c36f,
        #c9a227,
        transparent
    );
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    margin-bottom: 10px;
}

.sidebar-menu a {
    text-decoration: none;
    font-weight: bold;
    color: #0B0B45;
}

.sidebar-menu a:hover {
    color: #b22222;
    text-decoration: underline;
}

.house-access,
.house-access p {

    text-align: left !important;
    text-justify: auto;
    hyphens: none;

}

/* ==============================
   SIDEBAR ACTIVE STATE
============================== */

.sidebar-menu li.active a {
    color: #b22222;
    font-weight: bold;
}

.sidebar-menu li.active {
    border-left: 4px solid #d4af37;
    padding-left: 10px;
    background: #f3ecd2;
}

/* ==========================================
   COLLAPSIBLE SIDEBAR
========================================== */

.collapsible-header {
    cursor: pointer;
    user-select: none;
}

/* Default state */
.sidebar-content {
    overflow: hidden;
    transition:
        max-height .28s ease,
        opacity .18s ease;
    max-height: 1200px;
    opacity: 1;
    padding-bottom: .5rem;
}

/* Collapsed state */
.sidebar-content.collapsed {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding-bottom: 0;
}

/* Default open section */
.sidebar-content.default-open {
    max-height: 1200px;
    opacity: 1;
}

/* ==============================
   CHANCERY ACCESS
============================== */

.sidebar-admin {
    margin-top: 3rem;
    padding-top: 1.5rem;
}

.sidebar-admin-divider {
    width: 100%;
    height: 1px;
    background:
        rgba(
            180,
            160,
            120,
            .25
        );
    margin-bottom: 1.25rem;
}

.sidebar-admin-label {
    font-size: .72rem;
    letter-spacing: .14em;
    text-transform:
        uppercase;
    opacity: .65;
    margin-bottom: .85rem;
}

.sidebar-admin-links {
    display: flex;
    flex-direction:
        column;
    gap: .35rem;
}

.sidebar-admin-link {
    font-size: .92rem;
    opacity: .78;
    text-decoration:
        none;
    transition:
        opacity .2s ease;
}

.sidebar-admin-link:hover {
    opacity: 1;
}

/* ===============================
   LOGOUT REDIRECT
=============================== */
/* Logout warning text */
.logout-warning {
    margin-top: 10px;
    font-style: italic;
    color: #7a1f1f;
}

/* Continue button variation */
.logout-continue {
    display: inline-block;
    width: 60%;
    text-align: center;
    margin-top: 12px;
}