.promo-bar {
    height: 32px;
    background: linear-gradient(90deg, var(--accent-yellow) 0%, #ffdb4d 100%);
    color: #1a1a1a;
    font-size: 0.8125rem;
    font-weight: 600;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1101;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.guepardo-alerta-bloqueio {
    position: fixed;
    top: calc(var(--promo-height, 0px) + var(--gp-header-height, 64px));
    left: 0;
    right: 0;
    z-index: 999;
    background: #fff3cd;
    color: #664d03;
    border-bottom: 1px solid #ffecb5;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
    box-sizing: border-box;
}

body.has-bloqueio-alerta #containerContent {
    margin-top: calc(
        var(--gp-header-height, 64px)
        + var(--promo-height, 0px)
        + var(--bloqueio-alerta-height, 0px)
    ) !important;
}

:root {
  --gp-header-height: 64px;
}

@media (max-width: 1280px) {
  :root {
    --gp-header-height: 60px;
  }
}

/* --- HEADER --- */
.header-moderno {
    position: fixed;
    top: var(--promo-height, 0px);
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--borda);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    z-index: 1030;
    transition: var(--transicao);
    gap: 12px;
    overflow: visible;
}

.header-moderno.scrolled {
    height: 56px;
    box-shadow: 0 4px 16px rgba(0, 118, 179, 0.08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    min-width: 0;
}

.brand-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark, #005a8a) 100%);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 20px;
    transition: var(--transicao);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 118, 179, 0.3);
}

.header-moderno.scrolled .brand-logo {
    width: 34px;
    height: 34px;
    font-size: 17px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.brand-role {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-light, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.badge-demo-conta {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 4px;
    padding: 2px 6px;
    line-height: 1.2;
}

/* --- NAV DESKTOP --- */
.nav-desktop {
    display: flex;
    gap: 3px;
    align-items: center;
    flex: 1;
    justify-content: center;
    min-width: 0;
    overflow: visible;
}

.nav-link,
.nav-link-btn {
    text-decoration: none;
    color: #475569;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: var(--transicao);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: none;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    max-width: 100%;
    flex-shrink: 1;
    min-width: 0;
}

.nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.nav-ico {
    font-size: 0.95rem;
    opacity: 0.85;
}

.nav-link:hover,
.nav-link-btn:hover {
    background: #eff6ff;
    color: var(--primary-blue);
}

.nav-link.active,
.nav-link-btn.active {
    background: #eff6ff;
    color: var(--primary-blue);
}

.nav-chevron {
    font-size: 0.7rem;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.has-submenu:hover .nav-chevron,
.has-submenu:focus-within .nav-chevron,
.has-submenu.submenu-open .nav-chevron {
    transform: rotate(180deg);
}

/* Submenu desktop */
.has-submenu {
    position: relative;
}

/* Ponte invisível entre o botão e o dropdown (evita fechar ao mover o mouse) */
.has-submenu::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 12px;
}

.has-submenu > .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: white;
    min-width: 240px;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--borda);
    padding: 6px;
    display: none;
    z-index: 3000;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
}

.has-submenu:hover > .dropdown-menu,
.has-submenu:focus-within > .dropdown-menu,
.has-submenu.submenu-open > .dropdown-menu {
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-link {
    text-decoration: none;
    color: var(--text-dark);
    padding: 9px 11px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: var(--transicao);
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.dropdown-link.has-nav-badge {
    justify-content: flex-start;
}

.dropdown-link.has-nav-badge .nav-label {
    flex: 1;
}

.dropdown-link .nav-ico {
    width: 18px;
    text-align: center;
}

.dropdown-link:hover {
    background: #f1f5f9;
    color: var(--primary-blue);
}

/* --- USER AREA --- */
.user-area {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.btn-nav-login {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 18px;
    background: var(--primary-blue);
    color: white;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transicao);
}

.btn-nav-login:hover {
    background: var(--secondary-blue);
    color: white;
}

.user-profile-wrapper {
    position: relative;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border: 1px solid var(--borda);
    border-radius: 50px;
    cursor: pointer;
    background: #fff;
    transition: var(--transicao);
    max-width: 220px;
}

.user-profile:hover {
    border-color: var(--secondary-blue);
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: var(--secondary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.user-text {
    min-width: 0;
    text-align: left;
}

.user-text p {
    margin: 0;
    line-height: 1.2;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.68rem;
    color: #94a3b8;
    text-transform: capitalize;
}

.user-chevron {
    font-size: 0.75rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.admin-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    background: white;
    border-radius: 14px;
    border: 1px solid var(--borda);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
    display: none;
    flex-direction: column;
    padding: 8px;
    z-index: 3001;
}

.admin-dropdown.show {
    display: flex;
    animation: slideIn 0.2s ease-out;
}

.admin-dropdown-header {
    padding: 10px 12px 8px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 4px;
}

.admin-dropdown-header strong {
    display: block;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.admin-dropdown-header small {
    color: #94a3b8;
    font-size: 0.75rem;
}

.admin-dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 0;
}

.admin-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    transition: var(--transicao);
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
}

.admin-dropdown-item:hover {
    background: #f8fafc;
    color: var(--secondary-blue);
}

.admin-dropdown-item.sair {
    color: #ef4444;
}

.admin-dropdown-item.sair:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* --- MOBILE SIDEBAR --- */
.sidebar-mobile {
    position: fixed;
    top: 0;
    right: 0;
    width: min(320px, 92vw);
    max-height: 100vh;
    max-height: 100dvh;
    height: 100%;
    background: white;
    z-index: 10050;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
}

.sidebar-mobile.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: none;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark, #005a8a) 100%);
    color: #fff;
}

.sidebar-head .sidebar-brand strong {
    color: #fff;
}

.sidebar-head .sidebar-brand small {
    color: rgba(255, 255, 255, 0.75);
}

.sidebar-head .brand-logo-sm {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.sidebar-close {
    border: none;
    background: rgba(255, 255, 255, 0.15);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transicao);
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo-sm {
    width: 36px;
    height: 36px;
    background: var(--primary-blue);
    border-radius: 8px;
    color: white;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-brand strong {
    display: block;
    font-size: 0.95rem;
    color: var(--primary-blue);
}

.sidebar-brand small {
    color: #94a3b8;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.sidebar-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 8px 16px 16px;
}

.sidebar-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    padding: 16px 4px 6px;
    margin-top: 4px;
}

.sidebar-item.sidebar-toggle.open .bi-chevron-down {
    transform: rotate(180deg);
}

.sidebar-item.sidebar-toggle .bi-chevron-down {
    transition: transform 0.2s ease;
    font-size: 0.85rem;
    color: #94a3b8;
}

.sidebar-item {
    text-decoration: none;
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 11px 10px;
    border-bottom: none;
    border-radius: 10px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transicao);
    width: 100%;
}

.sidebar-item.has-nav-badge {
    justify-content: flex-start;
}

.sidebar-item.has-nav-badge .nav-label {
    flex: 1;
}

.sidebar-item:hover {
    background: #eff6ff;
    color: var(--primary-blue);
}

.sidebar-item.open,
.sidebar-item.sidebar-toggle.open {
    background: #eff6ff;
    color: var(--primary-blue);
}

.sidebar-item.sidebar-toggle {
    justify-content: space-between;
}

.sidebar-cta {
    margin-top: 12px;
    background: var(--primary-blue);
    color: white !important;
    border-radius: 10px;
    border: none;
    justify-content: center;
}

.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: max-height 0.35s ease;
}

.mobile-submenu.active {
    max-height: min(70vh, 520px);
    overflow-y: auto;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
}

.mobile-sub-link {
    padding: 11px 14px;
    text-decoration: none;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.mobile-sub-link.has-nav-badge {
    justify-content: flex-start;
}

.mobile-sub-link.has-nav-badge .nav-label {
    flex: 1;
}

.mobile-sub-link:hover {
    color: var(--primary-blue);
    background: #f1f5f9;
}

.sidebar-foot-inner {
    padding: 20px 0 8px;
    margin-top: 8px;
    border-top: 1px solid #f1f5f9;
}

.sidebar-foot {
    padding: 16px 20px;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.btn-sair-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    color: #ef4444;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: 10px;
    background: #fef2f2;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    z-index: 10040;
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.menu-toggle {
    display: none;
    font-size: 1.35rem;
    cursor: pointer;
    border: none;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: var(--primary-blue);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(0, 118, 179, 0.12);
    transition: var(--transicao);
}

.menu-toggle:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 12px rgba(0, 118, 179, 0.2);
}

body.menu-mobile-open,
html.menu-mobile-open {
    overflow: hidden;
    height: 100%;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 1281px) {
    .nav-link,
    .nav-link-btn {
        padding: 7px 11px;
        font-size: 0.84375rem;
    }
}

/* P8-c: compactação progressiva até ao drawer mobile */
@media (max-width: 1280px) {
    .header-moderno {
        padding: 0 14px;
        gap: 8px;
        height: 60px;
    }

    .brand-logo {
        width: 34px;
        height: 34px;
        font-size: 17px;
    }

    .brand-name {
        font-size: 1.05rem;
    }

    .user-profile {
        max-width: 168px;
    }

    .notif-wrapper {
        margin-right: 4px;
    }

    .nav-desktop {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }
}

@media (max-width: 650px) {
    .brand-text {
        display: none;
    }
    .user-text,
    .user-chevron {
        display: none;
    }
    .user-profile {
        padding: 4px;
        border-radius: 50%;
    }
    .header-moderno {
        padding: 0 16px;
    }
}

.nav-link,
.dropdown-link,
.sidebar-item,
.mobile-sub-link {
    position: relative;
}

.nav-badge,
.nav-badge-warning,
.nav-badge-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.35rem;
    margin-left: 0.35rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
    flex-shrink: 0;
}

.nav-badge {
    background: var(--primary-blue, #0076b3);
    color: #fff;
}

.nav-badge-warning {
    background: #fd7e14;
    color: #fff;
}

.nav-badge-danger {
    background: #dc3545;
    color: #fff;
}

.dropdown-link .nav-badge,
.dropdown-link .nav-badge-warning,
.dropdown-link .nav-badge-danger {
    margin-left: auto;
}

@keyframes nav-badge-pulse-keyframes {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.92; }
}

.nav-badge-pulse {
    animation: nav-badge-pulse-keyframes 2s ease-in-out infinite;
}

.sidebar-item .nav-badge,
.sidebar-item .nav-badge-warning,
.sidebar-item .nav-badge-danger,
.mobile-sub-link .nav-badge,
.mobile-sub-link .nav-badge-warning,
.mobile-sub-link .nav-badge-danger {
    margin-left: auto;
}

/* ─── Notificações — Sino ──────────────────────────────────────────────── */

.notif-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 8px;
}

.notif-bell-btn {
    position: relative;
    background: none;
    border: none;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary, #64748b);
    font-size: 1.2rem;
    line-height: 1;
    transition: background .15s, color .15s;
}

.notif-bell-btn:hover {
    background: rgba(0,0,0,.06);
    color: var(--primary-blue, #0077b6);
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ef4444;
    color: #fff;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    display: inline-block;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 1100;
    overflow: hidden;
}

.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 10px;
    border-bottom: 1px solid #f1f5f9;
    font-size: .875rem;
}

.notif-list {
    max-height: 380px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 11px 16px;
    border-bottom: 1px solid #f8fafc;
    cursor: pointer;
    transition: background .12s;
    text-decoration: none;
    color: inherit;
}

.notif-item:hover { background: #f8fafc; }

.notif-item.nao-lida { background: #eff6ff; }
.notif-item.nao-lida:hover { background: #dbeafe; }

.notif-item-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.notif-icon-nova_encomenda  { background: #dbeafe; color: #2563eb; }
.notif-icon-incidencia      { background: #fee2e2; color: #dc2626; }
.notif-icon-folga_conflito  { background: #fef3c7; color: #d97706; }
.notif-icon-fecho_mensal    { background: #e0e7ff; color: #4338ca; }
.notif-icon-contrato_proposta { background: #fce7f3; color: #be185d; }
.notif-icon-proposta_liquidacao { background: #dcfce7; color: #15803d; }
.notif-icon-default         { background: #f1f5f9; color: #64748b; }

.notif-item-body { flex: 1; min-width: 0; }
.notif-item-titulo { font-size: .82rem; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item-msg { font-size: .78rem; color: #64748b; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-item-hora { font-size: .7rem; color: #94a3b8; margin-top: 3px; }

@media (max-width: 480px) {
    .notif-dropdown { width: calc(100vw - 20px); right: -10px; }
}
