/* Orders Page Styles */

/* Stats Cards */
.order-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--admin-text);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: var(--admin-text-light);
    margin-bottom: 8px;
}

.stat-change {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.positive {
    color: #28a745;
}

.stat-change.negative {
    color: #dc3545;
}

.stat-change.neutral {
    color: #6c757d;
}

/* Filters */
.order-filters {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

.filter-row {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-row .search-box {
    flex: 1;
    min-width: 300px;
}

.filter-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.filter-select {
    padding: 10px 16px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: white;
    font-size: 14px;
    color: var(--admin-text);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:hover {
    border-color: var(--admin-primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.1);
}

/* Orders Table */
.orders-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table thead {
    background: var(--admin-bg-light);
    border-bottom: 1px solid var(--admin-border);
}

.orders-table th {
    padding: 16px 20px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--admin-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.orders-table tbody tr {
    border-bottom: 1px solid var(--admin-border);
    transition: background 0.2s ease;
}

.orders-table tbody tr:hover {
    background: var(--admin-bg-light);
}

.orders-table tbody tr:last-child {
    border-bottom: none;
}

.orders-table td {
    padding: 20px;
    font-size: 14px;
    color: var(--admin-text);
}

.checkbox-column {
    width: 40px;
}

.order-number {
    font-weight: 600;
    color: var(--admin-primary);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.order-number:hover {
    opacity: 0.8;
}

.customer-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.customer-name {
    font-weight: 500;
    color: var(--admin-text);
}

.customer-email {
    font-size: 13px;
    color: var(--admin-text-light);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.status-badge.pending {
    background: rgba(255, 193, 7, 0.1);
    color: #f39c12;
}

.status-badge.processing {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

.status-badge.shipped {
    background: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
}

.status-badge.delivered {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.status-badge.cancelled {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

.status-badge.refunded {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Payment Status Badges */
.payment-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.payment-badge.paid {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.payment-badge.pending {
    background: rgba(255, 193, 7, 0.1);
    color: #f39c12;
}

.payment-badge.failed {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.payment-badge.refunded {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

/* Order Actions */
.order-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    background: none;
    border: 1px solid var(--admin-border);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--admin-text);
}

.btn-action:hover {
    border-color: var(--admin-primary);
    color: var(--admin-primary);
}

/* Table Footer */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 0 0 12px 12px;
    margin-top: -1px;
    border-top: 1px solid var(--admin-border);
}

.showing-info {
    font-size: 14px;
    color: var(--admin-text-light);
}

/* Loading State */
.loading-cell {
    text-align: center;
    padding: 60px 20px !important;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--admin-text-light);
}

.loading-state i {
    font-size: 48px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--admin-text-light);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--admin-text);
    margin: 0 0 8px 0;
}

.empty-state p {
    margin: 0 0 24px 0;
    font-size: 16px;
}

/* Order Detail Link */
.order-detail-btn {
    color: var(--admin-primary);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.order-detail-btn:hover {
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 1200px) {
    .order-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .order-stats {
        grid-template-columns: 1fr;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-row .search-box {
        min-width: auto;
    }
    
    .filter-group {
        flex-wrap: wrap;
    }
    
    .orders-table-container {
        overflow-x: auto;
    }
    
    .orders-table {
        min-width: 800px;
    }
    
    .table-footer {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }
}

/* Order Details Page */
.order-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.order-detail-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.order-detail-title h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--admin-text);
    margin: 0;
}

.order-detail-actions {
    display: flex;
    gap: 12px;
}

/* Order Info Cards */
.order-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--admin-border);
}

.info-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--admin-bg-light);
    color: var(--admin-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.info-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--admin-text);
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.info-label {
    font-size: 14px;
    color: var(--admin-text-light);
}

.info-value {
    font-size: 14px;
    color: var(--admin-text);
    font-weight: 500;
}

/* Order Items Table */
.order-items-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.order-items-header {
    padding: 24px;
    border-bottom: 1px solid var(--admin-border);
}

.order-items-table {
    width: 100%;
    border-collapse: collapse;
}

.order-items-table th {
    background: var(--admin-bg-light);
    padding: 16px 20px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--admin-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-items-table td {
    padding: 20px;
    border-bottom: 1px solid var(--admin-border);
}

.order-items-table tbody tr:last-child td {
    border-bottom: none;
}

.product-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.product-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--admin-bg-light);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-details {
    flex: 1;
}

.product-name {
    font-weight: 500;
    color: var(--admin-text);
    margin-bottom: 4px;
}

.product-sku {
    font-size: 13px;
    color: var(--admin-text-light);
}

/* Order Summary */
.order-summary {
    padding: 24px;
    background: var(--admin-bg-light);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
}

.summary-row.total {
    font-size: 18px;
    font-weight: 700;
    color: var(--admin-text);
    padding-top: 12px;
    border-top: 2px solid var(--admin-border);
}