/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.chart-card {
    background: var(--panel-bg, white);
    border: 1px solid var(--panel-border, transparent);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.chart-card.full-width {
    grid-column: span 2;
}

.chart-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--panel-border, var(--gray-100));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
}

.chart-body {
    padding: 20px;
}

.chart-container {
    position: relative;
    height: 280px;
}

.chart-container.tall {
    height: 350px;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.data-table th {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--gray-50);
}

.data-table td {
    font-size: 13px;
    color: var(--gray-700);
}

.data-table tr:hover td {
    background: var(--gray-50);
}

/* Dashboard Sections */
.dashboard-section {
    margin-bottom: 32px;
}

.dashboard-section:last-child {
    margin-bottom: 0;
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--gray-200);
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    letter-spacing: -0.01em;
}

.section-title i {
    font-size: 15px;
    color: var(--primary);
    width: 20px;
    text-align: center;
}

.section-subtitle {
    font-size: 12px;
    color: var(--gray-400);
    font-weight: 400;
    padding-left: 30px;
}

/* Chart Hint (inline subtitle inside chart-header) */
.chart-hint {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 400;
    white-space: nowrap;
}

/* Tab Icons */
.tab i {
    margin-right: 5px;
    font-size: 12px;
    opacity: 0.7;
}

.tab.active i {
    opacity: 1;
    color: var(--primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .chart-card.full-width {
        grid-column: span 1;
    }
}

/* ── Medium screens: stack header actions into two rows ───────────── */
@media (max-width: 1200px) {
    .header-actions {
        gap: 6px;
    }
    .header-actions .last-updated-indicator {
        order: 10; /* push to end */
    }
}

@media (max-width: 768px) {
    .analytics-header {
        padding: 10px 12px 0;
    }
    .header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .header-title {
        justify-content: space-between;
    }
    .header-actions {
        justify-content: flex-start;
        gap: 6px;
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    .date-range-group {
        flex-direction: column;
        align-items: stretch;
    }
    .analytics-content {
        padding: 16px;
    }
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .section-subtitle {
        padding-left: 0;
    }
    .chart-hint {
        display: none;
    }
    .dashboard-section {
        margin-bottom: 24px;
    }
    .analytics-header .nav-switcher-pill {
        width: 100%;
    }
    .analytics-header .nav-switcher-pill .shared-project-selector-btn,
    .analytics-header .nav-switcher-pill .app-switcher-btn {
        flex: 1;
        justify-content: center;
    }
}
