:root {
    --bg: #f5f7fb;
    --bg-warm: #fbfcff;
    --surface: #ffffff;
    --surface-soft: #f9fbff;
    --surface-muted: #f4f7fb;
    --line: #e5e7eb;
    --line-soft: #edf2f7;
    --text: #0f172a;
    --text-soft: #475569;
    --text-muted: #6b7280;
    --primary: #3b82f6;
    --primary-deep: #2563eb;
    --mint: #10b981;
    --lilac: #8b5cf6;
    --rose: #f43f5e;
    --shadow-xs: 0 8px 24px rgba(15, 23, 42, 0.035);
    --shadow-sm: 0 18px 50px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 24px 64px rgba(59, 130, 246, 0.09);
    --radius-hero: 40px;
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top center, rgba(59, 130, 246, 0.10), transparent 24%),
        radial-gradient(circle at 0% 18%, rgba(139, 92, 246, 0.05), transparent 22%),
        linear-gradient(180deg, #fcfdff 0%, var(--bg-warm) 28%, var(--bg) 100%);
    font-family: "Inter", sans-serif;
}

h1, h2, h3, h4, h5 {
    margin: 0;
    font-family: "Plus Jakarta Sans", sans-serif;
    letter-spacing: -0.045em;
}

p {
    margin: 0;
    line-height: 1.7;
}

button,
select,
input,
textarea {
    font: inherit;
}

.dashboard-shell {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.ambient {
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(80px);
    opacity: .75;
}

.ambient-one {
    top: -120px;
    left: -80px;
    width: 320px;
    height: 320px;
    background: rgba(59, 130, 246, 0.12);
}

.ambient-two {
    top: 220px;
    right: -100px;
    width: 360px;
    height: 360px;
    background: rgba(16, 185, 129, 0.08);
}

main.container-fluid {
    position: relative;
    z-index: 2;
    max-width: 1200px;
}

.hero-panel {
    position: relative;
    overflow: hidden;
    display: block;
    padding: 4.75rem 2.4rem 3rem;
    border: 1px solid rgba(255, 255, 255, 0.92);
    border-radius: var(--radius-hero);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 252, 255, 0.98)),
        linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(16, 185, 129, 0.03));
    box-shadow: var(--shadow-md);
    text-align: center;
}

.hero-panel::before,
.hero-panel::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.hero-panel::before {
    top: -90px;
    left: -50px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.10), transparent 70%);
}

.hero-panel::after {
    right: -60px;
    bottom: -110px;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08), transparent 70%);
}

.hero-copy {
    position: relative;
    max-width: 820px;
    margin: 0 auto;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .55rem .9rem;
    border: 1px solid #dbe7fb;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
    color: var(--primary-deep);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em;
}

.eyebrow-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--mint));
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.09);
}

.hero-copy h1 {
    max-width: 840px;
    margin: 1.4rem auto 1rem;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: .98;
    color: var(--text);
}

.hero-copy h1::first-line {
    color: var(--text);
}

#dashboardTitle {
    background: linear-gradient(180deg, #101828 0%, #1f3d7a 72%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-copy p {
    max-width: 620px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 1.03rem;
}

.hero-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.45rem;
}

.soft-badge,
.panel-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .6rem .95rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
}

.soft-badge {
    color: var(--primary-deep);
    background: #eef4ff;
    border: 1px solid #dbe7fb;
}

.soft-badge.alt,
.panel-chip,
.panel-chip.subtle,
.panel-chip.accent {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--line-soft);
}

.hero-controls {
    position: relative;
    max-width: 520px;
    margin: 2rem auto 0;
    display: grid;
    gap: .95rem;
}

.control-card,
.panel-card,
.kpi-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(229, 231, 235, 0.82);
    box-shadow: var(--shadow-xs);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.control-card {
    padding: .95rem;
    border-radius: 999px;
}

.form-label {
    display: block;
    margin-bottom: .4rem;
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .16em;
}

.form-select {
    min-height: 54px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    box-shadow: none;
}

.form-select:focus {
    border-color: transparent;
    box-shadow: none;
}

.hero-actions {
    display: flex;
    justify-content: center;
}

.btn {
    min-height: 50px;
    padding: .85rem 1.35rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: -.01em;
    transition: transform .22s ease, box-shadow .22s ease, background .22s ease, border-color .22s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-premium {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-deep));
    box-shadow: 0 14px 30px rgba(59, 130, 246, 0.20);
}

.btn-premium:hover {
    box-shadow: 0 18px 34px rgba(59, 130, 246, 0.24);
}

.btn-light-premium {
    background: #fff;
    color: var(--text);
    border-color: var(--line);
}

.section-toolbar {
    margin-top: 1.35rem;
}

.view-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .65rem;
}

.view-tab {
    padding: .72rem 1rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-muted);
    font-weight: 600;
    font-size: .92rem;
    transition: all .2s ease;
}

.view-tab.active,
.view-tab:hover {
    color: var(--primary-deep);
    background: #eef4ff;
    border-color: #d9e6fe;
}

.section-block {
    margin-top: 5.75rem;
}

.section-head,
.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
}

.section-head {
    margin-bottom: 1.5rem;
    text-align: center;
    flex-direction: column;
    align-items: center;
}

.section-head h2,
.panel-head h3 {
    margin-top: .3rem;
    font-size: clamp(1.5rem, 2.6vw, 2.2rem);
    font-weight: 700;
    line-height: 1.08;
}

.section-head p,
.panel-head p {
    max-width: 650px;
    color: var(--text-muted);
}

.section-tag {
    display: inline-block;
    color: var(--primary-deep);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.panel-card {
    position: relative;
    height: 100%;
    padding: 1.55rem;
    border-radius: var(--radius-xl);
}

.panel-head {
    margin-bottom: 1.25rem;
}

.panel-head.compact {
    margin-bottom: 1rem;
}

.kpi-card {
    position: relative;
    height: 100%;
    min-height: 210px;
    padding: 1.3rem;
    border-radius: 26px;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.kpi-card:hover,
.panel-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
    border-color: #dce7f7;
}

.kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.12), rgba(16, 185, 129, 0.18), rgba(139, 92, 246, 0.12));
}

.kpi-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: var(--primary-deep);
    background: linear-gradient(180deg, #f4f8ff, #eef5ff);
    font-size: .96rem;
}

.kpi-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
}

.kpi-title {
    color: var(--text-muted);
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em;
}

.kpi-value {
    margin-top: .55rem;
    font-size: clamp(1.75rem, 2.8vw, 2.45rem);
    font-weight: 700;
    letter-spacing: -.04em;
}

.kpi-subtext {
    margin-top: .55rem;
    color: var(--text-soft);
    font-size: .93rem;
}

.delta-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .68rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
}

.delta-badge.up {
    color: var(--mint);
    background: rgba(16, 185, 129, 0.10);
}

.delta-badge.down {
    color: var(--rose);
    background: rgba(244, 63, 94, 0.09);
}

.delta-badge.flat {
    color: var(--text-muted);
    background: #f3f4f6;
}

.chart-card,
.narrative-card,
.insight-card {
    background: rgba(255, 255, 255, 0.92);
}

.chart-wrap {
    min-height: 340px;
}

.demographic-chart {
    min-height: 380px;
}

.apexcharts-tooltip {
    border-radius: 16px !important;
    box-shadow: var(--shadow-sm) !important;
    border: 1px solid var(--line-soft) !important;
}

.context-summary {
    margin: .4rem 0 1.1rem;
    color: var(--text-soft);
    font-size: .98rem;
}

.highlight-insight {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    margin-top: 1.25rem;
    padding: 1rem 1.1rem;
    border-radius: 20px;
    background: linear-gradient(180deg, #f8fbff, #f4f8ff);
    border: 1px solid #e2eafa;
}

.highlight-insight span {
    color: var(--primary-deep);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.highlight-insight strong {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.75;
}

.insight-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: .95rem;
}

.insight-list li {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    color: var(--text);
    line-height: 1.7;
}

.insight-list li i {
    margin-top: .28rem;
    color: var(--lilac);
    font-size: .82rem;
}

.premium-table {
    margin-top: 1rem;
    border: 1px solid var(--line-soft);
    border-radius: 24px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 252, 255, 0.94));
}

.table {
    margin: 0;
}

.table > :not(caption) > * > * {
    padding: 1rem 1.1rem;
    border-color: #eef2f7;
    vertical-align: middle;
}

.table thead th {
    background: #fafcff;
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    border-bottom: 1px solid var(--line-soft);
}

.table tbody tr {
    background: rgba(255, 255, 255, 0.9);
    transition: background .2s ease, transform .2s ease;
}

.table tbody tr:hover {
    background: #f9fbff;
}

.keyword-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-right: .85rem;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--primary-deep);
    font-size: .76rem;
    font-weight: 700;
}

.table-metric {
    font-weight: 700;
    color: var(--text);
}

.note-box {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin-top: 1rem;
    padding: .95rem 1rem;
    border-radius: 18px;
    background: #fafcff;
    border: 1px solid var(--line-soft);
    color: var(--text-muted);
    font-size: .9rem;
}

.loader-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(245, 247, 251, 0.68);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: all .22s ease;
    z-index: 1100;
}

.loader-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loader-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    min-width: 260px;
    padding: 1.4rem;
    border-radius: 26px;
    background: #fff;
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-md);
}

.loader-ring {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 3px solid #e6eeff;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

.loader-card strong {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 700;
}

.loader-card small {
    color: var(--text-muted);
}

.hidden-section {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 991.98px) {
    .hero-panel {
        padding: 3.4rem 1.4rem 2.3rem;
        border-radius: 30px;
    }

    .panel-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-block {
        margin-top: 4rem;
    }
}

@media (max-width: 767.98px) {
    main.container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .hero-copy h1 {
        font-size: 2.65rem;
    }

    .hero-panel {
        padding: 2.9rem 1.1rem 2rem;
    }

    .hero-controls {
        max-width: 100%;
    }

    .section-block {
        margin-top: 3rem;
    }

    .section-head h2,
    .panel-head h3 {
        font-size: 1.5rem;
    }

    .chart-wrap,
    .demographic-chart {
        min-height: 280px;
    }

    .table > :not(caption) > * > * {
        padding: .9rem .82rem;
    }
}

@media print {
    body {
        background: #fff;
    }

    .ambient,
    .section-toolbar,
    .loader-overlay {
        display: none !important;
    }

    .hero-panel,
    .panel-card,
    .kpi-card {
        box-shadow: none;
        border: 1px solid #dce3ef;
    }
}
