/* ============================================
   DESKTOP HEADER LAYOUT STYLES
   ============================================ */

.header-container {
    margin-left: 300px;
    padding: 0 20px;
    background-color: rgba(255, 255, 255, 1);
    border-bottom: 1px solid rgba(226, 232, 240, 1);
}


@media (max-width: 1279px) {
    .header-container {
        margin-left: 0;
        width: 100%;
    }
}


.header-title {
    padding: 19px 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    padding-right: 76px;
}

.header-title.header-title--dashboard {
    padding-right: 24px;
    align-items: center;
}

.header-title-actions {
    align-items: center;
    display: flex;
    gap: 12px;
    height: 44px;
    margin-left: auto;
}

.header-title-actions .admin-notification {
    align-items: center;
    background: transparent;
    border: 0;
    color: #94a3b8;
    cursor: pointer;
    display: inline-flex;
    font-size: 20px;
    height: 40px;
    justify-content: center;
    line-height: 1;
    position: relative;
    text-decoration: none;
    transition: color 0.2s ease;
    width: 40px;
    flex: 0 0 40px;
}

.notification-bell-default-icon {
    display: inline-flex;
    line-height: 1;
    position: relative;
}

.notification-bell-unread-icon {
    display: none;
    height: 22px;
    object-fit: contain;
    width: 22px;
}

.layout-header-admin-notification .notification-bell-unread-icon {
    height: 20px;
    width: 20px;
}

#notification-menu-toggle .notification-bell-unread-icon {
    height: 18px;
    width: 18px;
}

.header-title-actions .admin-notification:hover {
    color: #3151d3;
}

.admin-notification.has-unread .notification-bell-default-icon::after,
.layout-header-admin-notification.has-unread .notification-bell-default-icon::after,
#notification-menu-toggle.has-unread .notification-bell-default-icon::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(48%, -38%);
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #ef4444;
    border: 2px solid #ffffff;
    box-sizing: content-box;
    pointer-events: none;
}

.header-title-actions .admin-primary-btn {
    align-items: center;
    background: #2647c8;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    height: 44px;
    justify-content: center;
    min-width: 128px;
    padding: 0 22px;
    text-decoration: none;
    transition: background-color 0.2s ease;
    flex: 0 0 auto;
}

.header-title-actions .admin-primary-btn i {
    font-size: 13px;
    line-height: 1;
}

.header-title-actions .admin-primary-btn:hover,
.header-title-actions .admin-primary-btn:focus-visible {
    background: #1f3cae;
    color: #fff;
}

.layout-header-admin-notification {
    position: absolute;
    top: 50%;
    right: 24px;
    width: auto;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    background: transparent;
    text-decoration: none;
    flex-shrink: 0;
    transition: color 0.2s ease;
    z-index: 3;
    font-size: 18px;
    line-height: 1;
    transform: translateY(-50%);
}

.layout-header-admin-notification:hover {
    color: #3151d3;
}



/* ============================================
   DESKTOP SIDEBAR STYLES
   ============================================ */


/* Hide original header on desktop - sidebar will be used instead */
header {
    display: none;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    background-color: #1E3A8A;
    color: #fff;
    z-index: 1000;
    transition: width 0.2s ease;
    display: flex;
    align-items: center;
    /*padding: 24px 12px 12px;*/
    flex-direction: column;
    /*gap: 22px;*/
}

/* Sidebar collapsed state */
.sidebar.collapsed {
    width: 88px;
    padding: 24px 8px 12px;
    gap: 16px;
}

/* Sidebar toggle button */


.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    transition: all 0.2s ease;
    position: relative;
    /* garante contexto de empilhamento acima da nav */
    z-index: 2;
    border-bottom: 2px solid rgba(30, 64, 175, 1);
    padding: 24px 10px 0px
}

.sidebar.collapsed .sidebar-header {
    align-items: center;
}

.sidebar-logo {
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.sidebar.collapsed .sidebar-logo {
    margin-bottom: 16px;
}

.sidebar-logo a {
    display: block;
}

.sidebar-logo img {
    width: 208px;
    height: auto;
    transition: all 0.2s ease;
}

.sidebar.collapsed .sidebar-logo img {
    max-height: 60px;
}

.sidebar-user-info {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    border: none;
    justify-content: space-between;
    transition: all 0.2s ease;
    overflow: visible;
}

.sidebar-user-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.sidebar-user-left>div:not(.sidebar-user-avatar) {
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed .sidebar-user-info {
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.sidebar-user-info>div {
    transition: all 0.2s ease;
    min-width: 0;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    border: 2px solid #60A5FA;
}

.sidebar-user-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.collapsed .sidebar-user-name {
    font-size: 9px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 48px;
    line-height: 1.2;
}

.sidebar-user-time {
    font-size: 12px;
    color: #93C5FD;
    transition: all 0.2s ease;
    text-decoration: none;
}

.sidebar.collapsed .sidebar-user-time {
    font-size: 8px;
    text-align: center;
    line-height: 1.1;
}

.sidebar-header-item {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 64px;
    flex-direction: row;
    transition: all 0.2s ease;
}

.sidebar.collapsed .sidebar-header-item {
    flex-direction: column;
    gap: 8px;
    margin-top: 32px;
    align-items: center;
}

.sidebar-header-item .header-item-action {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease;
    font-size: 13px;
    position: relative;
}

.sidebar.collapsed .sidebar-header-item .header-item-action {
    padding: 8px;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.sidebar.collapsed .sidebar-header-item .header-item-action span {
    display: none;
}

.sidebar.collapsed .sidebar-header-item .header-item-action i {
    margin-right: 0;
}

.sidebar-header-item .header-item-action:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-header-item .header-item-action i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    width: 100%;
    padding-right: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #f1f1f7 var(--primary-color);
    transition: padding 0.2s ease;
    position: relative;
    z-index: 1;
    padding: 24px 12px;
}

.sidebar.collapsed .sidebar-nav {
    padding-right: 0;
    padding-left: 0;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav .sidebar-nav-item>a {
    display: flex;
    align-items: center;
    padding: 8px;
    color: #fff;
    text-decoration: none;
    transition: all 0.15s ease;
    position: relative;
    border: 8px solid transparent;
    border-radius: 8px;
}

.sidebar.collapsed .sidebar-nav .sidebar-nav-item>a {
    padding: 8px;
    justify-content: center;
    border-left: none;
    border-radius: 8px;
    margin: 4px 8px;
}

.sidebar-nav .sidebar-nav-item>a:not(.active):hover {
    background-color: rgba(255, 255, 255, 0.12);
}

.sidebar-nav .sidebar-nav-item>a.active {
    background-color: #1E40AF;
}

.sidebar:not(.collapsed).sidebar-hovering-link .sidebar-nav .sidebar-nav-item>a.active {
    background-color: #1E40AF;
}

.sidebar.collapsed.sidebar-hovering-link .sidebar-nav .sidebar-nav-item>a.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: #fff;
}

.sidebar.collapsed .sidebar-nav .sidebar-nav-item>a.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-left: none;
    border: 2px solid #fff;
}

.sidebar-nav .sidebar-nav-item--registrations .sidebar-registration-card__text {
    flex: 1;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-registration-card__count {
    align-items: center;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    color: #ffffff;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    height: 22px;
    justify-content: center;
    margin-left: auto;
    min-width: 22px;
    padding: 0 7px;
}

.sidebar.collapsed .sidebar-registration-card__text,
.sidebar.collapsed .sidebar-registration-card__count {
    display: none;
}

/* Collapsed sidebar flyout */
.sidebar-collapsed-flyout {
    position: fixed;
    top: 24px;
    left: 120px;
    background: #fff;
    color: var(--primary-color);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(13, 36, 78, 0.08);
    border-radius: 18px;
    min-width: 280px;
    max-width: 360px;
    max-height: calc(100vh - 48px);
    overflow: hidden;
    z-index: 1200;
    animation: flyoutFadeIn 0.15s ease-out;
}

.sidebar-collapsed-flyout::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: inherit;
    border-left: 1px solid rgba(13, 36, 78, 0.08);
    border-bottom: 1px solid rgba(13, 36, 78, 0.08);
    transform: rotate(45deg);
    left: -7px;
    top: var(--flyout-arrow-top, 32px);
}

.sidebar-collapsed-flyout .flyout-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(100vh - 80px);
}

.sidebar-collapsed-flyout .flyout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 15px;
    color: var(--primary-color);
}

.sidebar-collapsed-flyout .flyout-close {
    border: none;
    background: rgba(13, 36, 78, 0.07);
    color: inherit;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.sidebar-collapsed-flyout .flyout-close:hover {
    background: rgba(13, 36, 78, 0.15);
}

.sidebar-collapsed-flyout .flyout-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    max-height: calc(100vh - 140px);
    scrollbar-width: thin;
}

.sidebar-collapsed-flyout .flyout-item {
    margin-bottom: 4px;
}

.sidebar-collapsed-flyout .flyout-link,
.sidebar-collapsed-flyout .flyout-toggle {
    width: 100%;
    border: none;
    background: rgba(13, 36, 78, 0.04);
    color: inherit;
    text-decoration: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-collapsed-flyout .flyout-link:hover,
.sidebar-collapsed-flyout .flyout-toggle:hover {
    background: rgba(13, 36, 78, 0.12);
}

.sidebar-collapsed-flyout .flyout-toggle i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.sidebar-collapsed-flyout .flyout-item.has-children {
    padding-bottom: 2px;
}

.sidebar-collapsed-flyout .flyout-item.has-children .flyout-submenu {
    list-style: none;
    margin: 6px 0 0 0;
    padding-left: 12px;
    border-left: 1px solid rgba(13, 36, 78, 0.15);
    display: none;
    gap: 4px;
    flex-direction: column;
}

.sidebar-collapsed-flyout .flyout-item.has-children.open>.flyout-submenu {
    display: flex;
}

.sidebar-collapsed-flyout .flyout-item.has-children.open>.flyout-toggle i {
    transform: rotate(180deg);
}

.sidebar-collapsed-flyout .flyout-submenu .flyout-link,
.sidebar-collapsed-flyout .flyout-submenu .flyout-toggle {
    background: rgba(13, 36, 78, 0.02);
}

/* Context switcher flyout */
.context-collapsed-flyout {
    position: fixed;
    top: 24px;
    left: 120px;
    background: #fff;
    color: var(--primary-color);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(13, 36, 78, 0.08);
    border-radius: 16px;
    width: 320px;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 48px);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1250;
    animation: flyoutFadeIn 0.15s ease-out;
}

.context-collapsed-flyout::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: inherit;
    border-left: 1px solid rgba(13, 36, 78, 0.08);
    border-bottom: 1px solid rgba(13, 36, 78, 0.08);
    transform: rotate(45deg);
    left: -7px;
    top: var(--flyout-arrow-top, 32px);
}

.context-flyout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 15px;
    color: var(--primary-color);
}

.context-flyout-close {
    border: none;
    background: rgba(13, 36, 78, 0.07);
    color: var(--primary-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.context-flyout-close:hover {
    background: rgba(13, 36, 78, 0.15);
}

.context-flyout-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(13, 36, 78, 0.1);
    background: rgba(13, 36, 78, 0.04);
}

.context-flyout-search i {
    color: rgba(13, 36, 78, 0.6);
    font-size: 13px;
}

.context-flyout-search input {
    border: none;
    outline: none;
    background: transparent;
    flex: 1;
    font-size: 13px;
    color: var(--primary-color);
}

.context-flyout-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    padding-right: 4px;
}

.context-flyout-option {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(13, 36, 78, 0.04);
    text-align: left;
    font-size: 13px;
    color: var(--primary-color);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.context-flyout-option:hover {
    background: rgba(13, 36, 78, 0.08);
}

.context-flyout-option.active {
    border-color: var(--primary-color);
    background: rgba(13, 36, 78, 0.12);
    font-weight: 600;
}

.context-flyout-empty {
    padding: 12px;
    text-align: center;
    font-size: 12px;
    color: rgba(13, 36, 78, 0.7);
    background: rgba(13, 36, 78, 0.04);
    border-radius: 10px;
}

.sidebar-nav .sidebar-nav-item .nav-icon {
    margin-right: 12px;
    width: 16px;
    height: 16px;
    text-align: center;
    transition: all 0.15s ease;
}

.sidebar.collapsed .sidebar-nav .sidebar-nav-item .nav-icon {
    margin-right: 0;
    font-size: 14px;
    color: #fff;
}

.sidebar.collapsed .sidebar-nav .sidebar-nav-item>a:hover .nav-icon {
    color: #fff;
}

.sidebar-nav .sidebar-nav-item .nav-text {
    flex: 1;
    transition: opacity 0.15s ease;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
}

.sidebar.collapsed .sidebar-nav .sidebar-nav-item .nav-text {
    display: none;
}

.sidebar-nav .sidebar-nav-item .nav-arrow {
    transition: transform 0.15s ease;
    margin-left: auto;
    font-size: 12px;
}

.sidebar.collapsed .sidebar-nav .sidebar-nav-item .nav-arrow {
    display: none;
}

.sidebar-nav .sidebar-nav-item.open>a .nav-arrow {
    transform: rotate(90deg);
}

/* Dropdown Menu */
.sidebar-nav .dropdown-menu {
    max-height: 0;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.2);
    transition: max-height 0.2s ease-out;
    position: static;
    margin-left: 16px;
    display: block;
}

.sidebar.collapsed .sidebar-nav .dropdown-menu {
    display: none;
}

.sidebar-nav .sidebar-nav-item.open .dropdown-menu {
    max-height: 1000px;
    transition: max-height 0.25s ease-in;
    margin-bottom: 10px;
}

.sidebar.collapsed .sidebar-nav .sidebar-nav-item.open .dropdown-menu {
    max-height: 0;
}

.sidebar-nav .dropdown-menu .sidebar-nav-item {
    margin-bottom: 0;
}

.sidebar-nav .dropdown-menu .sidebar-nav-item a {
    padding: 10px 20px 10px 25px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease;
}

.sidebar-nav .dropdown-menu .sidebar-nav-item a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-nav .dropdown-menu .sidebar-nav-item.dropdown a {
    justify-content: space-between;
}

/* Nested dropdown arrows */
.sidebar-nav .dropdown-menu .sidebar-nav-item.dropdown .nav-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.sidebar-nav .dropdown-menu .sidebar-nav-item.dropdown.open>a .nav-arrow {
    transform: rotate(90deg);
}

/* Nested dropdown specific styling */
.sidebar-nav .dropdown-menu .sidebar-nav-item.dropdown>a {
    position: relative;
    background-color: rgba(255, 255, 255, 0.05);
    border-left: 2px solid rgba(255, 255, 255, 0.2);
}

.sidebar-nav .dropdown-menu .sidebar-nav-item.dropdown>a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-left-color: rgba(255, 255, 255, 0.4);
}

/* Nested Dropdown */
.sidebar-nav .dropdown-menu .sidebar-nav-item.dropdown {
    position: static;
}

.sidebar-nav .dropdown-menu .sidebar-nav-item.dropdown .dropdown-menu {
    background-color: rgba(0, 0, 0, 0.3);
    margin-left: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
}

.sidebar-nav .dropdown-menu .sidebar-nav-item.dropdown.open .dropdown-menu {
    max-height: 500px;
    transition: max-height 0.25s ease-in;
}

.sidebar-nav .dropdown-menu .sidebar-nav-item.dropdown .dropdown-menu .sidebar-nav-item a {
    padding-left: 21px;
    font-size: 12px;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
}

.sidebar-nav .dropdown-menu .sidebar-nav-item.dropdown .dropdown-menu .sidebar-nav-item a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    padding-left: 22px;
}

.sidebar-nav .dropdown-menu .sidebar-nav-item.dropdown .dropdown-menu .sidebar-nav-item.dropdown a {
    justify-content: space-between;
    background-color: rgba(255, 255, 255, 0.03);
    border-left: 2px solid rgba(255, 255, 255, 0.15);
}

/* Third level nesting if needed */
.sidebar-nav .dropdown-menu .sidebar-nav-item.dropdown .dropdown-menu .sidebar-nav-item.dropdown .dropdown-menu {
    background-color: rgba(0, 0, 0, 0.4);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
}

.sidebar-nav .dropdown-menu .sidebar-nav-item.dropdown .dropdown-menu .sidebar-nav-item.dropdown.open .dropdown-menu {
    max-height: 330px;
    transition: max-height 0.25s ease-in;
}

.sidebar-nav .dropdown-menu .sidebar-nav-item.dropdown .dropdown-menu .sidebar-nav-item.dropdown .dropdown-menu .sidebar-nav-item a {
    padding-left: 90px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

/* Sidebar Footer */
.sidebar-footer {
    width: 100%;
    border-top: 2px solid rgba(30, 64, 175, 1);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    height: 73px;
    justify-content: center;
    padding: 0 24px;
}

.sidebar.collapsed .sidebar-footer {
    gap: 8px;
    align-items: center;
    padding: 0;
}

.sidebar-footer .footer-action {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 13px;
}

.sidebar.collapsed .sidebar-footer .footer-action {
    padding: 8px;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.sidebar.collapsed .sidebar-footer .footer-action span {
    display: none;
}

.sidebar.collapsed .sidebar-footer .footer-action i {

}

.sidebar-footer .footer-action:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-footer .footer-action i {
    width: 16px;
    text-align: center;
}

/* Theme toggles in sidebar */
.dark-mode-toggle,
.holiday-theme-toggle {
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}

.sidebar.collapsed .dark-mode-toggle,
.sidebar.collapsed .holiday-theme-toggle {
    padding: 8px;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.sidebar.collapsed .dark-mode-toggle span,
.sidebar.collapsed .holiday-theme-toggle span {
    display: none;
}

.sidebar.collapsed .dark-mode-toggle i,
.sidebar.collapsed .holiday-theme-toggle i {
    margin-right: 0;
}

.dark-mode-toggle:hover,
.holiday-theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.dark-mode-toggle i,
.holiday-theme-toggle i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

/* Tooltip styles for collapsed sidebar */
.sidebar.collapsed .tooltip-trigger {
    position: relative;
}

.sidebar.collapsed .tooltip-trigger:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 16px);
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    animation: fadeInTooltip 0.3s ease forwards;
    min-width: max-content;
}

.sidebar.collapsed .tooltip-trigger:hover::before {
    content: '';
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: rgba(0, 0, 0, 0.9);
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    animation: fadeInTooltip 0.3s ease forwards;
}

@keyframes fadeInTooltip {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Environment badge */
.environment-badge {
    background-color: var(--red);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    margin-top: 24px;
    text-align: center;
    transition: all 0.2s ease;
}

.sidebar.collapsed .environment-badge {
    position: absolute;
    top: 12px;
    left: 96px;
    padding: 2px 6px;
    font-size: 8px;
    width: auto;
    white-space: nowrap;
    margin-bottom: 0;
    z-index: 10;
}

/* Main Content Adjustment */
.main-content {
    margin-left: 300px;
    padding: 20px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed+.main-content,
.main-content.sidebar-collapsed {
    margin-left: 88px;
}

/* ============================================
   MOBILE MENU STYLES (<1280px)
   ============================================ */

@media (max-width: 1279px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    header {
        display: block;
    }

    .header-top {
        flex-direction: row;
        gap: 16px;
        align-items: center;
        justify-content: space-between;
    }

    .header-top a:first-child {
        display: none;
    }

    .header-info {
        display: flex;
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        white-space: normal;
    }

    .header-user {
        display: flex;
        width: auto;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        flex: 1;
    }

    /* Ajustar layout do ambiente-info no mobile */
    #ambiente-info {
        margin-right: auto !important;
    }

    /* Container para os botões de ação no mobile */
    .header-user .action-wrapper,
    .header-user #menu-toggle {
        margin-left: auto;
    }

    .header-actions-mobile {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-left: auto;
    }

    .header-menu {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        position: absolute;
        top: 170px;
        left: 0;
        background: var(--primary-color);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        z-index: 200000;
    }

    .nav-menu-list {
        width: 100%;
    }

    .nav-menu-item {
        width: 100%;
    }

    .nav-menu-item a {
        color: #fff;
    }

    .menu-toggle {
        display: flex;
        margin-top: 35px;
    }

    header {
        background-color: var(--primary-color);
    }

    .bigger-than-small-desktop {
        display: none !important;
    }

    .smaller-than-small-desktop {
        display: flex !important;
    }

    /* Modern Mobile Menu Overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 9999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .mobile-menu-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    .mobile-menu {
        position: absolute;
        top: 0;
        right: 0;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        background-color: var(--primary-color);
        color: #fff;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    }

    .mobile-menu-overlay.show .mobile-menu {
        transform: translateX(0);
        z-index: 100000;
        /* acima de qualquer header/menu */
    }

    /* Environment Badge */
    .mobile-environment-badge {
        position: absolute;
        top: 10px;
        left: 10px;
        background-color: var(--red);
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 10px;
        font-weight: bold;
        z-index: 10;
    }

    /* Mobile Menu Header */
    .mobile-menu-header {
        padding: 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        position: relative;
    }

    .mobile-menu-close {
        position: absolute;
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    .mobile-menu-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    .mobile-menu-close i {
        font-size: 18px;
    }

    /* Mobile Menu Logo */
    .mobile-menu-logo {
        margin-bottom: 20px;
        text-align: center;
    }

    .mobile-menu-logo img {
        max-height: 50px;
        max-width: 200px;
        height: auto;
        width: auto;
    }

    .mobile-user-info {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-bottom: 20px;
        margin-top: 10px;
    }

    .mobile-user-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: #fff;
        color: var(--primary-color);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 18px;
        flex-shrink: 0;
    }

    .mobile-user-name {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 5px;
        line-height: 1.2;
    }

    .mobile-user-time {
        font-size: 12px;
        color: rgba(255, 255, 255, 0.8);
        line-height: 1.2;
    }

    .mobile-header-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mobile-header-action {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        text-decoration: none;
        color: #fff;
        transition: background-color 0.2s ease;

        .holiday-theme-toggle,
        .mobile-holiday-toggle {
            display: flex;
            align-items: center;
            gap: 10px;
            border-radius: 10px;
            padding: 10px 12px;
            border: none;
            cursor: pointer;
            font-size: 13px;
            font-weight: 600;
            transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
        }

        .holiday-theme-toggle {
            width: 100%;
            margin-top: 10px;
            background: rgba(255, 255, 255, 0.16);
            border: 1px dashed rgba(255, 255, 255, 0.4);
            color: #fff;
        }

        .holiday-theme-toggle:hover,
        .holiday-theme-toggle:focus-visible {
            background: rgba(255, 255, 255, 0.25);
        }

        .mobile-holiday-toggle {
            margin-top: 12px;
            width: 100%;
            background: rgba(4, 76, 141, 0.08);
            border: 1px dashed rgba(4, 76, 141, 0.35);
            color: var(--primary-color);
        }

        .mobile-holiday-toggle:hover,
        .mobile-holiday-toggle:focus-visible {
            background: rgba(4, 76, 141, 0.16);
        }

        .holiday-theme-toggle i,
        .mobile-holiday-toggle i {
            font-size: 16px;
        }

        position: relative;
    }

    .mobile-header-action:hover {
        background: rgba(255, 255, 255, 0.15);
        text-decoration: none;
        color: #fff;
    }

    .mobile-header-action i {
        font-size: 16px;
        width: 20px;
        text-align: center;
    }

    .mobile-header-action span {
        font-size: 14px;
        font-weight: 500;
    }

    .mobile-notification-badge {
        position: absolute;
        top: 8px;
        right: 12px;
        background-color: var(--red);
        color: white;
        border-radius: 10px;
        padding: 2px 6px;
        font-size: 12px;
        font-weight: bold;
        min-width: 18px;
        height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobile Menu Navigation */
    .mobile-menu-nav {
        flex: 1;
        padding: 20px 0;
        overflow-y: auto;
    }

    .mobile-nav-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .mobile-nav-item {
        position: relative;
    }

    .mobile-nav-item>a {
        display: flex;
        align-items: center;
        padding: 15px 20px;
        text-decoration: none;
        color: #fff;
        transition: background-color 0.2s ease;
        border-left: 3px solid transparent;
    }

    .mobile-nav-item>a:hover {
        background-color: rgba(255, 255, 255, 0.1);
        text-decoration: none;
        color: #fff;
    }

    .mobile-nav-item>a.active {
        background-color: rgba(255, 255, 255, 0.15);
        border-left-color: #fff;
    }

    .mobile-nav-icon {
        width: 20px;
        margin-right: 15px;
        text-align: center;
        font-size: 16px;
        flex-shrink: 0;
    }

    .mobile-nav-item>a>span {
        flex: 1;
        font-size: 14px;
        font-weight: 500;
    }

    .mobile-nav-arrow {
        margin-left: auto;
        font-size: 12px;
        transition: transform 0.2s ease;
    }

    /* Mobile Dropdown Styles */
    .mobile-nav-item.dropdown.open>a .mobile-nav-arrow {
        transform: rotate(90deg);
    }

    .mobile-dropdown-menu {
        list-style: none;
        margin: 0;
        padding: 0;
        background-color: rgba(0, 0, 0, 0.2);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .mobile-nav-item.dropdown.open .mobile-dropdown-menu {
        max-height: 1000px;
    }

    .mobile-dropdown-menu .mobile-nav-item>a {
        padding: 12px 20px 12px 55px;
        font-size: 13px;
        border-left: none;
    }

    .mobile-dropdown-menu .mobile-nav-item.dropdown>a {
        padding: 12px 20px 12px 55px;
    }

    .mobile-dropdown-menu .mobile-nav-item.dropdown .mobile-dropdown-menu .mobile-nav-item>a {
        padding: 10px 20px 10px 75px;
        font-size: 12px;
    }

    /* Animation for nested dropdowns */
    .mobile-dropdown-menu .mobile-nav-item.dropdown .mobile-dropdown-menu {
        background-color: rgba(0, 0, 0, 0.3);
    }

    /* Active state for nested items */
    .mobile-dropdown-menu .mobile-nav-item>a.active {
        background-color: rgba(255, 255, 255, 0.15);
        color: #fff;
    }

    /* Mobile Menu Footer */
    .mobile-menu-footer {
        padding: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mobile-dark-mode-toggle,
    .mobile-holiday-toggle,
    .mobile-footer-action {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        text-decoration: none;
        color: #fff;
        transition: background-color 0.2s ease;
        cursor: pointer;
        border: none;
        width: 100%;
        text-align: left;
    }

    .mobile-dark-mode-toggle:hover,
    .mobile-holiday-toggle:hover,
    .mobile-footer-action:hover {
        background: rgba(255, 255, 255, 0.15);
        text-decoration: none;
        color: #fff;
    }

    .mobile-dark-mode-toggle i,
    .mobile-holiday-toggle i,
    .mobile-footer-action i {
        font-size: 16px;
        width: 20px;
        text-align: center;
    }

    .mobile-dark-mode-toggle span,
    .mobile-holiday-toggle span,
    .mobile-footer-action span {
        font-size: 14px;
        font-weight: 500;
    }

    /* Mobile Menu Scrollbar */
    .mobile-menu::-webkit-scrollbar {
        width: 6px;
    }

    .mobile-menu::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
    }

    .mobile-menu::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 3px;
    }

    .mobile-menu::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.5);
    }

    /* Mobile Menu Navigation Scrollbar */
    .mobile-menu-nav::-webkit-scrollbar {
        width: 4px;
    }

    .mobile-menu-nav::-webkit-scrollbar-track {
        background: transparent;
    }

    .mobile-menu-nav::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
        border-radius: 2px;
    }

    /* Responsive adjustments */
    @media (max-width: 480px) {
        .mobile-menu {
            width: 100vw;
            max-width: 100vw;
        }

        .mobile-user-info {
            flex-direction: column;
            align-items: flex-start;
            gap: 10px;
        }

        .mobile-user-info>div {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .mobile-header-actions {
            margin-top: 10px;
        }
    }
}

@media (max-width: 1280px) {
    .header-logo img {
        max-height: 50px;
    }
}

/* ============================================
   HIDE ELEMENTS ON RESPECTIVE SCREEN SIZES
   ============================================ */

/* Hide mobile menu elements on desktop */
@media (min-width: 1280px) {

    .mobile-menu-overlay,
    .mobile-menu {
        display: none !important;
    }
}

/* Hide sidebar toggle on mobile */
@media (max-width: 1279px) {
    .sidebar-toggle {
        display: none !important;
    }
}

/* ============================================
   CONTEXT SWITCHER - VISUAL REFINEMENT
   Mantém classes/IDs existentes (custom-select-*)
   ============================================ */

.context-switcher {
    width: 100%;
    margin: 8px 0 0;
}

.context-switcher-status {
    font-size: 10px;
    color: #9aa;
    min-height: 14px;
    line-height: 14px;
    margin-top: 6px;
}

/* Wrapper ocupa largura total para evitar quebras em sidebar */
.context-switcher .custom-select-wrapper {
    width: 100%;
}

.context-switcher .custom-select {
    position: relative;
    width: 100%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    border-radius: 8px;
    overflow: visible;
    /* precisa ser visível para o dropdown extrapolar */
    backdrop-filter: saturate(120%) blur(0px);
}

/* Quando aberto, eleva o container para sobrepor vizinhos (nav/scroll) */
.context-switcher .custom-select.open {
    z-index: 20000;
    overflow: visible;
}

.context-switcher .custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
}

.context-switcher .custom-select-trigger span {
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ícone chevron como <i> ao invés de seta CSS */
.context-switcher .custom-select-trigger .select-chevron {
    font-size: 12px;
    line-height: 1;
    opacity: 0.9;
    transition: transform 0.2s ease;
}

.context-switcher .custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    color: #222;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 280px;
    overflow-y: auto;
    z-index: 10000;
    display: none;
    will-change: transform, opacity;
    transform: translateZ(0);
    /* força camada própria, evita bug de pintura */
}

.context-switcher .custom-select.open .custom-options {
    display: block;
}

.context-switcher .custom-option {
    padding: 10px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.context-switcher .custom-option:hover {
    background: #f3f4f6;
}

.context-switcher .custom-option[selected] {
    background: #eef2ff;
    color: #1f2937;
    font-weight: 600;
}

.context-switcher .custom-option.search-option {
    padding: 8px;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    border-bottom: 1px solid #f0f0f0;
}

.context-switcher .custom-option.search-option input {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
}

/* Estado foco/acessibilidade */
.context-switcher .custom-select:focus-within {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

/* Sidebar colapsada: manter largura, mas ajustar tipografia */
@media (min-width: 1280px) {
    .sidebar.collapsed .context-switcher .custom-select {
        background: rgba(255, 255, 255, 0.16);
        border-color: rgba(255, 255, 255, 0.26);
    }

    .sidebar.collapsed .context-switcher .custom-select-trigger span {
        font-size: 11px;
    }
}

/* Mobile: herdar tema do mobile menu */
@media (max-width: 1279px) {
    .mobile-menu .context-switcher {
        padding: 0 20px;
        margin: 0 0 10px;
    }

    .mobile-menu .context-switcher .custom-select {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: #fff;
    }

    .mobile-menu .context-switcher .custom-select.open {
        z-index: 20000;
    }

    .mobile-menu .context-switcher .custom-options {
        background: #fff;
        color: #222;
    }

    .mobile-menu .context-switcher .custom-option[selected] {
        background: #eef2ff;
        color: #1f2937;
    }

    .mobile-menu .context-switcher .custom-select-trigger .select-chevron {
        color: #fff;
    }
}

/* ============================================
       CONTEXT SWITCHER - MODAL DE CONFIRMAÇÃO
       ============================================ */
.ctx-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 100000;
}

.ctx-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.ctx-modal {
    width: min(520px, 92vw);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transform: translateY(10px);
    transition: transform 0.2s ease;
}

.ctx-modal-overlay.show .ctx-modal {
    transform: translateY(0);
}

.ctx-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    background: var(--primary-color);
    color: #fff;
}

.ctx-modal-header i {
    font-size: 18px;
}

.ctx-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ctx-modal-body {
    padding: 16px 18px;
    color: #111827;
    /* texto padrão preto/near-black */
}

.ctx-modal-body p {
    margin: 0 0 8px 0;
    line-height: 1.35;
    color: #111827;
}

.ctx-modal-actions {
    padding: 14px 18px 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.ctx-btn {
    border: 1px solid transparent;
    /* borda presente para evitar deslocamento no hover */
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    box-sizing: border-box;
}

.ctx-btn-primary {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    /* já tem borda da cor do botão */
}

.ctx-btn-primary:hover {
    filter: brightness(1.05);
    border-color: var(--primary-color);
}

.ctx-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.ctx-btn-secondary {
    background: #f3f4f6;
    color: #111827;
    border-color: #f3f4f6;
    /* mantem borda para não sambar */
}

.ctx-btn-secondary:hover {
    background: #e5e7eb;
    border-color: #e5e7eb;
}
