/* ============================================
   Analytics Beauty Report — Dark Theme
   analytics.css
   ============================================ */

/* ── Variables ── */
/* ── Variables ── */
:root {
    --ab-accent: #ec4899;
    --ab-accent-dim: rgba(236, 72, 153, 0.15);
    --ab-accent2: #8b5cf6;
    --ab-radius: 12px;
    --ab-radius-sm: 8px;
    --ab-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --ab-max-width: 1280px;
    --ab-header-h: 56px;
}

[data-theme="light"] {
    --ab-bg: #f8f9fa;
    --ab-surface: #ffffff;
    --ab-card: #ffffff;
    --ab-card-hover: #f1f3f5;
    --ab-border: #dee2e6;
    --ab-border-light: #e9ecef;
    --ab-text: #1a1a1a;
    --ab-text-secondary: #4a4a4a;
    --ab-muted: #6c757d;
}

[data-theme="dark"] {
    --ab-bg: #0a0a0a;
    --ab-surface: #111111;
    --ab-card: #171717;
    --ab-card-hover: #1e1e1e;
    --ab-border: #262626;
    --ab-border-light: #333333;
    --ab-text: #ededed;
    --ab-text-secondary: #a0a0a0;
    --ab-muted: #888888;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--ab-font);
    background: var(--ab-bg);
    color: var(--ab-text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.ab-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--ab-border);
    background: var(--ab-bg);
    opacity: 0.95;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.ab-header-inner {
    max-width: var(--ab-max-width);
    margin: 0 auto;
    padding: 0.7rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.ab-back-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    color: var(--ab-muted);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--ab-border);
    transition: all 0.2s ease;
    white-space: nowrap;
}
.ab-back-link:hover {
    color: var(--ab-text);
    border-color: var(--ab-border-light);
    background: var(--ab-surface);
}
.ab-header-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ab-text);
    flex: 1;
}

/* ── Main ── */
.ab-main {
    max-width: var(--ab-max-width);
    margin: 0 auto;
    padding: 1.5rem 1.5rem 3rem;
}

/* ── KPI Row ── */
.ab-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.ab-kpi-card {
    background: var(--ab-card);
    border: 1px solid var(--ab-border);
    border-radius: var(--ab-radius);
    padding: 1.25rem 1.25rem 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s ease;
}
.ab-kpi-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 0 0 3px 3px;
}
.ab-kpi-card--scanned::after { background: linear-gradient(90deg, #667eea, #8b5cf6); }
.ab-kpi-card--found::after   { background: linear-gradient(90deg, #ec4899, #f59e0b); }
.ab-kpi-card--rate::after    { background: linear-gradient(90deg, #22c55e, #10b981); }
.ab-kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ab-muted);
    margin-bottom: 0.4rem;
}
.ab-kpi-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.ab-kpi-card--scanned .ab-kpi-value { color: #8b5cf6; }
.ab-kpi-card--found .ab-kpi-value   { color: #ec4899; }
.ab-kpi-card--rate .ab-kpi-value    { color: #22c55e; }
.ab-kpi-sub {
    font-size: 0.7rem;
    color: var(--ab-muted);
    margin-top: 0.25rem;
}

/* ── KPI hover lift ── */
.ab-kpi-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.ab-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* ── KPI background icon ── */
.ab-kpi-icon {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    opacity: 0.12;
    pointer-events: none;
}

/* ── Segmented gender control ── */
.ab-seg-group {
    display: flex;
    background: var(--ab-surface);
    border: 1px solid var(--ab-border);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}
.ab-seg-btn {
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 0.35rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--ab-font);
    cursor: pointer;
    color: var(--ab-muted);
    transition: all 0.18s ease;
    white-space: nowrap;
}
.ab-seg-btn:hover {
    color: var(--ab-text);
    background: var(--ab-card-hover);
}
.ab-seg-btn.is-active {
    background: var(--ab-accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.35);
}

/* ── Filter loading indicator ── */
.ab-filter-loading {
    display: none;
    align-items: center;
    gap: 0.5rem;
    color: var(--ab-muted);
    font-size: 0.75rem;
    margin-top: 0.5rem;
}
.ab-filter-loading.is-active {
    display: flex;
}
.ab-filter-loading .ab-spinner {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

/* ── Warning Banner ── */
.ab-warning {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: var(--ab-radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    color: #fbbf24;
    font-size: 0.85rem;
}

