/* ==========================================================================
   nav.css — categorised accordion sidebar + header (theme toggle, sticky bar).
   Loaded AFTER admin.css. Base nav colours (dark #262d34 palette) live in
   admin.css; this file adds the section headers, accordion and header bits.
   ========================================================================== */

/* ---- Section headers (General / User / App / Other / Settings) ---- */
.nav-cat {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #626b7a;
    padding: 6px 12px 4px;
    margin-top: 12px;
}
.nav-cat:first-child {
    margin-top: 4px;
}

/* ---- Accordion parent row (caret rotates when open) ---- */
.nav-parent .nav-caret {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    opacity: 0.7;
    transition: transform 0.18s ease;
}
.nav-group.open .nav-parent .nav-caret {
    transform: rotate(90deg);
}
.nav-group.open .nav-parent {
    color: #cdd3de;
}

/* ---- Collapsible sub-menu ---- */
.nav-sub {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.2s ease;
}
.nav-group.open .nav-sub {
    max-height: 400px;
}
.nav-subitem {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: transparent;
    color: #8f96a6;
    font-weight: 500;
    font-size: 13.5px;
    padding: 8px 12px 8px 20px;
    border-radius: 8px;
}
.nav-subitem .nav-dot {
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.5;
    margin-left: 12px;
}
.nav-subitem .nav-subic {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    margin-left: 7px;
    font-size: 15px;
    line-height: 0;
    opacity: 0.9;
}
.nav-subitem .nav-subic svg {
    width: 1em;
    height: 1em;
}
.nav-subitem:hover {
    color: #4f97ff;
}
.nav-subitem.active {
    color: #4f97ff;
    background: rgba(43, 110, 240, 0.16);
}
.nav-subitem.active .nav-dot {
    opacity: 1;
}

/* ==========================================================================
   Header — sticky topbar with viewTitle + module pills + theme toggle icon.
   ========================================================================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg);
    padding-top: 20px;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.topbar-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}
#topbarAction {
    display: flex;
    align-items: center;
    gap: 10px;
}
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    font-size: 19px;
    line-height: 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--muted);
}
.icon-btn svg {
    width: 1em;
    height: 1em;
}
.icon-btn:hover {
    color: var(--brand-2);
    border-color: var(--brand);
}
/* Notifications toggle — green when alerts are ON */
#notifToggle.on {
    color: #16a34a;
    border-color: #16a34a;
}

/* ---- Minimal hover tooltip (.tip[data-tip]) ---- */
.tip {
    position: relative;
}
.tip::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow-sm, 0 6px 16px rgba(0, 0, 0, 0.18));
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
    z-index: 50;
}
.tip:hover::after {
    opacity: 1;
    transform: translateY(0);
}
