        :root {
            --primary: #0056b3;
            --primary-dark: #003d82;
            --secondary: #28a745;
            --accent: #17a2b8;
            --warning: #ffc107;
            --danger: #dc3545;
            --light: #f8f9fa;
            --dark: #212529;
            --gray-100: #f8f9fa;
            --gray-200: #e9ecef;
            --gray-300: #dee2e6;
            --gray-700: #495057;
            --gray-900: #212529;
            --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
            --shadow: 0 4px 6px rgba(0,0,0,0.1);
            --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
            --border-radius: 12px;
            --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            background-attachment: fixed;
            min-height: 100vh;
            color: var(--dark);
            line-height: 1.6;
        }

        /* ==================== HEADER ==================== */
        .header {
            background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
            color: white;
            padding: 1.5rem 2rem;
            box-shadow: var(--shadow-lg);
            position: sticky;
            top: 0;
            z-index: 1000;
        }

        .header-content {
            max-width: 1600px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 1rem;
        }

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

        .logo {
            width: 50px;
            height: 50px;
            background: rgba(255,255,255,0.2);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.8rem;
        }

        .header h1 {
            font-size: 1.8rem;
            font-weight: 700;
            margin: 0;
        }

        .header-subtitle {
            font-size: 0.9rem;
            opacity: 0.9;
            font-weight: 400;
        }

        .header-info {
            display: flex;
            gap: 2rem;
            align-items: center;
        }

        .info-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.9rem;
        }

        .info-item i {
            font-size: 1.2rem;
        }

        /* ==================== BANNER SERIE/AÑO ==================== */
        .banner-serie {
            background: #1a3a5c;
            color: white;
            padding: 1rem 2rem;
            box-shadow: 0 2px 10px rgba(0,0,0,0.15);
        }

        .banner-serie-content {
            max-width: 1600px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .banner-serie-info {
            display: flex;
            align-items: center;
            gap: 1.2rem;
        }

        .banner-serie-icon {
            width: 50px;
            height: 50px;
            background: #c41e3a;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.4rem;
            color: white;
        }

        .banner-serie-text {
            display: flex;
            flex-direction: column;
            gap: 0.15rem;
        }

        .banner-serie-label {
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            opacity: 0.7;
            font-weight: 500;
        }

        .banner-serie-value {
            font-size: 1.4rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 0.6rem;
        }

        .banner-serie-badge {
            background: #c41e3a;
            padding: 0.25rem 0.7rem;
            border-radius: 4px;
            font-size: 0.85rem;
            font-weight: 600;
        }

        .banner-serie-year {
            background: rgba(255,255,255,0.15);
            padding: 0.25rem 0.7rem;
            border-radius: 4px;
            font-size: 0.85rem;
            font-weight: 600;
        }

        .banner-serie-desc {
            font-size: 0.8rem;
            opacity: 0.8;
            font-weight: 400;
        }

        .banner-serie-actions {
            display: flex;
            align-items: center;
            gap: 1.5rem;
        }

        .banner-serie-stats {
            display: flex;
            gap: 1.5rem;
            padding-right: 1.5rem;
            border-right: 1px solid rgba(255,255,255,0.2);
        }

        .banner-stat {
            text-align: center;
        }

        .banner-stat-value {
            font-size: 1rem;
            font-weight: 700;
            color: #4ade80;
        }

        .banner-stat-label {
            font-size: 0.65rem;
            text-transform: uppercase;
            opacity: 0.7;
            letter-spacing: 0.5px;
        }

        .btn-cambiar-serie {
            background: #c41e3a;
            border: none;
            color: white;
            padding: 0.5rem 1rem;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.4rem;
            transition: all 0.2s ease;
        }

        .btn-cambiar-serie:hover {
            background: #a01830;
        }

        @media (max-width: 768px) {
            .banner-serie {
                padding: 0.8rem 1rem;
            }
            
            .banner-serie-stats {
                display: none;
            }
            
            .banner-serie-value {
                font-size: 1.1rem;
            }
            
            .banner-serie-icon {
                width: 40px;
                height: 40px;
                font-size: 1.1rem;
            }
        }

        /* ==================== CONTAINER ==================== */
        .container {
            max-width: 1600px;
            margin: 2rem auto;
            padding: 0 2rem;
        }

        /* ==================== CARDS ==================== */
        .card {
            background: white;
            border-radius: var(--border-radius);
            padding: 2rem;
            box-shadow: var(--shadow-lg);
            margin-bottom: 2rem;
            transition: var(--transition);
        }

        .card:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 30px rgba(0,0,0,0.18);
        }

        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 3px solid var(--primary);
        }

        .card-title {
            font-size: 1.4rem;
            font-weight: 600;
            color: var(--primary-dark);
            display: flex;
            align-items: center;
            gap: 0.8rem;
        }

        .card-title i {
            color: var(--primary);
        }

        .badge {
            padding: 0.4rem 0.8rem;
            border-radius: 20px;
            font-size: 0.85rem;
            font-weight: 500;
        }

        .badge-primary { background: rgba(0,86,179,0.1); color: var(--primary); }
        .badge-success { background: rgba(40,167,69,0.1); color: var(--secondary); }
        .badge-warning { background: rgba(255,193,7,0.1); color: var(--warning); }

        /* ==================== FILTERS ==================== */
        .filters-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .filter-group {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .filter-label {
            font-weight: 600;
            color: var(--gray-700);
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .filter-label i {
            color: var(--primary);
            font-size: 1rem;
        }

        .required {
            color: var(--danger);
            font-weight: bold;
        }

        select, input {
            padding: 0.9rem 1rem;
            border: 2px solid var(--gray-300);
            border-radius: 8px;
            font-size: 0.95rem;
            font-family: inherit;
            transition: var(--transition);
            background: white;
            width: 100%;
        }

        select:focus, input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 4px rgba(0,86,179,0.1);
        }

        select:disabled, input:disabled {
            background: var(--gray-100);
            cursor: not-allowed;
            opacity: 0.6;
        }

        /* ==================== BUTTONS ==================== */
        .btn {
            padding: 1rem 2rem;
            border: none;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: inline-flex;
            align-items: center;
            gap: 0.8rem;
            text-decoration: none;
            box-shadow: var(--shadow);
        }

        .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none !important;
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: white;
        }

        .btn-primary:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(0,86,179,0.3);
        }

        .btn-success {
            background: linear-gradient(135deg, var(--secondary) 0%, #218838 100%);
            color: white;
        }

        .btn-success:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(40,167,69,0.3);
        }

        .btn-outline {
            background: white;
            border: 2px solid var(--primary);
            color: var(--primary);
        }

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

        /* Tooltip personalizado - aparece instantáneamente */
        .tooltip-custom {
            position: relative;
        }
        
        .tooltip-custom::after {
            content: attr(data-tooltip);
            position: absolute;
            bottom: 120%;
            left: 50%;
            transform: translateX(-50%);
            background: #1a3a5c;
            color: white;
            padding: 0.8rem 1rem;
            border-radius: 8px;
            font-size: 0.8rem;
            line-height: 1.5;
            white-space: pre-line;
            width: 280px;
            text-align: left;
            box-shadow: 0 4px 15px rgba(0,0,0,0.2);
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.15s ease, visibility 0.15s ease;
            z-index: 1000;
            pointer-events: none;
        }
        
        .tooltip-custom::before {
            content: '';
            position: absolute;
            bottom: 110%;
            left: 50%;
            transform: translateX(-50%);
            border: 8px solid transparent;
            border-top-color: #1a3a5c;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.15s ease, visibility 0.15s ease;
            z-index: 1000;
        }
        
        .tooltip-custom:hover::after,
        .tooltip-custom:hover::before {
            opacity: 1;
            visibility: visible;
        }

        .btn-container {
            display: flex;
            gap: 1rem;
            justify-content: center;
            flex-wrap: wrap;
            margin-top: 2rem;
        }

        /* ==================== STATS CARDS ==================== */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .stat-card {
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: white;
            padding: 1.8rem;
            border-radius: var(--border-radius);
            box-shadow: var(--shadow);
            transition: var(--transition);
            position: relative;
            overflow: hidden;
        }

        .stat-card::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
            animation: pulse 3s infinite;
        }

        @keyframes pulse {
            0%, 100% { transform: scale(1); opacity: 0.5; }
            50% { transform: scale(1.1); opacity: 0.3; }
        }

        .stat-card:hover {
            transform: translateY(-4px) scale(1.02);
            box-shadow: 0 12px 30px rgba(0,0,0,0.2);
        }

        .stat-content {
            position: relative;
            z-index: 1;
        }

        .stat-label {
            font-size: 0.85rem;
            opacity: 0.95;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 0.5rem;
        }

        .stat-value {
            font-size: 2.2rem;
            font-weight: 700;
            line-height: 1;
        }

        .stat-icon {
            position: absolute;
            right: 1.5rem;
            top: 50%;
            transform: translateY(-50%);
            font-size: 3rem;
            opacity: 0.2;
        }

        .stat-card.success {
            background: linear-gradient(135deg, var(--secondary) 0%, #218838 100%);
        }

        .stat-card.info {
            background: linear-gradient(135deg, var(--accent) 0%, #138496 100%);
        }

        .stat-card.warning {
            background: linear-gradient(135deg, var(--warning) 0%, #e0a800 100%);
        }

        .stat-card.danger {
            background: linear-gradient(135deg, var(--danger) 0%, #c82333 100%);
        }

        /* ==================== TABLE ==================== */
        .table-container {
            overflow-x: auto;
            border-radius: 8px;
            box-shadow: var(--shadow);
            max-height: 600px;
            overflow-y: auto;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            background: white;
            font-size: 12px;
        }

        thead {
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: white;
            position: sticky;
            top: 0;
            z-index: 10;
        }

        th {
            padding: 0.8rem;
            text-align: left;
            font-weight: 600;
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.3px;
            white-space: normal;
            word-wrap: break-word;
            max-width: 150px;
        }

        /* Anchos específicos para columnas - ORDEN: AÑO, MES, SERIE, HOJA, SECCIÓN, ID_PRESTACIÓN, ESTABLECIMIENTO, CARACT_FILA, CARACT_COLUMNA, VALOR */
        /* Anchos específicos para columnas - ORDEN: AÑO, MES, SERVICIO, ESTABLECIMIENTO, CARACT_FILA, CARACT_COLUMNA, VALOR */
        th:nth-child(1) { width: 50px; min-width: 50px; max-width: 60px; text-align: center; }  /* AÑO */
        th:nth-child(2) { width: 45px; min-width: 45px; max-width: 55px; text-align: center; }  /* MES */
        th:nth-child(3) { min-width: 140px; max-width: 180px; }  /* SERVICIO */
        th:nth-child(4) { min-width: 180px; max-width: 250px; }  /* ESTABLECIMIENTO */
        th:nth-child(5) { min-width: 200px; max-width: 300px; }  /* CARACTERÍSTICAS FILA */
        th:nth-child(6) { min-width: 150px; max-width: 220px; }  /* CARACTERÍSTICAS COLUMNA */
        th:nth-child(7) { width: 70px; min-width: 70px; max-width: 90px; text-align: right; }  /* VALOR */

        td {
            padding: 0.8rem;
            border-bottom: 1px solid var(--gray-200);
            color: var(--gray-700);
            white-space: normal;
            word-wrap: break-word;
            font-size: 12px;
        }

        /* Anchos específicos para celdas - mismo orden */
        /* Anchos específicos para celdas - mismo orden */
        td:nth-child(1) { width: 50px; min-width: 50px; max-width: 60px; text-align: center; font-weight: 600; }  /* AÑO */
        td:nth-child(2) { width: 45px; min-width: 45px; max-width: 55px; text-align: center; }  /* MES */
        td:nth-child(3) { min-width: 140px; max-width: 180px; }  /* SERVICIO */
        td:nth-child(4) { min-width: 180px; max-width: 250px; }  /* ESTABLECIMIENTO */
        td:nth-child(5) { min-width: 200px; max-width: 300px; }  /* CARACTERÍSTICAS FILA */
        td:nth-child(6) { min-width: 150px; max-width: 220px; }  /* CARACTERÍSTICAS COLUMNA */
        td:nth-child(7) { width: 70px; min-width: 70px; max-width: 90px; text-align: right; font-weight: 600; }  /* VALOR */

        tbody tr {
            transition: var(--transition);
        }

        tbody tr:hover {
            background: var(--gray-100);
            transform: scale(1.005);
        }

        /* ==================== CHARTS ==================== */
        .charts-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
            gap: 2rem;
            margin-bottom: 2rem;
        }

        .chart-container {
            position: relative;
            height: 400px;
            padding: 1.5rem;
            background: white;
            border-radius: var(--border-radius);
            box-shadow: var(--shadow);
        }

        /* ==================== MESSAGES ==================== */
        .message {
            padding: 1.2rem 1.5rem;
            border-radius: 8px;
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            gap: 1rem;
            animation: slideIn 0.3s ease;
        }

        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .message i {
            font-size: 1.5rem;
        }

        .message-content {
            flex: 1;
        }

        .message-title {
            font-weight: 600;
            margin-bottom: 0.3rem;
        }

        .message-text {
            font-size: 0.9rem;
            opacity: 0.9;
        }

        .message.success {
            background: #d4edda;
            color: #155724;
            border-left: 4px solid var(--secondary);
        }

        .message.error {
            background: #f8d7da;
            color: #721c24;
            border-left: 4px solid var(--danger);
        }

        .message.info {
            background: #d1ecf1;
            color: #0c5460;
            border-left: 4px solid var(--accent);
        }

        .message.warning {
            background: #fff3cd;
            color: #856404;
            border-left: 4px solid var(--warning);
        }

        /* ==================== LOADING ==================== */
        .loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.7);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 9999;
            backdrop-filter: blur(4px);
        }

        .loading-content {
            background: white;
            padding: 3rem;
            border-radius: var(--border-radius);
            text-align: center;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            animation: scaleIn 0.3s ease;
        }

        @keyframes scaleIn {
            from {
                opacity: 0;
                transform: scale(0.9);
            }
            to {
                opacity: 1;
                transform: scale(1);
            }
        }

        .spinner {
            width: 60px;
            height: 60px;
            margin: 0 auto 1.5rem;
            border: 4px solid var(--gray-200);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .loading-text {
            font-size: 1.1rem;
            color: var(--gray-700);
            font-weight: 500;
        }

        /* ==================== RESPONSIVE ==================== */
        @media (max-width: 768px) {
            .header-content {
                flex-direction: column;
                text-align: center;
            }

            .header h1 {
                font-size: 1.4rem;
            }

            .filters-grid {
                grid-template-columns: 1fr;
            }

            .stats-grid {
                grid-template-columns: 1fr;
            }

            .charts-grid {
                grid-template-columns: 1fr;
            }

            .btn-container {
                flex-direction: column;
            }

            .btn {
                width: 100%;
                justify-content: center;
            }

            .card {
                padding: 1.5rem;
            }
        }

        /* ==================== UTILITIES ==================== */
        .text-center { text-align: center; }
        .mt-1 { margin-top: 0.5rem; }
        .mt-2 { margin-top: 1rem; }
        .mt-3 { margin-top: 1.5rem; }
        .mb-0 { margin-bottom: 0; }
        .hidden { display: none !important; }
        
        .fade-in {
            animation: fadeIn 0.5s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .no-data {
            text-align: center;
            padding: 4rem 2rem;
            color: var(--gray-700);
        }

        .no-data-icon {
            font-size: 5rem;
            opacity: 0.3;
            margin-bottom: 1rem;
        }

        .no-data-text {
            font-size: 1.2rem;
            font-weight: 500;
        }
    
        /* ==================== LOADING EXPORTACIÓN ==================== */
        .export-loading-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 9999;
            justify-content: center;
            align-items: center;
        }

        .export-loading-content {
            background: white;
            padding: 3rem;
            border-radius: 16px;
            text-align: center;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            animation: slideDown 0.3s ease-out;
        }

        @keyframes slideDown {
            from {
                transform: translateY(-50px);
                opacity: 0;
            }
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        .export-loading-spinner {
            width: 60px;
            height: 60px;
            border: 5px solid #e9ecef;
            border-top: 5px solid #28a745;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 1.5rem;
        }

        .export-loading-text {
            font-size: 1.2rem;
            color: #212529;
            font-weight: 600;
            margin-bottom: 0.5rem;
        }

        .export-loading-subtext {
            font-size: 0.9rem;
            color: #6c757d;
        }

    
        /* ==================== PANEL CARACTERIZACIONES ==================== */
        .caracterizaciones-panel {
            background: white;
            border-radius: var(--border-radius);
            padding: 2rem;
            margin-bottom: 2rem;
            box-shadow: var(--shadow-lg);
        }

        .caracterizaciones-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 1.5rem;
            border-radius: 8px 8px 0 0;
            margin: -2rem -2rem 2rem -2rem;
        }

        .caracterizaciones-header h3 {
            margin: 0;
            font-size: 1.3rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 0.8rem;
        }

        .caracterizaciones-header p {
            margin: 0.5rem 0 0 0;
            font-size: 0.9rem;
            opacity: 0.95;
        }

        .caracterizaciones-grid {
            display: flex;
            gap: 2rem;
            justify-content: center;
        }

        .caracterizacion-box {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 1.5rem;
            border: 2px solid #e9ecef;
            flex: 1;
            min-width: 480px;
            max-width: 600px;
        }

        .caracterizacion-box h4 {
            margin: 0 0 1.2rem 0;
            font-size: 1.1rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding-bottom: 0.8rem;
            border-bottom: 3px solid;
        }

        .caracterizacion-box.filas h4 {
            color: var(--primary);
            border-bottom-color: var(--primary);
        }

        .caracterizacion-box.columnas h4 {
            color: var(--secondary);
            border-bottom-color: var(--secondary);
        }

        .caracterizacion-badge {
            background: white;
            color: inherit;
            padding: 0.2rem 0.6rem;
            border-radius: 12px;
            font-size: 0.85rem;
            font-weight: 600;
            margin-left: auto;
        }

        .caracterizacion-list {
            max-height: 400px;
            overflow-y: auto;
            padding-right: 0.5rem;
        }

        .caracterizacion-list::-webkit-scrollbar {
            width: 8px;
        }

        .caracterizacion-list::-webkit-scrollbar-track {
            background: #e9ecef;
            border-radius: 4px;
        }

        .caracterizacion-list::-webkit-scrollbar-thumb {
            background: #adb5bd;
            border-radius: 4px;
        }

        .caracterizacion-list::-webkit-scrollbar-thumb:hover {
            background: #6c757d;
        }

        .caracterizacion-item {
            padding: 1rem;
            margin-bottom: 0.8rem;
            background: white;
            border-radius: 6px;
            border-left: 4px solid;
            font-size: 0.9rem;
            line-height: 1.6;
            word-wrap: break-word;
            white-space: normal;
            transition: var(--transition);
        }

        .caracterizacion-box.filas .caracterizacion-item {
            border-left-color: var(--primary);
        }

        .caracterizacion-box.columnas .caracterizacion-item {
            border-left-color: var(--secondary);
        }

        .caracterizacion-item:hover {
            transform: translateX(5px);
            box-shadow: var(--shadow);
        }

        .caracterizacion-item-number {
            font-weight: 700;
            margin-right: 0.5rem;
            opacity: 0.7;
        }

        .caracterizacion-box.filas .caracterizacion-item-number {
            color: var(--primary);
        }

        .caracterizacion-box.columnas .caracterizacion-item-number {
            color: var(--secondary);
        }

        .caracterizacion-empty {
            text-align: center;
            padding: 2rem;
            color: var(--gray-700);
            font-style: italic;
        }

        @media (max-width: 1024px) {
            .caracterizaciones-grid {
                flex-direction: column;
                align-items: center;
            }
        }


        /* ==================== POPUP DE ADVERTENCIA ==================== */
        .popup-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 10000;
            justify-content: center;
            align-items: center;
            animation: fadeIn 0.3s ease;
        }

        .popup-overlay.show {
            display: flex;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .popup-content {
            background: white;
            border-radius: 16px;
            padding: 40px;
            max-width: 550px;
            width: 90%;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
            text-align: center;
            animation: slideDown 0.4s ease;
        }

        @keyframes slideDown {
            from {
                transform: translateY(-50px);
                opacity: 0;
            }
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        .popup-icon {
            font-size: 64px;
            color: #ff9800;
            margin-bottom: 20px;
            animation: pulse 1.5s infinite;
        }

        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }

        .popup-title {
            font-size: 24px;
            font-weight: 700;
            color: #e65100;
            margin-bottom: 16px;
        }

        .popup-message {
            font-size: 16px;
            color: #424242;
            line-height: 1.6;
            margin-bottom: 24px;
        }

        .popup-details {
            background: #fff3e0;
            border-left: 4px solid #ff9800;
            padding: 16px;
            border-radius: 8px;
            margin-bottom: 24px;
            text-align: left;
        }

        .popup-detail-row {
            display: flex;
            justify-content: space-between;
            margin-bottom: 8px;
            font-size: 14px;
        }

        .popup-detail-label {
            font-weight: 600;
            color: #e65100;
        }

        .popup-detail-value {
            color: #424242;
        }

        .popup-button {
            background: linear-gradient(135deg, #ff9800, #f57c00);
            color: white;
            border: none;
            padding: 14px 32px;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
        }

        .popup-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(255, 152, 0, 0.4);
        }

        .popup-button:active {
            transform: translateY(0);
        }

        /* ==================== SKELETON LOADER ==================== */
        .skeleton-timeline {
            background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
            border-left: 4px solid #2196f3;
            padding: 24px;
            border-radius: 12px;
            box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
        }

        .skeleton-header {
            height: 20px;
            width: 250px;
            background: linear-gradient(90deg, #bbdefb 0%, #e3f2fd 50%, #bbdefb 100%);
            background-size: 200% 100%;
            border-radius: 4px;
            margin-bottom: 20px;
            animation: shimmer 1.5s infinite;
        }

        @keyframes shimmer {
            0% { background-position: -200% 0; }
            100% { background-position: 200% 0; }
        }

        .skeleton-months {
            display: flex;
            justify-content: space-between;
            padding: 20px 0;
            gap: 8px;
        }

        .skeleton-month {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: linear-gradient(90deg, #bbdefb 0%, #e3f2fd 50%, #bbdefb 100%);
            background-size: 200% 100%;
            animation: shimmer 1.5s infinite;
        }

        .skeleton-month:nth-child(2) { animation-delay: 0.1s; }
        .skeleton-month:nth-child(3) { animation-delay: 0.2s; }
        .skeleton-month:nth-child(4) { animation-delay: 0.3s; }
        .skeleton-month:nth-child(5) { animation-delay: 0.4s; }
        .skeleton-month:nth-child(6) { animation-delay: 0.5s; }
        .skeleton-month:nth-child(7) { animation-delay: 0.6s; }
        .skeleton-month:nth-child(8) { animation-delay: 0.7s; }
        .skeleton-month:nth-child(9) { animation-delay: 0.8s; }
        .skeleton-month:nth-child(10) { animation-delay: 0.9s; }
        .skeleton-month:nth-child(11) { animation-delay: 1s; }
        .skeleton-month:nth-child(12) { animation-delay: 1.1s; }

        .skeleton-footer {
            margin-top: 20px;
            padding-top: 16px;
            border-top: 2px solid rgba(33, 150, 243, 0.2);
            display: flex;
            gap: 12px;
        }

        .skeleton-text {
            height: 16px;
            background: linear-gradient(90deg, #bbdefb 0%, #e3f2fd 50%, #bbdefb 100%);
            background-size: 200% 100%;
            border-radius: 4px;
            animation: shimmer 1.5s infinite;
        }

        .skeleton-text.wide {
            width: 300px;
        }

        .skeleton-text.short {
            width: 100px;
        }

        /* ==================== MODAL DE FORMATO DE EXPORTACIÓN ==================== */
        .modal-export-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 10000;
            justify-content: center;
            align-items: center;
            animation: fadeIn 0.3s ease;
        }

        .modal-export-overlay.show {
            display: flex;
        }

        .modal-export-content {
            background: white;
            border-radius: 16px;
            padding: 40px;
            max-width: 700px;
            width: 90%;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
            animation: slideDown 0.4s ease;
        }

        .modal-export-header {
            text-align: center;
            margin-bottom: 30px;
        }

        .modal-export-title {
            font-size: 24px;
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 8px;
        }

        .modal-export-subtitle {
            font-size: 14px;
            color: #6c757d;
        }

        .formato-option {
            border: 3px solid #e0e0e0;
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 20px;
            cursor: pointer;
            transition: all 0.3s;
            position: relative;
        }

        .formato-option:hover {
            border-color: var(--primary);
            background: #f8f9fa;
        }

        .formato-option.selected {
            border-color: var(--primary);
            background: #e3f2fd;
        }

        .formato-option input[type="radio"] {
            position: absolute;
            top: 20px;
            right: 20px;
            width: 24px;
            height: 24px;
            cursor: pointer;
        }

        .formato-title {
            font-size: 18px;
            font-weight: 700;
            color: var(--dark);
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .formato-example {
            background: white;
            border: 2px solid #dee2e6;
            border-radius: 8px;
            padding: 15px;
            margin-bottom: 15px;
            overflow-x: auto;
        }

        .formato-example table {
            width: 100%;
            border-collapse: collapse;
            font-size: 12px;
        }

        .formato-example th {
            background: var(--primary);
            color: white;
            padding: 8px;
            text-align: left;
            font-weight: 600;
        }

        .formato-example td {
            padding: 8px;
            border: 1px solid #dee2e6;
        }

        .formato-example tr:nth-child(even) {
            background: #f8f9fa;
        }

        .formato-benefits {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .formato-benefit {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            color: #495057;
        }

        .formato-benefit i {
            color: #28a745;
            font-size: 14px;
        }

        .modal-export-actions {
            display: flex;
            gap: 12px;
            margin-top: 30px;
        }

        .modal-export-btn {
            flex: 1;
            padding: 14px;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .modal-export-btn.excel {
            background: linear-gradient(135deg, #217346, #1e6f3e);
            color: white;
        }

        .modal-export-btn.excel:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(33, 115, 70, 0.4);
        }

        .modal-export-btn.csv {
            background: linear-gradient(135deg, var(--primary), var(--primary-dark));
            color: white;
        }

        .modal-export-btn.csv:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(0, 86, 179, 0.4);
        }

        .modal-export-btn.cancel {
            background: #e0e0e0;
            color: var(--dark);
        }

        .modal-export-btn.cancel:hover {
            background: #d0d0d0;
        }


        /* ==================== HEADER CON PESTAÑAS ==================== */
        .header-with-tabs {
            background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
            color: white;
            box-shadow: 0 2px 20px rgba(0,0,0,0.1);
        }
        
        .header-main {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1.5rem 3rem 1rem 3rem;
        }
        
        .header-logo-title {
            display: flex;
            align-items: center;
            gap: 1.5rem;
        }
        
        .header-logo {
            width: 60px;
            height: 60px;
            background: rgba(255,255,255,0.15);
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2rem;
        }
        
        .header-text h1 {
            font-size: 1.8rem;
            font-weight: 700;
            margin: 0;
            letter-spacing: 0.5px;
        }
        
        .header-subtitle {
            font-size: 0.9rem;
            opacity: 0.85;
            margin-top: 0.3rem;
        }
        
        .header-info-mini {
            font-size: 0.9rem;
            opacity: 0.85;
            font-weight: 500;
        }
        
        /* PESTAÑAS TIPO LENGÜETAS */
        .tabs-nav {
            display: flex;
            gap: 0.5rem;
            padding: 0 3rem;
            background: transparent;
        }
        
        .tab-item {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            padding: 0.8rem 2rem;
            background: rgba(255,255,255,0.1);
            color: rgba(255,255,255,0.75);
            border: none;
            border-radius: 12px 12px 0 0;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 0.95rem;
            font-weight: 500;
            position: relative;
            bottom: 0;
            border-bottom: 3px solid transparent;
        }
        
        .tab-item:hover {
            background: rgba(255,255,255,0.15);
            color: white;
            transform: translateY(-2px);
        }
        
        .tab-item.active {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            font-weight: 600;
            box-shadow: 0 -4px 12px rgba(102,126,234,0.3);
            border-bottom: 3px solid #00f2fe;
        }
        
        .tab-item i {
            font-size: 1.1rem;
        }
        
        /* Ajustar body para el nuevo header */
        body {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            padding-top: 0;
        }
        
        .header {
            display: none; /* Ocultar header viejo */
        }
        
        .container {
            margin-top: 2rem !important;
        }

        
        /* Ajuste para fecha de actualización */
        .fecha-actualizacion {
            margin: 0;
            padding: 0;
        }
        
        .header-text {
            display: flex;
            flex-direction: column;
            gap: 0.2rem;
        }

        /* ==================== TOOLTIP ==================== */
        .btn-with-tooltip {
            position: relative;
        }
        
        .btn-with-tooltip:hover::after {
            content: attr(data-tooltip);
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
            margin-bottom: 0.5rem;
            padding: 0.75rem 1rem;
            background: rgba(0, 0, 0, 0.9);
            color: white;
            font-size: 0.85rem;
            white-space: nowrap;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
            z-index: 1000;
            pointer-events: none;
            animation: tooltipFadeIn 0.3s ease;
        }
        
        .btn-with-tooltip:hover::before {
            content: '';
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
            border: 6px solid transparent;
            border-top-color: rgba(0, 0, 0, 0.9);
            z-index: 1000;
            pointer-events: none;
        }
        
        @keyframes tooltipFadeIn {
            from {
                opacity: 0;
                transform: translateX(-50%) translateY(5px);
            }
            to {
                opacity: 1;
                transform: translateX(-50%) translateY(0);
            }
        }

        
        /* COLORES INDIVIDUALES POR PESTAÑA */
        
        /* Seleccionar Serie/Año - Azul */
        .tab-item[data-tab="seleccionar-serie"] {
            background: rgba(41, 128, 185, 0.2);
            color: rgba(255,255,255,0.85);
        }
        .tab-item[data-tab="seleccionar-serie"]:hover {
            background: rgba(41, 128, 185, 0.35);
        }
        .tab-item[data-tab="seleccionar-serie"].active {
            background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
            border-bottom-color: #5dade2;
        }
        
        /* Consulta de Datos - Verde */
        .tab-item[data-tab="consulta"] {
            background: rgba(39, 174, 96, 0.2);
            color: rgba(255,255,255,0.85);
        }
        .tab-item[data-tab="consulta"]:hover {
            background: rgba(39, 174, 96, 0.35);
        }
        .tab-item[data-tab="consulta"].active {
            background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
            border-bottom-color: #58d68d;
        }
        
        /* Descargas Masivas - Verde oscuro */
        .tab-item[data-tab="descargas"] {
            background: rgba(22, 160, 133, 0.2);
            color: rgba(255,255,255,0.85);
        }
        .tab-item[data-tab="descargas"]:hover {
            background: rgba(22, 160, 133, 0.35);
        }
        .tab-item[data-tab="descargas"].active {
            background: linear-gradient(135deg, #16a085 0%, #1abc9c 100%);
            border-bottom-color: #48c9b0;
        }
        
        /* Búsqueda Avanzada - Púrpura */
        .tab-item[data-tab="busqueda"] {
            background: rgba(102, 126, 234, 0.2);
            color: rgba(255,255,255,0.85);
        }
        .tab-item[data-tab="busqueda"]:hover {
            background: rgba(102, 126, 234, 0.35);
        }
        .tab-item[data-tab="busqueda"].active {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-bottom-color: #9b7ed9;
        }
        
        /* Diccionario REM - Naranja */
        .tab-item[data-tab="diccionario"] {
            background: rgba(230, 126, 34, 0.2);
            color: rgba(255,255,255,0.85);
        }
        .tab-item[data-tab="diccionario"]:hover {
            background: rgba(230, 126, 34, 0.35);
        }
        .tab-item[data-tab="diccionario"].active {
            background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
            border-bottom-color: #f8b739;
        }

        
        /* Ajustar ancho del header y pestañas al contenedor */
        .header-with-tabs {
            max-width: 1400px;
            margin: 0 auto;
            width: 100%;
        }
        
        .banner-serie {
            max-width: 1400px;
            margin: 0 auto;
            width: 100%;
        }
        
        .container {
            max-width: 1400px;
            margin: 0 auto;
            width: 100%;
            padding: 2rem;
        }











        /* ==================== BANNER INFO INTEGRADO (Dentro del contenedor) ==================== */
        .banner-info-integrado {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            padding: 1.2rem 1.5rem;
            border-radius: 12px 12px 0 0;
            margin: -2rem 0rem 1.5rem 0rem; /* Sin margin lateral - mismo ancho que contenedor */
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        
        .banner-info-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 1rem;
            margin-bottom: 0.5rem;
        }
        
        .banner-info-left {
            display: flex;
            align-items: center;
            gap: 0.8rem;
            flex-wrap: wrap;
        }
        
        .banner-info-icono {
            font-size: 1.5rem;
        }
        
        .banner-info-label {
            color: rgba(255,255,255,0.9);
            font-weight: 500;
            font-size: 0.95rem;
        }
        
        .banner-info-serie {
            background: rgba(255,255,255,0.25);
            color: white;
            padding: 0.4rem 1rem;
            border-radius: 8px;
            font-weight: 700;
            font-size: 1.1rem;
            letter-spacing: 0.5px;
        }
        
        .banner-info-ano {
            background: rgba(0, 242, 254, 0.3);
            color: #00f2fe;
            padding: 0.4rem 1rem;
            border-radius: 8px;
            font-weight: 700;
            font-size: 1.1rem;
        }
        
        .banner-info-right {
            color: white;
            font-size: 0.95rem;
        }
        
        .banner-info-desc {
            color: rgba(255,255,255,0.85);
            font-size: 0.85rem;
            font-style: italic;
            margin-left: 2.5rem;
        }
        
        /* Responsive */
        @media (max-width: 768px) {
            .banner-info-integrado {
                margin: -1.5rem -1.5rem 1rem -1.5rem;
                padding: 1rem;
            }
            
            .banner-info-content {
                flex-direction: column;
                align-items: flex-start;
            }
            
            .banner-info-desc {
                margin-left: 0;
            }
        }


        
        /* ==================== ALINEACIÓN FORZADA - TODOS AL MISMO ANCHO ==================== */
        
        /* HEADER COMPLETO: mismo ancho que container */
        .header-with-tabs {
            max-width: 1400px !important;
            margin: 0 auto !important;
            padding: 0 !important;
            width: 100% !important;
            box-sizing: border-box !important;
            border-radius: 0 0 16px 16px !important;
            overflow: hidden !important;
            box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
            margin-top: 0 !important;
        }
        
        /* Header-main: dentro del header contenido */
        .header-main {
            padding: 1.5rem 2rem 1rem 2rem !important;
            width: 100% !important;
            box-sizing: border-box !important;
        }
        
        /* Tabs-nav: dentro del header contenido */
        .tabs-nav {
            padding: 0 2rem 0 2rem !important;
            width: 100% !important;
            box-sizing: border-box !important;
            background: transparent !important;
        }
        
        /* Container: mismo ancho */
        .container {
            max-width: 1400px !important;
            margin: 2rem auto !important;
            padding: 2rem !important;
            width: 100% !important;
            box-sizing: border-box !important;
        }
        
        /* Body: agregar padding superior para que el header no quede pegado arriba */
        body {
            padding-top: 1.5rem !important;
        }
        
        /* Responsive */
        @media (max-width: 1440px) {
            .header-with-tabs,
            .container {
                max-width: 95% !important;
            }
        }
        
        @media (max-width: 1024px) {
            /* Tabs más compactos en tablets */
            .tab-item {
                padding: 0.7rem 1.2rem !important;
                font-size: 0.85rem !important;
            }
            
            .tab-item i {
                font-size: 1rem !important;
            }
        }
        
        @media (max-width: 768px) {
            .header-main,
            .tabs-nav,
            .container {
                padding-left: 1rem !important;
                padding-right: 1rem !important;
            }
            
            body {
                padding-top: 0.5rem !important;
            }
            
            /* HEADER RESPONSIVE */
            .header-main {
                flex-direction: column !important;
                gap: 0.75rem !important;
                padding-top: 1rem !important;
                padding-bottom: 0.75rem !important;
                text-align: center !important;
            }
            
            .header-logo-title {
                flex-direction: column !important;
                gap: 0.5rem !important;
            }
            
            .header-logo {
                width: 45px !important;
                height: 45px !important;
                font-size: 1.5rem !important;
            }
            
            .header-text h1 {
                font-size: 1.3rem !important;
            }
            
            .header-subtitle {
                font-size: 0.8rem !important;
            }
            
            .header-info-mini {
                font-size: 0.75rem !important;
            }
            
            /* TABS RESPONSIVE */
            .tabs-nav {
                flex-wrap: wrap !important;
                gap: 0.4rem !important;
                justify-content: center !important;
            }
            
            .tab-item {
                padding: 0.6rem 1rem !important;
                font-size: 0.8rem !important;
                flex: 1 1 auto !important;
                min-width: 0 !important;
                justify-content: center !important;
            }
            
            .tab-item i {
                font-size: 1rem !important;
            }
            
            .tab-item span {
                display: none !important;
            }
        }
        
        @media (max-width: 500px) {
            .tabs-nav {
                gap: 0.3rem !important;
            }
            
            .tab-item {
                padding: 0.6rem 0.8rem !important;
                border-radius: 8px 8px 0 0 !important;
            }
            
            .header-text h1 {
                font-size: 1.1rem !important;
            }
        }


        
        /* ==================== ALINEAR BANNER EXTERNO ==================== */
        .banner-externo-alineado {
            max-width: 1400px !important;
            margin-left: auto !important;
            margin-right: auto !important;
            padding-left: 2rem !important;
            padding-right: 2rem !important;
            box-sizing: border-box !important;
        }

/* ==================== PANEL ESTABLECIMIENTOS (copiado de descargas_masivas.css) ==================== */
.panel-establecimientos {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    overflow: hidden;
    animation: pulso-atencion 2s ease-in-out 3;
    border: 3px solid transparent;
}

.panel-establecimientos.destacado {
    border-color: #00897b;
}

@keyframes pulso-atencion {
    0%, 100% { 
        box-shadow: 0 2px 15px rgba(0,0,0,0.1);
        border-color: #00897b;
    }
    50% { 
        box-shadow: 0 0 25px 8px rgba(0, 137, 123, 0.5);
        border-color: #00897b;
    }
}

.panel-estab-header {
    background: linear-gradient(135deg, #00897b 0%, #26a69a 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.panel-estab-header:hover {
    background: linear-gradient(135deg, #00796b 0%, #009688 100%);
}

.panel-estab-header h2 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0;
}

.panel-estab-toggle {
    transition: transform 0.3s ease;
}

.panel-estab-toggle.expandido {
    transform: rotate(180deg);
}

.panel-estab-body {
    display: none;
    padding: 1.5rem;
}

.panel-estab-body.visible {
    display: block;
}

.filtro-estab {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.filtro-estab label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.filtro-estab select,
.filtro-estab input {
    width: 100%;
    padding: 0.6rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
}

#filtroTipoEstab {
    padding: 0.8rem 0.6rem;
    font-size: 0.85rem;
    min-height: 48px;
}

.filtro-estab select:focus,
.filtro-estab input:focus {
    border-color: #00897b;
    outline: none;
}

.filtros-acciones {
    display: flex;
    gap: 1rem;
    margin-bottom: 0;
    padding-top: 0;
}

.btn-aplicar-filtros {
    background: linear-gradient(135deg, #00897b 0%, #26a69a 100%);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-aplicar-filtros:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 137, 123, 0.4);
}

.btn-limpiar-filtros {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-limpiar-filtros:hover {
    background: #eee;
}

.contador-filtros {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Dropdown de sugerencias de autocompletado */
.sugerencias-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #00897b;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.sugerencia-item {
    padding: 0.7rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.sugerencia-item:hover {
    background: #e0f2f1;
}

.sugerencia-item:last-child {
    border-bottom: none;
}

.sugerencia-nombre {
    font-weight: 600;
    color: #333;
}

.sugerencia-detalle {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.2rem;
}

.sugerencia-codigo {
    background: #e3f2fd;
    color: #1565c0;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.sugerencias-vacio {
    padding: 1rem;
    text-align: center;
    color: #999;
}

.sugerencias-contador {
    padding: 0.5rem 1rem;
    background: #f5f5f5;
    font-size: 0.8rem;
    color: #666;
    border-bottom: 1px solid #eee;
}

/* Lista de establecimientos disponibles */
.lista-estab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0 1rem 0;
    padding-top: 1rem;
    border-top: 2px solid #e0e0e0;
}

.lista-estab-header h3 {
    color: #333;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.lista-estab-acciones {
    display: flex;
    gap: 0.5rem;
}

.btn-seleccion-estab {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.btn-seleccion-estab:hover {
    background: #e0e0e0;
}

.lista-establecimientos {
    max-height: 350px;
    overflow-y: auto;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.estab-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #eee;
    transition: all 0.2s ease;
    cursor: pointer;
}

.estab-item:hover {
    background: #e8f5e9;
}

.estab-item:last-child {
    border-bottom: none;
}

.estab-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.estab-info {
    flex: 1;
}

.estab-nombre {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.estab-detalles {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.2rem;
}

.estab-codigo {
    background: #e3f2fd;
    color: #1565c0;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.estab-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.estab-loading i {
    font-size: 2rem;
    color: #00897b;
    margin-bottom: 0.5rem;
}

/* Resumen de filtros aplicados */
.filtros-aplicados-resumen {
    background: #e0f2f1;
    border: 2px solid #00897b;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: none;
}

.filtros-aplicados-resumen.visible {
    display: block;
}

.filtros-aplicados-resumen h4 {
    color: #00695c;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.filtros-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filtro-tag {
    background: white;
    border: 1px solid #00897b;
    color: #00695c;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* =====================================================
   STEPPER - GUÍA DE PASOS
   ===================================================== */

.stepper-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 0.8rem 1.5rem;
    margin-bottom: 1rem;
}

.stepper-titulo {
    text-align: center;
    margin-bottom: 0.6rem;
}

.stepper-titulo h2 {
    color: #1565c0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 0.4rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.stepper-titulo h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #1565c0, #42a5f5);
    margin-left: 0.8rem;
    border-radius: 2px;
}

.stepper-titulo h2::before {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #42a5f5, #1565c0);
    margin-right: 0.8rem;
    border-radius: 2px;
}

.stepper-titulo p {
    color: #666;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 400;
}

.stepper-pasos {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.6rem;
}

.stepper-paso-box {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 0.5rem 0.6rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
}

.stepper-paso-box:hover {
    border-color: #1565c0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.2);
}

.stepper-paso-box.activo {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    border-color: #1565c0;
    color: white;
    box-shadow: 0 4px 15px rgba(21, 101, 192, 0.4);
}

.stepper-paso-box.completado {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.stepper-paso-box.expandido {
    border-color: #1565c0;
    box-shadow: 0 4px 15px rgba(21, 101, 192, 0.3);
}

.stepper-paso-numero {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    margin: 0 auto 0.25rem;
    color: #666;
}

.stepper-paso-box.activo .stepper-paso-numero {
    background: rgba(255,255,255,0.3);
    color: white;
}

.stepper-paso-box.completado .stepper-paso-numero {
    background: #28a745;
    color: white;
}

.stepper-paso-texto {
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.1rem;
}

.stepper-paso-subtexto {
    font-size: 0.7rem;
    opacity: 0.7;
}

.stepper-paso-box.activo .stepper-paso-subtexto {
    opacity: 0.9;
}

/* Flecha entre cajas */
.stepper-paso-box::after {
    content: '→';
    position: absolute;
    right: -0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
    font-size: 1.2rem;
    font-weight: bold;
}

.stepper-paso-box:last-of-type::after {
    display: none;
}

/* Panel de información expandible */
.stepper-info-panel {
    display: none;
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #1565c0;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-top: 0.5rem;
    animation: slideDown 0.3s ease;
}

.stepper-info-panel.visible {
    display: block;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.stepper-info-panel h4 {
    color: #333;
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stepper-info-panel p {
    color: #555;
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.stepper-info-panel p:last-child {
    margin-bottom: 0;
}

.stepper-info-panel .tip {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 0.6rem 0.8rem;
    border-radius: 0 6px 6px 0;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #856404;
}

.stepper-info-panel .tip a {
    color: #0d47a1;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dashed #0d47a1;
    transition: all 0.2s ease;
}

.stepper-info-panel .tip a:hover {
    color: #1565c0;
    border-bottom-style: solid;
}

/* Responsive stepper */
@media (max-width: 768px) {
    .stepper-pasos {
        grid-template-columns: repeat(2, 1fr);
    }
    .stepper-paso-box::after {
        display: none;
    }
}

@media (max-width: 500px) {
    .stepper-pasos {
        grid-template-columns: 1fr;
    }
}
