/* Orders Dashboard Styles */

:root {
    --z2u-blue: #00A0DF;
    --z2u-grey: #2c3e50;
    --success-green: #10b981;
    --warning-orange: #f59e0b;
    --danger-red: #ef4444;
    --pending-blue: #3b82f6;
}

.dashboard-main {
    min-height: 100vh;
    background: #f8f9fa;
    padding: 200px 20px 40px;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.header-content h1 {
    font-size: 32px;
    color: var(--z2u-grey);
    margin: 0 0 5px 0;
}

.subtitle {
    color: #6b7280;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-refresh,
.btn-export {
    padding: 10px 20px;
    border: 2px solid var(--z2u-blue);
    background: white;
    color: var(--z2u-blue);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-refresh:hover,
.btn-export:hover {
    background: var(--z2u-blue);
    color: white;
}

.refresh-icon {
    font-size: 18px;
    display: inline-block;
    transition: transform 0.3s;
}

.btn-refresh:hover .refresh-icon {
    transform: rotate(180deg);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 40px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--z2u-blue) 0%, #0088b8 100%);
    border-radius: 12px;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--z2u-grey);
}

/* Filters */
.filters-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-weight: 600;
    font-size: 14px;
    color: var(--z2u-grey);
}

.filter-group input,
.filter-group select {
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--z2u-blue);
}

/* Table */
.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: linear-gradient(135deg, var(--z2u-blue) 0%, #0088b8 100%);
    color: white;
}

.orders-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.orders-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s;
}

.orders-table tbody tr:hover {
    background: #f9fafb;
}

.orders-table td {
    padding: 15px;
    font-size: 14px;
    color: var(--z2u-grey);
}

.loading {
    text-align: center;
    padding: 40px !important;
    color: #6b7280;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-pending {
    background: #dbeafe;
    color: var(--pending-blue);
}

.status-processed {
    background: #fef3c7;
    color: var(--warning-orange);
}

.status-completed {
    background: #d1fae5;
    color: var(--success-green);
}

.status-on-hold {
    background: #fee2e2;
    color: var(--danger-red);
}

.status-recurring {
    background: #e0e7ff;
    color: #6366f1;
}

.payment-succeeded {
    background: #d1fae5;
    color: var(--success-green);
}

.payment-subscription {
    background: #e0e7ff;
    color: #6366f1;
}

/* Action Buttons */
.btn-view {
    padding: 6px 12px;
    background: var(--z2u-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-view:hover {
    background: #0088b8;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    color: var(--z2u-grey);
    margin-bottom: 10px;
}

.empty-state p {
    color: #6b7280;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    color: var(--z2u-grey);
}

.modal-close {
    background: none;
    border: none;
    font-size: 30px;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    color: var(--z2u-grey);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-primary,
.btn-secondary {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--z2u-blue);
    color: white;
}

.btn-primary:hover {
    background: #0088b8;
}

.btn-secondary {
    background: #e5e7eb;
    color: var(--z2u-grey);
}

.btn-secondary:hover {
    background: #d1d5db;
}

/* Order Details */
.detail-section {
    margin-bottom: 25px;
}

.detail-section h3 {
    font-size: 18px;
    color: var(--z2u-grey);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--z2u-blue);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
}

.detail-value {
    font-size: 14px;
    color: var(--z2u-grey);
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters-section {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .orders-table {
        font-size: 12px;
    }

    .orders-table th,
    .orders-table td {
        padding: 10px 8px;
    }

    /* Stack table for mobile */
    .orders-table thead {
        display: none;
    }

    .orders-table tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 15px;
    }

    .orders-table td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border: none;
    }

    .orders-table td:before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
    }
}

