@media print {
    body {
        font-family: Arial, Calibri, 'Segoe UI', sans-serif;
        font-size: 11pt;
        background-color: #ffffff;
        color: #000000;
        margin: 0;
        padding: 0;
    }

    /* Ocultar elementos no deseados de la interfaz */
    .input-column, .footer, .actions-footer, .resultado-header, #placeholder-results, .mode-toggle, #listaAparatos, .estimaciones-imagen, .grafico-circular-container, .main-header .header-title p, .card-title i, hr {
        display: none !important;
    }

    /* Layout del Contenido del Reporte */
    .container {
        width: 100%;
        max-width: 100%;
        box-shadow: none;
        padding: 15mm;
        position: relative;
    }
    .calculator-grid, #resultados {
        display: block !important;
        box-shadow: none;
        border: none;
        margin: 0;
        width: 100%;
    }
    .card-content { padding: 0; }

    /* Encabezado del Reporte */
    .main-header {
        display: block;
        text-align: left;
        border-bottom: 1.5pt solid #000;
        padding-bottom: 1rem;
        margin-bottom: 1.5rem;
    }

    .main-header .header-title h1 {
        font-size: 24pt; /* Título principal más grande */
        font-weight: bold;
        color: #000;
        margin: 0;
    }
    
    .logo {
        position: absolute;
        top: 15mm;
        right: 15mm;
        max-width: 100px !important; /* Logo pequeño y elegante */
        height: auto;
    }
    
    /* Estilo general de las secciones */
    .subheader {
        font-size: 13pt;
        font-weight: bold;
        margin-top: 1.5rem;
        margin-bottom: 0.5rem;
        border-bottom: 0.5pt solid #888888;
        padding-bottom: 0.25rem;
        color: #000;
    }
    .resultado-cliente {
        border: 0.5pt solid #cccccc;
        background-color: #f8f8f8 !important;
        padding: 0.8rem;
        border-radius: 8px;
        font-size: 11pt;
        margin-bottom: 1.5rem;
    }

    /* Resumen de Carga (Tabla) */
    .print-only-summary { display: block; }
    .print-only-summary table {
        width: 100%;
        border-collapse: collapse;
        font-size: 10pt;
        margin-top: 0.5rem;
    }
    .print-only-summary th, .print-only-summary td {
        border: 0.5pt solid #cccccc;
        padding: 5px 8px;
        text-align: left;
    }
    .print-only-summary th {
        background-color: #f0f0f0 !important;
        font-weight: bold;
        border-bottom: 1pt solid #000;
    }
    .print-only-summary tr:nth-child(even) {
        background-color: #f9f9f9 !important; /* Bandas en las filas */
    }

    /* Componentes y Estimaciones */
    .resultado-grid, .battery-details {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }
    .resultado-item, .battery-details div {
        background-color: #ffffff !important;
        border: 0.5pt solid #cccccc !important;
        padding: 0.8rem;
    }
    .resultado-item h4 { font-size: 11pt; font-weight: bold; }
    .resultado-item p, .battery-details p { font-size: 12pt; font-weight: bold; }
    .resultado-item.full-span-desktop { grid-column: 1 / -1; }
    
    .estimaciones-container, .estimaciones-grafico { display: block; }
    .estimaciones-items {
        font-size: 11pt;
        background-color: #f8f8f8 !important;
        border: 0.5pt solid #ccc;
        padding: 0.8rem;
        border-radius: 8px;
    }
    .estimaciones-items p { margin: 0.4rem 0; }
    .estimaciones-items p:first-child { 
        font-size: 12pt; 
        font-weight: bold; 
        color: var(--primary-color);
    }
    #ahorroAnualSoles:before { content: 'S/ '; }
    #ahorroAnualSoles { font-size: 12pt; font-weight: bold; }


    /* Diagrama Unifilar */
    .print-only-diagram { display: block; text-align: center; margin-top: 1.5rem; page-break-before: auto; }
    .print-only-diagram svg { max-width: 100%; height: auto; }

    /* Evitar que las secciones se corten entre páginas */
    .card, .resultado-item, .estimaciones-container, .print-only-summary {
        page-break-inside: avoid;
    }
    
    /* Forzar la impresión de fondos y colores */
    body, .resultado-cliente, .print-only-summary th, .print-only-summary tr:nth-child(even), .estimaciones-items {
        color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}