/*
|--------------------------------------------------------------------------
| POSTECH.CLOUD V4.1 - Sale Details Modal Polish
|--------------------------------------------------------------------------
| Visual only:
| - Sale/invoice detail modal
| - Product lines
| - Payment info
| - Totals / notes / activities
| No controller/route/db/printing logic changes.
*/

:root {
    --pc41-navy: #0d3155;
    --pc41-deep: #082540;
    --pc41-blue: #1678e8;
    --pc41-blue-soft: #3b98ff;
    --pc41-gold: #f2ad19;
    --pc41-green: #1fa56f;
    --pc41-green-soft: #edf9f4;
    --pc41-bg: #f5f8fc;
    --pc41-card: #ffffff;
    --pc41-text: #17324f;
    --pc41-muted: #6d8196;
    --pc41-border: #d9e5f1;
    --pc41-border-soft: #e8eef5;
}

.postech-sale-detail-modal {
    width: min(96vw, 1280px) !important;
    max-width: 1280px !important;
    margin: 18px auto !important;
}

.postech-sale-detail-content {
    background: #fff !important;
    border: 1px solid var(--pc41-border) !important;
    border-radius: 16px !important;
    box-shadow: 0 26px 70px rgba(8,37,64,.20) !important;
    overflow: hidden !important;
}

.postech-sale-detail-header {
    min-height: 62px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 14px 18px !important;
    color: var(--pc41-deep) !important;
    background: linear-gradient(180deg,#fff,#fbfdff) !important;
    border-bottom: 1px solid var(--pc41-border) !important;
}

.postech-sale-detail-header .modal-title {
    margin: 0 !important;
    color: var(--pc41-deep) !important;
    font-size: 17px !important;
    font-weight: 950 !important;
}

.postech-sale-detail-header .close {
    width: 36px !important;
    height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    color: var(--pc41-navy) !important;
    background: #f4f8fc !important;
    border: 1px solid #d4e1ed !important;
    border-radius: 8px !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

.postech-sale-detail-body {
    padding: 16px 18px 10px !important;
    color: var(--pc41-text) !important;
    background: #fff !important;
    font-size: 12px !important;
}

/* Date line */
.postech-sale-detail-body > .row:first-child {
    margin-bottom: 9px !important;
}

.postech-sale-detail-body > .row:first-child p {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 34px !important;
    margin: 0 !important;
    padding: 7px 10px !important;
    color: #4b647d !important;
    background: #f7fafc !important;
    border: 1px solid #e1e9f1 !important;
    border-radius: 8px !important;
}

/* Top metadata cards */
.postech-sale-meta-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    margin: 0 0 14px !important;
}

.postech-sale-meta-grid > [class*="col-sm-"] {
    flex: 1 1 280px !important;
    width: auto !important;
    min-width: 250px !important;
    padding: 13px 14px !important;
    color: #4a6178 !important;
    background: #f9fbfd !important;
    border: 1px solid #e0e8f0 !important;
    border-radius: 10px !important;
    line-height: 1.9 !important;
}

.postech-sale-meta-grid b,
.postech-sale-meta-grid strong {
    color: #1f3d59 !important;
    font-weight: 900 !important;
}

/* Section headings */
.postech-sale-section-title {
    min-height: 40px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 6px 0 8px !important;
    padding: 9px 12px !important;
    color: var(--pc41-deep) !important;
    background: #f7fafc !important;
    border: 1px solid #e0e8f0 !important;
    border-radius: 9px !important;
    font-size: 14px !important;
    font-weight: 950 !important;
}

.postech-sale-section-title i {
    color: var(--pc41-blue) !important;
}

/* All tables inside sale detail */
.postech-sale-detail-modal .table-responsive {
    border: 1px solid var(--pc41-border) !important;
    border-radius: 10px !important;
    overflow-x: auto !important;
    background: #fff !important;
}

.postech-sale-detail-modal table.table {
    width: 100% !important;
    margin: 0 !important;
    background: #fff !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.postech-sale-detail-modal table.table thead th,
.postech-sale-detail-modal table.table tr.bg-green th {
    min-height: 42px !important;
    padding: 9px 10px !important;
    color: #38536f !important;
    background: #f1f6fb !important;
    border-color: #dce6ef !important;
    font-size: 10.5px !important;
    font-weight: 900 !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

.postech-sale-detail-modal table.table td {
    padding: 9px 10px !important;
    color: #27445f !important;
    background: #fff !important;
    border-color: #e7eef5 !important;
    font-size: 11px !important;
    font-weight: 650 !important;
    vertical-align: middle !important;
}

.postech-sale-detail-modal table.table tr:nth-child(even) td {
    background: #fbfdff !important;
}

/* Override old bright green */
.postech-sale-detail-modal .bg-green,
.postech-sale-detail-modal tr.bg-green {
    color: #147b55 !important;
    background: var(--pc41-green-soft) !important;
}

.postech-sale-detail-modal tr.bg-green th {
    color: #147b55 !important;
    background: var(--pc41-green-soft) !important;
    border-color: #d2eee2 !important;
}

/* Payment section / totals layout */
.postech-sale-detail-modal .col-md-6 .table-responsive,
.postech-sale-detail-modal .col-sm-6 .table-responsive {
    box-shadow: none !important;
}

.postech-sale-detail-modal .row .col-md-6 > table.table,
.postech-sale-detail-modal .row .col-sm-6 > table.table {
    margin-top: 10px !important;
    border: 1px solid var(--pc41-border) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
}

.postech-sale-detail-modal .row .col-md-6 > table.table th,
.postech-sale-detail-modal .row .col-sm-6 > table.table th {
    color: #435e78 !important;
    font-weight: 850 !important;
}

.postech-sale-detail-modal .display_currency {
    color: var(--pc41-deep) !important;
    font-weight: 850 !important;
}

/* Notes */
.postech-sale-notes-row {
    margin-top: 12px !important;
}

.postech-sale-notes-row .well {
    min-height: 62px !important;
    margin-top: 5px !important;
    padding: 10px 12px !important;
    color: #50687f !important;
    background: #f8fafc !important;
    border: 1px solid #e0e8f0 !important;
    border-radius: 9px !important;
    box-shadow: none !important;
}

/* Activities */
.postech-sale-activities-row {
    margin-top: 10px !important;
    padding-top: 11px !important;
    border-top: 1px solid var(--pc41-border-soft) !important;
}

.postech-sale-activities-row strong {
    color: var(--pc41-deep) !important;
    font-weight: 900 !important;
}

/* Footer buttons */
.postech-sale-detail-footer {
    min-height: 64px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    padding: 12px 18px !important;
    background: #fbfdff !important;
    border-top: 1px solid var(--pc41-border) !important;
}

.postech-sale-detail-footer .tw-dw-btn {
    min-height: 38px !important;
    padding: 7px 13px !important;
    border-radius: 8px !important;
    font-size: 11.5px !important;
    font-weight: 850 !important;
}

.postech-sale-detail-footer .tw-dw-btn-primary {
    color: #fff !important;
    background: linear-gradient(135deg,var(--pc41-blue-soft),var(--pc41-blue)) !important;
    border: 1px solid #1067c7 !important;
}

.postech-sale-detail-footer .tw-dw-btn-success {
    color: #fff !important;
    background: linear-gradient(135deg,#2ab985,#188a61) !important;
    border: 1px solid #177954 !important;
}

.postech-sale-detail-footer .tw-dw-btn-neutral {
    color: var(--pc41-navy) !important;
    background: #fff !important;
    border: 1px solid #cedce8 !important;
}

/* Mobile/tablet */
@media (max-width: 900px) {
    .postech-sale-detail-modal {
        width: 97vw !important;
        margin: 10px auto !important;
    }

    .postech-sale-meta-grid {
        display: block !important;
    }

    .postech-sale-meta-grid > [class*="col-sm-"] {
        width: 100% !important;
        min-width: 0 !important;
        margin-bottom: 8px !important;
    }
}

/* Print */
@media print {
    .postech-sale-detail-modal {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }

    .postech-sale-detail-content {
        border: 0 !important;
        box-shadow: none !important;
    }

    .postech-sale-detail-footer {
        display: none !important;
    }
}
