/* ============================================================================
   PRINT STYLES - PRODUCTION MODULE
   Loaded via <link media="print"> — do not import in main.css
   ============================================================================ */

@media print {
    /* Set landscape orientation */
    @page {
        size: 11in 8.5in;
        margin: 0.4in 0.5in;
    }

    * {
        box-sizing: border-box;
    }

    /* Hide all app shell elements */
    #app-sidebar,
    .view-header,
    .mes-sidebar,
    .stage-control-panel,
    .timer-box,
    .completion-box,
    .queue-toggle-btn,
    .prod-stepper,
    .job-info-panel,
    .job-context-panel,
    .stage-notes-box,
    .control-row,
    .prod-main-grid-enhanced {
        display: none !important;
    }

    /* Show print-only header */
    .print-only-header {
        display: block !important;
        margin-bottom: 15px;
        page-break-after: avoid;
    }

    .print-only-header h1 {
        color: #000 !important;
        margin: 0 0 8px 0 !important;
        font-size: 20pt !important;
    }

    .print-only-header p {
        color: #000 !important;
        font-size: 10pt;
        margin: 3px 0 !important;
    }

    .print-only-header div {
        border-bottom: 2px solid #333 !important;
        padding-bottom: 8px !important;
        margin-bottom: 12px !important;
    }

    /* Reset body and container for print */
    body {
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    #app-shell {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .prod-layout-mes {
        margin: 0 !important;
        height: auto !important;
        background: white !important;
        display: block !important;
        width: 100% !important;
    }

    .mes-stage {
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }

    /* Show only the cutlist section */
    .cutlist-visual-section {
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .cutlist-header {
        margin-bottom: 12px !important;
        padding-bottom: 8px !important;
        border-bottom: 2px solid #333 !important;
    }

    .cutlist-header h2 {
        color: #000 !important;
        font-size: 16pt !important;
        margin: 0 !important;
    }

    .cutlist-header .btn {
        display: none !important;
    }

    /* Stats bar - horizontal layout for landscape */
    .cutlist-stats {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 10px !important;
        margin-bottom: 15px !important;
        page-break-inside: avoid;
        color: #000 !important;
    }

    .stat-pill {
        background: #f0f0f0 !important;
        border: 1px solid #ccc !important;
        color: #000 !important;
        padding: 6px 12px !important;
        font-size: 9pt !important;
        white-space: nowrap !important;
    }

    .stat-pill i {
        color: #000 !important;
    }

    /* Assignment section - minimal for landscape */
    .assignment-section {
        margin-bottom: 10px !important;
        page-break-inside: avoid;
    }

    .assignment-section h3 {
        font-size: 9pt !important;
        margin: 0 0 4px 0 !important;
        color: #000 !important;
    }

    .assignment-table-wrap {
        max-height: none !important;
        overflow: visible !important;
        border: 1px solid #333 !important;
    }

    .assignment-table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 7pt !important;
    }

    .assignment-table th {
        background: #e0e0e0 !important;
        color: #000 !important;
        border: 1px solid #333 !important;
        padding: 3px 5px !important;
        font-size: 7pt !important;
    }

    .assignment-table td {
        color: #000 !important;
        border: 1px solid #ccc !important;
        padding: 2px 5px !important;
    }

    .sheet-badge {
        background: #000 !important;
        color: #fff !important;
        padding: 1px 4px !important;
        font-size: 6pt !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Sheet layouts */
    .sheet-layouts-section {
        margin-bottom: 20px !important;
        margin-top: 15px !important;
        page-break-before: auto;
    }

    .sheet-layouts-section h3 {
        font-size: 14pt !important;
        margin: 0 0 15px 0 !important;
        color: #000 !important;
        font-weight: 700 !important;
        border-bottom: 2px solid #000 !important;
        padding-bottom: 5px !important;
    }

    .sheets-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
        width: 100% !important;
    }

    .sheet-card {
        border: 1px solid #333 !important;
        background: white !important;
        page-break-inside: avoid;
        margin-bottom: 0 !important;
        width: 100% !important;
    }

    .sheet-card-header {
        background: #f5f5f5 !important;
        color: #000 !important;
        border-bottom: 1px solid #ccc !important;
        padding: 6px 10px !important;
        font-size: 9pt !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .sheet-qty-badge {
        background: var(--color-success) !important;
        color: #000 !important;
        border: 1px solid var(--color-success) !important;
        padding: 2px 6px !important;
        font-size: 8pt !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .sheet-card-footer,
    .sheet-numbers {
        background: #f5f5f5 !important;
        color: #000 !important;
        border-top: 1px solid #ccc !important;
        padding: 5px 10px !important;
        font-size: 8pt !important;
    }

    .sheet-numbers {
        background: #e5e5e5 !important;
        font-size: 7pt !important;
    }

    .total-sheets {
        font-weight: 700 !important;
        color: #000 !important;
    }

    .sheet-bar {
        border: 2px solid #666 !important;
        height: 80px !important;
        margin: 12px !important;
        border-radius: 4px !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .sheet-piece {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .piece-label {
        color: #fff !important;
        text-shadow: 0 1px 3px rgba(0,0,0,0.9) !important;
        font-size: 11pt !important;
        font-weight: 700 !important;
    }

    .sheet-waste {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Legend - compact for landscape */
    .cutlist-legend {
        padding-top: 12px !important;
        border-top: 1px solid #ccc !important;
        page-break-inside: avoid;
    }

    .cutlist-legend h4 {
        font-size: 10pt !important;
        margin: 0 0 8px 0 !important;
        color: #000 !important;
    }

    .legend-items {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    .legend-item {
        color: #000 !important;
        font-size: 8pt !important;
    }

    .legend-color {
        border: 1px solid #333 !important;
        width: 12px !important;
        height: 12px !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Simple cutlist styling */
    .simple-cutlist {
        page-break-inside: avoid;
    }

    .cut-row {
        border: 1px solid #ccc !important;
        background: white !important;
        color: #000 !important;
        page-break-inside: avoid;
    }

    .cut-name,
    .cut-mat,
    .cut-qty,
    .cut-len {
        color: #000 !important;
    }

    /* Ensure colors print */
    .color-swatch,
    .material-chip {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Hide the production board nav chrome */
    .pb-board, .pb-col, .pb-card-actions, .pb-btn-sm {
        display: none !important;
    }
}
