/* Tema azul para Gestión ROL */
.fi-topbar > nav {
    background-color: #184e9a !important;
}

.fi-sidebar-header {
    background-color: #184e9a !important;
}

.fi-avatar {
    background-color: #184e9a !important;
}

/* Login styling */
.fi-simple-layout {
    background: linear-gradient(to bottom right, #184e9a, #0e2f5d);
    color: #fff;
}

.fi-simple-main {
    background-color: #ffffff !important;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.fi-simple-header-heading {
    color: #184e9a !important;
}

.fi-simple-page button[type="submit"] {
    background-color: #184e9a !important;
    color: #fff !important;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.fi-simple-page button[type="submit"]:hover {
    background-color: #123a74 !important;
}

/* ===================================== */
/* JERARQUÍA Z-INDEX ESTABLE Y STACKING CONTEXT */
/* ===================================== */
/* 1. Navbar: 1000 */
/* 2. Drawer notificaciones: 2000 */
/* 3. Sticky elements: 100-200 (bajo) */
/* 4. Modales: ~50000 (Filament default) */
/* 5. Overlays modales: 60000 (máximo) */
/*
/* REGLAS CRÍTICAS: */
/* - NO usar transform/contain/isolation en contenedores padre de modales */
/* - Overlays SIEMPRE se renderizan en body */
/* - Z-index hierarchy respetada estrictamente */

/* ===================================== */
/* SOLO OVERLAYS (NO TOCAR MODALES) */
/* ===================================== */

/* Dropdowns/Selectores que se renderizan en body */
body > [role="listbox"],
body > [data-headlessui-listbox], 
body > [data-headlessui-combobox-options],
body > [data-headlessui-listbox-options],
body > .fi-select-options,
body > .fi-select-dropdown,
body > .fi-select-list,
body > .fi-dropdown-panel,
body > .fi-fo-select-search-results,
body > [data-slot="listbox"],
body > div[data-headlessui-state*="open"][role="listbox"],
body > ul[role="listbox"],
body > div[role="listbox"],
body > .choices__list--dropdown,
body > .select2-dropdown,
body > .ts-dropdown,
body > .ts-dropdown-content {
    z-index: 60000 !important;
    background-color: white !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25) !important;
    max-height: 70vh !important;
    max-width: 90vw !important;
    overflow-y: auto !important;
    position: fixed !important;
    /* Portal rendering properties */
    contain: layout style paint !important;
    isolation: isolate !important;
    pointer-events: auto !important;
}

/* Calendarios que se renderizan en body */
body > .flatpickr-calendar,
body > .flatpickr-calendar.open,
body > .flatpickr-calendar.inline,
body > .flatpickr-calendar.static,
body > .flatpickr-wrapper,
body > div[class*="flatpickr"] {
    z-index: 60000 !important;
    background-color: white !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25) !important;
    min-width: 280px !important;
    max-width: 90vw !important;
    max-height: 70vh !important;
    padding: 0.75rem !important;
    position: fixed !important;
    /* Portal rendering properties */
    contain: layout style paint !important;
    isolation: isolate !important;
    pointer-events: auto !important;
    overflow-y: auto !important;
}

/* ===================================== */
/* JERARQUÍA NAVBAR/DRAWER */
/* ===================================== */

/* Navbar del sitio */
.fi-topbar,
.fi-main-ctn > .fi-topbar {
    z-index: 1000 !important;
}

/* Header de navegación principal (navbar) */
.fi-sidebar + .fi-main-ctn .fi-header,
.fi-main-ctn > .fi-header {
    z-index: 1000 !important;
}

/* Header de página con z-index bajo para que no interfiera con modales */
.fi-page .fi-header,
.fi-header-heading,
.fi-header-heading *,
.fi-page-header,
.fi-page-header *,
.fi-page-header-heading {
    z-index: 1 !important;
    position: relative !important;
}

/* Específico para panel de instructores - forzar z-index muy bajo */
[wire\:id*="panel-instructores"] .fi-header,
[wire\:id*="panel-instructores"] .fi-page-header,
[wire\:id*="panel-instructores"] .fi-page-header-heading,
[data-livewire-component*="panel-instructores"] .fi-header,
[data-livewire-component*="panel-instructores"] .fi-page-header {
    z-index: -1 !important;
}

/* Ocultar header cuando hay modales abiertos en panel instructores */
body:has(.fi-modal) [wire\:id*="panel-instructores"] .fi-header,
body:has(.fi-modal) [wire\:id*="panel-instructores"] .fi-page-header {
    visibility: hidden !important;
}

/* Panel de notificaciones/drawer */
.fi-notifications,
.fi-notifications-panel,
[data-popover-content],
.fi-popover,
.fi-popover-content,
.fi-user-menu-dropdown {
    z-index: 2000 !important;
}

/* ===================================== */
/* NOTIFICACIONES TOAST Y MODALES */
/* ===================================== */

/* Notificaciones toast/snackbar - solo z-index muy alto para que aparezcan sobre nav */
.fi-notification,
.fi-notification-container,
.fi-toast,
.fi-toast-container,
[data-notification],
[data-toast],
.notification,
.toast,
div[class*="notification"]:not(.fi-notifications),
div[class*="toast"],
.fi-notification-wrapper,
.fi-notification-item,
[x-data*="notification"],
[x-data*="toast"],
div[wire\:key*="notification"],
div[wire\:key*="toast"],
[role="alert"],
[role="status"],
[aria-live] {
    z-index: 999999 !important;
}