/* static/css/main.css */

/* ====================================================================
   VARIABLES CSS CORPORATIVAS - Reutilizables para toda la aplicación
   ==================================================================== */
:root {
    /* Colores Corporativos */
    --corp-primary: #1f2937;       /* Azul oscuro corporativo */
    --corp-secondary: #3b82f6;     /* Azul principal */
    --corp-accent: #10b981;        /* Verde éxito */
    --corp-warning: #f59e0b;       /* Amarillo advertencia */
    --corp-danger: #ef4444;        /* Rojo crítico */
    --corp-info: #3b82f6;          /* Azul información */
    
    /* Textos */
    --text-primary: #111827;       /* Texto principal */
    --text-secondary: #6b7280;     /* Texto secundario */
    --text-muted: #9ca3af;         /* Texto sutil */
    --text-white: #ffffff;         /* Texto blanco */
    
    /* Fondos */
    --bg-primary: #ffffff;         /* Fondo principal */
    --bg-secondary: #f9fafb;       /* Fondo secundario */
    --bg-tertiary: #f3f4f6;        /* Fondo terciario */
    --bg-dark: #1f2937;            /* Fondo oscuro */
    
    /* Bordes */
    --border-light: #e5e7eb;       /* Bordes sutiles */
    --border-medium: #d1d5db;      /* Bordes normales */
    --border-dark: #9ca3af;        /* Bordes oscuros */
    
    /* Sombras */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    
    /* Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    
    /* Espaciado (sistema 8px) */
    --space-1: 0.25rem;  /* 4px */
    --space-2: 0.5rem;   /* 8px */
    --space-3: 0.75rem;  /* 12px */
    --space-4: 1rem;     /* 16px */
    --space-5: 1.25rem;  /* 20px */
    --space-6: 1.5rem;   /* 24px */
    --space-8: 2rem;     /* 32px */
    --space-10: 2.5rem;  /* 40px */
    --space-12: 3rem;    /* 48px */
    
    /* Tipografía */
    --font-xs: 0.75rem;    /* 12px */
    --font-sm: 0.875rem;   /* 14px */
    --font-base: 1rem;     /* 16px */
    --font-lg: 1.125rem;   /* 18px */
    --font-xl: 1.25rem;    /* 20px */
    --font-2xl: 1.5rem;    /* 24px */
    --font-3xl: 1.875rem;  /* 30px */
    --font-4xl: 2.25rem;   /* 36px */
    
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    
    /* Transiciones */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* Clases de utilidad corporativas */
.corp-text-primary { color: var(--text-primary); }
.corp-text-secondary { color: var(--text-secondary); }
.corp-text-muted { color: var(--text-muted); }
.corp-bg-primary { background-color: var(--bg-primary); }
.corp-bg-secondary { background-color: var(--bg-secondary); }
.corp-shadow-md { box-shadow: var(--shadow-md); }
.corp-rounded { border-radius: var(--radius-lg); }
.corp-transition { transition: var(--transition-normal); }

/* HTMX Global Loading Overlay */
#htmx-global-loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
}

.loading-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* HTMX Toast Notifications */
.htmx-toast {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* HTMX Indicators */
.htmx-request .htmx-indicator {
    opacity: 1;
}

.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}

/* Category Edit Modal Styles */
#editCategoryModal .modal-lg {
    max-width: 800px;
}

#editCategoryModal .nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

#editCategoryModal .nav-link {
    font-weight: 500;
    color: #6c757d;
    border: none;
    padding: 0.75rem 1.25rem;
}

#editCategoryModal .nav-link.active {
    color: #0d6efd;
    background-color: transparent;
    border-bottom: 2px solid #0d6efd;
}

#editCategoryModal .nav-link:hover {
    color: #0d6efd;
    border: none;
}

#categoryIndicatorsList .list-group-item {
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

#categoryIndicatorsList .list-group-item:hover {
    border-left-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.05);
}

/* ====================================================================
   DRAG & DROP STYLES
   ==================================================================== */

/* Drag Handles */
.drag-handle-category,
.drag-handle-indicator, 
.drag-handle-question {
    cursor: grab;
    padding: 0.375rem 0.25rem;
    color: #6c757d;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
}

.drag-handle-category:hover,
.drag-handle-indicator:hover,
.drag-handle-question:hover {
    color: #0d6efd !important;
    background-color: rgba(13, 110, 253, 0.1);
    border-radius: 0.25rem;
    transform: scale(1.1);
}

.drag-handle-category:active,
.drag-handle-indicator:active,
.drag-handle-question:active {
    cursor: grabbing;
    color: #0d6efd !important;
}

/* Sortable States */
.sortable-chosen {
    opacity: 0.8;
    transform: rotate(1deg) scale(1.02);
    box-shadow: 0 0.25rem 1rem rgba(13, 110, 253, 0.4) !important;
    border: 2px solid #0d6efd !important;
    background-color: rgba(13, 110, 253, 0.08) !important;
    z-index: 1000;
    transition: none !important;
}

.sortable-ghost {
    opacity: 0.4;
    background-color: rgba(13, 110, 253, 0.1) !important;
    border: 2px dashed #0d6efd !important;
    border-radius: 0.375rem;
}

.sortable-drag {
    opacity: 0.9;
    transform: rotate(-1deg);
    box-shadow: 0 0.25rem 1.5rem rgba(0, 0, 0, 0.3) !important;
}

/* Drop Zones */
.sortable-container {
    min-height: 40px;
    transition: all 0.2s ease;
    position: relative;
}

.sortable-container:empty:not(.list-group) {
    border: 2px dashed #dee2e6;
    border-radius: 0.375rem;
    padding: 2rem;
    text-align: center;
    color: #6c757d;
}

.sortable-container:empty:not(.list-group)::after {
    content: "Arrastra elementos aquí";
    font-style: italic;
}

.sortable-container.drag-over {
    background-color: rgba(13, 110, 253, 0.05);
    border-color: #0d6efd;
}

/* Drag Handle Icons */
.drag-handle-category .bi,
.drag-handle-indicator .bi,
.drag-handle-question .bi {
    font-size: 1rem;
    pointer-events: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .drag-handle-category,
    .drag-handle-indicator,
    .drag-handle-question {
        padding: 0.5rem 0.375rem;
        min-width: 32px;
    }
    
    .drag-handle-category .bi,
    .drag-handle-indicator .bi,
    .drag-handle-question .bi {
        font-size: 1.1rem;
    }
}

/* Specific Element Styling */
.list-group-item.sortable-item {
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.list-group-item.sortable-item:hover {
    border-left-color: rgba(13, 110, 253, 0.3);
}

.sortable-item .drag-handle-category {
    color: #28a745; /* Verde para categorías */
}

.sortable-item .drag-handle-indicator {
    color: #17a2b8; /* Celeste para indicadores */
}

.sortable-item .drag-handle-question {
    color: #ffc107; /* Amarillo para preguntas */
}

.sortable-item .drag-handle-category:hover {
    color: #28a745 !important;
    background-color: rgba(40, 167, 69, 0.1);
}

.sortable-item .drag-handle-indicator:hover {
    color: #17a2b8 !important;
    background-color: rgba(23, 162, 184, 0.1);
}

.sortable-item .drag-handle-question:hover {
    color: #ffc107 !important;
    background-color: rgba(255, 193, 7, 0.1);
}

/* Animation for successful reorder */
@keyframes reorderSuccess {
    0% { background-color: rgba(40, 167, 69, 0.2); }
    50% { background-color: rgba(40, 167, 69, 0.1); }
    100% { background-color: transparent; }
}

.reorder-success {
    animation: reorderSuccess 1s ease-in-out;
}

/* Improved Toast Container */
.toast-container {
    z-index: 1055 !important;
}

.toast-container .toast {
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
    border: none;
}

/* Loading Overlay for Drag Operations */
#drag-drop-loader {
    backdrop-filter: blur(2px);
}

#drag-drop-loader .spinner-border {
    width: 2rem;
    height: 2rem;
}

/* ====================================================================
   MODAL UNIFICADO INDICADORES
   ==================================================================== */

/* Context Alert en modal de indicadores */
#addIndicatorModal #categoryContextAlert {
    background-color: rgba(13, 110, 253, 0.1);
    border-color: rgba(13, 110, 253, 0.3);
    color: #0d6efd;
}

#addIndicatorModal #categoryContextAlert .bi-info-circle {
    color: #0d6efd;
}

/* Campo de categoría deshabilitado */
#addIndicatorModal #indicatorCategory:disabled {
    background-color: rgba(13, 110, 253, 0.05);
    border-color: rgba(13, 110, 253, 0.3);
    color: #0d6efd;
}

/* Texto de ayuda contextual */
#addIndicatorModal #categoryHelpText.text-info {
    color: #0d6efd !important;
    font-weight: 500;
}

/* Título del modal con contexto */
#addIndicatorModal .modal-title .bi-plus-square {
    font-size: 1.1rem;
}

/* Animación suave para cambios de contexto */
#addIndicatorModal #categoryContextAlert,
#addIndicatorModal #categoryHelpText {
    transition: all 0.3s ease-in-out;
}

/* Focus mejorado en inputs */
#addIndicatorModal #indicatorTitle:focus,
#addIndicatorModal #indicatorDescription:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Z-index para modales anidados */
#addIndicatorModal.modal {
    z-index: 1060; /* Bootstrap default es 1055, este debe estar encima */
}

#addIndicatorModal .modal-backdrop {
    z-index: 1059; /* Backdrop debe estar debajo del modal pero encima del anterior */
}

/* Cuando se abre desde otra modal, incrementar aún más */
.modal-stacked #addIndicatorModal.modal {
    z-index: 1070;
}

.modal-stacked #addIndicatorModal .modal-backdrop {
    z-index: 1069;
}

/* Improved stat cards */
.stat-card {
    transition:
        transform 0.2s ease-in-out,
        box-shadow 0.2s ease-in-out;
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
}

/* HTMX Scan Results Container */
#scan-results {
    min-height: 300px;
}

/* Prevent horizontal scroll issues */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Ensure proper container width */
.container-fluid,
.row,
.col-lg-12 {
    max-width: 100%;
    overflow-x: hidden;
}

/* Fix pagination spacing */
.pagination {
    flex-wrap: wrap;
    justify-content: center;
}

.pagination .page-link {
    min-width: 44px;
    text-align: center;
}
.library-badge {
    font-size: 0.8em;
    padding: 0.3em 0.6em;
    border-radius: 0.25rem;
}

.js-badge {
    background-color: #f0ad4e; /* Bootstrap warning */
    color: #fff;
}

.css-badge {
    background-color: #5bc0de; /* Bootstrap info */
    color: #fff;
}

.scan-detail-table th {
    background-color: #f8f9fa; /* Light gray background */
}

.scan-actions .btn {
    min-width: 120px;
}

.btn-review-pending .badge {
    font-size: 0.6em;
    vertical-align: top;
}

/* Legacy navbar styles (kept for compatibility) */
.navbar-nav .nav-link.active,
.navbar-nav .nav-link.show {
    background-color: #0d6efd; /* Bootstrap primary blue */
    color: #fff !important; /* White text */
    border-radius: 0.375rem; /* Rounded corners */
    font-weight: 600; /* Bolder font */
}

/* Adjust padding for a better look */
.navbar-nav .nav-link {
    padding: 0.5rem 1rem;
}

/* Additional layout adjustments */
body {
    overflow-x: hidden;
}

.container-fluid {
    transition: all 0.3s ease;
}

/* Ensure proper spacing for alerts and flash messages */
.alert {
    margin-bottom: 1rem;
}

/* Loading Overlay Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: none; /* Oculto por defecto */
    justify-content: center;
    align-items: center;
}

.loading-overlay.active {
    display: flex; /* Visible cuando tiene clase 'active' */
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 0 auto;
}

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

/* Sidebar base styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: white;
    color: rgba(0, 0, 0, 0.7);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
    margin-left: auto;
}

.sidebar-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    /*color: white;*/
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.sidebar-brand i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
    min-width: 28px;
}

.sidebar-menu {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
    margin: 0.2rem 0.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
}

.sidebar .nav-link i {
    font-size: 1.2rem;
    margin-right: 0.75rem;
    min-width: 24px;
    text-align: center;
}

.sidebar .nav-link.external-link {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.sidebar .nav-link.external-link:hover {
    color: rgba(255, 255, 255, 0.9);
}

.nav-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 1rem 0.5rem;
}

/* Sidebar footer (user info) */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    position: relative;
}

.user-avatar {
    font-size: 2rem;
    margin-right: 0.75rem;
    min-width: 32px;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.username {
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role .badge {
    font-size: 0.7rem;
}

.user-menu-btn {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.25rem 0.5rem;
    border: none;
    background: none;
    margin-left: 0.5rem;
}

.user-menu-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Collapsed sidebar styles */
.sidebar.collapsed .sidebar-text {
    display: none;
}

.sidebar.collapsed .user-details {
    display: none;
}

.sidebar.collapsed .user-menu-btn {
    display: none;
}

.sidebar.collapsed .nav-link {
    /*justify-content: center;*/
    margin: 0.2rem 0.25rem;
    padding: 0.75rem;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
}

.sidebar.collapsed .user-info {
    justify-content: center;
}

.sidebar.collapsed .user-avatar {
    margin-right: 0;
}

/* Top navbar styles */
.top-navbar {
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    z-index: 999;
    transition: left 0.3s ease;
}

.sidebar.collapsed + .top-navbar {
    left: 60px;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    padding: 0.5rem;
    margin-right: 1rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
}

/* Main content area */
.main-content {
    margin-left: 280px;
    margin-top: 60px;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 60px;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .d-lg-none {
        display: none !important;
    }
}

/* Medium devices (tablets, 768px to 991px) */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        z-index: 1001;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        width: 280px;
        transform: translateX(-100%);
    }

    .sidebar.collapsed.show {
        transform: translateX(0);
    }

    .top-navbar {
        left: 0;
        right: 0;
    }

    .main-content {
        margin-left: 0;
        margin-top: 60px;
    }

    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
    }

    /* Enhanced active link visibility on mobile */
    .sidebar .nav-link.active {
        background-color: rgba(255, 255, 255, 0.3);
        color: white;
        font-weight: 700;
        border-left: 4px solid white;
        padding-left: 0.75rem;
    }

    /* Show close button only on mobile */
    .sidebar-close {
        display: block;
    }
}

/* Small devices (phones, 576px and down) */
@media (max-width: 575.98px) {
    .sidebar {
        width: 100vw;
    }

    .sidebar.show {
        width: 100vw;
    }

    .main-content {
        margin-top: 60px;
    }

    .container-fluid {
        padding: 1rem !important;
    }

    /* Extra enhanced active link for small screens */
    .sidebar .nav-link.active {
        background-color: rgba(255, 255, 255, 0.35);
        color: white;
        font-weight: 700;
        border-left: 6px solid white;
        padding-left: 0.5rem;
        font-size: 1.1rem;
    }

    /* Larger touch targets on mobile */
    .sidebar .nav-link {
        padding: 1rem 1rem;
        font-size: 1rem;
    }

    .sidebar .nav-link i {
        font-size: 1.3rem;
        margin-right: 1rem;
    }
}

/* Accessibility and focus styles */
.sidebar .nav-link:focus,
.sidebar-toggle:focus,
.user-menu-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Smooth scrolling for sidebar menu */
.sidebar-menu {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

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

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

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

/* ====================================================================
   ESTILOS DE IMPRESIÓN GLOBALES - Aplicados a toda la aplicación
   ==================================================================== */
@media print {
    /* Ocultar navegación y elementos de interfaz */
    .navbar,
    .sidebar,
    .print-button,
    .btn,
    .dropdown,
    .modal,
    .toast,
    .alert-dismissible .btn-close,
    .pagination,
    .breadcrumb,
    .footer,
    .sidebar-toggle,
    .user-menu,
    .navbar-brand,
    .navbar-nav,
    .navbar-toggler {
        display: none !important;
    }
    
    /* Ajustar el contenido principal */
    .main-content,
    .container,
    .container-fluid,
    .content-wrapper {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Resetear márgenes del body */
    body {
        margin: 0 !important;
        padding: 0 !important;
        font-size: 12pt !important;
        line-height: 1.4 !important;
        color: #000 !important;
        background: white !important;
    }
    
    /* Ajustar cards y contenedores */
    .card,
    .modern-card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        margin-bottom: 1rem !important;
    }
    
    .card-header,
    .modern-card-header {
        background: #f8f9fa !important;
        color: #333 !important;
        border-bottom: 1px solid #ddd !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Preservar colores importantes */
    .modern-badge,
    .badge {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        border: 1px solid #ddd !important;
    }
    
    /* Optimizar tablas para impresión */
    .table {
        font-size: 10pt !important;
        border-collapse: collapse !important;
    }
    
    .table th,
    .table td {
        border: 1px solid #ddd !important;
        padding: 4px 6px !important;
    }
    
    /* Evitar saltos de página en elementos importantes */
    .stats-card,
    .chart-summary,
    .info-grid,
    .executive-summary {
        page-break-inside: avoid;
    }
    
    /* Ajustar títulos y headings */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        margin-top: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Enlaces y referencias */
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }
    
    /* Gráficos y elementos visuales */
    canvas,
    .chart-container {
        page-break-inside: avoid;
    }
    
    /* Eliminar animaciones en impresión */
    *,
    *::before,
    *::after {
        animation-delay: 0s !important;
        animation-duration: 0s !important;
        transition: none !important;
    }
}
