/*
=========================================
  MODERN OVERRIDE CSS
  Modernización Visual 2024-2025
  Compatible con Bootstrap 4
  Sin modificar estructura base
=========================================
*/

/* ============================================
   1. VARIABLES CSS MODERNAS
============================================ */
:root {
    /* Colores Principales */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;

    /* Colores Secundarios */
    --secondary-color: #64748b;
    --accent-color: #8b5cf6;
    --color-accent: #0168B3;
    --color-text-primary: #212529;
    --color-text-muted: #6c757d;

    /* Grises Modernos */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Sombras Modernas */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Border Radius Modernos */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Transiciones */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Espaciados */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
}

/* ============================================
   2. RESET Y BASE MODERNOS
============================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   3. HEADER MODERNO
============================================ */
#header.header {
    /*background: linear-gradient(135deg, #0D2B5B 0%, #20407C 100%) !important;*/
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
    height: 60px;
    padding: 0 1.5rem !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1020;
    transition: all var(--transition-base);
}

/* Temas de Aseguradoras con Gradientes Modernos */
#header.navbar-zurich {
    background: linear-gradient(135deg, #0066b2 0%, #004c87 100%) !important;
}

#header.navbar-generali {
    background: linear-gradient(135deg, #c41e3a 0%, #8b1429 100%) !important;
}

#header.navbar-aig {
    background: linear-gradient(135deg, #003da5 0%, #002d7a 100%) !important;
}

#header.navbar-mapfre {
    background: linear-gradient(135deg, #dc241f 0%, #a51b18 100%) !important;
}


#header.navbar-latina {
    background: #001428 !important;
}

/* ===== ALIANZA - Naranja ===== */
#header.navbar-alianza {
    background: #ff6c00 !important;
}

/* ===== CONDOR - Azul marino ===== */
#header.navbar-condor {
    background: #0a1847 !important;
}

#header.navbar-mixto {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667de9 100%) !important;
}

/* Navbar Brand Moderno */
.navbar-brand {
    /*display: flex !important;*/
    /*align-items: center !important;*/
    /*gap: 0.75rem !important;*/
    /*padding: 0.5rem 1rem !important;*/
    /*border-radius: var(--radius-lg);*/
    /*transition: all var(--transition-base);*/
    /*background: rgba(255, 255, 255, 0.1) !important;*/
    backdrop-filter: blur(10px);
}

.navbar-brand:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-1px);
}

.navbar-brand img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.navbar-brand b {
    color: white !important;
    font-weight: 600 !important;
    font-size: 1.125rem !important;
    letter-spacing: -0.025em;
}

/* Botón Toggle Moderno */
.navbar-toggle,
.btn.btn-default[data-click="sidebar-minify"] {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: var(--radius-md) !important;
    transition: all var(--transition-base) !important;
    padding: 0.5rem 0.75rem !important;
}

.navbar-toggle:hover,
.btn.btn-default[data-click="sidebar-minify"]:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.navbar-toggle .icon-bar {
    background-color: white !important;
    border-radius: 2px;
    transition: all var(--transition-fast);
}

.btn.btn-default[data-click="sidebar-minify"] i {
    color: white !important;
}

/* Search Bar Moderno */

.navbar-form .form-control {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: var(--radius-lg) !important;
    color: white !important;
    /*padding: 0.5rem 1rem !important;*/
    transition: all var(--transition-base) !important;
    font-size: 0.9375rem;
}

.navbar-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
}

.navbar-form .form-control:focus {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1) !important;
    outline: none;
}

/* Dropdown Usuario Moderno */
.navbar-user > a {
    display: flex !important;
    align-items: center !important;
    /*gap: 0.75rem !important;*/
    /*padding: 0.375rem 0.75rem !important;*/
    border-radius: var(--radius-lg) !important;
    /*background: rgba(255, 255, 255, 0.15) !important;*/
    /*background: rgb(0 0 0 / 15%) !important;*/
    transition: all var(--transition-base) !important;
    color: white !important;
    text-decoration: none !important;
}

.navbar-user > a:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-1px);
}

.navbar-user img {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    transition: all var(--transition-base);
}

.navbar-user > a:hover img {
    border-color: white !important;
    transform: scale(1.05);
}

.navbar-user .caret {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.25rem;
    vertical-align: middle;
    border-top: 4px solid white;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

/* ===========================
   RESPONSIVE FIXES
   =========================== */
@media (max-width: 768px) {
    .navbar-user > a {
        gap: 0.25rem !important;
        padding: 0.25rem !important;
    }

    .navbar-user img {
        width: 30px !important;
        height: 30px !important;
    }

    .navbar-user .caret {
        display: none !important; /* Ocultar caret en móviles */
    }

    .navbar-user > a span {
        display: none !important; /* Ocultar texto “admin” */
    }
}

/* Evita que se salga del contenedor */
@media (max-width: 576px) {
    .navbar-user {
        position: relative !important;
        right: 0 !important;
    }

    .navbar-user > a {
        justify-content: center !important;
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        background: transparent !important;
    }

    .navbar-user img {
        width: 34px !important;
        height: 34px !important;
        border: 2px solid rgba(255, 255, 255, 0.3) !important;
    }
}

/* Dropdown Menu Moderno */
.dropdown-menu {
    border: none !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
    padding: 0.5rem !important;
    margin-top: 0.5rem !important;
    background: white !important;
    min-width: 200px;
}

.dropdown-item {
    padding: 0.327rem 1rem !important;
    border-radius: var(--radius-md) !important;
    transition: all var(--transition-fast) !important;
    display: flex !important;
    align-items: center !important;
    /*gap: 0.40rem !important;*/
    color: var(--gray-700) !important;
    /*font-size: 0.9375rem;*/
}

.dropdown-item:hover {
    background: var(--gray-100) !important;
    color: var(--primary-color) !important;
    transform: translateX(2px);
}

.dropdown-item i,
.dropdown-item .fa,
.dropdown-item .fas {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.dropdown-divider {
    margin: 0.5rem 0 !important;
    border-top: 1px solid var(--gray-200) !important;
}


/* Botón Success */
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
}

/* Botón Danger */
.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
}

/* Botón Warning */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
}

/* Botón Info */
.btn-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
    color: white !important;
}

.btn-info:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%) !important;
}

/* Botón Secondary */
.btn-secondary,
.btn-default {
    background: var(--gray-100) !important;
    color: var(--gray-700) !important;
    border: 1px solid var(--gray-300) !important;
}

.btn-secondary:hover,
.btn-default:hover {
    background: var(--gray-200) !important;
    color: var(--gray-900) !important;
}

/* Botón Outline */
.btn-outline-primary {
    background: transparent !important;
    color: var(--primary-color) !important;
    border: 2px solid var(--primary-color) !important;
}

.btn-outline-primary:hover {
    background: var(--primary-color) !important;
    color: white !important;
}

/* Botón Small */
/*.btn-sm {*/
/*    padding: 0.5rem 1rem !important;*/
/*    font-size: 0.875rem !important;*/
/*}*/

/* Botón Large */
/*.btn-lg {*/
/*    padding: 0.75rem 1.5rem !important;*/
/*    font-size: 1.125rem !important;*/
/*}*/


/* ============================================
   11. ALERTAS Y MENSAJES MODERNOS
============================================ */
.alert {
    border: none !important;
    border-radius: 0.25rem !important;
    padding: 1rem 1.25rem !important;
    border-left: 4px solid !important;
    box-shadow: var(--shadow-sm) !important;
}

.alert-success {
    background: #f0fdf4 !important;
    color: #166534 !important;
    border-left-color: #22c55e !important;
}

.alert-danger {
    background: #fef2f2 !important;
    color: #991b1b !important;
    border-left-color: #ef4444 !important;
}

.alert-warning {
    background: #fffbeb !important;
    color: #92400e !important;
    border-left-color: #f59e0b !important;
}

.alert-info {
    background: #f0f9ff !important;
    color: #075985 !important;
    border-left-color: #0ea5e9 !important;
}

/* ============================================
   12. BADGES Y LABELS MODERNOS
============================================ */
.badge,
.label {
    /*padding: 0.375rem 0.75rem !important;*/
    border-radius: var(--radius-md) !important;
    font-weight: 600 !important;
    font-size: 0.70rem !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/*.badge-primary,*/
/*.label-primary {*/
/*    background: var(--primary-color) !important;*/
/*    color: white !important;*/
/*}*/

.badge-success,
.label-success {
    background: #22c55e !important;
    color: white !important;
}

.badge-danger,
.label-danger {
    background: #ef4444 !important;
    color: white !important;
}

.badge-warning,
.label-warning {
    background: #f59e0b !important;
    color: white !important;
}

/*.badge-info,*/
/*.label-info {*/
/*    background: #0ea5e9 !important;*/
/*    color: white !important;*/
/*}*/


/* ============================================
   15. PROGRESS BARS MODERNOS
============================================ */
/*.progress {*/
/*    height: 0.75rem !important;*/
/*    border-radius: var(--radius-lg) !important;*/
/*    background: var(--gray-200) !important;*/
/*    overflow: hidden;*/
/*    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);*/
/*}*/

/*.progress-bar {*/
/*    !*background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-hover) 100%) !important;*!*/
/*    border-radius: var(--radius-lg) !important;*/
/*    transition: width 0.6s ease !important;*/
/*    position: relative;*/
/*    overflow: hidden;*/
/*}*/

/*.progress-bar::after {*/
/*    content: '';*/
/*    position: absolute;*/
/*    top: 0;*/
/*    left: 0;*/
/*    bottom: 0;*/
/*    right: 0;*/
/*    background: linear-gradient(*/
/*            90deg,*/
/*            transparent,*/
/*            rgba(255, 255, 255, 0.3),*/
/*            transparent*/
/*    );*/
/*    animation: shimmer 2s infinite;*/
/*}*/

/*@keyframes shimmer {*/
/*    0% {*/
/*        transform: translateX(-100%);*/
/*    }*/
/*    100% {*/
/*        transform: translateX(100%);*/
/*    }*/
/*}*/

/* ============================================
   16. TOOLTIPS Y POPOVERS
============================================ */
.tooltip-inner {
    background: var(--gray-900) !important;
    border-radius: var(--radius-md) !important;
    padding: 0.5rem 0.875rem !important;
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
}

.popover {
    border: none !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
}

.popover-header {
    background: var(--gray-100) !important;
    border-bottom: 1px solid var(--gray-200) !important;
    padding: 0.875rem 1rem !important;
    font-weight: 600;
}

.popover-body {
    padding: 1rem !important;
}

/* ============================================
   18. SCROLLBAR MODERNO
============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius-lg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-600);
}


/* ============================================
   19. ANIMACIONES SUAVES
============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

/* ============================================
   20. RESPONSIVE MEJORAS
============================================ */
@media (max-width: 768px) {
    #header.header {
        padding: 0 1rem !important;
        height: 106px !important;
    }

    .navbar-brand b {
        /*display: none !important;*/
    }

    #sidebar.sidebar {
        transform: translateX(-100%);
    }

    .page-sidebar-toggled #sidebar.sidebar {
        transform: translateX(0);
        z-index: 1030;
    }

    #content {
        margin-left: 0 !important;
        padding: 1rem !important;
    }

    .table {
        font-size: 0.875rem;
    }

    .btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.875rem !important;
    }

    .modal-dialog {
        margin: 0.5rem !important;
    }
}

@media (max-width: 576px) {
    #header.header {
        height: 106px !important;
    }

    #content {
        /*margin-top: 56px !important;*/
    }

    /*#sidebar.sidebar {*/
    /*    top: 56px;*/
    /*}*/
    .page-header h1,
    .page-header h2 {
        font-size: 1.5rem !important;
    }
}

/* ============================================
   21. UTILIDADES ADICIONALES
============================================ */
.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

.rounded-sm {
    border-radius: var(--radius-sm) !important;
}

.rounded {
    border-radius: var(--radius-md) !important;
}

.rounded-lg {
    border-radius: var(--radius-lg) !important;
}

.rounded-xl {
    border-radius: var(--radius-xl) !important;
}

/* Texto Moderno */
.text-primary {
    color: var(--primary-color) !important;
}

.text-muted {
    color: var(--gray-600) !important;
}

.text-dark {
    color: var(--gray-900) !important;
}

/* Backgrounds Modernos */
.bg-light {
    background-color: var(--gray-50) !important;
}

.bg-white {
    background-color: white !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

/* ============================================
   22. FIXES ESPECÍFICOS PARA TU ESTRUCTURA
============================================ */

/* Fix para iconos Material */
.material-icons {
    font-family: 'Material Icons' !important;
    vertical-align: middle;
}

/* Fix para Gritter (notificaciones) */
#gritter-notice-wrapper {
    z-index: 9999 !important;
}

.gritter-item {
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
}

/* Fix para DatePicker */
.datepicker {
    border: none !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
}

.datepicker table tr td.active,
.datepicker table tr td.active:hover {
    background: var(--primary-color) !important;
}

/* ============================================
   23. MEJORAS DE ACCESIBILIDAD
============================================ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   24. MEJORAS ESPECÍFICAS DE LA PLANTILLA

/* Indicadores de submenús */
.sidebar .nav li.has-sub > a::after {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    float: right;
    transition: transform 0.3s ease;
}


.sidebar .nav li.has-sub.open > a::after {
    transform: rotate(180deg);
}


.page-sidebar-minified .sidebar .nav > li > a {
    justify-content: center;
}


.page-sidebar-minified .sidebar .nav > li > a i {
    margin-right: 0;
}


.page-sidebar-minified .sidebar .nav > li > a b {
    display: none;
}


/* PAGE HEADER =============================================== */
.page-header {
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 20px;
}

/* CARDS MODERNOS =============================================== */
.card {
    border-radius: 10px;
    transition: all 0.25s ease;
}


.card-body h6 {
    color: var(--color-text-primary);
}

.dropdown-menu a.dropdown-item i {
    width: 18px;
    text-align: center;
    margin-right: 4px;
}

.badge {
    font-size: 0.75rem;
    padding: 3px 6px;
}

.pace .pace-progress {
    top: 60px;
}

/* PERMITE QUE EL DROPDOWN SOBRESALGA DEL CONTENEDOR */
.table-responsive:has(.btn-group.show) {
    overflow: visible !important;
}