/* ================================
   POSTALYTICS SIDEBAR NAVIGATION
   Modern HubSpot-style navigation
   ================================ */

/* ================================
   EARLY SIDEBAR STATE (prevents flash on page load)
   These rules apply immediately before DOMContentLoaded
   ================================ */
html.sidebar-expanded-early .sidebar {
    width: 220px !important;
    transition: none !important;
}

html.sidebar-collapsed-early .sidebar {
    width: 60px !important;
    transition: none !important;
}

/* Apply expanded styles early */
html.sidebar-expanded-early .sidebar .sidebar-toggle {
    transform: rotate(180deg);
}

html.sidebar-expanded-early .sidebar .nav-item-text,
html.sidebar-expanded-early .sidebar .nav-section-title {
    display: block;
    opacity: 1;
}

html.sidebar-expanded-early .sidebar .nav-item-arrow {
    display: block;
    opacity: 1;
}

/* Content area positioning based on early sidebar state */
/* Only apply when sidebar exists (using :has() for modern browsers) */
html.sidebar-expanded-early:has(.sidebar) #main {
    margin-left: 220px !important;
    transition: none !important;
}

html.sidebar-collapsed-early:has(.sidebar) #main {
    margin-left: 60px !important;
    transition: none !important;
}

/* Fallback: Reset margins when no sidebar is present */
html.sidebar-expanded-early:not(:has(.sidebar)) #main,
html.sidebar-collapsed-early:not(:has(.sidebar)) #main {
    margin-left: 0 !important;
    width: 100% !important;
}

html.sidebar-expanded-early .footer,
html.sidebar-collapsed-early .footer {
    transition: none !important;
}

html.sidebar-expanded-early:has(.sidebar) .footer {
    margin-left: 220px !important;
}

html.sidebar-collapsed-early:has(.sidebar) .footer {
    margin-left: 60px !important;
}

/* Reset footer margins when no sidebar */
html.sidebar-expanded-early:not(:has(.sidebar)) .footer,
html.sidebar-collapsed-early:not(:has(.sidebar)) .footer {
    margin-left: 0 !important;
    width: 100% !important;
}

/* ================================
   TOP BAR - Minified Header
   ================================ */
/* BACKUP: Original dark grey: #33475b */
/* Brand color options:
   - Primary brand cyan: #61caeb
   - Dark teal: #0e4d64
   - Navy blue: #1a3a5c
   - Deep ocean: #0e4d64
*/
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: #0e4d64;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1040;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar-logo {
    height: 28px;
    /**filter: brightness(0) invert(1);**/
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8fa4b8;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    text-decoration: none;
}

.top-bar-icon:hover {
    background: #1a5a6e;
    color: #fff;
    text-decoration: none;
}

.top-bar-icon .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #f5c26b;
    color: #2d3e50;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    font-weight: 600;
}

.top-bar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    color: #fff;
}

.top-bar-user:hover {
    background: #1a5a6e;
}

.user-name-top {
    font-size: 14px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-chevron {
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.top-bar-profile:hover .user-chevron {
    transform: rotate(180deg);
}

/* ================================
   TOP BAR DROPDOWNS (Help & Profile)
   ================================ */
.top-bar-dropdown {
    position: relative;
}

.top-bar-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    min-width: 220px;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 1100;
    overflow: hidden;
}

.top-bar-dropdown:hover .top-bar-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.top-bar-dropdown-menu .dropdown-header {
    padding: 14px 16px 10px;
    font-weight: 600;
    color: #33475b;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e5e8ed;
    background: #f7f9fc;
}

.top-bar-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #506e91;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}

.top-bar-dropdown-menu .dropdown-item:hover {
    background: #f5f8fa;
    color: #33475b;
}

.top-bar-dropdown-menu .dropdown-item .fa {
    width: 20px;
    margin-right: 12px;
    font-size: 14px;
    color: #7c98b6;
    text-align: center;
}

.top-bar-dropdown-menu .dropdown-item:hover .fa {
    color: #61caeb;
}

.top-bar-dropdown-menu .dropdown-divider {
    height: 1px;
    background: #e5e8ed;
    margin: 4px 0;
}

/* Profile dropdown specific */
.top-bar-dropdown-menu.profile-menu {
    min-width: 240px;
}

.top-bar-dropdown-menu .logout-item {
    color: #d9534f;
}

.top-bar-dropdown-menu .logout-item .fa {
    color: #d9534f;
}

.top-bar-dropdown-menu .logout-item:hover {
    background: #fef2f2;
    color: #c9302c;
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: #61caeb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

/* ================================
   LEFT SIDEBAR
   ================================ */
/* BACKUP: Original dark grey: #33475b */
.sidebar {
    position: fixed;
    top: 50px;
    left: 0;
    bottom: 0;
    width: 60px;
    background: #0e4d64;
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease;
    z-index: 1030;
    overflow: visible;
}

.sidebar.expanded {
    width: 220px;
}

.sidebar-toggle {
    position: absolute;
    top: 12px;
    right: -14px;
    width: 28px;
    height: 28px;
    background: #fff;
    border: 1px solid #cbd6e2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1031;
    box-shadow: 0 2px 5px rgba(0,0,0,0.12);
    transition: transform 0.2s ease, box-shadow 0.15s ease;
}

.sidebar-toggle:hover {
    background: #f5f8fa;
    box-shadow: 0 3px 6px rgba(0,0,0,0.16);
}

.sidebar.expanded .sidebar-toggle {
    transform: rotate(180deg);
}

.sidebar-toggle .fa {
    color: #33475b;
    font-size: 13px;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow: visible;
}

.nav-section {
    margin-bottom: 4px;
}

.nav-section-title {
    color: #7c98b6;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 12px 16px 8px;
    display: none;
}

.sidebar.expanded .nav-section-title {
    display: block;
}

.nav-divider {
    height: 1px;
    background: #1a5a6e;
    margin: 12px 8px;
}

/* ================================
   NAV ITEMS
   ================================ */
.sidebar .nav-item {
    position: relative;
}

/* Constrain nav-item width when sidebar is collapsed to prevent hover triggering outside sidebar */
.sidebar:not(.expanded) .nav-item {
    width: 60px;
    overflow: visible;
}

.sidebar:not(.expanded) .nav-item-main {
    width: 60px;
    overflow: hidden;
}

.sidebar .nav-item-main {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: #b4c7d9;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.sidebar .nav-item-main:hover {
    background: #1a5a6e;
    color: #fff;
    text-decoration: none;
}

.sidebar .nav-item.active .nav-item-main {
    background: #1a5a6e;
    color: #fff;
    border-left: 3px solid #61caeb;
    padding-left: 13px;
}

.nav-item-icon {
    width: 28px;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.nav-item-text {
    margin-left: 12px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar.expanded .nav-item-text {
    opacity: 1;
}

.nav-item-arrow {
    margin-left: auto;
    font-size: 12px;
    opacity: 0;
    transition: all 0.2s ease;
}

.sidebar.expanded .nav-item-arrow {
    opacity: 1;
}

/* Removed translateX on hover - was causing distracting jump */

/* ================================
   SUBMENU POPOUT
   ================================ */
.nav-submenu {
    position: fixed;
    left: 60px;
    background: #fff;
    min-width: 220px;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 1100;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.sidebar.expanded .nav-submenu {
    left: 220px;
}

.sidebar .nav-item:hover .nav-submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Ensure sidebar and submenu are always above page content */
.sidebar,
.nav-submenu {
    pointer-events: auto;
}

/* When collapsed, disable pointer events on text/arrow so only icon triggers hover */
.sidebar:not(.expanded) .nav-item-text,
.sidebar:not(.expanded) .nav-item-arrow {
    pointer-events: none;
}

.submenu-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e8ed;
    font-weight: 600;
    color: #33475b;
    font-size: 14px;
}

.submenu-header:not(:first-child) {
    padding-top: 8px;
    border-bottom: none;
    border-top: 1px solid #e5e8ed;
    margin-top: 8px;
}

.submenu-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: #506e91;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.submenu-item:hover {
    background: #f5f8fa;
    color: #33475b;
    text-decoration: none;
}

.submenu-item .fa {
    width: 20px;
    margin-right: 10px;
    font-size: 14px;
    color: #7c98b6;
}

.submenu-divider {
    height: 1px;
    background: #e5e8ed;
    margin: 8px 0;
}

/* ================================
   SIDEBAR FOOTER (Profile Section)
   ================================ */
.sidebar-footer {
    border-top: 1px solid #1a5a6e;
    padding: 8px 0;
}

.sidebar-footer .nav-item-main {
    padding: 12px 16px;
}

.sidebar-footer .user-avatar-sidebar {
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
    background: #61caeb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-footer .user-info {
    margin-left: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
    overflow: hidden;
}

.sidebar.expanded .sidebar-footer .user-info {
    opacity: 1;
}

.sidebar-footer .user-name {
    font-size: 13px;
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer .user-company {
    font-size: 11px;
    color: #7c98b6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ================================
   MAIN CONTENT AREA
   ================================ */
.sidebar-layout .main-content {
    margin-left: 60px;
    margin-top: 50px;
    padding: 24px;
    transition: margin-left 0.2s ease;
    min-height: calc(100vh - 50px);
}

.sidebar.expanded ~ .main-content {
    margin-left: 220px;
}

/* Override existing content styles for sidebar layout */
.sidebar-layout .container-fluid.content {
    margin-top: 0;
    padding-top: 0;
}

.sidebar-layout #main {
    margin-left: 60px;
    margin-top: 50px;
    width: calc(100% - 60px);
    transition: margin-left 0.2s ease, width 0.2s ease;
    position: relative;
}

.sidebar.expanded ~ #main {
    margin-left: 220px;
    width: calc(100% - 220px);
}

.sidebar-layout .footer {
    margin-left: 60px;
    transition: margin-left 0.2s ease, width 0.2s ease;
    background-color: #fff;
    height: 40px;
    line-height: 40px;
    font-size: 12px;
    color: #7c98b6;
    margin-top: 0;
    width: calc(100% - 60px);
}

.sidebar.expanded ~ .footer,
.sidebar.expanded ~ * .footer {
    margin-left: 220px;
    width: calc(100% - 220px);
}

/* ================================
   CONTENT PANEL STYLES
   Standard styles for page content
   ================================ */

/* Content panel - main wrapper for page content */
.content-panel {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    min-height: calc(100vh - 130px);
    width: 100%;
}

/* Content header - page title section */
.content-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e8ed;
}

.content-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #33475b;
}

.content-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #33475b;
}

.content-header p {
    margin: 8px 0 0 0;
    color: #7c98b6;
}

/* Content body - main content area */
.content-body {
    padding: 24px;
}
.content-body h3 {
    font-size: 1.2rem;
}

.content-body h4 {
    font-size: 1.15rem;
}

.content-body h5 {
    font-size: 1.1rem;
}

/* For pages that don't use content-panel, ensure container-fluid works */
.sidebar-layout .container-fluid {
    padding-left: 0;
    padding-right: 0;
}

/* Ensure form-control class used as wrapper doesn't add unwanted styles */
.sidebar-layout .form-control:not(input):not(textarea):not(select) {
    height: auto;
    border: none;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ================================
   STATUS BADGES
   ================================ */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.new {
    background: #e8f7f0;
    color: #00a37a;
}

.status-badge.beta {
    background: #fff3e0;
    color: #f5a623;
}

/* ================================
   TOOLTIP FOR COLLAPSED STATE
   ================================ */
.nav-tooltip {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #33475b;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease;
    margin-left: 8px;
    z-index: 1001;
}

.nav-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #33475b;
}

.sidebar:not(.expanded) .nav-item:not(:hover) .nav-item-main:hover + .nav-tooltip,
.sidebar:not(.expanded) .nav-item:hover .nav-tooltip {
    display: none;
}

/* ================================
   HIDE OLD NAVBAR IN SIDEBAR LAYOUT
   ================================ */
.sidebar-layout .navbar.navbar-toggleable-md {
    display: none !important;
}

/* ================================
   MOBILE RESPONSIVE
   ================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease, width 0.2s ease;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar-layout #main,
    .sidebar-layout .main-content,
    .sidebar-layout .footer {
        margin-left: 0;
    }

    .top-bar-mobile-toggle {
        display: flex;
    }
}

@media (min-width: 769px) {
    .top-bar-mobile-toggle {
        display: none;
    }
}

/* ================================
   DROPDOWN MENU FIXES
   (for dropdowns inside sidebar)
   ================================ */
.sidebar .dropdown-menu {
    position: static;
    float: none;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0;
}

/* ================================
   AGENCY HOME BUTTON SPECIAL STYLING
   ================================ */
.nav-item.nav-agency-home .nav-item-main {
    background: transparent;
}

.nav-item.nav-agency-home .nav-item-main:hover {
    background: #1a5a6e;
}

.nav-item.nav-agency-home.active .nav-item-main {
    background: #1a5a6e;
    border-left: 3px solid #61caeb;
}

/* ================================
   CREDIT BALANCE PANEL
   ================================ */
.credit-balance-panel {
    position: fixed;
    top: 60px;
    left: 70px;
    z-index: 1050;
    width: 350px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.1);
}

.sidebar.expanded ~ .credit-balance-panel,
.sidebar.expanded + * + * + .credit-balance-panel {
    left: 230px;
}

.credit-balance-panel-content {
    display: flex;
    flex-direction: column;
}

.credit-balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f5f8fa;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    border-radius: 4px 4px 0 0;
}

.credit-balance-header .close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
}

.credit-balance-header .close:hover {
    opacity: 1;
}

.credit-balance-body {
    max-height: 400px;
    overflow-y: auto;
}

.credit-balance-body .list-group {
    margin: 0;
    border-radius: 0;
}

.credit-balance-body .list-group-item {
    border-left: none;
    border-right: none;
    border-radius: 0;
    padding: 10px 16px;
    font-size: 13px;
}

.credit-balance-body .list-group-item:first-child {
    border-top: none;
}

.credit-balance-body .list-group-item a {
    color: inherit;
    text-decoration: none;
}

.credit-balance-body .list-group-item a:hover {
    color: #0056b3;
}

.credit-balance-footer {
    padding: 12px 16px;
    background: #f5f8fa;
    border-top: 1px solid rgba(0,0,0,0.1);
    border-radius: 0 0 4px 4px;
    text-align: right;
}

/* Credit balance warnings */
.credit-balance-body .credit-balance-danger {
    color: #721c24;
    background-color: #f8d7da;
}

.credit-balance-body .credit-balance-warning {
    color: #856404;
    background-color: #fff3cd;
}

/* ================================
   ACCOUNT SECONDARY NAVIGATION
   Inline sub-nav within content area
   ================================ */
.account-secondary-nav {
    background: #fff;
    border-bottom: 1px solid #e5e8ed;
    margin: -24px -24px 24px -24px;
    padding: 0;
}

.secondary-nav-container {
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 0;
    flex-wrap: wrap;
}

.secondary-nav-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    color: #506e91;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    position: relative;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}

.secondary-nav-item:hover {
    background: #f5f8fa;
    color: #33475b;
    text-decoration: none;
}

.secondary-nav-item.active,
.secondary-nav-item.active span,
.secondary-nav-item.active i {
    color: #33475b !important;
    font-weight: 500;
    border-bottom-color: #61caeb;
    background: transparent !important;
    background-color: transparent !important;
}

.secondary-nav-item.active i {
    color: #61caeb !important;
}

.secondary-nav-item .fa {
    margin-right: 8px;
    font-size: 14px;
    color: #7c98b6;
}

.secondary-nav-item:hover .fa {
    color: #61caeb;
}

.secondary-nav-item.active .fa {
    color: #61caeb;
}

/* Secondary nav group labels and dividers */
.secondary-nav-group-label {
    font-size: 11px;
    font-weight: 600;
    color: #7c98b6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 8px 14px 16px;
    white-space: nowrap;
}

.secondary-nav-divider {
    width: 1px;
    height: 24px;
    background: #dfe3e8;
    margin: 0 4px;
    align-self: center;
}

/* ================================
   CATEGORY TABS
   Internal tab bar within category pages
   ================================ */
.category-tabs {
    display: flex;
    gap: 0;
    background: #f5f8fa;
    border-bottom: 1px solid #e5e8ed;
    margin: -24px -24px 24px -24px;
    padding: 0 16px;
}

.category-tabs-container {
    display: flex;
    align-items: center;
    gap: 0;
}

.category-tab {
    display: inline-flex;
    align-items: center;
    padding: 12px 16px;
    color: #506e91;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.category-tab:hover {
    color: #33475b;
    background: rgba(0,0,0,0.03);
    text-decoration: none;
}

.category-tab.active {
    color: #33475b;
    border-bottom-color: #61caeb;
    font-weight: 500;
    background: transparent;
}

.category-tab .fa {
    margin-right: 6px;
    font-size: 13px;
}

/* When both secondary nav and category tabs are present */
.account-secondary-nav + .category-tabs {
    margin-top: 0;
}

/* Mobile responsive for category tabs */
@media (max-width: 768px) {
    .category-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 8px;
    }

    .category-tab {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Account Page Header - Modern styling */
.account-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e8ed;
}

.account-page-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #33475b;
    margin: 0;
}

.account-page-header p {
    font-size: 0.875rem;
    color: #7c98b6;
    margin: 4px 0 0 0;
}

.account-page-header .header-actions {
    display: flex;
    gap: 8px;
}

/* Mobile responsive for secondary nav */
@media (max-width: 768px) {
    .account-secondary-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: -24px -24px 16px -24px;
    }

    .secondary-nav-container {
        flex-wrap: nowrap;
        padding: 0 4px;
    }

    .secondary-nav-item {
        padding: 12px 10px;
        font-size: 13px;
    }

    .secondary-nav-item span {
        display: none;
    }

    .secondary-nav-item .fa {
        margin-right: 0;
        font-size: 16px;
    }
}

/* ================================
   TOP NAV MODE (Legacy Layout)
   Used when agency toggles sub-account
   navigation to top bar instead of sidebar
   ================================ */

/* Hide sidebar completely in top-nav mode */
body.topnav-mode .sidebar {
    display: none !important;
}

/* Hide sidebar toggle button */
body.topnav-mode .sidebar-toggle {
    display: none !important;
}

/* Adjust content panel to fill full width */
body.topnav-mode .content-panel {
    margin-left: 0 !important;
}

body.topnav-mode #main {
    margin-left: 0 !important;
    width: 100% !important;
}

body.topnav-mode .footer {
    margin-left: 0 !important;
    width: 100% !important;
}

/* Bottom navigation bar (wizard steps, campaign create, etc.) */
body.topnav-mode .nav-purchase {
    left: 0 !important;
}

/* Override early sidebar state classes in top-nav mode */
html.sidebar-expanded-early body.topnav-mode #main,
html.sidebar-collapsed-early body.topnav-mode #main {
    margin-left: 0 !important;
    width: 100% !important;
}

html.sidebar-expanded-early body.topnav-mode .footer,
html.sidebar-collapsed-early body.topnav-mode .footer {
    margin-left: 0 !important;
    width: 100% !important;
}

/* Top bar center navigation container */
.top-bar-center {
    display: none;
    flex: 1;
    justify-content: flex-start;
    align-items: center;
    gap: 2px;
    margin-left: 24px;
    overflow: visible;
    height: 50px;
}

body.topnav-mode .top-bar-center {
    display: flex;
}

/* Top nav items styling */
.top-bar-center .top-nav-item {
    position: relative;
    color: #b4c7d9;
    padding: 8px 12px;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 4px;
    transition: all 0.15s ease;
    height: 36px;
    display: flex;
    align-items: center;
}

.top-bar-center .top-nav-item:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.top-bar-center .top-nav-item > a {
    color: inherit;
    text-decoration: none;
}

.top-bar-center .top-nav-item > a:hover {
    color: inherit;
    text-decoration: none;
}

/* Top nav dropdowns */
.top-bar-center .top-nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0;
    padding-top: 4px;
    background: transparent;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    z-index: 1100;
    pointer-events: none;
}

.top-bar-center .top-nav-dropdown-inner {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    overflow: hidden;
}

.top-bar-center .top-nav-item:hover .top-nav-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Top nav dropdown items */
.top-bar-center .top-nav-dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: #506e91;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s ease;
    cursor: pointer;
}

.top-bar-center .top-nav-dropdown-item:hover {
    background: #f5f8fa;
    color: #33475b;
    text-decoration: none;
}

.top-bar-center .top-nav-dropdown-item .fa {
    width: 20px;
    margin-right: 10px;
    font-size: 14px;
    color: #7c98b6;
}

.top-bar-center .top-nav-dropdown-item:hover .fa {
    color: #61caeb;
}

/* Top nav label */
.top-bar-center .top-nav-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Top nav chevron icon */
.top-bar-center .top-nav-item .nav-chevron {
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.top-bar-center .top-nav-item:hover .nav-chevron {
    transform: rotate(180deg);
}


/* Mobile responsive for top nav mode */
@media (max-width: 992px) {
    .top-bar-center {
        max-width: 50%;
    }

    .top-bar-center .top-nav-item {
        padding: 8px 8px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    body.topnav-mode .top-bar-center {
        display: none;
    }

    /* Show mobile hamburger menu in top-nav mode on mobile */
    body.topnav-mode .top-bar-mobile-toggle {
        display: flex;
    }

    /* Allow sidebar to be toggled on mobile even in top-nav mode */
    body.topnav-mode .sidebar {
        display: flex !important;
        transform: translateX(-100%);
    }

    body.topnav-mode .sidebar.mobile-open {
        transform: translateX(0);
    }
}
