input,
select,
textarea {
    border: 1px solid #cbd5e1;
    padding: 0.375rem 0.75rem !important; /* Relleno general */
    padding-left: 15px !important; /* FORZAMOS el espacio a la izquierda */
    outline: none;
    width: 100%;
    font-size: 0.875rem;
    background: #fff;
}
input:focus,
select:focus {
    border-color: #1e3a8a;
}

label {
    color: #1e40af;
    font-weight: 600;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
}

.container-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.logo-paracas {
    width: 120px;
    height: auto;
    object-fit: contain;
}

.titulo-excel {
    font-size: 24px;
    font-weight: bold;
    color: #000;
    text-align: center;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .container-title {
        flex-direction: column;
        gap: 10px;
    }

    .titulo-excel {
        font-size: 18px;
    }
}

/* =========================================================
   CONFIGURACIÓN ULTRA COMPACTA PARA 1 SOLA HOJA (PDF)
========================================================= */
@media print {
    /* 1. Forzamos tamaño A4 y márgenes mínimos */
    @page { 
        size: A4 portrait; 
        margin: 10mm; 
    }

    body { 
        background-color: white !important; 
        padding: 0 !important; 
        font-size: 9.5px !important; /* Letra más pequeña */
        line-height: 1.1 !important; /* Interlineado más apretado */
    }

    /* 2. Limpiar el contenedor principal */
    .max-w-6xl { 
        box-shadow: none !important; 
        border: none !important; 
        max-width: 100% !important; 
        margin: 0 !important; 
        padding: 0 !important;
    }
    #btn-descargar, #btn-buscar { display: none !important; }

    /* 3. Forzar impresión de colores de fondo */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* 4. MANTENER LAS COLUMNAS INTACTAS */
    .grid { display: grid !important; }
    .grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)) !important; }
    .grid-cols-8 { grid-template-columns: repeat(8, minmax(0, 1fr)) !important; }
    .grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
    .col-span-1 { grid-column: span 1 / span 1 !important; }
    .col-span-2 { grid-column: span 2 / span 2 !important; }
    .col-span-3 { grid-column: span 3 / span 3 !important; }
    .col-span-4 { grid-column: span 4 / span 4 !important; }
    .col-span-5 { grid-column: span 5 / span 5 !important; }
    .col-span-8 { grid-column: span 8 / span 8 !important; }
    .col-span-9 { grid-column: span 9 / span 9 !important; }
    .col-span-10 { grid-column: span 10 / span 10 !important; }
    .col-span-12 { grid-column: span 12 / span 12 !important; }

    /* 5. Inputs ultra compactos */
    input, select, textarea { 
        border: none !important; 
        background: transparent !important; 
        padding: 0 2px !important;
        border-bottom: 1px solid #94a3b8 !important;
        height: 16px !important; /* Altura ultra fina */
        font-size: 9.5px !important;
    }

    /* 6. COMPRESIÓN MÁXIMA DE ESPACIOS DE TAILWIND */
    .gap-2 { gap: 2px !important; }
    .gap-4 { gap: 4px !important; }
    .p-4 { padding: 4px !important; }
    .p-6 { padding: 0 !important; }
    .py-2 { padding-top: 2px !important; padding-bottom: 2px !important; }
    .pt-4 { padding-top: 4px !important; }
    .pb-2 { padding-bottom: 2px !important; }
    
    .mt-2 { margin-top: 2px !important; }
    .mt-4 { margin-top: 4px !important; }
    .mt-6, .mt-8 { margin-top: 8px !important; } /* Comprime el espacio gigante de firmas */
    .mb-1, .mb-12 { margin-bottom: 2px !important; }
    
    .space-y-2 > * + * { margin-top: 2px !important; }
    .space-y-3 > * + * { margin-top: 3px !important; }
    .space-y-4 > * + * { margin-top: 4px !important; }

    /* 7. Reducir el encabezado y textos grandes */
    .container-title { padding: 0 0 4px 0 !important; gap: 10px !important; border:none !important;}
    .logo-paracas { width: 75px !important; } /* Logo más chico */
    .titulo-excel { font-size: 13px !important; margin: 0 !important; }
    h2.text-lg { font-size: 11px !important; margin: 0 !important; padding: 2px 0 !important; }
    label { font-size: 9px !important; }

    /* 8. Ajustes para la tabla de precios (Sección III) */
    .h-12 { height: 24px !important; font-size: 8px !important; padding: 2px !important; line-height: 1 !important; }
    .text-\[10px\] { font-size: 8px !important; }
    .text-\[11px\] { font-size: 8.5px !important; }
    input.border-t, input.border-l { border: none !important; }

    /* 9. Área de firmas */
    .h-6 { height: 14px !important; }
}