* { box-sizing: border-box; }

body {
    font-family: system-ui, sans-serif;
    margin: 0;
    background: #f4f6f9;
}

.site-wrapper {
    max-width: 1280px;
    margin: 40px auto;
    background: white;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #ddd;
}

header img {
    width: 100%;
    display: block;
}

.topnav {
    background: #2F5496;
    padding: 2px 24px;    /* 2px: space top/bottom, 24px: leftmost icon spacing */
    display: block;           /* important for floats */
    overflow: hidden;         /* important for floats */
}

.nav-item {
    color: white;
    text-decoration: none;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 8px;
    border-radius: 8px;
    transition: 0.2s;
    margin-right: 18px;        /* spacing between left icons */
    float: left;              /* all normal icons float left */
}

/* Right-justified login/logout */
.topnav .nav-item.split {
    float: right;
    margin-right: 0;
    margin-left: 30px;        /* space between last left icon and login */
}

.nav-item:hover {
    background: rgba(255,255,255,0.2);
}

.nav-item img {
    width: 32px;
    height: 32px;
}

/* Main content layout */
.flex {
    display: flex;
    gap: 0;
}

aside {
    background: white !important;
}

aside a {
    display: block !important;
    margin-bottom: 8px;
}
main {
    flex: 1;
    padding: 40px;
}

footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: #555;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    min-width: 240px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    padding: 8px 0;
    margin-top: 6px;
    z-index: 1000;
    border: 1px solid #e5e7eb;
}

.dropdown-menu.show {
    display: block;
}

/* ==================== ACCORDION MENU ==================== */
.accordion-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-x: hidden;        /* ← Add this line */
    overflow-y: auto;          /* Keeps vertical scroll working */
}

.level-0 { padding: 10px 0; }
.level-1 { padding-left: 20px; display: none; }
.level-2 { padding-left: 20px; display: none; }
.level-3 { padding-left: 20px; display: none; }
.level-4 { padding-left: 20px; display: none; }
.level-5 { padding-left: 20px; display: none; }

/* PARENT ITEMS (with arrow) */
.menu-parent {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    color: #2F5496;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    position: relative; /* Required for tooltips */
}

.menu-parent:hover {
    background: #f0f7ff;
    color: #1e40af;
}

/* NORMAL CHILD ITEMS */
.menu-link {
    display: block;
    padding: 10px 16px;
    color: #374151;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
}

.menu-link:hover,
.active > a {
    background: #2F5496;
    color: white;
}

/* ARROW */
.arrow {
    transition: transform 0.3s ease;
    font-size: 13px;
    opacity: 0.75;
    padding: 2px 6px;
    border-radius: 4px;
}

.menu-parent.open .arrow {
    transform: rotate(90deg);
}

/* ==================== IMPROVED TOOLTIPS ==================== */

.menu-text,
.arrow {
    position: relative;
}

/* ==================== FLOATING TOOLTIP ==================== */
.floating-tooltip {
    position: fixed;
    background-color: #1e3a5f;
    color: #fff;
    padding: 7px 13px;
    border-radius: 6px;
    font-size: 0.82rem;
    white-space: nowrap;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    max-width: 260px;
}

/* Small triangle below the tooltip */
.floating-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e3a5f;
}

/* Show on hover */
.menu-text:hover::after,
.menu-text:hover::before,
.arrow:hover::after,
.arrow:hover::before {
    opacity: 1;
    visibility: visible;
    transition-delay: 0.35s;
}

/* Subtle arrow hover effect */
.arrow:hover {
    background-color: #e6eef9;
    background-color: rgba(47, 84, 150, 0.1);
    opacity: 1;
}

.menu-content {
    display: flex;
    align-items: center;
}

.menu-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    flex-shrink: 0;
    vertical-align: middle;
}