/* ------------------------------------------------------------------------------
 *
 *  # Layout header (top navbar) and sidebar styles
 *  Extracted from templates/header.php and templates/core/header.php
 *
 * ---------------------------------------------------------------------------- */

/* Environment indicator: diagonal ribbon (env_indicator_mode = ribbon) */
.dev-ribbon {
    position: fixed;
    top: 18px;
    right: -45px;
    transform: rotate(45deg);
    width: 150px;
    background: linear-gradient(135deg, #d90429 0%, #ef233c 100%);
    color: white;
    text-align: center;
    line-height: 24px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    z-index: 1035;
    pointer-events: none;
    border-top: 1px dashed rgba(255,255,255,0.4);
    border-bottom: 1px dashed rgba(255,255,255,0.4);
    font-family: 'Roboto', sans-serif;
}

/* Environment indicator: full-width top banner (env_indicator_mode = banner) */
.dev-top-banner {
    background: #d90429;
    color: white;
    text-align: center;
    line-height: 28px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-family: 'Roboto', sans-serif;
    position: relative;
    z-index: 1040;
    width: 100%;
    pointer-events: none;
}

/* Environment indicator: inline badge next to the search (env_indicator_mode = text) */
.navbar .badge.env-indicator-badge {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* Global search box (ID selector beats .navbar-expand-lg .navbar-search) */
#navbar_search .navbar-search.global-search-box {
    max-width: 600px;
    min-width: 100px;
}

#globalSearchResults {
    max-height: 400px;
    overflow-y: auto;
}

/* Below lg (templates/header.php): the search is a collapsed full-width row under the icon bar,
   opened by the magnifying glass button */
@media (max-width: 991.98px) {
    #navbar_search .navbar-search.global-search-box {
        max-width: none;
        min-width: 0;
    }

    #navbar_search.show,
    #navbar_search.collapsing {
        padding-bottom: 0.625rem;
    }
}

/* Sidebar logo: full logo sized like the CheckPOP top bar logo; the square logo
   (.sidebar-logo-icon) only shows when the sidebar is resized to icons */
.sidebar-logo .sidebar-logo-full {
    height: 28px;
    max-width: 125px;
    object-fit: contain;
}

/* The logos carry their intrinsic width / height attributes (templates/sidebar.php, AppImage): the width
   follows the fixed height through the aspect ratio instead of the width attribute */
.sidebar-logo .sidebar-logo-full,
.sidebar-logo .sidebar-logo-icon {
    width: auto;
}

/* Sidebar menu: same sizes as CheckPOP (plateforme-active.css), MyNatais colors kept.
   Sub-menu items keep their own font size (mmi.css, already shared with CheckPOP). */
.sidebar .nav-sidebar {
    --nav-link-spacer-y: 2px;
}

.sidebar .navigation-main .nav-link {
    align-items: center;
    gap: 11px;
    font-size: 13px;
}

.sidebar .navigation-main .nav-link > svg.icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: .7;
}

.sidebar .navigation-main .nav-item > .nav-link.active > svg.icon {
    opacity: 1;
}

/* Pending updates link of the header (templates/header.php, AppUpdates): semantic warning tint,
   readable text (the warning color itself is too light for text) */
.navbar .app-update-link {
    gap: 6px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--body-color);
    background-color: var(--alpha-warning);
    border: 1px solid rgba(var(--warning-rgb), 0.45);
}

.navbar .app-update-link .icon {
    color: var(--warning);
}

.navbar .app-update-link:hover,
.navbar .app-update-link:focus-visible {
    color: var(--body-color);
    background-color: rgba(var(--warning-rgb), 0.22);
}

/* Small phones: compact pending updates link so the icon bar stays on the line of the menu toggle */
@media (max-width: 575.98px) {
    .navbar .app-update-link {
        padding: 0.3rem 0.5rem;
    }
}
