/* ============================================================
   ELIMINAR COLUMNAS CON GRADIENTE NARANJA
   ============================================================ */

/* Eliminar cualquier elemento con el gradiente naranja */
*[style*="linear-gradient"],
*[style*="f59e0b"],
*[style*="d97706"] {
    background: transparent !important;
    background-image: none !important;
}

/* Si hay columnas laterales, ocultarlas */
.fi-sidebar::before,
.fi-sidebar::after,
.fi-main::before,
.fi-main::after,
body::before,
body::after {
    display: none !important;
}

/* Asegurar que no hay decoración lateral */
.fi-layout::before,
.fi-layout::after {
    display: none !important;
}

/* Eliminar cualquier borde o sombra con color naranja */
* {
    border-image: none !important;
}

/* Forzar fondo blanco en todo */
html,
body,
#app,
.fi-panel,
.fi-layout {
    background: #ffffff !important;
    background-image: none !important;
    background-color: #ffffff !important;
}

.dark html,
.dark body,
.dark #app,
.dark .fi-panel,
.dark .fi-layout {
    background: #111827 !important;
    background-image: none !important;
    background-color: #111827 !important;
}

/* Eliminar gradiente del topbar completamente */
.fi-topbar {
    background: #ffffff !important;
    background-image: none !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.dark .fi-topbar {
    background: #1f2937 !important;
    background-image: none !important;
    border-bottom: 1px solid #374151 !important;
}

/* El nav interno del topbar */
.fi-topbar > nav {
    background: transparent !important;
    box-shadow: none !important;
    ring: none !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
}

/* Eliminar el padding horizontal del nav en todas las pantallas */
@media (min-width: 768px) {
    .fi-topbar > nav {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

@media (min-width: 1024px) {
    .fi-topbar > nav {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* ============================================================
   TOPBAR IMPROVEMENTS - User Menu Alignment
   ============================================================ */

/* Los elementos dentro del nav - buscador debe expandirse, usuario a la derecha */
.fi-topbar > nav > * {
    flex-shrink: 0 !important;
}

/* El último elemento (menú de usuario) debe ir a la derecha */
.fi-topbar > nav > *:last-child,
.fi-topbar > nav > button:last-child,
.fi-topbar > nav > div:last-child {
    margin-left: auto !important;
}

/* User menu button styling improvements */
.fi-user-menu-button,
.fi-topbar [role="button"]:has(img) {
    padding: 0.5rem !important;
    border-radius: 0.5rem !important;
    transition: background-color 0.2s ease !important;
}

.fi-user-menu-button:hover,
.fi-topbar [role="button"]:has(img):hover {
    background-color: #f3f4f6 !important;
}

.dark .fi-user-menu-button:hover,
.dark .fi-topbar [role="button"]:has(img):hover {
    background-color: #374151 !important;
}

/* ============================================================
   TOPBAR IMPROVEMENTS - Search Box Visibility
   ============================================================ */

/* Search container - debe expandirse pero con límite */
.fi-topbar-search,
.fi-global-search,
[x-data*="global-search"],
.fi-topbar .fi-input-wrapper,
.fi-topbar > nav > div:not(:last-child) {
    flex: 1 1 auto !important;
    max-width: 600px !important;
}

/* Search input field - enhanced visibility */
.fi-topbar input[type="search"],
.fi-topbar input[placeholder*="Search"],
.fi-topbar input[placeholder*="search"],
.fi-topbar input[placeholder*="Buscar"],
.fi-global-search input,
.fi-topbar-search input {
    background-color: #f9fafb !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.5rem !important;
    padding: 0.625rem 1rem !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    width: 100% !important;
}

/* Search input focus state */
.fi-topbar input[type="search"]:focus,
.fi-topbar input[placeholder*="Search"]:focus,
.fi-topbar input[placeholder*="search"]:focus,
.fi-topbar input[placeholder*="Buscar"]:focus,
.fi-global-search input:focus,
.fi-topbar-search input:focus {
    background-color: #ffffff !important;
    border-color: #3b82f6 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

/* Search input placeholder */
.fi-topbar input[type="search"]::placeholder,
.fi-topbar input[placeholder*="Search"]::placeholder,
.fi-topbar input[placeholder*="search"]::placeholder,
.fi-topbar input[placeholder*="Buscar"]::placeholder,
.fi-global-search input::placeholder,
.fi-topbar-search input::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

/* Dark mode search input */
.dark .fi-topbar input[type="search"],
.dark .fi-topbar input[placeholder*="Search"],
.dark .fi-topbar input[placeholder*="search"],
.dark .fi-topbar input[placeholder*="Buscar"],
.dark .fi-global-search input,
.dark .fi-topbar-search input {
    background-color: #111827 !important;
    border-color: #4b5563 !important;
    color: #f9fafb !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2) !important;
}

/* Dark mode search input focus */
.dark .fi-topbar input[type="search"]:focus,
.dark .fi-topbar input[placeholder*="Search"]:focus,
.dark .fi-topbar input[placeholder*="search"]:focus,
.dark .fi-topbar input[placeholder*="Buscar"]:focus,
.dark .fi-global-search input:focus,
.dark .fi-topbar-search input:focus {
    background-color: #1f2937 !important;
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.2) !important;
}

/* Dark mode search placeholder */
.dark .fi-topbar input[type="search"]::placeholder,
.dark .fi-topbar input[placeholder*="Search"]::placeholder,
.dark .fi-topbar input[placeholder*="search"]::placeholder,
.dark .fi-topbar input[placeholder*="Buscar"]::placeholder,
.dark .fi-global-search input::placeholder,
.dark .fi-topbar-search input::placeholder {
    color: #6b7280 !important;
}

/* Search icon styling */
.fi-topbar-search svg,
.fi-global-search svg,
.fi-topbar input[type="search"] ~ svg {
    color: #6b7280 !important;
}

.dark .fi-topbar-search svg,
.dark .fi-global-search svg,
.dark .fi-topbar input[type="search"] ~ svg {
    color: #9ca3af !important;
}

/* ============================================================
   TOPBAR IMPROVEMENTS - Visual Hierarchy & Spacing
   ============================================================ */

/* Topbar height consistency */
.fi-topbar {
    min-height: 4rem !important;
    height: auto !important;
}

/* Topbar actions group */
.fi-topbar-actions,
.fi-topbar > div:last-child {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin-left: auto !important;
}

/* Topbar buttons general styling */
.fi-topbar button,
.fi-topbar [role="button"] {
    border-radius: 0.5rem !important;
    transition: all 0.2s ease !important;
}

/* Icon buttons in topbar */
.fi-topbar button:not(:has(span)),
.fi-topbar [role="button"]:not(:has(span)) {
    padding: 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Hover states for topbar buttons */
.fi-topbar button:hover,
.fi-topbar [role="button"]:hover {
    background-color: #f3f4f6 !important;
}

.dark .fi-topbar button:hover,
.dark .fi-topbar [role="button"]:hover {
    background-color: #374151 !important;
}

/* Badge/notification indicators */
.fi-topbar .fi-badge,
.fi-topbar [class*="badge"] {
    font-size: 0.75rem !important;
    padding: 0.125rem 0.5rem !important;
    border-radius: 9999px !important;
}

/* Dividers in topbar */
.fi-topbar .fi-divider,
.fi-topbar hr {
    height: 1.5rem !important;
    width: 1px !important;
    background-color: #e5e7eb !important;
    border: none !important;
    margin: 0 0.5rem !important;
}

.dark .fi-topbar .fi-divider,
.dark .fi-topbar hr {
    background-color: #374151 !important;
}

/* ============================================================
   TOPBAR IMPROVEMENTS - Responsive Design
   ============================================================ */

@media (max-width: 768px) {
    .fi-topbar {
        padding: 0.5rem 1rem !important;
        flex-wrap: wrap !important;
    }

    .fi-topbar-search,
    .fi-global-search,
    [x-data*="global-search"] {
        max-width: 100% !important;
        order: 3 !important;
        flex-basis: 100% !important;
    }

    .fi-topbar-actions {
        order: 2 !important;
    }
}

/* ============================================================
   MAIN CONTENT ALIGNMENT FIX - Corrección de desplazamiento
   ============================================================ */

/* Reset margins and ensure proper alignment for main content */
.fi-main,
main.fi-main {
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-inline-start: 0 !important;
    margin-inline-end: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Ensure the main content container is properly aligned */
.fi-main-ctn {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Body content should not have displacement */
.fi-body,
.fi-content {
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Ensure proper layout structure */
.fi-layout {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Main content should fill available space */
.fi-main,
main.fi-main {
    flex: 1 !important;
    min-width: 0 !important;
    position: relative !important;
}

/* Ensure positioning doesn't cause layout shifts */
/* Note: This rule is disabled to prevent breaking dropdowns, modals, and other positioned elements */

/* Ensure page content is properly centered */
.fi-page,
.fi-page-content {
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Fix any grid or flex container issues */
.fi-main > div {
    width: 100% !important;
}

/* Responsive adjustments to prevent displacement */
@media (min-width: 1024px) {
    body:has(.fi-sidebar) .fi-main {
        margin-left: 0 !important;
        margin-inline-start: 0 !important;
    }
}

/* Override any inherited margins from other CSS files */
@media (min-width: 1024px) {
    body:has(.fi-sidebar) main,
    body:has(aside.fi-sidebar) main,
    body:has(.fi-sidebar-open) main,
    body:has(.fi-sidebar:not(.fi-sidebar-open)) main {
        margin-left: 0 !important;
        margin-inline-start: 0 !important;
        margin-right: 0 !important;
        margin-inline-end: 0 !important;
    }
}

/* Ensure topbar doesn't cause alignment issues */
.fi-topbar {
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
}

/* Fix for any container that might be causing the shift */
.fi-main-ctn > main,
.fi-layout > .fi-main-ctn > main {
    margin: 0 !important;
    width: 100% !important;
}

/* Ensure tables and content don't overflow or shift */
.fi-ta-ctn,
.fi-resource-table {
    width: 100% !important;
    margin: 0 !important;
}

/* ============================================================
   FIN DE CORRECCIÓN DE COLUMNAS
   ============================================================ */
