/* v9.0.2 */
/* detail-print-module.css */

.dpm-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', 'Meiryo UI', sans-serif;
}

.dpm-modal {
    background: #ffffff;
    border-radius: 8px;
    width: 340px;
    max-width: 90vw;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    overflow: hidden;
    animation: pe-modal-enter 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #cbd5e1;
}

.dpm-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dpm-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dpm-close {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    color: #475569;
    cursor: pointer;
    line-height: 1;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    transition: all 0.2s;
}

.dpm-close:hover {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fecaca;
}

.dpm-body {
    padding: 24px 20px;
}

.dpm-item-info {
    font-size: 14px;
    color: #475569;
    margin-bottom: 20px;
    padding: 10px;
    background: #f1f5f9;
    border-radius: 6px;
    border-left: 4px solid #3b82f6;
}

.dpm-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dpm-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.dpm-btn-print {
    background: #3b82f6;
    color: white;
}

.dpm-btn-print:hover {
    background: #2563eb;
}

.dpm-btn-excel {
    background: #10b981;
    color: white;
}

.dpm-btn-excel:hover {
    background: #059669;
}

/* =========================================
   PRINT SPECIFIC CSS (Activated ONLY in window.print()) 
   ========================================= */

@media print {
    @page {
        size: A4 portrait;
        margin: 15mm 15mm 15mm 15mm;
    }

    html, body.is-printing-detail {
        height: auto !important;
        overflow: visible !important;
        background-color: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    body.is-printing-detail > *:not(#dpmPrintArea) {
        display: none !important;
    }
    
    body.is-printing-detail #dpmPrintArea, 
    body.is-printing-detail #dpmPrintArea * {
        visibility: visible !important;
    }
    
    #dpmPrintArea {
        display: block !important;
        position: static !important;
        width: 100%;
        color: #000;
        font-family: 'Meiryo', 'MS PGothic', sans-serif;
    }

    .dp-print-container {
        width: 100%;
        max-width: 180mm;
        margin: 0 auto;
    }

    .dp-print-title {
        text-align: center;
        font-size: 24px;
        font-weight: bold;
        letter-spacing: 4px;
        margin-bottom: 15px;
        border-bottom: 2px solid #000;
        padding-bottom: 5px;
    }

    .dp-print-meta {
        display: flex;
        justify-content: flex-end;
        font-size: 12px;
        margin-bottom: 10px;
    }

    .dp-print-meta table {
        border-collapse: collapse;
    }

    .dp-print-meta td {
        border: 1px solid #000;
        padding: 4px 8px;
        text-align: center;
    }
    
    .dp-print-meta td.label {
        background: #f0f0f0;
        width: 80px;
    }

    .dp-print-meta td.value {
        width: 120px;
    }

    /* Thẻ quy chiếu ảnh */
    .dp-print-header-grid {
        display: flex;
        gap: 15px;
        margin-bottom: 15px;
    }

    .dp-print-photo {
        width: 140px;
        height: 140px;
        border: 1px solid #000;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }
    
    .dp-print-photo img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .dp-print-photo .no-photo {
        font-size: 12px;
        color: #666;
    }

    .dp-print-table {
        flex: 1;
        width: 100%;
        border-collapse: collapse;
        font-size: 12px;
    }

    .dp-print-table th, .dp-print-table td {
        border: 1px solid #000;
        padding: 6px;
        vertical-align: middle;
    }

    .dp-print-table th {
        background-color: #f0f0f0;
        font-weight: normal;
        text-align: left;
        width: 25%;
    }

    /* Subsection Header */
    .dp-print-section-title {
        background-color: #e0e0e0;
        font-size: 14px;
        font-weight: bold;
        padding: 4px 8px;
        border: 1px solid #000;
        border-bottom: none;
        margin-top: 15px;
    }

    .dp-print-sub-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 11px;
    }

    .dp-print-sub-table th, .dp-print-sub-table td {
        border: 1px solid #000;
        padding: 5px;
        text-align: left;
        vertical-align: middle;
    }
    
    .dp-print-sub-table th {
        background: #f9f9f9;
        font-weight: normal;
        text-align: center;
    }

    .dp-print-notes {
        border: 1px solid #000;
        min-height: 80px;
        padding: 8px;
        font-size: 12px;
        margin-top: 15px;
    }
}
