/* Dashboard Styles */
.wc-dashboard {
    direction: rtl;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.wc-dashboard h1 {
    margin-bottom: 20px;
    color: #333;
}

/* Message styles */
.message {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: none;
}

.success-message {
    background-color: #ecf8f0;
    color: #46b450;
    border: 1px solid #bfe5c7;
}

.error-message {
    background-color: #fcf0f0;
    color: #dc3232;
    border: 1px solid #f1c0c0;
}

/* Header and filters */
.dashboard-header {
    margin-bottom: 20px;
}

.date-filter {
    display: flex;
    gap: 10px;
    align-items: center;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.date-filter input[type="date"] {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.date-filter button {
    padding: 10px 15px;
    background: #2271b1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

.date-filter button:hover {
    background: #135e96;
}

.consultant-filter {
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.consultant-filter select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
    min-width: 200px;
    font-size: 14px;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #2271b1;
    margin: 10px 0;
}

/* Chart containers */
.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Orders table */
.orders-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table-responsive {
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.orders-table th,
.orders-table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid #eee;
}

.orders-table th {
    background: #f1f5f9;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.orders-table tr:last-child td {
    border-bottom: none;
}

.orders-table tr:hover td {
    background-color: #f8f9fa;
}

/* Loading indicators */
.loading {
    display: inline-block;
    opacity: 0.7;
    animation: pulse 1.2s infinite;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-text {
    font-size: 16px;
    color: #333;
}

/* Consultant selector in table */
.select-consultant {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    width: 120px;
}

.consultant-cell {
    display: flex;
    align-items: center;
    gap: 5px;
}

.saving-indicator {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top: 2px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    display: none;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    gap: 5px;
    flex-wrap: wrap;
}

.pagination-button {
    padding: 8px 12px;
    background: #f1f5f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.pagination-button:hover:not(:disabled) {
    background: #e2e8f0;
}

.pagination-button.active {
    background: #2271b1;
    color: white;
    border-color: #2271b1;
}

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 8px 12px;
    font-size: 14px;
}

/* Animations */
@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .date-filter {
            flex-direction: column;
            align-items: flex-start;
        }

        .orders-table th,
        .orders-table td {
            padding: 10px;
            font-size: 14px;
        }

        .pagination {
            flex-wrap: wrap;
        }
    }