
.orders-page {
    width: 100%;
}

/* ========================================================
   HEADER
======================================================== */

.orders-header {
    margin-bottom: 28px;
}

.orders-header h1 {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 700;
    color: #243b2a;
}

.orders-header p {
    margin: 0;
    color: #6f7d72;
    font-size: 14px;
}

/* ========================================================
   STATISTICS
======================================================== */

.order-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.order-stat {
    background: #ffffff;
    border: 1px solid #e4ebe5;
    border-radius: 12px;
    padding: 18px;
}

.order-stat-label {
    color: #718076;
    font-size: 12px;
    margin-bottom: 8px;
}

.order-stat-value {
    color: #243b2a;
    font-size: 25px;
    font-weight: 700;
}

/* ========================================================
   MAIN CARD
======================================================== */

.orders-card {
    background: #ffffff;
    border: 1px solid #e4ebe5;
    border-radius: 14px;
    overflow: hidden;
}

.orders-card-header {
    padding: 20px 22px;
    border-bottom: 1px solid #e8eee9;
}

.orders-card-header h2 {
    margin: 0;
    color: #243b2a;
    font-size: 18px;
    font-weight: 700;
}

.orders-card-header p {
    margin: 4px 0 0;
    color: #7b877d;
    font-size: 13px;
}

/* ========================================================
   FILTERS
======================================================== */

.status-filters {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    padding: 16px 22px;
    border-bottom: 1px solid #edf1ed;
    background: #fbfcfb;
}

.status-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 7px;
    text-decoration: none;
    color: #536157;
    background: #ffffff;
    border: 1px solid #dfe7e1;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s;
}

.status-filter span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 20px;
    background: #edf2ee;
    color: #536157;
    font-size: 10px;
}

.status-filter:hover {
    border-color: #9db0a0;
    color: #243b2a;
}

.status-filter.active {
    background: #3f6044;
    border-color: #3f6044;
    color: #ffffff;
}

.status-filter.active span {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

/* ========================================================
   ORDER LIST
======================================================== */

.orders-list {
    padding: 18px 20px;
}

.order-item {
    display: block;
    margin-bottom: 12px;
    border: 1px solid #e2e9e3;
    border-radius: 11px;
    overflow: hidden;
    background: #ffffff;
}

.order-item:last-child {
    margin-bottom: 0;
}

/* ========================================================
   COLLAPSIBLE ORDER HEADER
======================================================== */

.order-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    background: #f8faf8;
    cursor: pointer;
    list-style: none;
    transition: background 0.2s;
}

.order-item-header::-webkit-details-marker {
    display: none;
}

.order-item-header::marker {
    content: "";
}

.order-item-header:hover {
    background: #f0f5f1;
}

.order-item[open] > .order-item-header {
    border-bottom: 1px solid #e2e9e3;
    background: #f3f7f3;
}

.order-summary-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.order-number {
    color: #3f6044;
    font-size: 15px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.order-summary-customer {
    color: #243b2a;
    font-size: 13px;
    font-weight: 600;
}

.order-date {
    color: #7b877d;
    font-size: 11px;
}

.order-summary-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 9px;
}

.order-summary-total {
    color: #243b2a;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.order-payment-status {
    color: #68756b;
    font-size: 11px;
    white-space: nowrap;
}

.order-expand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: #eaf0eb;
    color: #3f6044;
    font-size: 12px;
    transition: transform 0.2s, background 0.2s;
}

.order-item[open] .order-expand-icon {
    transform: rotate(180deg);
    background: #3f6044;
    color: #ffffff;
}

/* ========================================================
   ORDER STATUS
======================================================== */

.order-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.status-pending {
    background: #fff7df;
    color: #8a6b13;
}

.status-processing {
    background: #eaf1f7;
    color: #42647a;
}

.status-completed {
    background: #eaf5ec;
    color: #357044;
}

.status-cancelled {
    background: #f8eaea;
    color: #a33a3a;
}

/* ========================================================
   EXPANDED ORDER BODY
======================================================== */

.order-body {
    padding: 22px;
    animation: orderReveal 0.2s ease;
}

@keyframes orderReveal {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.order-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 22px;
    margin-bottom: 24px;
}

.order-section {
    min-width: 0;
}

.order-section-title {
    margin-bottom: 10px;
    color: #68756b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.customer-name {
    color: #243b2a;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 5px;
}

.order-detail-line {
    color: #68736b;
    font-size: 13px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

/* ========================================================
   PRODUCTS
======================================================== */

.order-products {
    border: 1px solid #e6ece7;
    border-radius: 9px;
    overflow: hidden;
    margin-bottom: 20px;
}

.order-products-header,
.order-product-row {
    display: grid;
    grid-template-columns: 2fr 0.8fr 0.8fr 1fr;
    gap: 12px;
    align-items: center;
}

.order-products-header {
    padding: 10px 14px;
    background: #f8faf8;
    color: #748076;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.order-products-header > div:last-child {
    text-align: right;
}

.order-product-row {
    padding: 13px 14px;
    border-top: 1px solid #edf1ed;
    color: #39463d;
    font-size: 13px;
}

.order-product-name {
    color: #243b2a;
    font-weight: 600;
}

.order-product-mass {
    color: #7a857c;
    font-size: 12px;
}

.order-product-price,
.order-product-total {
    text-align: right;
    white-space: nowrap;
}

.order-product-total {
    color: #243b2a;
    font-weight: 700;
}

/* ========================================================
   TOTALS
======================================================== */

.order-totals {
    width: 320px;
    max-width: 100%;
    margin-left: auto;
    margin-bottom: 24px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 7px 0;
    color: #68736b;
    font-size: 13px;
}

.total-row.grand-total {
    margin-top: 7px;
    padding-top: 13px;
    border-top: 1px solid #dfe6e0;
    color: #243b2a;
    font-size: 16px;
    font-weight: 700;
}

/* ========================================================
   PAYMENT / DELIVERY
======================================================== */

.order-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 24px;
}

.info-box {
    min-width: 0;
    padding: 16px;
    background: #f8faf8;
    border: 1px solid #e5ebe6;
    border-radius: 9px;
}

.info-box-title {
    margin-bottom: 10px;
    color: #68756b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 5px 0;
    font-size: 13px;
}

.info-label {
    color: #7b877d;
    flex-shrink: 0;
}

.info-value {
    color: #243b2a;
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

.payment-paid {
    color: #357044;
}

.payment-pending {
    color: #8a6b13;
}

.payment-failed {
    color: #a33a3a;
}

/* ========================================================
   DELIVERY ADDRESS
======================================================== */

.delivery-address {
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #e2e9e3;
    border-radius: 7px;
    color: #536157;
    font-size: 13px;
    line-height: 1.6;
}

/* ========================================================
   STATUS UPDATE
======================================================== */

.order-update {
    padding-top: 20px;
    border-top: 1px solid #e5ebe6;
}

.order-update-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.status-field {
    flex: 1;
    max-width: 300px;
}

.status-field label {
    display: block;
    margin-bottom: 6px;
    color: #59665c;
    font-size: 12px;
    font-weight: 600;
}

.status-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d6dfd8;
    border-radius: 7px;
    background: #ffffff;
    color: #39463d;
    font-size: 13px;
    outline: none;
}

.status-field select:focus {
    border-color: #6f8b6c;
}

.update-button {
    padding: 10px 16px;
    border: none;
    border-radius: 7px;
    background: #3f6044;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.update-button:hover {
    background: #2f4b35;
}

/* ========================================================
   NOTES
======================================================== */

.order-notes {
    margin-top: 18px;
    margin-bottom: 20px;
    padding: 13px 15px;
    background: #fffaf0;
    border: 1px solid #eee3c5;
    border-radius: 8px;
}

.order-notes-title {
    margin-bottom: 5px;
    color: #7d651d;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.order-notes-text {
    color: #6e654b;
    font-size: 13px;
    line-height: 1.6;
}

/* ========================================================
   PAGINATION
======================================================== */

.orders-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 17px 20px;
    border-top: 1px solid #edf1ed;
    background: #fbfcfb;
}

.pagination-info {
    color: #748076;
    font-size: 12px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination-button,
.pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #dfe7e1;
    border-radius: 7px;
    background: #ffffff;
    color: #536157;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: 0.2s;
}

.pagination-button {
    gap: 7px;
}

.pagination-button:hover,
.pagination-page:hover {
    border-color: #9db0a0;
    color: #243b2a;
}

.pagination-page.active {
    background: #3f6044;
    border-color: #3f6044;
    color: #ffffff;
}

/* ========================================================
   EMPTY STATE
======================================================== */

.empty-orders {
    padding: 70px 25px;
    text-align: center;
}

.empty-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #eef5ef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3f6044;
    font-size: 23px;
}

.empty-orders h3 {
    margin: 0 0 8px;
    color: #243b2a;
    font-size: 18px;
}

.empty-orders p {
    margin: 0;
    color: #7b877d;
    font-size: 14px;
}

/* ========================================================
   RESPONSIVE
======================================================== */

@media (max-width: 1100px) {

    .order-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .order-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 750px) {

    .order-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .order-grid {
        grid-template-columns: 1fr;
    }

    .order-info-grid {
        grid-template-columns: 1fr;
    }

    .order-item-header {
        align-items: flex-start;
        gap: 10px;
    }

    .order-summary-main {
        flex: 1;
    }

    .order-summary-meta {
        align-items: flex-end;
        flex-direction: column;
        gap: 6px;
    }

    .order-update-form {
        align-items: stretch;
        flex-direction: column;
    }

    .status-field {
        max-width: none;
    }

    .orders-pagination {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 500px) {

    .order-stats {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }

    .order-stat {
        padding: 13px;
    }

    .order-stat-value {
        font-size: 21px;
    }

    .orders-list {
        padding: 10px;
    }

    .order-item-header {
        padding: 13px 11px;
    }

    .order-body {
        padding: 14px;
    }

    .orders-header h1 {
        font-size: 24px;
    }

    .status-filters {
        padding: 12px;
    }

    .order-products-header,
    .order-product-row {
        grid-template-columns: 1.5fr 0.65fr 0.9fr 0.9fr;
        gap: 6px;
        padding-left: 8px;
        padding-right: 8px;
        font-size: 10px;
    }

    .order-product-row {
        font-size: 11px;
    }

    .order-summary-customer {
        font-size: 12px;
    }

    .order-summary-total {
        font-size: 12px;
    }

    .order-status {
        font-size: 10px;
        padding: 5px 8px;
    }

    .pagination-controls {
        gap: 4px;
    }

    .pagination-button,
    .pagination-page {
        min-width: 30px;
        height: 32px;
        padding: 0 7px;
    }
}


.orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.create-phone-order-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 18px;
    background: #700f2d;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.create-phone-order-button:hover {
    background: #48091d;
    color: #ffffff;
}

@media (max-width: 600px) {
    .create-phone-order-button {
        width: 100%;
    }
}