/* ============================================
   Game Analytics Dashboard (v9.4.0)
   ============================================ */

:root {
    --ga-font-serif: 'Bodoni Moda', serif;
    --ga-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ga-primary: #ffd700;
    --ga-accent: #4ecdc4;
    --ga-bg: #f5f5f5;
    --ga-card: #fff;
    --ga-text: #1a1a1a;
    --ga-muted: #666;
}

body {
    font-family: var(--ga-font-sans);
    background: var(--ga-bg);
    color: var(--ga-text);
    margin: 0;
    min-height: 100vh;
}

/* ---------- Header ---------- */
.ga-header {
    background: var(--ga-text);
    color: white;
    padding: 24px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ga-header h1 {
    font-family: var(--ga-font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.ga-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ga-back-link {
    color: #ccc;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.ga-back-link:hover {
    color: var(--ga-primary);
}

/* ---------- Toolbar ---------- */
.ga-toolbar {
    padding: 16px 40px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.ga-tabs {
    display: flex;
    gap: 4px;
}

.ga-tab {
    padding: 8px 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    background: white;
    color: var(--ga-muted);
    font-family: var(--ga-font-sans);
    transition: all 0.2s;
}

.ga-tab:hover {
    border-color: var(--ga-primary);
}

.ga-tab.active {
    background: var(--ga-text);
    color: white;
    border-color: var(--ga-text);
}

#ga-org-switcher {
    display: inline-block;
}

#ga-org-switcher select,
#ga-period {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: var(--ga-font-sans);
    background: white;
}

#ga-period {
    margin-left: auto;
}

/* ---------- Content ---------- */
.ga-content {
    padding: 30px 40px;
}

/* ---------- Metrics Grid ---------- */
.ga-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.ga-metric-card {
    background: var(--ga-card);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    text-align: center;
    transition: transform 0.15s;
}

.ga-metric-card:hover {
    transform: translateY(-2px);
}

.ga-metric-card.accent {
    background: var(--ga-text);
    color: white;
}

.ga-metric-card.accent .ga-metric-label {
    color: #ccc;
}

.ga-metric-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--ga-font-serif);
    margin-bottom: 4px;
    line-height: 1.1;
}

.ga-metric-label {
    font-size: 0.8rem;
    color: var(--ga-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---------- Charts ---------- */
.ga-charts-row {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.ga-chart-container {
    flex: 1;
    min-width: 300px;
    background: var(--ga-card);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ga-chart-container.full-width {
    flex-basis: 100%;
}

.ga-chart-container h3 {
    font-size: 1rem;
    margin: 0 0 16px 0;
    color: var(--ga-text);
}

/* ---------- Completion Stats ---------- */
.ga-stats-row {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.ga-stat {
    font-size: 0.95rem;
    color: var(--ga-muted);
}

.ga-stat strong {
    color: var(--ga-text);
    font-size: 1.1rem;
}

/* ---------- Tables ---------- */
.ga-section {
    margin-bottom: 30px;
}

.ga-section h3 {
    margin: 0 0 12px 0;
    font-size: 1rem;
}

.ga-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ga-table th,
.ga-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.ga-table th {
    background: #fafafa;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--ga-muted);
    letter-spacing: 0.5px;
}

.ga-table tbody tr:hover {
    background: #f9f9f9;
}

.ga-table tbody tr:last-child td {
    border-bottom: none;
}

/* ---------- States ---------- */
.ga-loading,
.ga-empty,
.ga-error {
    text-align: center;
    padding: 60px 20px;
    color: var(--ga-muted);
    font-size: 1rem;
}

.ga-error {
    color: #e53e3e;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {

    .ga-header,
    .ga-toolbar,
    .ga-content {
        padding-left: 20px;
        padding-right: 20px;
    }

    .ga-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ga-charts-row {
        flex-direction: column;
    }

    .ga-chart-container {
        min-width: auto;
    }

    .ga-stats-row {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .ga-metrics-grid {
        grid-template-columns: 1fr;
    }

    .ga-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}