/* ══════════════════════════════════════════════════════════════════════════════
   Data Manager Platform — McKinsey-Inspired Design System
   Typography: Georgia (serif heading), Arial/system sans (body)
   Palette: Deep navy, electric blue, white, warm gray, gold accent
   ══════════════════════════════════════════════════════════════════════════════ */

:root {
    /* McKinsey-inspired palette */
    --navy-900: #051C2C;
    --navy-800: #0A2540;
    --navy-700: #0F3557;
    --navy-600: #164068;
    --blue-500: #005EB8;
    --blue-400: #1A73E8;
    --blue-300: #4A90D9;
    --blue-200: #7AB3EF;
    --blue-100: #E8F0FE;
    --teal-500: #00A5A8;
    --teal-400: #26C6C9;
    --gold-500: #C99700;
    --gold-400: #F3C13A;
    --green-500: #0D7C4A;
    --green-400: #27AE60;
    --red-500: #C53030;
    --red-400: #E74C3C;
    --orange-500: #D35400;
    --gray-50: #FAFBFC;
    --gray-100: #F4F5F7;
    --gray-200: #E8EAED;
    --gray-300: #D2D5DA;
    --gray-400: #A2AAAD;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --white: #FFFFFF;

    /* Semantic */
    --bg-primary: var(--gray-50);
    --bg-card: var(--white);
    --bg-dark: var(--navy-900);
    --text-primary: var(--navy-900);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-400);
    --text-on-dark: var(--white);
    --accent: var(--blue-500);
    --accent-hover: var(--blue-400);
    --border: var(--gray-200);
    --shadow-sm: 0 1px 3px rgba(5, 28, 44, 0.06);
    --shadow-md: 0 4px 12px rgba(5, 28, 44, 0.08);
    --shadow-lg: 0 8px 30px rgba(5, 28, 44, 0.12);
    --shadow-xl: 0 20px 60px rgba(5, 28, 44, 0.15);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ───────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--navy-900);
    margin-top: 0;
}

h1 { font-size: 2.5rem; letter-spacing: -0.02em; }
h2 { font-size: 1.875rem; letter-spacing: -0.015em; }
h3 { font-size: 1.375rem; letter-spacing: -0.01em; }
h4 { font-size: 1.125rem; }

p { color: var(--text-secondary); margin-bottom: 1rem; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}
a:hover { color: var(--accent-hover); }

/* ── Navbar ─────────────────────────────────────────────────────────────── */

.dm-navbar {
    background: var(--navy-900);
    padding: 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 1050;
}

.dm-navbar .navbar-brand {
    font-family: Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white) !important;
    letter-spacing: 0.02em;
    padding: 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dm-navbar .navbar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--blue-500), var(--teal-500));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.dm-navbar .nav-link {
    color: rgba(255,255,255,0.7) !important;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.875rem 1rem !important;
    transition: var(--transition);
    position: relative;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.dm-navbar .nav-link:hover,
.dm-navbar .nav-link.active {
    color: var(--white) !important;
}

.dm-navbar .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--blue-400);
}

/* ── Hero Section ───────────────────────────────────────────────────────── */

.hero-section {
    background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 50%, var(--blue-500) 100%);
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(0, 94, 184, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(74, 144, 217, 0.3), transparent);
}

.hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

.hero-title {
    font-family: Georgia, serif;
    font-size: 3.25rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1.25rem;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: rgba(255,255,255,0.75);
    max-width: 600px;
    line-height: 1.7;
    font-weight: 400;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    color: var(--blue-200);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.hero-badge .pulse {
    width: 8px;
    height: 8px;
    background: var(--green-400);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.5); }
}

/* ── KPI Cards ──────────────────────────────────────────────────────────── */

.kpi-strip {
    margin-top: -2.5rem;
    position: relative;
    z-index: 10;
    margin-bottom: 3rem;
}

.kpi-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    height: 100%;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.kpi-card .kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.kpi-card .kpi-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.kpi-card .kpi-value {
    font-family: Georgia, serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--navy-900);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.kpi-card .kpi-delta {
    font-size: 0.75rem;
    font-weight: 600;
}

.kpi-delta.positive { color: var(--green-500); }
.kpi-delta.negative { color: var(--red-500); }

/* ── Use Case Cards (Home) ──────────────────────────────────────────────── */

.section-header {
    margin-bottom: 2.5rem;
}

.section-header .section-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--blue-500);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-header h2 {
    margin-bottom: 0.5rem;
}

.section-header .section-desc {
    color: var(--text-secondary);
    max-width: 640px;
    font-size: 0.9375rem;
}

.uc-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    text-decoration: none !important;
}

.uc-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--blue-300);
}

.uc-card .uc-header {
    padding: 1.5rem 1.5rem 1rem;
    position: relative;
}

.uc-card .uc-number {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-family: Georgia, serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-100);
    line-height: 1;
}

.uc-card .uc-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    margin-bottom: 1rem;
}

.uc-card .uc-title {
    font-family: Georgia, serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--navy-900);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.uc-card .uc-body {
    padding: 0 1.5rem 1.5rem;
    flex: 1;
}

.uc-card .uc-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.uc-card .uc-benefit {
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--gold-500);
}

.uc-card .uc-benefit-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gold-500);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.uc-card .uc-benefit-text {
    font-size: 0.8125rem;
    color: var(--navy-900);
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.uc-card .uc-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.uc-card .uc-stakeholders {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.uc-card .uc-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--blue-100);
    color: var(--blue-500);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.uc-card:hover .uc-arrow {
    background: var(--blue-500);
    color: var(--white);
}

/* ── Use Case Detail Page ───────────────────────────────────────────────── */

.uc-detail-hero {
    background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
    padding: 3rem 0 2.5rem;
    position: relative;
}

.uc-detail-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(74, 144, 217, 0.3), transparent);
}

.uc-detail-hero .breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 1rem;
}

.uc-detail-hero .breadcrumb-item a {
    color: rgba(255,255,255,0.5);
    font-size: 0.8125rem;
}

.uc-detail-hero .breadcrumb-item.active {
    color: rgba(255,255,255,0.8);
    font-size: 0.8125rem;
}

.uc-detail-hero .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255,255,255,0.3);
}

.uc-detail-hero h1 {
    color: var(--white);
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
}

.uc-detail-hero p {
    color: rgba(255,255,255,0.7);
    max-width: 700px;
    font-size: 1rem;
}

.uc-detail-body {
    padding: 2.5rem 0 4rem;
}

/* ── Metric Panels ──────────────────────────────────────────────────────── */

.metric-panel {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    height: 100%;
    transition: var(--transition);
}

.metric-panel:hover {
    box-shadow: var(--shadow-md);
}

.metric-panel .metric-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.metric-panel .metric-value {
    font-family: Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy-900);
    line-height: 1;
}

.metric-panel .metric-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ── Chart Cards ────────────────────────────────────────────────────────── */

.chart-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.chart-card:hover {
    box-shadow: var(--shadow-md);
}

.chart-card .chart-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chart-card .chart-title {
    font-family: Georgia, serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy-900);
    margin: 0;
}

.chart-card .chart-body {
    padding: 1.5rem;
}

/* ── Data Table ─────────────────────────────────────────────────────────── */

.dm-table-wrapper {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.dm-table-wrapper .table-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.dm-table-wrapper .table-title {
    font-family: Georgia, serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy-900);
    margin: 0;
}

.dm-table {
    width: 100%;
    font-size: 0.8125rem;
    margin: 0;
}

.dm-table thead th {
    background: var(--gray-50);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.dm-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
    color: var(--text-primary);
}

.dm-table tbody tr:hover {
    background: var(--blue-100);
}

.dm-table tbody tr:last-child td {
    border-bottom: none;
}

/* ── Status Badges ──────────────────────────────────────────────────────── */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 50px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.resolved, .status-badge.completed, .status-badge.cleared, .status-badge.approved {
    background: rgba(13, 124, 74, 0.08);
    color: var(--green-500);
}
.status-badge.resolved::before, .status-badge.completed::before, .status-badge.cleared::before, .status-badge.approved::before {
    background: var(--green-500);
}

.status-badge.detected, .status-badge.pending, .status-badge.open, .status-badge.review {
    background: rgba(243, 193, 58, 0.12);
    color: var(--gold-500);
}
.status-badge.detected::before, .status-badge.pending::before, .status-badge.open::before, .status-badge.review::before {
    background: var(--gold-500);
}

.status-badge.investigating, .status-badge.under_review, .status-badge.filed {
    background: rgba(0, 94, 184, 0.08);
    color: var(--blue-500);
}
.status-badge.investigating::before, .status-badge.under_review::before, .status-badge.filed::before {
    background: var(--blue-500);
}

.status-badge.escalated, .status-badge.failed, .status-badge.flagged, .status-badge.blocked, .status-badge.declined {
    background: rgba(197, 48, 48, 0.08);
    color: var(--red-500);
}
.status-badge.escalated::before, .status-badge.failed::before, .status-badge.flagged::before, .status-badge.blocked::before, .status-badge.declined::before {
    background: var(--red-500);
}

/* ── Risk Level Badges ──────────────────────────────────────────────────── */

.risk-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.risk-badge.low { background: #dcfce7; color: #166534; }
.risk-badge.medium { background: #fef3c7; color: #92400e; }
.risk-badge.high { background: #fee2e2; color: #991b1b; }
.risk-badge.critical { background: #991b1b; color: #fff; }

/* ── Progress Bar ───────────────────────────────────────────────────────── */

.dm-progress {
    height: 6px;
    border-radius: 3px;
    background: var(--gray-200);
    overflow: hidden;
}

.dm-progress .dm-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn-dm {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    border: none;
    transition: var(--transition);
    letter-spacing: 0.01em;
}

.btn-dm-primary {
    background: var(--blue-500);
    color: var(--white);
}
.btn-dm-primary:hover {
    background: var(--blue-400);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 94, 184, 0.3);
}

.btn-dm-outline {
    background: transparent;
    color: var(--blue-500);
    border: 1px solid var(--blue-500);
}
.btn-dm-outline:hover {
    background: var(--blue-500);
    color: var(--white);
}

/* ── Info Box ───────────────────────────────────────────────────────────── */

.info-box {
    background: var(--blue-100);
    border-left: 4px solid var(--blue-500);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.info-box h5 {
    font-family: Georgia, serif;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--navy-900);
    margin-bottom: 0.5rem;
}

.info-box p, .info-box li {
    font-size: 0.8125rem;
    color: var(--navy-700);
    margin-bottom: 0.25rem;
}

/* ── How It Works ───────────────────────────────────────────────────────── */

.hiw-step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    align-items: flex-start;
}

.hiw-step .step-num {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: var(--navy-900);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Georgia, serif;
    font-size: 0.8125rem;
    font-weight: 700;
}

.hiw-step .step-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-top: 0.25rem;
}

/* ── Timeline ───────────────────────────────────────────────────────────── */

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--blue-500);
    border: 2px solid var(--white);
    box-shadow: 0 0 0 2px var(--blue-200);
}

.timeline-item .tl-time {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.timeline-item .tl-event {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--navy-900);
}

.timeline-item .tl-detail {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.dm-footer {
    background: var(--navy-900);
    color: rgba(255,255,255,0.5);
    padding: 2rem 0;
    font-size: 0.8125rem;
    margin-top: 3rem;
}

.dm-footer a {
    color: rgba(255,255,255,0.7);
}

.dm-footer a:hover {
    color: var(--white);
}

/* ── Animations ─────────────────────────────────────────────────────────── */

.fade-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.6s ease forwards;
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.fade-up:nth-child(2) { animation-delay: 0.1s; }
.fade-up:nth-child(3) { animation-delay: 0.2s; }
.fade-up:nth-child(4) { animation-delay: 0.3s; }
.fade-up:nth-child(5) { animation-delay: 0.4s; }
.fade-up:nth-child(6) { animation-delay: 0.5s; }

/* ── Loading Spinner ────────────────────────────────────────────────────── */

.dm-spinner {
    display: flex;
    justify-content: center;
    padding: 3rem;
}

.dm-spinner::after {
    content: '';
    width: 36px;
    height: 36px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--blue-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* counter animation */
.counter-animated {
    transition: all 0.5s ease;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .hero-title { font-size: 2rem; }
    .hero-section { padding: 3rem 0 2.5rem; }
    .kpi-strip { margin-top: -1.5rem; }
    .kpi-card .kpi-value { font-size: 1.375rem; }
}

/* ── Scrollbar ──────────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ── Filter Chips ───────────────────────────────────────────────────────── */

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.filter-chip:hover, .filter-chip.active {
    border-color: var(--blue-500);
    color: var(--blue-500);
    background: var(--blue-100);
}

/* ── Donut center text ──────────────────────────────────────────────────── */
.chart-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

/* ══════════════════════════════════════════════════════════════════════════════
   WORLD-CLASS ENHANCEMENTS
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Live Transaction Ticker ──────────────────────────────────────────────── */

.live-ticker-wrapper {
    background: var(--navy-900);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
}

.live-ticker-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
}

.live-ticker-header .live-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
    box-shadow: 0 0 8px rgba(34,197,94,0.5);
}

.live-ticker-header span {
    color: rgba(255,255,255,0.7);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.live-ticker-body {
    max-height: 220px;
    overflow: hidden;
    position: relative;
}

.live-ticker-body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, var(--navy-900));
    pointer-events: none;
}

.ticker-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    animation: tickerSlideIn 0.4s ease;
    font-size: 0.75rem;
}

@keyframes tickerSlideIn {
    from { opacity: 0; transform: translateY(-100%); }
    to { opacity: 1; transform: translateY(0); }
}

.ticker-row .ticker-time {
    color: rgba(255,255,255,0.35);
    font-size: 0.625rem;
    min-width: 45px;
    font-variant-numeric: tabular-nums;
}

.ticker-row .ticker-source {
    min-width: 70px;
    font-weight: 600;
}

.ticker-row .ticker-source.gcash { color: #3b82f6; }
.ticker-row .ticker-source.instapay { color: #22c55e; }
.ticker-row .ticker-source.bancnet { color: #f59e0b; }
.ticker-row .ticker-source.pesnet { color: #a78bfa; }
.ticker-row .ticker-source.other { color: rgba(255,255,255,0.5); }

.ticker-row .ticker-type {
    color: rgba(255,255,255,0.5);
    min-width: 80px;
}

.ticker-row .ticker-amount {
    color: #fff;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-left: auto;
    min-width: 90px;
    text-align: right;
}

.ticker-row .ticker-status {
    min-width: 16px;
}

.ticker-row .ticker-status .dot-ok { color: #22c55e; }
.ticker-row .ticker-status .dot-flag { color: #f59e0b; }
.ticker-row .ticker-status .dot-fail { color: #ef4444; }

/* ── Sparkline in KPI Cards ───────────────────────────────────────────────── */

.kpi-card .kpi-spark {
    height: 32px;
    margin-top: 0.5rem;
    opacity: 0.6;
}

/* ── Globe/GCash Stats Banner ─────────────────────────────────────────────── */

.stats-banner {
    background: linear-gradient(135deg, #051C2C 0%, #0A2540 50%, #005EB8 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.stats-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 50%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(0,165,168,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.stats-banner .stat-item {
    text-align: center;
    position: relative;
    z-index: 1;
}

.stats-banner .stat-number {
    font-family: Georgia, serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.stats-banner .stat-label {
    font-size: 0.6875rem;
    color: rgba(255,255,255,0.55);
    margin-top: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

.stats-banner .stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    align-self: center;
}

/* ── Enhanced Hero with Globe Stats ───────────────────────────────────────── */

.hero-stats-row {
    display: flex;
    gap: 2.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: left;
}

.hero-stat .hero-stat-value {
    font-family: Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.hero-stat .hero-stat-label {
    font-size: 0.6875rem;
    color: rgba(255,255,255,0.45);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Platform TOTF Enhanced Hero ──────────────────────────────────────────── */

.platform-hero {
    background: linear-gradient(135deg, #051C2C 0%, #0F3557 40%, #005EB8 100%);
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.platform-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(0,165,168,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0,94,184,0.2) 0%, transparent 50%);
    pointer-events: none;
}

.platform-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
}

.totf-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0,165,168,0.15);
    border: 1px solid rgba(0,165,168,0.25);
    padding: 0.35rem 1rem;
    border-radius: 50px;
    color: var(--teal-400);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

/* ── Command Center Layout ────────────────────────────────────────────────── */

.command-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .command-grid { grid-template-columns: 1fr; }
}

/* ── Glassmorphism overlay cards ──────────────────────────────────────────── */

.glass-card {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

/* ── Enhanced metric panel with trend indicator ───────────────────────────── */

.metric-panel .metric-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    margin-top: 0.5rem;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
}

.metric-panel .metric-trend.up {
    background: rgba(13,124,74,0.08);
    color: var(--green-500);
}

.metric-panel .metric-trend.down {
    background: rgba(197,48,48,0.08);
    color: var(--red-500);
}

/* ── Animated gradient border ─────────────────────────────────────────────── */

.gradient-border {
    position: relative;
    border: none !important;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, var(--blue-500), var(--teal-500), var(--gold-500));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* ── Data flow animation ──────────────────────────────────────────────────── */

.flow-pulse {
    animation: flowPulse 2s ease-in-out infinite;
}

@keyframes flowPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ── Benchmark comparison bar ─────────────────────────────────────────────── */

.benchmark-bar {
    position: relative;
    height: 8px;
    border-radius: 4px;
    background: var(--gray-200);
    overflow: visible;
    margin-top: 0.5rem;
}

.benchmark-bar .bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1.5s ease;
}

.benchmark-bar .bar-marker {
    position: absolute;
    top: -4px;
    width: 2px;
    height: 16px;
    background: var(--navy-900);
    border-radius: 1px;
}

.benchmark-bar .bar-marker-label {
    position: absolute;
    top: -18px;
    transform: translateX(-50%);
    font-size: 0.5625rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ── Real-world context callout ───────────────────────────────────────────── */

.context-callout {
    background: linear-gradient(135deg, rgba(0,165,168,0.04), rgba(0,94,184,0.04));
    border: 1px solid rgba(0,165,168,0.12);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.context-callout .callout-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: rgba(0,165,168,0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--teal-500);
    font-size: 1.125rem;
}

.context-callout .callout-title {
    font-family: Georgia, serif;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--navy-900);
    margin-bottom: 0.25rem;
}

.context-callout .callout-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* ── Impact metric with benchmark ─────────────────────────────────────────── */

.impact-metric {
    text-align: center;
    padding: 1.25rem;
}

.impact-metric .impact-value {
    font-family: Georgia, serif;
    font-size: 2.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--blue-500), var(--teal-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.impact-metric .impact-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 0.375rem;
}

.impact-metric .impact-benchmark {
    font-size: 0.625rem;
    color: var(--green-500);
    margin-top: 0.25rem;
}

/* ── Notification dot on nav ──────────────────────────────────────────────── */

.nav-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
    margin-left: 4px;
    animation: pulse 2s infinite;
}

/* ══════════════════════════════════════════════════════════════════════════════
   AI CHAT WIDGET & ANALYSIS PANELS
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Floating Chat Toggle ────────────────────────────────────────────────── */

.ai-chat-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #051C2C, #005EB8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9998;
    box-shadow: 0 4px 20px rgba(0,94,184,0.35), 0 0 0 0 rgba(0,94,184,0.4);
    transition: all 0.3s ease;
    color: #fff;
    font-size: 1.5rem;
    animation: aiPulse 3s ease-in-out infinite;
}

.ai-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(0,94,184,0.5);
}

.ai-chat-toggle .ai-chat-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--teal-500);
    color: #fff;
    font-size: 0.5rem;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 50px;
    letter-spacing: 0.05em;
}

@keyframes aiPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(0,94,184,0.35), 0 0 0 0 rgba(0,94,184,0.4); }
    50% { box-shadow: 0 4px 20px rgba(0,94,184,0.35), 0 0 0 12px rgba(0,94,184,0); }
}

/* ── Chat Panel ──────────────────────────────────────────────────────────── */

.ai-chat-panel {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 420px;
    max-height: 600px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(5,28,44,0.25), 0 0 0 1px rgba(0,0,0,0.05);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideUp 0.35s ease;
}

.ai-chat-panel.open {
    display: flex;
}

@keyframes chatSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, #051C2C, #0A3055);
    color: #fff;
}

.ai-status-dot {
    width: 7px;
    height: 7px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.ai-header-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: rgba(255,255,255,0.7);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8125rem;
}

.ai-header-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* ── Chat Messages ───────────────────────────────────────────────────────── */

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    max-height: 380px;
    min-height: 200px;
    background: #f8f9fa;
}

.ai-msg {
    display: flex;
    gap: 0.625rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.ai-msg-avatar {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.ai-msg-bot .ai-msg-avatar {
    background: linear-gradient(135deg, #051C2C, #005EB8);
    color: #fff;
}

.ai-msg-user .ai-msg-avatar {
    background: var(--teal-500);
    color: #fff;
}

.ai-msg-user {
    flex-direction: row-reverse;
}

.ai-msg-content {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.8125rem;
    line-height: 1.6;
}

.ai-msg-bot .ai-msg-content {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    color: var(--navy-900);
    border-top-left-radius: 4px;
}

.ai-msg-user .ai-msg-content {
    background: linear-gradient(135deg, #051C2C, #0A3055);
    color: #fff;
    border-top-right-radius: 4px;
}

.ai-msg-content p { margin-bottom: 0.5rem; }
.ai-msg-content p:last-child { margin-bottom: 0; }
.ai-msg-content ul, .ai-msg-content ol { margin-bottom: 0.5rem; padding-left: 1.25rem; }
.ai-msg-content li { margin-bottom: 0.25rem; }
.ai-msg-content strong { color: var(--blue-500); }
.ai-msg-user .ai-msg-content strong { color: #8ecdf7; }
.ai-msg-content code {
    background: rgba(0,94,184,0.08);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.75rem;
}
.ai-msg-content h1, .ai-msg-content h2, .ai-msg-content h3,
.ai-msg-content h4, .ai-msg-content h5, .ai-msg-content h6 {
    font-family: Georgia, serif;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--navy-900);
}
.ai-msg-content h3 { font-size: 0.8125rem; }

/* ── Typing Indicator ────────────────────────────────────────────────────── */

.ai-typing {
    display: flex;
    gap: 4px;
    padding: 0.75rem 1rem;
    align-items: center;
}

.ai-typing .dot {
    width: 6px;
    height: 6px;
    background: var(--blue-500);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.ai-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.ai-typing .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ── Chat Input ──────────────────────────────────────────────────────────── */

.ai-chat-input-area {
    border-top: 1px solid rgba(0,0,0,0.06);
    background: #fff;
}

.ai-quick-actions {
    display: flex;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem 0;
    flex-wrap: wrap;
}

.ai-quick-btn {
    background: rgba(0,94,184,0.06);
    border: 1px solid rgba(0,94,184,0.12);
    color: var(--blue-500);
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ai-quick-btn:hover {
    background: var(--blue-500);
    color: #fff;
}

.ai-chat-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
}

.ai-chat-input {
    flex: 1;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: Arial, sans-serif;
}

.ai-chat-input:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(0,94,184,0.08);
}

.ai-send-btn {
    background: linear-gradient(135deg, #051C2C, #005EB8);
    border: none;
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.ai-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 12px rgba(0,94,184,0.3);
}

/* ── AI Analysis Panel (Use Case Pages) ──────────────────────────────────── */

.ai-analysis-panel {
    background: linear-gradient(135deg, rgba(5,28,44,0.02), rgba(0,94,184,0.03));
    border: 1px solid rgba(0,94,184,0.1);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.ai-analysis-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #051C2C, #0A3055);
    color: #fff;
}

.ai-analysis-header h5 {
    font-family: Georgia, serif;
    font-size: 0.9375rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-analysis-header .ai-tag {
    background: rgba(0,165,168,0.2);
    border: 1px solid rgba(0,165,168,0.3);
    color: var(--teal-400);
    font-size: 0.5625rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.ai-analysis-body {
    padding: 1.5rem;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--navy-800);
    min-height: 100px;
}

.ai-analysis-body h1, .ai-analysis-body h2, .ai-analysis-body h3,
.ai-analysis-body h4, .ai-analysis-body h5, .ai-analysis-body h6 {
    font-family: Georgia, serif;
    color: var(--navy-900);
    margin-top: 1.25rem;
    margin-bottom: 0.625rem;
}

.ai-analysis-body h2 { font-size: 1.0625rem; border-bottom: 1px solid rgba(0,0,0,0.06); padding-bottom: 0.375rem; }
.ai-analysis-body h3 { font-size: 0.9375rem; }
.ai-analysis-body h4 { font-size: 0.875rem; }

.ai-analysis-body ul, .ai-analysis-body ol { padding-left: 1.25rem; margin-bottom: 0.75rem; }
.ai-analysis-body li { margin-bottom: 0.375rem; }

.ai-analysis-body strong { color: var(--blue-500); }

.ai-analysis-body code {
    background: rgba(0,94,184,0.06);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.ai-analysis-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.75rem;
}

.ai-analysis-body table th,
.ai-analysis-body table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(0,0,0,0.08);
    text-align: left;
}

.ai-analysis-body table th {
    background: rgba(5,28,44,0.04);
    font-weight: 700;
    color: var(--navy-900);
}

.ai-analysis-body blockquote {
    border-left: 3px solid var(--blue-500);
    background: rgba(0,94,184,0.04);
    padding: 0.75rem 1rem;
    margin: 0.75rem 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.ai-refresh-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
    padding: 0.35rem 0.875rem;
    border-radius: 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.ai-refresh-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.ai-loading-skeleton {
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

.ai-loading-skeleton .skeleton-line {
    height: 12px;
    border-radius: 4px;
    background: rgba(0,94,184,0.08);
    margin-bottom: 0.625rem;
}

.ai-loading-skeleton .skeleton-line:nth-child(1) { width: 90%; }
.ai-loading-skeleton .skeleton-line:nth-child(2) { width: 75%; }
.ai-loading-skeleton .skeleton-line:nth-child(3) { width: 85%; }
.ai-loading-skeleton .skeleton-line:nth-child(4) { width: 60%; }
.ai-loading-skeleton .skeleton-line:nth-child(5) { width: 70%; }

@keyframes skeletonPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@media (max-width: 576px) {
    .ai-chat-panel {
        width: calc(100vw - 1.5rem);
        right: 0.75rem;
        bottom: 0.75rem;
        max-height: 85vh;
    }
    .ai-chat-toggle {
        bottom: 1rem;
        right: 1rem;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   Dark Theme Utilities
   ══════════════════════════════════════════════════════════════════════════════ */

/* ─── Scrollbar (dark) ─── */
.dark-theme ::-webkit-scrollbar { width: 6px; height: 6px; }
.dark-theme ::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.02); }
.dark-theme ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 3px; }
.dark-theme ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); }

/* ─── Recharts dark overrides ─── */
.recharts-cartesian-grid-horizontal line,
.recharts-cartesian-grid-vertical line {
  stroke: rgba(255, 255, 255, 0.05) !important;
}
.recharts-text { fill: var(--gray-500) !important; font-size: 11px !important; }

/* ─── Glass morphism ─── */
.glass {
  background: rgba(13, 31, 45, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.glass-hover:hover {
  background: rgba(19, 45, 66, 0.85);
  border-color: rgba(35, 137, 218, 0.2);
}

/* ─── Gradient text ─── */
.gradient-text {
  background: linear-gradient(135deg, #F0F4F8 0%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-text-accent {
  background: linear-gradient(135deg, #2389DA 0%, #00A4BD 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Animations ─── */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.6); }
}
.pulse-dot { animation: pulse-dot 2s ease-in-out infinite; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fade-in 0.4s ease-out forwards; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer {
  background: linear-gradient(90deg, transparent 25%, rgba(255,255,255,0.05) 50%, transparent 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(35, 137, 218, 0.1); }
  50% { box-shadow: 0 0 30px rgba(35, 137, 218, 0.2); }
}

/* ─── Glow effects ─── */
.glow-blue { box-shadow: 0 0 24px rgba(35, 137, 218, 0.12), 0 0 48px rgba(35, 137, 218, 0.06); }
.glow-teal { box-shadow: 0 0 24px rgba(0, 164, 189, 0.12), 0 0 48px rgba(0, 164, 189, 0.06); }
.glow-gold { box-shadow: 0 0 24px rgba(212, 168, 83, 0.12); }
.glow-red  { box-shadow: 0 0 24px rgba(239, 68, 68, 0.12); }

/* ─── Focus visible ─── */
*:focus-visible {
  outline: 2px solid rgba(35, 137, 218, 0.5);
  outline-offset: 2px;
}

/* ─── Grid pattern overlay ─── */
.grid-pattern {
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ─── Accent bar ─── */
.accent-bar-top {
  position: relative;
}
.accent-bar-top::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #2389DA, #00A4BD, #D4A853);
}
