/* ═══════════════════════════════════════════════════════════════════════
   Analytics Dashboard — Copyway Theme (Gold / Black / Paper)
   ═══════════════════════════════════════════════════════════════════════ */

:root {
    --analytics-bg-body: #e8e6e0;
    --analytics-bg-card: #f5f5f0;
    --analytics-bg-card-accent: #0d0d0d;
    --analytics-gold: #d4a017;
    --analytics-gold-light: #f0c040;
    --analytics-black: #0d0d0d;
    --analytics-white: #f5f5f0;
    --analytics-paper: #e8e6e0;
    --analytics-paper-dark: #c8c4bc;
    --analytics-gray: #8a8a8a;
    --analytics-red: #c92a2a;
    --analytics-text-main: #0d0d0d;
    --analytics-text-muted: #8a8a8a;
    --analytics-text-light: #c8c4bc;
    --analytics-border: #c8c4bc;
    --analytics-font: 'Cairo', sans-serif;
}

.analytics-page {
    font-family: var(--analytics-font);
    background-color: var(--analytics-bg-body);
    color: var(--analytics-text-main);
    min-height: 100vh;
    direction: rtl;
}

/* ─── Header ──────────────────────────────────────────────────────── */
.analytics-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 15px 30px;
    background-color: var(--analytics-black);
    border-bottom: 3px solid var(--analytics-gold);
}

.analytics-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.analytics-btn-share {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--analytics-gold);
    border: 2px solid var(--analytics-gold);
    padding: 8px 16px;
    border-radius: 20px;
    font-family: var(--analytics-font);
    font-weight: 700;
    cursor: pointer;
    color: var(--analytics-black);
    text-decoration: none;
    font-size: 14px;
    box-shadow: 4px 4px 0px var(--analytics-black);
    transition: all 0.2s ease;
}

.analytics-btn-share:hover {
    background-color: var(--analytics-gold-light);
    border-color: var(--analytics-gold-light);
    transform: translate(1px, 1px);
    box-shadow: 3px 3px 0px var(--analytics-black);
}

/* ─── Date Filter ─────────────────────────────────────────────────── */
.analytics-date-filter {
    display: flex;
    justify-content: flex-end;
    padding: 20px 30px 0;
}

.analytics-filter-form {
    display: inline;
}

.analytics-select-styled {
    padding: 8px 16px;
    border: 2px solid var(--analytics-black);
    border-radius: 6px;
    background-color: var(--analytics-bg-card);
    font-family: var(--analytics-font);
    color: var(--analytics-text-main);
    outline: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 3px 3px 0px var(--analytics-black);
    transition: all 0.2s ease;
}

.analytics-select-styled:hover {
    border-color: var(--analytics-gold);
}

/* ─── Container ───────────────────────────────────────────────────── */
.analytics-container {
    padding: 20px 30px 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ─── Stats Grid ──────────────────────────────────────────────────── */
.analytics-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.analytics-stat-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.analytics-stat-card {
    background-color: var(--analytics-black);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 110px;
    border: 2px solid var(--analytics-black);
    box-shadow: 4px 4px 0px var(--analytics-gold);
}

.analytics-stat-card--white {
    background-color: var(--analytics-bg-card);
    border: 2px solid var(--analytics-black);
    box-shadow: 4px 4px 0px var(--analytics-black);
}

.analytics-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--analytics-gold);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
}

.analytics-stat-card--white .analytics-stat-header {
    color: var(--analytics-text-muted);
}

.analytics-stat-header i {
    color: var(--analytics-gold);
    font-size: 16px;
}

.analytics-stat-card--white .analytics-stat-header i {
    color: var(--analytics-black);
}

.analytics-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--analytics-white);
    text-align: left;
}

.analytics-stat-card--white .analytics-stat-value {
    color: var(--analytics-black);
}

.analytics-stat-currency {
    font-size: 12px;
    color: var(--analytics-gray);
    margin-top: 5px;
    text-align: left;
}

.analytics-stat-card--white .analytics-stat-currency {
    color: var(--analytics-text-muted);
}

/* ─── Cards ───────────────────────────────────────────────────────── */
.analytics-card {
    background-color: var(--analytics-bg-card);
    border-radius: 8px;
    padding: 24px;
    width: 100%;
    border: 2px solid var(--analytics-black);
    box-shadow: 4px 4px 0px var(--analytics-black);
}

.analytics-card-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--analytics-black);
}

.analytics-card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.analytics-period-label {
    font-size: 12px;
    color: var(--analytics-text-muted);
    font-weight: 600;
}

/* ─── Empty State ─────────────────────────────────────────────────── */
.analytics-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: var(--analytics-text-muted);
    font-weight: 700;
    font-size: 15px;
}

.analytics-css-illustration {
    width: 80px;
    height: 80px;
    margin-top: 15px;
    position: relative;
    background-color: var(--analytics-paper);
    border-radius: 10px;
    border: 2px dashed var(--analytics-paper-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--analytics-paper-dark);
}

/* ─── Table ───────────────────────────────────────────────────────── */
.analytics-table-wrap {
    overflow-x: auto;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.analytics-table th {
    text-align: right;
    padding: 12px;
    border-bottom: 2px solid var(--analytics-black);
    color: var(--analytics-black);
    font-weight: 700;
    font-size: 13px;
    background-color: var(--analytics-paper);
}

.analytics-table td {
    padding: 12px;
    border-bottom: 1px solid var(--analytics-paper-dark);
}

.analytics-table tbody tr:hover {
    background-color: var(--analytics-paper);
}

/* ─── Status Badge ────────────────────────────────────────────────── */
.analytics-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid;
}

.analytics-status--pending {
    background-color: #fef3c7;
    color: #92400e;
    border-color: #fbbf24;
}

.analytics-status--processing {
    background-color: #dbeafe;
    color: #1e40af;
    border-color: #60a5fa;
}

.analytics-status--cancelled {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #f87171;
}

/* ─── Charts ──────────────────────────────────────────────────────── */
.analytics-chart-area {
    height: 250px;
    margin-bottom: 15px;
    position: relative;
}

.analytics-x-axis {
    display: flex;
    justify-content: space-between;
    color: var(--analytics-text-muted);
    font-size: 11px;
    padding-top: 10px;
    overflow-x: auto;
}

.analytics-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    font-size: 12px;
    color: var(--analytics-text-muted);
    font-weight: 600;
}

.analytics-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.analytics-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid var(--analytics-black);
}

.analytics-dot--grey { background-color: var(--analytics-paper-dark); }
.analytics-dot--blue { background-color: var(--analytics-gold); }
.analytics-dot--dark { background-color: var(--analytics-black); }

/* ─── Grid 2 Columns ──────────────────────────────────────────────── */
.analytics-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ─── Top Lists ───────────────────────────────────────────────────── */
.analytics-top-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.analytics-top-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--analytics-paper-dark);
    font-size: 14px;
}

.analytics-top-item:last-child {
    border-bottom: none;
}

.analytics-top-name {
    color: var(--analytics-black);
    font-weight: 600;
}

.analytics-top-count {
    color: var(--analytics-gold);
    font-weight: 800;
    background-color: var(--analytics-black);
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 13px;
}

/* ─── Footer ──────────────────────────────────────────────────────── */
.analytics-footer {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--analytics-white);
    font-size: 13px;
    background-color: var(--analytics-black);
    border-top: 3px solid var(--analytics-gold);
    margin-top: 20px;
}

/* ─── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .analytics-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .analytics-stats-grid {
        grid-template-columns: 1fr;
    }

    .analytics-grid-2 {
        grid-template-columns: 1fr;
    }

    .analytics-header {
        padding: 15px;
    }

    .analytics-container {
        padding: 0 15px 20px;
    }

    .analytics-date-filter {
        padding: 15px 15px 0;
    }

    .analytics-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .analytics-x-axis {
        flex-wrap: wrap;
        gap: 5px;
    }

    .analytics-stat-card,
    .analytics-card {
        box-shadow: 3px 3px 0px var(--analytics-black);
    }
}
