.account-head {
    flex-wrap: wrap;
    gap: 10px;
}

.account-head-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.account-head-actions .btn {
    white-space: nowrap;
}

.order-filters {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(180px, 1.3fr) minmax(300px, 2.2fr) minmax(140px, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.order-filters .field {
    min-width: 0;
}

.order-payment-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    padding: 3px;
    border: 1px solid #d8dfe6;
    border-radius: 10px;
    background: var(--soft);
}

.order-payment-tabs button {
    min-width: 0;
    min-height: 37px;
    padding: 5px 7px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.order-payment-tabs button.on {
    background: var(--red);
    color: #fff;
}

.order-payment-tabs button:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}

.order-status-line {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    line-height: 1.45;
}

@media (max-width: 1320px) {
    .order-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payment-filter-field {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    .order-filters .field:nth-child(-n+2),
    .order-filters .field:last-child {
        grid-column: 1 / -1;
    }
}

.orders-table th:first-child,
.orders-table td:first-child {
    min-width: 190px;
}

.orders-table th:nth-child(2),
.orders-table td:nth-child(2) {
    min-width: 270px;
    width: 32%;
}

.orders-table th:last-child,
.orders-table td:last-child {
    min-width: 112px;
}

.orders-table th:nth-child(4),
.orders-table td:nth-child(4) {
    min-width: 145px;
}

.order-delivery-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 99px;
    background: #eef2f6;
    color: #445469;
    font-size: 11px;
    font-weight: 850;
    line-height: 1.3;
}

.order-delivery-status.pending {
    background: #fff4d9;
    color: #916000;
}

.order-delivery-status.delivered {
    background: #e7f7ed;
    color: #16864b;
}

.order-products {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.order-product {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
}

.order-product-qty {
    flex: none;
    color: var(--muted);
    font-weight: 800;
}

.order-product-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-product-more {
    justify-self: start;
    border: 0;
    padding: 2px 0;
    background: transparent;
    color: var(--red);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.order-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-action-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid #d7dce3;
    border-radius: 11px;
    background: #fff;
    color: var(--red);
    cursor: pointer;
}

.order-action-icon svg {
    width: 19px;
    height: 19px;
}

.order-action-icon:hover,
.order-action-icon:focus-visible {
    border-color: var(--red);
    background: #fff1f2;
    outline: none;
}

.order-action-icon.approved {
    color: #16864b;
    border-color: #b8e3cb;
    background: #f1fbf5;
}

.order-detail-button {
    display: inline-flex;
    gap: 7px;
    width: auto;
    padding: 0 14px;
    border-color: var(--red);
    background: var(--red);
    color: #fff;
    font-size: 13px;
    font-weight: 850;
}

.order-detail-button:hover,
.order-detail-button:focus-visible {
    background: #cc1426;
    border-color: #cc1426;
    color: #fff;
}

.dialog.purchase-detail-dialog {
    width: min(760px, 100%);
    overflow-wrap: anywhere;
}

.purchase-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 15px;
}

.purchase-detail-head h2 {
    margin: 0 0 7px;
}

.purchase-detail-head small,
.purchase-detail-line {
    display: block;
    margin-top: 4px;
}

.purchase-detail-status {
    margin-top: 16px;
}

.purchase-detail-status .card {
    padding: 12px;
    background: var(--soft);
}

.purchase-detail-status .card b {
    font-size: 14px;
    line-height: 1.3;
}

.purchase-detail-section {
    border-top: 1px solid var(--line);
    margin-top: 18px;
    padding-top: 16px;
}

.purchase-detail-section h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.purchase-detail-section p {
    margin: 0;
    line-height: 1.6;
}

.purchase-detail-total {
    font-size: 17px;
    font-weight: 900;
    border-bottom: 0;
}

.purchase-timeline {
    list-style: none;
    margin: 0;
    padding: 0 0 0 13px;
    border-left: 2px solid #dfe6ee;
}

.purchase-timeline li {
    position: relative;
    display: grid;
    gap: 3px;
    padding: 0 0 17px 17px;
}

.purchase-timeline li:last-child {
    padding-bottom: 0;
}

.purchase-timeline li::before {
    content: '';
    position: absolute;
    left: -19px;
    top: 3px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--red);
}

.purchase-proof-list {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    padding: 10px 0 3px;
}

.purchase-proof-list button {
    flex: 0 0 120px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 6px;
    background: var(--soft);
    text-align: left;
    color: var(--navy);
    cursor: pointer;
}

.purchase-proof-list img {
    display: block;
    width: 100%;
    height: 82px;
    object-fit: cover;
    border-radius: 7px;
}

.purchase-proof-list small,
.purchase-proof-list b {
    display: block;
    margin-top: 5px;
    font-size: 10px;
}

.purchase-proof-list b {
    color: var(--green);
}

.review-readonly-note {
    padding: 10px 13px;
    border-radius: 10px;
    background: #f1fbf5;
    color: #17603d;
}

@media (max-width: 760px) {
    .orders-table {
        display: block !important;
        min-width: 0 !important;
    }

    .orders-table thead {
        display: none;
    }

    .orders-table tbody {
        display: grid;
        gap: 14px;
    }

    .orders-table tr {
        display: block;
        padding: 8px 14px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 4px 14px rgb(24 37 54 / 4%);
    }

    .orders-table td,
    .orders-table td:first-child,
    .orders-table td:nth-child(2) {
        display: grid;
        grid-template-columns: 105px minmax(0, 1fr);
        gap: 10px;
        min-width: 0;
        width: auto;
        padding: 9px 0;
        border-bottom: 1px solid var(--line);
        overflow-wrap: anywhere;
    }

    .orders-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 11px;
        font-weight: 850;
        text-transform: uppercase;
    }

    .orders-table td:last-child {
        display: block;
        min-width: 0;
        padding-top: 13px;
        border-bottom: 0;
    }

    .orders-table td:last-child::before {
        display: none;
    }

    .orders-table tr:last-child td.empty {
        display: block;
    }

    .order-actions {
        gap: 10px;
    }

    .order-actions .order-detail-button {
        width: 100%;
        justify-content: center;
    }
}
