﻿/* ================= ROOT ================= */
.orderhistory {
    padding: 20px;
    background: #f6f7f9;
    min-height: 100vh;
}

/* ================= HEADER ================= */
.orderhistory-header {
    margin-bottom: 15px;
}

    .orderhistory-header h2 {
        margin: 0;
        font-size: 22px;
    }

.orderhistory-subtitle {
    font-size: 13px;
    color: #777;
}

/* ================= TABLE ================= */
.orders-table {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    min-width: 500px;
}

.orders-header,
.orders-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr 1.5fr;
    padding: 10px;
    gap: 10px;
    align-items: center;
}

.orders-header {
    background: #efefef;
    font-weight: 600;
    font-size: 13px;
}

.orders-row {
    border-top: 1px solid #eee;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

    .orders-row:hover {
        background-color: #f0f6ff;
        box-shadow: inset 4px 0 0 #007bff;
    }

/* ================= LOADING / EMPTY ================= */
.orders-loading,
.orders-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: #999;
    font-size: 14px;
}

.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #eee;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ================= DISPATCH BADGE ================= */
.dispatch-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
}

    .dispatch-badge.dining {
        background: #cce5ff;
        color: #004085;
    }

    .dispatch-badge.takeaway {
        background: #d4edda;
        color: #155724;
    }

/* ================= MODAL ================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-sheet {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    animation: fadeSlide 0.2s ease-out;
    overflow: hidden;
}

@keyframes fadeSlide {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 18px 14px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-billno {
    font-size: 16px;
    font-weight: 700;
    color: #111;
}

.modal-meta {
    font-size: 12px;
    color: #888;
    margin-top: 3px;
}

.modal-close {
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 12px;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .modal-close:hover {
        background: #eee;
    }

.modal-body {
    padding: 16px 18px 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
}

    .modal-row.grand {
        font-weight: 700;
        font-size: 15px;
        color: #111;
    }

.modal-label {
    color: #888;
    font-size: 13px;
}

.modal-value {
    font-weight: 500;
    color: #111;
    text-align: right;
    max-width: 60%;
}

.modal-divider {
    border-top: 1px dashed #eee;
    margin: 10px 0;
}

.modal-section-title {
    font-size: 11px;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 8px;
}

/* ================= MODAL ITEMS ================= */
.modal-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px dashed #f5f5f5;
    font-size: 13px;
    gap: 8px;
}

    .modal-item:last-child {
        border-bottom: none;
    }

.modal-item-name {
    flex: 1;
    color: #222;
}

.modal-item-cust {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.modal-item-qty {
    color: #777;
    white-space: nowrap;
}

.modal-item-price {
    font-weight: 600;
    color: #111;
    white-space: nowrap;
}

/* ================= STATUS PILL ================= */
.status-pill {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-block;
}

    .status-pill.completed {
        background: #d1ecf1;
        color: #0c5460;
    }

    .status-pill.cancelled {
        background: #fdecea;
        color: #d32f2f;
    }

/* ================= UTIL ================= */
.d-none {
    display: none !important;
}

/* ================= PRINT BILL BUTTON ================= */
.btn-print-bill {
    width: 100%;
    padding: 10px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

    .btn-print-bill:hover {
        background: #333;
    }
