/* Dashboard container foundation */
.wooc-modern-orders-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 24px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

/* Grid columns proportions definition */
.wooc-modern-orders-thead,
.wooc-modern-orders-card {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr 1.8fr 2.5fr 2.2fr;
    align-items: center;
    padding: 16px 24px;
}

/* Desktop Header style */
.wooc-modern-orders-thead {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.wooc-modern-orders-th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #4b5563;
    letter-spacing: 0.05em;
}

.wooc-modern-orders-th.th-order-actions {
    text-align: right;
}

/* Individual Data Row / Cards styling */
.wooc-modern-orders-card {
    background: #ffffff;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s ease;
}

.wooc-modern-orders-card:last-child {
    border-bottom: none;
}

.wooc-modern-orders-card:hover {
    background: #f9fafb;
}

/* Elements formatting */
.order-id-link {
    font-weight: 700;
    color: #2563eb !important;
    text-decoration: none !important;
}

.order-date-text {
    color: #4b5563;
    font-size: 0.9rem;
}

.total-amount-display {
    font-weight: 600;
    color: #111827;
    display: block;
}

.total-items-badge {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Color Coded Status Badges */
.status-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-slug-completed {
    background-color: #ecfdf5;
    color: #065f46;
}

.status-slug-processing {
    background-color: #eff6ff;
    color: #1e40af;
}

.status-slug-pending {
    background-color: #fffbeb;
    color: #92400e;
}

.status-slug-on-hold {
    background-color: #f3f4f6;
    color: #374151;
}

.status-slug-cancelled,
.status-slug-failed {
    background-color: #fef2f2;
    color: #991b1b;
}

/* Buttons layout architecture */
.order-actions-flex-wrapper {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.modern-action-btn {
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none !important;
    text-align: center;
    transition: all 0.2s ease;
}

/* View Button customization */
.modern-action-btn.action-view {
    background: #ffffff;
    color: #374151 !important;
    border: 1px solid #d1d5db;
}

.modern-action-btn.action-view:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* Pay/Reorder Custom Action Overrides */
.modern-action-btn:not(.action-view) {
    background: #2563eb;
    color: #ffffff !important;
}

.modern-action-btn:not(.action-view):hover {
    background: #1d4ed8;
}

/* Pagination Adjustments */
.modern-pagination-container {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
}

/* --- Mobile Responsiveness Breakpoint --- */
@media (max-width: 768px) {
    .wooc-modern-orders-thead {
        display: none;
        /* Hide header indicators on smartphones */
    }

    .wooc-modern-orders-dashboard {
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .wooc-modern-orders-card {
        grid-template-columns: 1fr;
        /* Transform from horizontal grid row to stacked card element */
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        margin-bottom: 16px;
        padding: 16px;
        gap: 12px;
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    }

    .wooc-modern-orders-cell {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
    }

    /* Dynamically inject labels from data attributes */
    .wooc-modern-orders-cell::before {
        content: attr(data-title);
        font-weight: 600;
        font-size: 0.8rem;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.025em;
    }

    .wooc-modern-orders-cell.cell-order-actions {
        border-top: 1px dashed #e5e7eb;
        padding-top: 12px;
        margin-top: 4px;
        display: block;
    }

    .wooc-modern-orders-cell.cell-order-actions::before {
        display: none;
        /* Strip standard action label text on mobile */
    }

    .order-actions-flex-wrapper {
        justify-content: stretch;
    }

    .modern-action-btn {
        flex: 1;
    }

    .total-amount-display {
        display: inline-block;
    }
}