/* =====================================================
   Topbar Navigation — Parallèle Alberta CRM
   Overrides sidebar-based layout to use a full-width
   horizontal navigation in the header.
   ===================================================== */

/* ---- Remove sidebar space ---- */
:root {
    --app-sidebar-width: 0px !important;
}

.app-wrapper {
    margin-left: 0 !important;
}

.app-header {
    padding-left: 0 !important;
}

.footer-wrapper {
    margin-left: 0 !important;
}

/* ---- Header layout ---- */
.app-header {
    height: auto;
    min-height: var(--app-header-height);
    flex-direction: column;
    align-items: stretch;
}

.app-header-inner {
    padding-left: 20px;
    gap: 0;
}

/* ---- Brand ---- */
.topbar-brand {
    min-width: 180px;
    height: var(--app-header-height);
    padding: 0 8px 0 0;
    flex-shrink: 0;
}

.topbar-brand .navbar-brand-logo img {
    height: 32px;
}

.topbar-brand .brand-text {
    color: #1e40af !important;
    font-family: var(--bs-body-font-family);
    white-space: nowrap;
}

/* ---- Desktop Topbar Nav ---- */
.topbar-nav-menu {
    flex: 1;
    height: var(--app-header-height);
    margin-left: 16px;
}

.topbar-menu {
    height: 100%;
}

.topbar-menu-item {
    position: relative;
    display: flex;
    align-items: center;
}

.topbar-menu-link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--bs-heading-color);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    height: 38px;
}

.topbar-menu-link:hover {
    color: #fff;
    background-color: #1e40af;
}

.topbar-menu-link.active {
    color: #fff;
    background-color: #1e40af;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15);
}

.topbar-menu-link:hover i[data-lucide],
.topbar-menu-link.active i[data-lucide] {
    color: #fff;
}

.topbar-menu-link i[data-lucide] {
    flex-shrink: 0;
    color: var(--bs-body-color);
    transition: color 0.2s ease;
}

.topbar-chevron {
    font-size: 8px;
    margin-left: 2px;
    transition: transform 0.2s ease;
}

.topbar-menu-link:hover .topbar-chevron,
.topbar-menu-link.active .topbar-chevron {
    color: #fff;
}

/* ---- Dropdown ---- */
.topbar-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    padding: 8px 0;
    margin-top: 4px;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
    z-index: 1050;
}

.topbar-has-dropdown:hover > .topbar-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.topbar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--bs-heading-color);
    text-decoration: none;
    transition: all 0.15s ease;
}

.topbar-dropdown-item:hover {
    background-color: rgba(30, 64, 175, 0.06);
    color: #1e40af;
}

.topbar-dropdown-item i[data-lucide] {
    color: var(--bs-body-color);
    flex-shrink: 0;
}

.topbar-dropdown-item:hover i[data-lucide] {
    color: #1e40af;
}

/* ---- Toggler override for topbar ---- */
.topbar-toggler {
    margin: 15px 10px;
}

/* ---- Mobile Menu ---- */
.topbar-mobile-menu {
    border-top: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.topbar-mobile-menu.open {
    max-height: 500px;
}

.topbar-mobile-nav {
    padding: 8px 16px;
}

.topbar-mobile-item {
    display: block;
}

.topbar-mobile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--bs-heading-color);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.topbar-mobile-link:hover,
.topbar-mobile-link.active {
    color: #fff;
    background-color: #1e40af;
}

.topbar-mobile-link:hover i[data-lucide],
.topbar-mobile-link.active i[data-lucide] {
    color: #fff;
}

.topbar-mobile-link i[data-lucide] {
    color: var(--bs-body-color);
    flex-shrink: 0;
}

.topbar-mobile-dropdown {
    list-style: none;
    padding-left: 38px;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.topbar-mobile-has-dropdown.open > .topbar-mobile-dropdown {
    max-height: 300px;
}

.topbar-mobile-has-dropdown.open > .topbar-mobile-link .topbar-chevron {
    transform: rotate(180deg);
}

.topbar-mobile-dropdown li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--bs-heading-color);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.topbar-mobile-dropdown li a:hover {
    background-color: rgba(30, 64, 175, 0.06);
    color: #1e40af;
}

.topbar-mobile-dropdown li a i[data-lucide] {
    color: var(--bs-body-color);
}

.topbar-mobile-dropdown li a:hover i[data-lucide] {
    color: #1e40af;
}

/* ---- Responsive ---- */
@media (max-width: 1199.98px) {
    .topbar-brand {
        min-width: auto;
    }

    .app-header-inner {
        padding-left: 10px;
    }
}

@media (max-width: 575.98px) {
    .topbar-brand .brand-text {
        display: none !important;
    }
}
