/* =========================================================
   SAVITAR ORDERS
========================================================= */

.pes-orders-page {
    max-width: 1500px;
    margin: 0 auto;
    padding: 34px 28px 60px;
    box-sizing: border-box;
}


/* =========================================================
   HEADER
========================================================= */

.pes-orders-header,
.pes-order-detail-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 34px;
}


.pes-orders-eyebrow {
    color: #f47700;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 8px;
}


.pes-orders-header h1,
.pes-order-detail-header h1 {
    margin: 0 0 7px;
    color: #10213b;
    font-size: 34px;
    line-height: 1.15;
}


.pes-orders-header p,
.pes-order-detail-header p {
    margin: 0;
    color: #718096;
    font-size: 15px;
}


/* =========================================================
   BUTTONS
========================================================= */

.pes-order-primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 6px;
    background: #2678b9;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}


.pes-order-primary-button:hover {
    background: #1d679f;
    color: #fff !important;
}


.pes-order-secondary-button {
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid #d6dce4;
    border-radius: 6px;
    background: #fff;
    color: #26364d;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}


.pes-order-danger-button {
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 6px;
    background: #df3d3d;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}


.pes-order-danger-button:hover {
    background: #c93232;
}


/* =========================================================
   NOTICE
========================================================= */

.pes-order-notice {
    margin-bottom: 24px;
    padding: 13px 16px;
    border: 1px solid #cde7d5;
    border-radius: 8px;
    background: #effaf2;
    color: #27733e;
    font-size: 14px;
}


/* =========================================================
   STATS
========================================================= */

.pes-order-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 26px;
}


.pes-order-stat-card {
    min-height: 104px;
    padding: 24px;
    border: 1px solid #e0e5eb;
    border-radius: 10px;
    background: #fff;
    box-sizing: border-box;
}


.pes-order-stat-card span {
    display: block;
    margin-bottom: 10px;
    color: #63738b;
    font-size: 13px;
}


.pes-order-stat-card strong {
    color: #111d32;
    font-size: 28px;
    line-height: 1;
}


/* =========================================================
   MAIN CARD
========================================================= */

.pes-orders-card {
    overflow: hidden;
    border: 1px solid #e0e5eb;
    border-radius: 10px;
    background: #fff;
}


.pes-orders-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    padding: 24px 22px;
    border-bottom: 1px solid #e7ebf0;
}


.pes-orders-toolbar h2 {
    margin: 0 0 5px;
    color: #10213b;
    font-size: 19px;
}


.pes-orders-toolbar span {
    color: #718096;
    font-size: 13px;
}


.pes-order-filters {
    display: flex;
    align-items: center;
    gap: 10px;
}


.pes-order-filters select,
.pes-order-filters input {
    height: 40px;
    min-width: 160px;
    padding: 0 12px;
    border: 1px solid #cdd3db;
    border-radius: 6px;
    background: #fff;
    color: #172033;
    font-size: 13px;
    box-sizing: border-box;
}


.pes-order-filters input {
    width: 250px;
}


/* =========================================================
   ORDER TABLE
========================================================= */

.pes-orders-table-wrap {
    width: 100%;
    overflow-x: auto;
}


.pes-orders-table {
    width: 100%;
    min-width: 1050px;
    border-collapse: collapse;
}


.pes-orders-table th {
    padding: 14px 16px;
    border-bottom: 1px solid #e4e8ed;
    background: #f8fafc;
    color: #63738b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .4px;
    text-align: left;
    white-space: nowrap;
}


.pes-orders-table td {
    padding: 17px 16px;
    border-bottom: 1px solid #edf0f3;
    color: #172033;
    font-size: 13px;
    vertical-align: middle;
}


.pes-orders-table tbody tr:hover {
    background: #fafcff;
}


.pes-order-number {
    color: #1872b8;
    font-weight: 700;
    text-decoration: none;
}


.pes-order-company {
    display: block;
    color: #15213a;
    font-weight: 700;
    text-decoration: none;
}


.pes-order-company:hover,
.pes-order-number:hover {
    color: #f47700;
}


.pes-orders-table td small {
    display: block;
    margin-top: 4px;
    color: #718096;
    font-size: 11px;
}


.pes-order-product-main {
    color: #172033;
    font-weight: 600;
}


.pes-order-product-sub {
    color: #718096;
    font-size: 11px;
}


/* =========================================================
   STATUS
========================================================= */

.pes-order-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 11px;
    border-radius: 20px;
    background: #edf4fb;
    color: #2678b9;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}


.status-order-confirmed {
    background: #edf4fb;
    color: #2678b9;
}


.status-manufacturer-assigned,
.status-production-procurement {
    background: #fff4dc;
    color: #a76a00;
}


.status-ready-for-dispatch {
    background: #eaf8ef;
    color: #26804a;
}


.status-dispatched-from-manufacturer,
.status-at-origin-port,
.status-export-clearance,
.status-shipment-booked {
    background: #eef4ff;
    color: #356cb2;
}


.status-shipped,
.status-in-transit,
.status-at-destination-port {
    background: #f0ecff;
    color: #6842c7;
}


.status-import-clearance {
    background: #fff0df;
    color: #b56600;
}


.status-delivered,
.status-completed {
    background: #e7f7ed;
    color: #218447;
}


.status-cancelled {
    background: #fdecec;
    color: #c33131;
}


/* =========================================================
   PROFIT
========================================================= */

.pes-order-profit {
    display: block;
    color: #087b43;
    font-size: 14px;
}


.pes-order-loss {
    display: block;
    color: #c43131;
    font-size: 14px;
}


.pes-order-no-profit {
    color: #9aa4b2;
}


/* =========================================================
   DETAIL PAGE
========================================================= */

.pes-order-back {
    display: inline-block;
    margin-bottom: 15px;
    color: #2678b9;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}


.pes-order-detail-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}


.pes-order-delete-form {
    margin: 0;
}


.pes-order-detail-card {
    margin-bottom: 22px;
    padding: 28px;
    border: 1px solid #e0e5eb;
    border-radius: 10px;
    background: #fff;
    box-sizing: border-box;
}


.pes-order-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}


.pes-order-section-title h2 {
    margin: 0;
    color: #10213b;
    font-size: 19px;
}


.pes-order-section-title span {
    color: #718096;
    font-size: 12px;
}


/* =========================================================
   INFO GRID
========================================================= */

.pes-order-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px 55px;
}


.pes-order-info-grid > div span {
    display: block;
    margin-bottom: 7px;
    color: #718096;
    font-size: 12px;
}


.pes-order-info-grid > div strong {
    color: #172033;
    font-size: 14px;
}


/* =========================================================
   PRODUCT TABLE
========================================================= */

.pes-order-product-table,
.pes-order-activity-table {
    width: 100%;
    border-collapse: collapse;
}


.pes-order-product-table th,
.pes-order-activity-table th {
    padding: 13px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e1e6ec;
    color: #65758c;
    font-size: 11px;
    font-weight: 800;
    text-align: left;
}


.pes-order-product-table td,
.pes-order-activity-table td {
    padding: 15px 14px;
    border-bottom: 1px solid #edf0f3;
    color: #26364d;
    font-size: 13px;
}


.pes-order-product-table td strong {
    color: #15213a;
}


/* =========================================================
   PROGRESS
========================================================= */

.pes-order-status-form {
    margin: 0;
}


.pes-order-detail-status {
    min-width: 230px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #cdd4dc;
    border-radius: 7px;
    background: #fff;
    color: #172033;
    font-size: 13px;
    font-weight: 600;
}


.pes-order-progress {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px 12px;
    padding: 10px 0 5px;
}


.pes-order-progress-step {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f7f9fb;
    box-sizing: border-box;
}


.pes-order-progress-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 25px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #e4e9ef;
    color: #7a8798;
    font-size: 11px;
    font-weight: 700;
}


.pes-order-progress-label {
    color: #63738b;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
}


.pes-order-progress-step.completed {
    background: #edf8f1;
}


.pes-order-progress-step.completed .pes-order-progress-dot {
    background: #2e9b5c;
    color: #fff;
}


.pes-order-progress-step.completed .pes-order-progress-label {
    color: #287c4a;
}


.pes-order-progress-step.current {
    background: #edf5fc;
}


.pes-order-progress-step.current .pes-order-progress-dot {
    background: #2678b9;
    color: #fff;
}


.pes-order-progress-step.current .pes-order-progress-label {
    color: #2678b9;
}


/* =========================================================
   NOTES
========================================================= */

.pes-order-notes {
    padding: 18px;
    border: 1px solid #e1e6ec;
    border-radius: 8px;
    background: #f8fafc;
    color: #34445a;
    font-size: 14px;
    line-height: 1.7;
}


/* =========================================================
   CALCULATOR LAUNCH
========================================================= */

.pes-order-calculator-launch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
    padding: 24px 28px;
    border: 1px solid #dfe5eb;
    border-radius: 10px;
    background: #fff;
}


.pes-order-calculator-launch h2 {
    margin: 0 0 6px;
    color: #10213b;
    font-size: 19px;
}


.pes-order-calculator-launch p {
    margin: 0;
    color: #718096;
    font-size: 13px;
}


/* =========================================================
   SAVED CALCULATION
========================================================= */

.pes-order-saved-result {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 22px;
}


.pes-order-saved-result > div {
    padding: 20px 24px;
    border: 1px solid #dfe5eb;
    border-radius: 9px;
    background: #fff;
}


.pes-order-saved-result span {
    display: block;
    margin-bottom: 8px;
    color: #718096;
    font-size: 12px;
}


.pes-order-saved-result strong {
    font-size: 22px;
}


/* =========================================================
   ACTIVITY
========================================================= */

.pes-order-activity-table-wrap {
    overflow-x: auto;
}


.pes-order-activity-table {
    min-width: 750px;
}


.pes-order-empty {
    padding: 35px 10px;
    color: #8793a3;
    text-align: center;
    font-size: 13px;
}


/* =========================================================
   MODALS
========================================================= */

body.pes-order-modal-open {
    overflow: hidden;
}


.pes-order-modal {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: none;
}


.pes-order-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}


.pes-order-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 27, 45, .58);
}


.pes-order-modal-content {
    position: relative;
    z-index: 2;
    width: min(900px, calc(100vw - 40px));
    max-height: calc(100vh - 50px);
    overflow-y: auto;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
}


.pes-order-calculator-modal {
    width: min(1000px, calc(100vw - 40px));
}


.pes-order-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 25px 28px;
    border-bottom: 1px solid #e5e9ee;
}


.pes-order-modal-header h2 {
    margin: 0 0 5px;
    color: #10213b;
    font-size: 21px;
}


.pes-order-modal-header p {
    margin: 0;
    color: #718096;
    font-size: 13px;
}


.pes-order-modal-close {
    width: 35px;
    height: 35px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f1f3f6;
    color: #435066;
    font-size: 23px;
    line-height: 35px;
    cursor: pointer;
}


/* =========================================================
   FORMS
========================================================= */

.pes-order-form-section {
    padding: 25px 28px;
    border-bottom: 1px solid #e6eaf0;
}


.pes-order-form-section h3 {
    margin: 0 0 20px;
    color: #10213b;
    font-size: 16px;
}


.pes-order-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}


.pes-order-form-grid > div {
    min-width: 0;
}


.pes-order-form-full {
    grid-column: 1 / -1;
}


.pes-order-form-grid label,
.pes-calculation-section label {
    display: block;
    margin-bottom: 7px;
    color: #26364d;
    font-size: 12px;
    font-weight: 600;
}


.pes-order-form-grid input,
.pes-order-form-grid textarea,
.pes-order-form-grid select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #cdd4dc;
    border-radius: 6px;
    background: #fff;
    color: #172033;
    font-size: 13px;
    box-sizing: border-box;
}


.pes-order-form-grid textarea {
    resize: vertical;
}


.pes-order-product-row {
    position: relative;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 34px;
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
    padding: 15px;
    border: 1px solid #e0e5eb;
    border-radius: 8px;
    background: #fafbfd;
}


.pes-remove-product {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: #fdecec;
    color: #c43131;
    font-size: 18px;
    cursor: pointer;
}


.pes-order-add-product {
    min-height: 39px;
    padding: 0 14px;
    border: 1px solid #2678b9;
    border-radius: 6px;
    background: #fff;
    color: #2678b9;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}


/* =========================================================
   MODAL FOOTER
========================================================= */

.pes-order-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 28px;
    background: #fafbfd;
}


/* =========================================================
   CALCULATOR
========================================================= */

.pes-calculation-section {
    padding: 25px 28px;
    border-bottom: 1px solid #e6eaf0;
}


.pes-calculation-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 20px;
}


.pes-calculation-title h3 {
    margin: 0;
    color: #10213b;
    font-size: 17px;
}


.pes-calculation-title span {
    color: #718096;
    font-size: 12px;
}


.pes-calculation-grid {
    display: grid;
    gap: 18px;
}


.pes-calculation-grid.two {
    grid-template-columns: repeat(2, 1fr);
}


.pes-calculation-grid.three {
    grid-template-columns: repeat(3, 1fr);
}


.pes-money-input {
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 42px;
    border: 1px solid #cdd4dc;
    border-radius: 6px;
    background: #fff;
}


.pes-money-input span {
    padding-left: 12px;
    color: #718096;
    font-size: 13px;
}


.pes-money-input input {
    width: 100%;
    height: 100%;
    padding: 0 10px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #172033;
    font-size: 13px;
}


.pes-calculation-output {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 13px;
    border: 1px solid #dfe4ea;
    border-radius: 6px;
    background: #f7f9fb;
    color: #172033;
    font-size: 14px;
    font-weight: 700;
    box-sizing: border-box;
}


.pes-calculation-result {
    display: flex;
    align-items: center;
    min-height: 55px;
    padding: 0 16px;
    border-radius: 7px;
    background: #f7f9fb;
    color: #172033;
    font-size: 20px;
    font-weight: 700;
}


.pes-calculation-result.profit-positive {
    color: #087b43;
    background: #edf8f1;
}


.pes-calculation-result.profit-negative {
    color: #c43131;
    background: #fdecec;
}


/* =========================================================
   NO RESULTS
========================================================= */

.pes-order-no-results {
    padding: 45px 20px;
    color: #7d8999;
    text-align: center;
    font-size: 14px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {

    .pes-order-stats {
        grid-template-columns: repeat(2, 1fr);
    }


    .pes-order-progress {
        grid-template-columns: repeat(3, 1fr);
    }


    .pes-calculation-grid.three {
        grid-template-columns: repeat(2, 1fr);
    }

}


@media (max-width: 782px) {

    .pes-orders-page {
        padding: 25px 15px 50px;
    }


    .pes-orders-header,
    .pes-order-detail-header,
    .pes-orders-toolbar,
    .pes-order-calculator-launch {
        align-items: stretch;
        flex-direction: column;
    }


    .pes-order-detail-actions {
        width: 100%;
    }


    .pes-order-detail-actions > *,
    .pes-order-detail-actions button,
    .pes-order-detail-actions a {
        flex: 1;
    }


.pes-order-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}


    .pes-order-filters {
        flex-direction: column;
    }


    .pes-order-filters select,
    .pes-order-filters input {
        width: 100%;
    }


    .pes-order-info-grid {
        grid-template-columns: 1fr;
    }


    .pes-order-form-grid,
    .pes-calculation-grid.two,
    .pes-calculation-grid.three {
        grid-template-columns: 1fr;
    }


    .pes-order-product-row {
        grid-template-columns: 1fr;
    }


    .pes-remove-product {
        width: 100%;
    }


    .pes-order-progress {
        grid-template-columns: 1fr;
    }


    .pes-order-saved-result {
        grid-template-columns: 1fr;
    }

}
/* =========================================================
   SEARCHABLE PRODUCT / MANUFACTURER SELECT
========================================================= */

.pes-searchable-select {
    position: relative;
    width: 100%;
}


.pes-product-search,
.pes-manufacturer-search {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #cfd5dc;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    box-sizing: border-box;
}


.pes-product-search:focus,
.pes-manufacturer-search:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.08);
}


/* DROPDOWN */

.pes-product-results,
.pes-manufacturer-results {
    display: none;

    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;

    max-height: 260px;
    overflow-y: auto;

    background: #fff;
    border: 1px solid #d9dee5;
    border-radius: 8px;

    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.10);

    z-index: 9999;
}


.pes-searchable-select.open .pes-product-results,
.pes-searchable-select.open .pes-manufacturer-results {
    display: block;
}


/* PRODUCT OPTION */

.pes-product-option,
.pes-manufacturer-option {
    padding: 11px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f5;
    font-size: 14px;
}


.pes-product-option:last-child,
.pes-manufacturer-option:last-child {
    border-bottom: none;
}


.pes-product-option:hover,
.pes-manufacturer-option:hover {
    background: #f5f8fb;
}


.pes-product-option strong {
    display: inline-block;
    color: #14213d;
    font-weight: 600;
}


.pes-product-option span {
    margin-left: 6px;
    color: #667085;
}


.pes-product-option small {
    display: block;
    margin-top: 3px;
    color: #8a94a6;
}


.pes-manufacturer-option {
    color: #14213d;
    font-weight: 500;
}


/* OTHER OPTION */

.pes-product-other-option,
.pes-manufacturer-other-option {
    color: #2271b1;
    font-weight: 600;
}


/* QUANTITY */

.pes-product-quantity {
    margin-top: 14px;
}


.pes-product-quantity label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
    color: #14213d;
}


.pes-order-quantity {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #cfd5dc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px;
}


.pes-order-quantity:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.08);
}