﻿        /* ========================================== */
        /* 7. ESTILOS DE INFORMES Y FICHAS PDF EN A4  */
        /* ========================================== */
        .pdf-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(15, 23, 42, 0.75);
            backdrop-filter: blur(4px);
            z-index: 9999;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 1rem;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.25s ease;
        }

        .pdf-modal-overlay.active {
            opacity: 1;
            pointer-events: auto;
        }

        .pdf-modal-window {
            background: #e2e8f0;
            width: 100%;
            max-width: 1100px;
            height: 94vh;
            border-radius: var(--radius-lg);
            display: flex;
            flex-direction: column;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
            overflow: hidden;
        }

        .pdf-modal-topbar {
            background: #ffffff;
            padding: 0.8rem 1.25rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid var(--border-color);
            gap: 1rem;
            flex-wrap: wrap;
        }

        .pdf-modal-title {
            display: flex;
            align-items: center;
            gap: 10px;
            font-family: 'Outfit', sans-serif;
            font-size: 1.15rem;
            font-weight: 700;
            color: var(--text-main);
        }

        .pdf-modal-actions {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .pdf-scroll-area {
            flex: 1;
            overflow-y: auto;
            padding: 2rem 1rem;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2.5rem;
            background: #64748b;
        }

        /* Hoja física A4 */
        .a4-page {
            width: 210mm;
            height: 297mm;
            min-height: 297mm;
            max-height: 297mm;
            background: #ffffff;
            padding: 8mm 12mm 8mm 12mm;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            position: relative;
            color: #0f172a;
            font-size: 8pt;
            line-height: 1.35;
            overflow: hidden;
            page-break-after: always;
            break-after: page;
        }

        .a4-page:first-child {
            margin-bottom: 2rem;
        }

        /* Cabecera A4 */
        .a4-header {
            border-bottom: 2.5px solid #008844;
            padding-bottom: 5px;
            margin-bottom: 6px;
        }

        .a4-header-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 7pt;
            font-weight: 700;
            color: #475569;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 3px;
        }

        .a4-header-main {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .a4-line-badge {
            background: #008844;
            color: #ffffff;
            font-family: 'Outfit', sans-serif;
            font-size: 15pt;
            font-weight: 800;
            padding: 3px 10px;
            border-radius: 6px;
            letter-spacing: 0.5px;
            white-space: nowrap;
        }

        .a4-line-info {
            flex: 1;
        }

        .a4-line-title {
            font-family: 'Outfit', sans-serif;
            font-size: 11pt;
            font-weight: 800;
            color: #0f172a;
            line-height: 1.2;
        }

        .a4-line-meta {
            font-size: 7.2pt;
            color: #64748b;
            margin-top: 2px;
            display: flex;
            gap: 12px;
        }

        /* Pie de página A4 */
        .a4-footer {
            border-top: 1px solid #cbd5e1;
            padding-top: 4px;
            margin-top: 4px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 6.8pt;
            color: #64748b;
        }

        /* Página 1: Grid de 2 Columnas (Itinerario + Mapa) */
        .a4-p1-grid {
            display: grid;
            grid-template-columns: 48% 52%;
            gap: 10px;
            flex: 1;
            min-height: 0;
            max-height: 245mm;
            overflow: hidden;
        }

        .a4-col-title {
            font-family: 'Outfit', sans-serif;
            font-size: 8pt;
            font-weight: 800;
            color: #0f172a;
            background: #f1f5f9;
            padding: 3px 6px;
            border-left: 3px solid #008844;
            margin-bottom: 5px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .a4-stops-container {
            height: 100%;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .a4-stops-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 6.6pt;
        }

        .a4-stops-table th {
            background: #e2e8f0;
            font-weight: 800;
            color: #334155;
            padding: 2px 4px;
            text-align: left;
            border: 0.5px solid #cbd5e1;
        }

        .a4-stops-table td {
            padding: 1.5px 4px;
            border: 0.5px solid #e2e8f0;
            vertical-align: middle;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .a4-zona-pill {
            display: inline-block;
            padding: 1px 4px;
            border-radius: 3px;
            font-weight: 800;
            font-size: 6.2pt;
            text-align: center;
            min-width: 16px;
        }

        /* Contenedor del Mapa en A4 */
        .a4-map-container {
            height: 100%;
            border: 1px solid #cbd5e1;
            border-radius: 6px;
            overflow: hidden;
            position: relative;
            background: #f8fafc;
            display: flex;
            flex-direction: column;
        }

        #pdf-map-render {
            width: 100%;
            height: 100%;
            flex: 1;
            min-height: 200mm;
        }

        .a4-map-legend {
            background: rgba(255, 255, 255, 0.95);
            border-top: 1px solid #cbd5e1;
            padding: 3px 6px;
            font-size: 6.5pt;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 4px;
        }

        /* Página 2: Horarios, Tarifas e Info */
        .a4-p2-content {
            display: flex;
            flex-direction: column;
            gap: 6px;
            flex: 1;
            min-height: 0;
            max-height: 245mm;
            overflow: hidden;
        }

        .a4-timetable-box {
            border: 1px solid #cbd5e1;
            border-radius: 6px;
            padding: 4px 6px;
            background: #ffffff;
            overflow: hidden;
            height: 100%;
            display: flex;
            flex-direction: column;
        }

        .a4-mini-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 6.1pt;
            text-align: center;
        }

        .a4-mini-table th {
            background: #e2e8f0;
            font-weight: 800;
            color: #1e293b;
            padding: 1.5px 3px;
            border: 0.5px solid #cbd5e1;
            font-size: 6.1pt;
            line-height: 1.15;
        }

        .a4-mini-table td {
            padding: 1px 2.5px;
            border: 0.5px solid #e2e8f0;
            font-size: 6pt;
            line-height: 1.15;
        }

        .a4-tarifas-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 6px;
        }

        .a4-tarifa-card {
            border: 1px solid #cbd5e1;
            border-radius: 4px;
            padding: 3px 5px;
            background: #f8fafc;
            text-align: center;
        }

        .a4-tarifa-card strong {
            display: block;
            font-size: 8.5pt;
            color: #008844;
            margin-top: 1px;
        }

        .a4-info-box {
            background: #f1f5f9;
            border-radius: 6px;
            padding: 5px 8px;
            font-size: 7pt;
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 8px;
            border: 1px solid #e2e8f0;
        }

        /* Estilos A4 para Informes de Puntos de Venta y Paradas */
        .a4-puntos-stats-grid, .a4-paradas-stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 6px;
            margin-bottom: 6px;
        }

        .a4-puntos-stat-card, .a4-paradas-stat-card {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 4px;
            padding: 4px 6px;
            text-align: center;
        }

        .a4-puntos-stat-num, .a4-paradas-stat-num {
            font-family: 'Outfit', sans-serif;
            font-size: 11pt;
            font-weight: 800;
            color: #008844;
            line-height: 1.1;
        }

        .a4-puntos-stat-label, .a4-paradas-stat-label {
            font-size: 6.2pt;
            font-weight: 700;
            color: #64748b;
            text-transform: uppercase;
        }

        .a4-puntos-table, .a4-paradas-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 6.6pt;
        }

        .a4-puntos-table th, .a4-paradas-table th {
            background: #f1f5f9;
            color: #1e293b;
            font-weight: 800;
            padding: 3px 5px;
            text-align: left;
            border: 0.5px solid #cbd5e1;
            font-size: 6.6pt;
        }

        .a4-puntos-table td, .a4-paradas-table td {
            padding: 2.5px 5px;
            border: 0.5px solid #e2e8f0;
            color: #334155;
            vertical-align: middle;
        }

        .a4-puntos-table tr:nth-child(even), .a4-paradas-table tr:nth-child(even) {
            background: #f8fafc;
        }

        .a4-tipo-badge {
            display: inline-block;
            font-size: 6pt;
            font-weight: 800;
            padding: 1px 5px;
            border-radius: 3px;
            white-space: nowrap;
        }

        /* Reglas de Impresión Nativa @media print */
        @media print {
            body * {
                visibility: hidden;
            }
            .pdf-modal-overlay {
                position: static;
                background: none;
                padding: 0;
                display: block !important;
                opacity: 1 !important;
                visibility: visible !important;
            }
            .pdf-modal-window {
                box-shadow: none;
                border-radius: 0;
                width: 100%;
                max-width: none;
                height: auto;
                background: transparent;
                display: block !important;
                visibility: visible !important;
            }
            .pdf-modal-topbar {
                display: none !important;
            }
            .pdf-scroll-area {
                padding: 0;
                background: transparent;
                display: block !important;
                visibility: visible !important;
            }
            .a4-page {
                visibility: visible !important;
                display: flex !important;
                box-shadow: none;
                margin: 0 !important;
                page-break-after: always;
                break-after: page;
                width: 100%;
                height: 100%;
                min-height: 297mm;
                max-height: 297mm;
            }
            .a4-page:first-child {
                margin-bottom: 0 !important;
            }
            .a4-page * {
                visibility: visible !important;
            }
            @page {
                size: A4 portrait;
                margin: 0;
            }
        }
