/* ═══════════════════════════════════════════════════════════════
   AnchalAI — Maternal Care Intelligence
   Design System: Terracotta/Coral → Teal/Medical Blue
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
    /* ── Logo-derived Palette ── */
    --coral: #D4816B;
    --coral-light: #E8937A;
    --coral-pale: #FDF0EB;
    --coral-deep: #B8654E;
    --teal: #3A9E9E;
    --teal-light: #4FBDBD;
    --teal-pale: #E8F6F6;
    --teal-deep: #2D7D8B;
    --teal-darker: #1F5F6B;
    /* ── Semantic Colors ── */
    --crimson: #C0392B;
    --crimson-pale: #FDF2F2;
    --gold: #D4860A;
    --gold-pale: #FEF9F0;
    --green: #1E8449;
    --green-pale: #EAFAF1;
    /* ── Neutrals ── */
    --charcoal: #2C2420;
    --warm-gray: #7A6E66;
    --border: #EDE8E3;
    --surface: #FBF9F7;
    --white: #FFFFFF;
    /* ── Layout ── */
    --sidebar-w: 240px;
    --topbar-h: 64px;
    /* ── Gradient ── */
    --brand-gradient: linear-gradient(135deg, #E8937A 0%, #3A9E9E 100%);
    --sidebar-gradient: linear-gradient(180deg, #2D7D8B 0%, #1F5F6B 100%);
}

[data-theme="dark"] {
    --charcoal: #E8E4E0;
    --warm-gray: #A09890;
    --border: #2A2520;
    --surface: #141210;
    --white: #1C1A18;
    --teal-pale: #0D2222;
    --crimson-pale: #2A1414;
    --gold-pale: #2A2010;
    --green-pale: #0D1E14;
    --coral-pale: #2A1C16;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(128,128,128,0.25); border-radius: 4px; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--surface);
    color: var(--charcoal);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── SIDEBAR ── */
aside {
    background: var(--sidebar-gradient);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: var(--sidebar-w);
    z-index: 50;
    box-shadow: 4px 0 24px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; gap: 12px;
}
.brand-logo {
    width: 44px; height: 44px;
    border-radius: 10px;
    object-fit: contain;
    background: rgba(255,255,255,0.1);
    padding: 2px;
}
.brand-text {}
.brand-name {
    font-family: 'Playfair Display', serif;
    font-size: 20px; font-weight: 700;
}
.brand-tagline {
    font-size: 10px; opacity: 0.6; margin-top: 2px;
    text-transform: uppercase; letter-spacing: 1px;
}
.sidebar-nav { padding: 16px 10px; flex: 1; overflow-y: auto; }
.nav-label {
    font-size: 10px; text-transform: uppercase;
    letter-spacing: 1.5px; opacity: 0.4;
    padding: 0 12px; margin: 16px 0 6px;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px;
    font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.2s; opacity: 0.7;
    text-decoration: none; color: white;
}
.nav-item.active { background: rgba(255,255,255,0.15); opacity: 1; }
.nav-item:hover:not(.active) { background: rgba(255,255,255,0.08); opacity: 1; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.1);
}
.asha-profile { display: flex; align-items: center; gap: 10px; }
.asha-avatar {
    width: 36px; height: 36px;
    background: var(--brand-gradient);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.asha-name { font-size: 13px; font-weight: 600; }
.asha-role { font-size: 11px; opacity: 0.5; margin-top: 2px; }

.theme-toggle {
    margin-top: 12px;
    background: rgba(255,255,255,0.1);
    border: none; color: white;
    padding: 8px; border-radius: 8px;
    cursor: pointer; font-size: 14px;
    width: 100%; transition: background 0.2s;
}
.theme-toggle:hover { background: rgba(255,255,255,0.2); }

/* ── Mobile hamburger ── */
.hamburger {
    display: none; position: fixed; top: 16px; left: 16px;
    z-index: 60; background: var(--teal-deep); border: none;
    color: white; width: 40px; height: 40px; border-radius: 10px;
    font-size: 20px; cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.4); z-index: 45;
}

/* ── MAIN CONTENT ── */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    transition: margin-left 0.3s;
}

/* ── TOPBAR ── */
.topbar {
    background: rgba(251,249,247,0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 30;
    height: var(--topbar-h);
}
[data-theme="dark"] .topbar { background: rgba(20,18,16,0.85); }

.topbar h1 {
    font-family: 'Playfair Display', serif;
    font-size: 20px; font-weight: 700; color: var(--teal-deep);
}
.topbar-right { display: flex; align-items: center; gap: 12px; }

.search-bar {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 8px 14px;
    transition: border-color 0.2s;
}
[data-theme="dark"] .search-bar { background: #1C1A18; }
.search-bar:focus-within { border-color: var(--teal); }
.search-bar input {
    border: none; background: transparent; outline: none;
    font-size: 13px; font-family: 'DM Sans', sans-serif;
    color: var(--charcoal); width: 180px;
}
.search-bar svg { width: 16px; height: 16px; color: var(--warm-gray); flex-shrink: 0; }

.powered-badge {
    display: flex; align-items: center; gap: 6px;
    background: var(--teal-pale); color: var(--teal-deep);
    padding: 6px 14px; border-radius: 18px;
    font-size: 11px; font-weight: 600;
}
.gemini-dot {
    width: 7px; height: 7px; background: var(--teal);
    border-radius: 50%; animation: pulse 2s infinite;
}

/* ── PAGE CONTAINER ── */
.page { display: none; padding: 24px 28px; }
.page.active { display: block; animation: fadeUp 0.35s ease-out; }

/* ── ANIMATIONS ── */
@keyframes pulse {
    0%,100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ── STATS ROW ── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px; margin-bottom: 24px;
}
.stat-card {
    background: var(--white);
    border-radius: 14px; padding: 20px;
    border: 1px solid var(--border);
    position: relative; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}
.stat-card::before {
    content: ''; position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.total::before { background: var(--teal); }
.stat-card.high::before { background: var(--crimson); }
.stat-card.medium::before { background: var(--gold); }
.stat-card.low::before { background: var(--green); }

.stat-icon {
    width: 42px; height: 42px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; margin-bottom: 12px;
}
.stat-card.total .stat-icon { background: var(--teal-pale); }
.stat-card.high .stat-icon { background: var(--crimson-pale); }
.stat-card.medium .stat-icon { background: var(--gold-pale); }
.stat-card.low .stat-icon { background: var(--green-pale); }

.stat-number {
    font-family: 'Playfair Display', serif;
    font-size: 32px; font-weight: 700; line-height: 1;
}
.stat-card.total .stat-number { color: var(--teal-deep); }
.stat-card.high .stat-number { color: var(--crimson); }
.stat-card.medium .stat-number { color: var(--gold); }
.stat-card.low .stat-number { color: var(--green); }

.stat-label {
    font-size: 12px; font-weight: 500;
    color: var(--warm-gray); margin-top: 4px;
}

/* ── HERO ── */
.hero-card {
    background: var(--brand-gradient);
    border-radius: 16px; padding: 28px 32px;
    display: flex; align-items: center; justify-content: space-between;
    overflow: hidden; position: relative;
    box-shadow: 0 8px 24px rgba(58,158,158,0.2);
    margin-bottom: 24px; color: white;
}
.hero-text h2 {
    font-family: 'Playfair Display', serif;
    font-size: 24px; margin-bottom: 8px;
}
.hero-text p { font-size: 14px; opacity: 0.9; max-width: 420px; line-height: 1.5; }
.hero-stats { display: flex; gap: 32px; margin-top: 20px; }
.hero-stat .hs-num {
    font-family: 'Playfair Display', serif;
    font-size: 26px; color: #FFE8D6; font-weight: 700;
}
.hero-stat .hs-label {
    font-size: 11px; font-weight: 500; opacity: 0.75;
    margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px;
}

/* ── SECTION HEADERS ── */
.section-header {
    display: flex; align-items: center;
    justify-content: space-between; margin-bottom: 16px;
}
.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px; font-weight: 700; color: var(--teal-deep);
}
.filter-tabs {
    display: flex; gap: 6px; background: var(--white);
    padding: 3px; border-radius: 20px; border: 1px solid var(--border);
}
.filter-tab {
    padding: 6px 14px; border-radius: 16px;
    font-size: 12px; font-weight: 600;
    cursor: pointer; color: var(--warm-gray);
    transition: all 0.2s; border: none; background: none;
    font-family: 'DM Sans', sans-serif;
}
.filter-tab.active {
    background: var(--teal-deep); color: white;
    box-shadow: 0 2px 8px rgba(45,125,139,0.25);
}
.filter-tab:hover:not(.active) { background: var(--teal-pale); color: var(--teal-deep); }

/* ── WOMAN CARD ── */
.women-grid { display: flex; flex-direction: column; gap: 10px; }
.woman-card {
    background: var(--white);
    border-radius: 14px; padding: 16px 20px;
    display: flex; align-items: center; gap: 16px;
    border: 1px solid var(--border);
    cursor: pointer; transition: all 0.25s;
    position: relative; overflow: hidden;
}
.woman-card::before {
    content: ''; position: absolute;
    left: 0; top: 0; bottom: 0; width: 4px;
    border-radius: 4px 0 0 4px; transition: width 0.2s;
}
.woman-card.High::before { background: var(--crimson); }
.woman-card.Medium::before { background: var(--gold); }
.woman-card.Low::before { background: var(--green); }
.woman-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
    border-color: transparent;
}
.woman-card:hover::before { width: 6px; }

.woman-rank {
    font-family: 'Playfair Display', serif;
    font-size: 18px; color: #CCC; width: 28px;
    text-align: center; flex-shrink: 0; font-weight: 600;
}
.woman-avatar {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 13px; font-weight: 700;
    color: white;
}
.woman-avatar.High { background: linear-gradient(135deg, #E74C3C, #C0392B); }
.woman-avatar.Medium { background: linear-gradient(135deg, #F39C12, #D4860A); }
.woman-avatar.Low { background: linear-gradient(135deg, #27AE60, #1E8449); }

.woman-details { flex: 1; min-width: 0; }
.woman-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.woman-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.meta-chip {
    font-size: 11px; color: var(--warm-gray); font-weight: 500;
    background: var(--surface); padding: 3px 8px; border-radius: 6px;
}

.risk-indicator { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.risk-percent {
    font-family: 'Playfair Display', serif;
    font-size: 24px; font-weight: 700; line-height: 1;
}
.risk-percent.High { color: var(--crimson); }
.risk-percent.Medium { color: var(--gold); }
.risk-percent.Low { color: var(--green); }
.risk-badge {
    font-size: 10px; font-weight: 700;
    padding: 3px 10px; border-radius: 16px;
    text-transform: uppercase; letter-spacing: 0.8px;
}
.risk-badge.High { background: var(--crimson-pale); color: var(--crimson); }
.risk-badge.Medium { background: var(--gold-pale); color: var(--gold); }
.risk-badge.Low { background: var(--green-pale); color: var(--green); }

.reach-btn {
    background: var(--coral); color: white; border: none;
    padding: 10px 18px; border-radius: 10px;
    font-size: 12px; font-weight: 600; cursor: pointer;
    transition: all 0.2s; flex-shrink: 0;
    font-family: 'DM Sans', sans-serif;
    box-shadow: 0 3px 10px rgba(212,129,107,0.2);
}
.reach-btn:hover {
    background: var(--coral-deep); transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(212,129,107,0.3);
}

/* ── PAGINATION ── */
.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; margin-top: 24px;
}
.pagination button {
    background: var(--white); border: 1px solid var(--border);
    padding: 8px 14px; border-radius: 8px; cursor: pointer;
    font-size: 13px; font-weight: 500; color: var(--charcoal);
    font-family: 'DM Sans', sans-serif; transition: all 0.2s;
}
.pagination button:hover { border-color: var(--teal); color: var(--teal-deep); }
.pagination button.active {
    background: var(--teal-deep); color: white; border-color: var(--teal-deep);
}
.pagination button:disabled { opacity: 0.3; cursor: default; }
.pagination span { font-size: 13px; color: var(--warm-gray); }

/* ── MODAL ── */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(44,36,32,0.5);
    backdrop-filter: blur(8px);
    z-index: 100; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal {
    background: var(--white); border-radius: 20px;
    width: 92%; max-width: 580px; max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0,0,0,0.25);
    animation: modalPop 0.35s cubic-bezier(0.16,1,0.3,1);
}
@keyframes modalPop {
    0% { transform: scale(0.95) translateY(16px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
    background: var(--brand-gradient);
    padding: 24px 28px; color: white; position: relative;
}
.modal-header-top {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 16px;
}
.modal-patient-info h3 {
    font-family: 'Playfair Display', serif;
    font-size: 20px; margin-bottom: 4px;
}
.modal-patient-info p { font-size: 13px; opacity: 0.85; }

.modal-risk-badge {
    background: rgba(255,255,255,0.15); border-radius: 14px;
    padding: 10px 16px; text-align: center;
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
}
.modal-risk-badge .mrb-num {
    font-family: 'Playfair Display', serif;
    font-size: 28px; font-weight: 700; color: #FFE8D6;
}
.modal-risk-badge .mrb-label {
    font-size: 10px; opacity: 0.7; text-transform: uppercase;
    letter-spacing: 0.8px; margin-top: 2px; font-weight: 600;
}

.close-btn {
    position: absolute; top: 14px; right: 14px;
    background: rgba(255,255,255,0.15); border: none;
    color: white; width: 30px; height: 30px; border-radius: 50%;
    cursor: pointer; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
}
.close-btn:hover { background: rgba(255,255,255,0.3); }

.modal-body { padding: 24px 28px; }

.escalation-banner {
    padding: 12px 16px; border-radius: 12px;
    margin-bottom: 16px; font-size: 13px; font-weight: 600;
    display: flex; align-items: center; gap: 10px;
    border: 1px solid;
}
.escalation-banner.critical {
    background: var(--crimson-pale); border-color: #F0C0C0;
    color: var(--crimson);
}
.escalation-banner.moderate {
    background: var(--gold-pale); border-color: #F0D8A0;
    color: var(--gold);
}
.escalation-banner.low {
    background: var(--green-pale); border-color: #A0D8B0;
    color: var(--green);
}

.factors-section {
    background: var(--coral-pale); border-radius: 12px;
    padding: 16px; margin-bottom: 16px;
    border: 1px solid #F0CFC0;
}
.factors-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; color: var(--coral-deep);
    margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.factor-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.factor-chip {
    background: var(--white); border: 1px solid #F0CFC0;
    border-radius: 16px; padding: 4px 12px;
    font-size: 12px; color: var(--coral-deep); font-weight: 500;
}

.lang-section { margin-bottom: 16px; }
.lang-section-label {
    font-size: 11px; font-weight: 600; color: var(--warm-gray);
    margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.8px;
}
.lang-tabs { display: flex; gap: 8px; }
.lang-tab {
    flex: 1; padding: 10px; border: 2px solid var(--border);
    border-radius: 10px; background: var(--white); cursor: pointer;
    font-size: 13px; font-weight: 600;
    font-family: 'DM Sans', sans-serif; color: var(--warm-gray);
    transition: all 0.2s;
}
.lang-tab.active {
    border-color: var(--teal); background: var(--teal-pale); color: var(--teal-deep);
}

.message-section { margin-bottom: 20px; }
.message-label {
    font-size: 11px; font-weight: 600; color: var(--warm-gray);
    margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.8px;
    display: flex; align-items: center; gap: 8px;
}
.gemini-tag {
    background: linear-gradient(135deg, #4285F4, #9B72CB, #D96570);
    color: white; font-size: 10px; padding: 2px 8px;
    border-radius: 10px; font-weight: 700;
}
.message-box {
    background: var(--coral-pale); border: 1.5px solid #F0CFC0;
    border-radius: 12px; padding: 20px;
    font-size: 14px; line-height: 1.6; min-height: 100px;
    color: var(--charcoal); transition: all 0.3s;
}
.message-box.loading {
    color: var(--warm-gray); font-style: italic;
    display: flex; align-items: center; gap: 10px;
}

.loading-dots { display: flex; gap: 5px; }
.loading-dots span {
    width: 7px; height: 7px; background: var(--coral);
    border-radius: 50%; animation: bounce 1.2s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.modal-actions { display: flex; gap: 12px; }
.btn-primary {
    flex: 2; background: var(--teal-deep); color: white; border: none;
    padding: 14px; border-radius: 12px;
    font-size: 14px; font-weight: 700; cursor: pointer;
    font-family: 'DM Sans', sans-serif; transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(45,125,139,0.2);
}
.btn-primary:hover { background: var(--teal); transform: translateY(-2px); }
.btn-secondary {
    flex: 1; background: var(--white); color: var(--warm-gray);
    border: 2px solid var(--border); padding: 14px; border-radius: 12px;
    font-size: 14px; font-weight: 700; cursor: pointer;
    font-family: 'DM Sans', sans-serif;
}

/* ── CHARTS ── */
.chart-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 16px; margin-bottom: 24px;
}
.chart-card {
    background: var(--white); border-radius: 14px;
    padding: 20px; border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.chart-card h3 {
    font-size: 14px; font-weight: 700; color: var(--teal-deep);
    margin-bottom: 16px;
}
.chart-card canvas { width: 100% !important; }

/* ── VILLAGE TABLE ── */
.village-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.village-table th {
    text-align: left; padding: 10px 12px;
    font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.8px; color: var(--warm-gray);
    border-bottom: 2px solid var(--border);
}
.village-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.village-table tr:hover { background: var(--teal-pale); }

/* ── OUTREACH LOG ── */
.contact-card {
    background: var(--white); border-radius: 12px;
    padding: 16px 20px; border: 1px solid var(--border);
    display: flex; align-items: center; gap: 16px;
    margin-bottom: 10px;
}
.contact-card .cc-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
    background: var(--teal-pale);
}
.contact-card .cc-details { flex: 1; }
.contact-card .cc-name { font-size: 14px; font-weight: 600; }
.contact-card .cc-meta { font-size: 12px; color: var(--warm-gray); margin-top: 2px; }
.contact-card .cc-time { font-size: 11px; color: var(--warm-gray); flex-shrink: 0; }

/* ── ACTIVITY FEED ── */
.activity-feed { max-height: 300px; overflow-y: auto; }
.activity-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.activity-dot.High { background: var(--crimson); }
.activity-dot.Medium { background: var(--gold); }
.activity-dot.Low { background: var(--green); }
.activity-text { font-size: 13px; flex: 1; }
.activity-time { font-size: 11px; color: var(--warm-gray); flex-shrink: 0; }

/* ── EMPTY / LOADING ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--warm-gray); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 14px; }

.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, var(--surface) 50%, var(--border) 75%);
    background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px;
}

/* ── TOAST ── */
.toast-container {
    position: fixed; bottom: 24px; right: 24px;
    z-index: 200; display: flex; flex-direction: column; gap: 8px;
}
.toast {
    background: var(--charcoal); color: white;
    padding: 12px 20px; border-radius: 10px;
    font-size: 13px; font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: slideInRight 0.3s ease;
    display: flex; align-items: center; gap: 8px;
}
[data-theme="dark"] .toast { background: #2A2820; }
@keyframes slideInRight {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ── ANALYTICS METRIC CARDS ── */
.metric-row {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 16px; margin-bottom: 24px;
}
.metric-card {
    background: var(--white); border-radius: 14px;
    padding: 20px; border: 1px solid var(--border);
    text-align: center;
}
.metric-card .mc-value {
    font-family: 'Playfair Display', serif;
    font-size: 28px; font-weight: 700; color: var(--teal-deep);
}
.metric-card .mc-label { font-size: 12px; color: var(--warm-gray); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════
   GEMINI CHAT ASSISTANT — "Anchal Sahayak"
   ═══════════════════════════════════════════════════════════════ */
.chat-fab {
    position: fixed; bottom: 24px; right: 24px;
    z-index: 90; width: 56px; height: 56px;
    border-radius: 50%; border: none; cursor: pointer;
    background: var(--brand-gradient);
    color: white; font-size: 24px;
    box-shadow: 0 6px 20px rgba(212,129,107,0.35);
    transition: all 0.3s; display: flex;
    align-items: center; justify-content: center;
}
.chat-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 28px rgba(212,129,107,0.45);
}
.chat-fab.hidden { display: none; }

.chat-panel {
    position: fixed; bottom: 24px; right: 24px;
    z-index: 100; width: 380px; height: 520px;
    background: var(--white); border-radius: 20px;
    box-shadow: 0 16px 60px rgba(0,0,0,0.2);
    display: none; flex-direction: column;
    overflow: hidden;
    animation: modalPop 0.35s cubic-bezier(0.16,1,0.3,1);
}
.chat-panel.active { display: flex; }

.chat-header {
    background: var(--brand-gradient);
    padding: 16px 20px; color: white;
    display: flex; align-items: center; justify-content: space-between;
}
.chat-header-left { display: flex; align-items: center; gap: 10px; }
.chat-header-left .ch-icon {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.chat-header-left .ch-name { font-weight: 700; font-size: 14px; }
.chat-header-left .ch-sub { font-size: 11px; opacity: 0.7; }
.chat-close {
    background: rgba(255,255,255,0.15); border: none;
    color: white; width: 28px; height: 28px; border-radius: 50%;
    cursor: pointer; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
}

.chat-messages {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 12px;
}

.chat-msg {
    max-width: 85%; padding: 10px 14px;
    border-radius: 14px; font-size: 13px; line-height: 1.5;
}
.chat-msg.bot {
    align-self: flex-start;
    background: var(--teal-pale); color: var(--charcoal);
    border-bottom-left-radius: 4px;
}
.chat-msg.user {
    align-self: flex-end;
    background: var(--teal-deep); color: white;
    border-bottom-right-radius: 4px;
}
.chat-msg.typing {
    align-self: flex-start;
    background: var(--teal-pale); color: var(--warm-gray);
    font-style: italic;
}

.chat-input-area {
    padding: 12px 16px; border-top: 1px solid var(--border);
    display: flex; gap: 8px; align-items: center;
    background: var(--white);
}
.chat-input-area input {
    flex: 1; border: 1px solid var(--border);
    border-radius: 20px; padding: 10px 16px;
    font-size: 13px; font-family: 'DM Sans', sans-serif;
    outline: none; background: var(--surface);
    color: var(--charcoal);
}
.chat-input-area input:focus { border-color: var(--teal); }
.chat-send {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--teal-deep); color: white;
    border: none; cursor: pointer; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}
.chat-send:hover { background: var(--teal); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    aside { transform: translateX(-100%); }
    aside.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .hamburger { display: flex; align-items: center; justify-content: center; }
    .main-content { margin-left: 0; }
    .topbar { padding: 14px 16px; padding-left: 64px; }
    .topbar h1 { font-size: 16px; }
    .search-bar { display: none; }
    .page { padding: 16px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .hero-card { flex-direction: column; padding: 20px; }
    .hero-stats { gap: 20px; }
    .chart-grid { grid-template-columns: 1fr; }
    .metric-row { grid-template-columns: 1fr; }
    .woman-card { flex-wrap: wrap; }
    .woman-meta { display: none; }
    .modal { width: 96%; max-width: none; border-radius: 16px; }
    .modal-header { padding: 20px; }
    .modal-body { padding: 20px; }
    .lang-tabs { flex-wrap: wrap; }
    .chat-panel { width: calc(100vw - 32px); height: 70vh; bottom: 16px; right: 16px; }
}

@media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr 1fr; }
    .stat-card { padding: 14px; }
    .stat-number { font-size: 24px; }
    .hero-stats { flex-wrap: wrap; }
}
