/* Base Styles */
:root {
    --header-height: 134px;
    --header-large-tablet-height: 110px;
    --header-tablet-height: 90px;
    --header-mobile-height: 70px;
    --header-sm-height: 60px;
}


/* Header Container */
.header-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
}

/* Header Layers */
.header-bar-accent {
    width: 100%;
    height: 139px;
    position: absolute;
    top: 0;
    left: 0;
    background: #0771B1;
    z-index: 51;
}

.header-main-bar {
    width: 100%;
    height: var(--header-height);
    background: #064479;
    display: flex;
    align-items: center;
    /* Mantiene alineación vertical */
    padding: 0 28px;
    position: relative;
    border-bottom: 8px #0771B1 solid;
    z-index: 52;
    justify-content: space-between;
}

/* Logo Styles */
.header-logo-link {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 54;
    height: 65px;
    margin-right: 40px;
    flex-shrink: 0;
}

.header-logo {
    width: 251px;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Logo image - con mayor especificidad */
#mainLogoImage.header-logo {
    width: 251px !important;
    height: auto !important;
    display: block !important;
    object-fit: contain !important;
    position: relative !important;
    left: auto !important;
    /* Contrarresta el -10000px */
}

/* Header Navigation */
.header-nav {
    display: flex;
    align-items: center;
    height: 40px;
    gap: 8px;
    flex: 1;
    position: relative;
    z-index: 53;
    justify-content: flex-end;
    padding-right: 20px;
}

/* Navigation Items */
.header-nav-item {
    position: relative;
    padding-bottom: 4px;
}

.header-nav-link {
    display: flex;
    align-items: center;
    color: #D8EBF3;
    font-size: 16px;
    font-weight: 400;
    text-decoration: none;
    padding: 8px 16px;
    height: 100%;
    transition: color 0.2s;
}

.header-nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Active States */
.header-nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.15);
}

.header-submenu-item.active {
    background-color: #F5F5F5;
    font-weight: 500;
}

/* Dropdown Base Styles */
.header-submenu {
    display: none;
    position: absolute;
    top: calc(100% - 4px);
    right: 0;
    background: white;
    border: 1px solid #E1E2E3;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    max-width: 280px;
    z-index: 54;
    padding: 4px 0;
}

/* Base Submenu Item */
.header-submenu-item {
    position: relative;
    display: block;
    padding: 8px 16px;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s, color 0.2s;
    white-space: normal;
    line-height: 1.4;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

.header-submenu-item:hover {
    background-color: #F5F5F5;
    color: #1a1a1a;
    text-decoration: none;
}

/* Nested Items */
.header-submenu-item.has-nested {
    padding: 8px 16px 8px 24px;
    color: #1a1a1a;
    text-decoration: none;
    display: flex;
    align-items: center;
    position: relative;
    /* Necesario para ::after */
}

.header-submenu-item.has-nested a {
    display: block;
    width: 100%;
    color: inherit;
    /* Hereda el color del elemento padre */
    text-decoration: inherit;
    /* Hereda el texto decorativo */
    padding: 8px 16px 8px 24px;
}

.header-submenu-item.has-nested::after {
    content: '‹';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
    line-height: 1;
}

/* Nested Submenu */
.header-nested-submenu {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #E1E2E3;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    max-width: 260px;
    z-index: 55;
    padding: 4px 0;
    margin-left: 2px;
    right: 100%;
    /* Aparece al lado izquierdo del contenedor */
    top: 0;
}

/* Show/Hide and Transitions */
.header-submenu,
.header-nested-submenu {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    pointer-events: none;
}

.header-nav-item:hover .header-submenu,
.header-submenu-item.has-nested:hover .header-nested-submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: block;
}

/* Accessibility: Focus styles */
.header-nav-item:focus-within .header-submenu,
.header-submenu-item.has-nested:focus-within .header-nested-submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: block;
}

.header-menu-toggle {
    display: none !important;
}

/* Mobile Menu Toggle - Hidden by default */
.header-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #D8EBF3;
    padding: 8px;
    cursor: pointer;
    z-index: 55;
    position: relative;
    height: 40px;
    /* Altura específica para mantener consistencia */
    width: 40px;
    /* Ancho específico para mantener consistencia */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Side Menu */
.header-side-menu {
    display: none;
    width: 300px;
    right: -300px;
    position: fixed;
    top: 0;
    height: 100vh;
    background: #064479;
    z-index: 60;
    transition: right 0.3s ease-in-out;
    overflow-y: auto;
    padding-top: 80px;
}

.header-side-menu.active {
    right: 0;
}

/* Overlay */
.header-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 59;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.header-overlay.active {
    display: block;
    opacity: 1;
}

/* User Controls */
.header-user-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    z-index: 53;
}

.header-user-menu {
    position: relative;
}

.header-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #D8EBF3;
    transition: color 0.2s;
}

.header-icon-link:hover {
    color: white;
}

/* User Dropdown Menu */
.header-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid #E1E2E3;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 54;
    padding: 4px 0;
}

.header-dropdown-menu.show {
    display: block;
}

.header-dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
}

.header-dropdown-menu a:hover {
    background-color: #F5F5F5;
}

/* Page title section */
.header-page-title-section {
    position: fixed;
    left: 0;
    right: 0;
    background: var(--background-color, white);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: var(--title-section-height);
    z-index: 49;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 0.5rem;
}

.header-page-title-wrapper {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 49;
    background: var(--background-color, white);
    width: 100%;
}

.header-page-title-wrapper::-webkit-scrollbar {
    display: none;
}

/* Breadcrumb Styles */
.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    padding: 0 1rem;
    min-height: 60px;
}

.header-breadcrumb-main {
    font-size: 1.25rem;
    font-weight: 600;
    color: #64748b;
}

.header-breadcrumb-sub {
    font-size: 1.25rem;
    font-weight: 600;
    color: #94a3b8;
}

.header-breadcrumb-current {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
}

.header-breadcrumb-separator {
    color: #94a3b8;
    font-size: 1.25rem;
    padding: 0 0.25rem;
    line-height: 1;
}

/* Filter Base Container */
.header-page-selectors {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 1rem;
    gap: 1rem;
    background: var(--background-color, white);
}


.header-selectors-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-selector {
    position: relative;
    min-width: 200px;
}

/* Filter Forms */
.header-selector-form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    width: 100%;
}

/* Date Inputs */
.header-date-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-date-input {
    padding: 0.5rem;
    border: 1px solid #E1E2E3;
    border-radius: 4px;
    font-size: 14px;
    width: 120px;
    color: #1a1a1a;
}

.header-time-input {
    padding: 0.5rem;
    border: 1px solid #E1E2E3;
    border-radius: 4px;
    font-size: 14px;
    width: 80px;
    color: #1a1a1a;
}

/* Select Inputs */
.header-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid #E1E2E3;
    border-radius: 4px;
    font-size: 14px;
    color: #1a1a1a;
    background-color: white;
    min-width: 200px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

/* Ensure side menu works properly across all tablet sizes */
.header-side-menu {
    display: none;
    width: 300px;
    right: -300px;
}

.header-side-menu.active {
    display: block;
    right: 0;
}

/* Labels */
.header-filter-label {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    margin-right: 0.5rem;
}

/* Filter Group */
.header-filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    flex-shrink: 0;
}

/* Submit Button */
.header-filter-submit {
    padding: 0.5rem 1rem;
    background: #0771B1;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.header-filter-submit:hover {
    background: #064479;
}

/* DateTime Group */
.header-datetime-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Button styling */
.header-filter-submit {
    flex-shrink: 0;
    white-space: nowrap;
    min-width: 100px;
}

/* DatePicker Overwrites */
.dp-popup {
    background: white;
    border: 1px solid #E1E2E3;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dp-popup td {
    padding: 0.25rem;
}

.dp-popup th {
    padding: 0.5rem;
    color: #64748b;
}

.dp-selected {
    background: #0771B1;
    color: white;
}

.header-nav-link.has-submenu {
    cursor: default;
    text-decoration: none;
}

.header-nav-link.has-submenu:hover {
    background-color: rgba(255, 255, 255, 0.15);
}