/* ---------- Print ---------- */
@media print {

    /* Reset page margins and setup */
    @page {
        margin: 1cm;
        size: A4 portrait;
    }

    body {
        background: white;
        font-size: 10pt;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
        /* Scale to 80% so Notes column fits (equivalent to user setting scale 80% in print dialog) */
        zoom: 0.78;
    }

    /* Header adjustments */
    .app-header {
        position: static;
        background: linear-gradient(135deg, #5B8AB5, #7FA8C9);
        padding: 0.75rem 1rem;
        page-break-after: avoid;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .header-content {
        max-width: 100%;
    }

    .header-left h1 {
        font-size: 1.2rem;
    }

    .header-left .subtitle {
        font-size: 0.75rem;
    }

    /* Hide interactive elements */
    .header-controls,
    .settings-section,
    .btn,
    .btn-icon,
    .btn-small,
    .td-actions,
    .pc-actions,
    .day-popover,
    .timeline-actions,
    .collapse-icon,
    .collapsible {
        display: none !important;
    }

    /* Container and cards */
    .container {
        max-width: 100%;
        padding: 0.5rem;
        gap: 0.75rem;
    }

    .card {
        box-shadow: none;
        border: 1px solid #D1D4DB;
        page-break-inside: avoid;
        margin-bottom: 0.5rem;
    }

    .card-header {
        padding: 0.5rem 0.75rem;
        background: #EEEDEA;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .card-header h2 {
        font-size: 0.9rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    /* Legend */
    .legend-section {
        page-break-after: avoid;
    }

    .legend-grid {
        gap: 0.5rem;
    }

    .legend-item {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    /* Summary section */
    .summary-grid {
        gap: 1rem;
        page-break-inside: avoid;
    }

    .summary-card {
        page-break-inside: avoid;
    }

    .summary-card h3 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .partner-gantt {
        padding: 0.5rem;
        margin-bottom: 0.75rem;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .gantt-bar {
        height: 28px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .gantt-segment {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .gantt-due-marker {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .summary-stats {
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .stat {
        font-size: 0.7rem;
    }

    .stat-value {
        font-size: 1rem;
    }

    .pool-bar {
        margin-bottom: 0.4rem;
    }

    .pool-label {
        font-size: 0.7rem;
        margin-bottom: 0.2rem;
    }

    .pool-track {
        height: 6px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .pool-fill {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Timeline section */
    .timeline-section {
        page-break-before: auto;
    }

    .timeline-wrapper {
        max-height: none !important;
        overflow: visible !important;
    }

    #timeline-table {
        font-size: 0.7rem;
        width: 100%;
    }

    #timeline-table th {
        padding: 0.3rem 0.4rem;
        font-size: 0.7rem;
    }

    #timeline-table td {
        padding: 0.3rem 0.4rem;
    }

    #timeline-table tbody tr {
        page-break-inside: avoid;
    }

    .td-week {
        font-size: 0.65rem;
    }

    .td-dates {
        font-size: 0.65rem;
    }

    .td-notes {
        font-size: 0.65rem;
    }

    .partner-cell {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .pc-header {
        margin-bottom: 0.3rem;
    }

    .pc-name {
        font-size: 0.65rem;
    }

    .pc-salary {
        font-size: 0.6rem;
        padding: 0.1rem 0.3rem;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .pc-days {
        gap: 0.2rem;
        margin-bottom: 0.3rem;
    }

    .day-btn {
        width: 20px;
        height: 20px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .day-btn svg {
        width: 10px;
        height: 10px;
    }

    .day-label {
        font-size: 0.6rem;
    }

    .pc-hours {
        font-size: 0.65rem;
    }

    .childcare-cell {
        font-size: 0.65rem;
    }

    .cc-dot {
        width: 18px;
        height: 18px;
        font-size: 0.65rem;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .week-notes-cell {
        font-size: 0.65rem;
    }

    /* Footer */
    .app-footer {
        padding: 0.5rem;
        font-size: 0.65rem;
        page-break-before: avoid;
    }

    /* Ensure colors are printed */
    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}