/* ======================================================
   GLOBAL RESET
====================================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
        'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #111827;
    line-height: 1.6;
}

/* ======================================================
   CONTAINER
====================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ======================================================
   ORDERS PAGE OFFSET (PUSH DOWN)
====================================================== */
.orders-page.container {
    margin-top: 4.5rem; /* adjust if needed */
}


/* ======================================================
   TOP STATS GRID
====================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    margin-top: 2rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 1.4rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}

.stat-card span {
    font-size: 13px;
    color: #6b7280;
    display: block;
    margin-top: 0.6rem;
}

.stat-card h3 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 0.3rem;
}

/* ======================================================
   STAT ICONS
====================================================== */
.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.blue   { background: #e0f2fe; color: #0284c7; }
.green  { background: #dcfce7; color: #15803d; }
.orange { background: #ffedd5; color: #c2410c; }
.violet { background: #ede9fe; color: #6d28d9; }

.border-blue   { border-left: 4px solid #0284c7; }
.border-green  { border-left: 4px solid #16a34a; }
.border-orange { border-left: 4px solid #ea580c; }
.border-violet { border-left: 4px solid #7c3aed; }

/* ======================================================
   TABLE CARD
====================================================== */
.table-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 28px rgba(0,0,0,0.05);
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 1.2rem;
}

/* ======================================================
   RESPONSIVE TABLE WRAPPER
====================================================== */
.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto; /* 🔥 horizontal scroll instead of breaking */
}

/* ======================================================
   DATATABLE (INLINE – NO BREAKING)
====================================================== */
table.dataTable {
    width: 100% !important;
    min-width: 1050px; /* 🔥 prevents column collapse */
    border-collapse: collapse !important;
}

table.dataTable thead th {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px;
    white-space: nowrap;
}

table.dataTable tbody td {
    font-size: 14px;
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    white-space: nowrap;      /* 🔥 KEEP INLINE */
}

/* Row hover */
table.dataTable tbody tr:hover {
    background: #f9fafb;
}

/* ======================================================
   DATATABLE CONTROLS
====================================================== */
.dataTables_wrapper {
    width: 100%;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 13px;
    margin-left: 6px;
}

/* Violet focus */
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #6d28d9;
    box-shadow: 0 0 0 2px rgba(109,40,217,0.25);
    outline: none;
}

.dataTables_wrapper .dataTables_info {
    font-size: 13px;
    color: #6b7280;
    margin-top: 12px;
}

/* Pagination */
.dataTables_wrapper .dataTables_paginate {
    margin-top: 14px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 6px 12px;
    margin: 0 3px;
    border-radius: 8px;
    border: none;
    background: #f1f5f9;
    color: #111827 !important;
    font-size: 13px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #6d28d9 !important;
    color: #ffffff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #5b21b6 !important;
    color: #ffffff !important;
}

/* ======================================================
   STATUS BADGES
====================================================== */
.badge {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

/* Order status */
.badge-order.process {
    background: #ffedd5;
    color: #c2410c;
}

.badge-order.pending {
    background: #fef3c7;
    color: #92400e;
}

/* Payment status */
.badge-payment.success {
    background: #dcfce7;
    color: #166534;
}

/* 🔥 PAYMENT PENDING (NEW) */
.badge-payment.pending {
    background: #fee2e2;
    color: #991b1b;
}

/* ======================================================
   PAYMENT METHOD TEXT
====================================================== */
.payment-method-text {
    font-size: 13px;
    font-weight: 600;
    text-transform: capitalize;
    color: #374151;
}

/* ======================================================
   ACTION ICONS
====================================================== */
.actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: #e5e7eb;
    transform: scale(1.08);
}

.icon-btn.violet {
    background: #ede9fe;
    color: #6d28d9;
}

.icon-btn.violet:hover {
    background: #ddd6fe;
}

/* ======================================================
   RESPONSIVE
====================================================== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .table-card {
        padding: 1rem;
    }
}


/* ======================================================
   ORDER STATUS BADGES
====================================================== */

/* Base */
.badge-order {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

/* Pending */
.badge-order.pending {
    background: #fef3c7;   /* light amber */
    color: #92400e;        /* amber text */
}

/* Process */
.badge-order.process {
    background: #ffedd5;   /* soft orange */
    color: #c2410c;        /* orange text */
}

/* In Progress */
.badge-order.in-progress {
    background: #e0f2fe;   /* soft blue */
    color: #0369a1;        /* blue text */
}

/* Completed */
.badge-order.completed {
    background: #dcfce7;   /* soft green */
    color: #166534;        /* green text */
}


/* ===============================================
   PROFESSIONAL STATUS BADGES
=============================================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4px;
}

/* ORDER STATUS */
.order-completed {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.order-processing {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.order-pending {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.order-unknown {
    background: rgba(107, 114, 128, 0.12);
    color: #4b5563;
    border: 1px solid rgba(107, 114, 128, 0.35);
}

/* PAYMENT STATUS */
.payment-paid {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.payment-pending {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.payment-failed {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.payment-unknown {
    background: rgba(107, 114, 128, 0.12);
    color: #4b5563;
    border: 1px solid rgba(107, 114, 128, 0.35);
}
