﻿/* ============================================================================
   styles.css — TDS BI Reporting Dashboard  |  Premium Design
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg:         #00111f;
    --bg-card:    rgba(0,38,62,0.55);
    --bg-card-h:  rgba(0,38,62,0.8);
    --border:     rgba(0,196,179,0.12);
    --border-h:   rgba(0,196,179,0.28);
    --text-1:     #e8f4f8;
    --text-2:     #6b8fa8;
    --text-3:     #2a4558;
    --accent:     #00c4b3;
    --radius:     16px;
    --radius-sm:  10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    overflow-x: hidden;
    max-width: 100%;
}

html, body {
    height: 100%;
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg);
    color: var(--text-1);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
}

.hidden { display: none !important; }

/* ── Login ──────────────────────────────────────────────────────────────── */
.overlay {
    position: fixed; inset: 0;
    background: #00111f;
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}

.login-card {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    padding: 52px 44px;
    width: 100%; max-width: 420px;
    text-align: center;
    box-shadow: 0 32px 80px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08);
    animation: fadeUp .4s cubic-bezier(.16,1,.3,1);
}

.login-logo { margin-bottom: 28px; display: flex; justify-content: center; width: 100%; }
.login-logo img {
    background: rgba(255,255,255,0.92);
    border-radius: 12px;
    padding: 12px 20px;
}

.login-card h1 { font-size: 24px; font-weight: 800; margin-bottom: 10px; letter-spacing: -.4px; }

.login-card > p { color: var(--text-2); margin-bottom: 36px; font-size: 14px; line-height: 1.6; }

.login-note { margin-top: 22px !important; margin-bottom: 0 !important; font-size: 11px; color: var(--text-3); }

/* ── Local auth form ────────────────────────────────────────────────────── */
.login-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 22px 0 18px; color: var(--text-3); font-size: 12px;
}
.login-divider::before, .login-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.local-login-form {
    display: flex; flex-direction: column; gap: 10px; width: 100%;
}
.local-input {
    width: 100%; padding: 11px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    color: var(--text-1); font-size: 14px; font-family: inherit;
    outline: none; transition: border-color .15s;
    box-sizing: border-box;
}
.local-input::placeholder { color: var(--text-3); }
.local-input:focus { border-color: rgba(0,196,179,0.5); background: rgba(255,255,255,0.07); }
.btn-local-login {
    width: 100%; padding: 11px 24px;
    background: rgba(0,196,179,0.12);
    border: 1px solid rgba(0,196,179,0.3);
    border-radius: var(--radius-sm);
    color: #3ccfc3; font-size: 14px; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: background .15s, border-color .15s;
}
.btn-local-login:hover { background: rgba(0,196,179,0.2); border-color: rgba(0,196,179,0.5); }
.local-login-error { font-size: 12px !important; color: #f87171 !important; margin-top: 4px !important; margin-bottom: 0 !important; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    background: linear-gradient(135deg, #00c4b3 0%, #009e8f 100%);
    color: #fff; border: none; border-radius: var(--radius-sm);
    padding: 13px 24px; font-size: 14px; font-weight: 600; font-family: inherit;
    cursor: pointer; width: 100%;
    box-shadow: 0 4px 24px rgba(0,196,179,0.35);
    transition: all .2s cubic-bezier(.16,1,.3,1);
}
.btn-primary:hover  { transform: translateY(-1px); box-shadow: 0 8px 32px rgba(0,196,179,0.45); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-icon {
    background: rgba(0,160,147,0.1); border: 1px solid rgba(0,160,147,0.35);
    color: #007a71; border-radius: var(--radius-sm);
    width: 36px; height: 36px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s; flex-shrink: 0;
}
.btn-icon:hover { background: #00c4b3; color: #fff; border-color: #00a899; }
.btn-icon.spinning svg { animation: spin .7s linear infinite; }

.btn-link {
    background: none; border: none; color: #2a6b63; font-size: 11px;
    cursor: pointer; padding: 0; font-family: inherit; transition: color .15s;
}
.btn-link:hover { color: #f87171; }

/* ── Shell ──────────────────────────────────────────────────────────────── */
#dashboard { display: flex; flex-direction: column; min-height: 100vh; width: 100%; overflow-x: hidden; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 32px; height: 80px;
    background: rgba(255,255,255,0.70);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,160,147,0.2);
    position: sticky; top: 0; z-index: 100; gap: 16px;
    transition: background 0.3s ease, border-color 0.3s ease;
}
.header.scrolled {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: rgba(0,0,0,0.1);
}

.header-left { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.header-title  { font-size: 18px; font-weight: 800; letter-spacing: -.4px; }
.header-subtitle { font-size: 12px; color: var(--text-2); display: block; margin-top: 1px; }

.live-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.4);
    color: #14693a; border-radius: 20px; padding: 5px 12px;
    font-size: 11px; font-weight: 600; letter-spacing: .05em;
}

.live-dot {
    width: 6px; height: 6px; border-radius: 50%; background: #22c55e;
    animation: pulse-green 2s infinite;
}

.header-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.refresh-time { font-size: 12px; color: #2a6b63; white-space: nowrap; }

.user-menu { display: flex; align-items: center; gap: 10px; }

.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, #00c4b3, #f97316);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px; color: #fff; flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.3);
}

.user-details { display: flex; flex-direction: column; }
.user-name { font-size: 13px; font-weight: 500; white-space: nowrap; color: #0a1f1c; }

/* ── Main ────────────────────────────────────────────────────────────────── */
.main { flex: 1; padding: 32px 28px; max-width: 1600px; width: 100%; margin: 0 auto; }

/* ── States ──────────────────────────────────────────────────────────────── */
.loading-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; min-height: 400px; gap: 20px; color: var(--text-2);
}

.spinner {
    width: 44px; height: 44px;
    border: 3px solid rgba(255,255,255,0.06);
    border-top-color: var(--accent);
    border-radius: 50%; animation: spin .75s linear infinite;
}

.loading-state p { font-size: 14px; color: var(--text-2); }

.error-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; min-height: 400px; gap: 14px; text-align: center;
}
.error-state h3 { font-size: 20px; font-weight: 700; }
.error-state p  { color: var(--text-2); max-width: 460px; font-size: 13px; line-height: 1.7; }
.error-state .btn-primary { width: auto; margin-top: 8px; }

/* ── Hero Banner ─────────────────────────────────────────────────────────── */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    background: linear-gradient(135deg, rgba(0,38,62,0.8) 0%, rgba(0,17,31,0.6) 100%);
    border: 1px solid rgba(0,196,179,0.15);
    border-radius: var(--radius);
    padding: 36px 40px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 280px; height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,196,179,0.08), transparent 70%);
    pointer-events: none;
}

.hero-left { flex: 1; min-width: 0; }

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #00c4b3;
    margin-bottom: 16px;
}

.hero-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #00c4b3;
    animation: pulse-green 2s infinite;
    flex-shrink: 0;
}

.hero-title {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.8px;
    color: var(--text-1);
    margin-bottom: 14px;
}

.hero-accent {
    background: linear-gradient(90deg, #00c4b3, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.7;
    max-width: 520px;
    margin-bottom: 20px;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-2);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px;
    letter-spacing: .04em;
}

.hero-right {
    flex-shrink: 0;
    width: 260px;
    opacity: 0.85;
}

.hero-svg { width: 100%; height: auto; }

@media (max-width: 768px) {
    .hero { flex-direction: column; padding: 28px 24px; }
    .hero-right { display: none; }
    .hero-title { font-size: 26px; }
}

/* ── Section ─────────────────────────────────────────────────────────────── */
.section { margin-bottom: 36px; }

.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 18px;
}

.section-title {
    font-size: 13px; font-weight: 600; color: var(--text-2);
    text-transform: uppercase; letter-spacing: .08em;
}

.section-error {
    font-size: 11px; color: #f5333f;
    background: rgba(245,51,63,0.08);
    border: 1px solid rgba(245,51,63,0.2);
    border-radius: 8px; padding: 4px 10px;
}

.section-badge {
    font-size: 11px; color: var(--text-2);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px;
}

/* ── KPI Grid ────────────────────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.kpi-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-top: 2px solid var(--kpi-color, var(--accent));
    border-radius: var(--radius);
    padding: 24px 22px 20px;
    position: relative; overflow: hidden;
    transition: transform .25s cubic-bezier(.16,1,.3,1),
                box-shadow .25s ease,
                border-color .25s ease,
                background .25s ease;
    animation: fadeUp .5s cubic-bezier(.16,1,.3,1) both;
}

.kpi-card::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at top right, var(--kpi-color, var(--accent)), transparent 65%);
    opacity: .06;
    transition: opacity .3s;
    pointer-events: none;
}

.kpi-card:hover {
    transform: translateY(-4px);
    background: var(--bg-card-h);
    border-color: rgba(255,255,255,0.12);
    border-top-color: var(--kpi-color, var(--accent));
    box-shadow: 0 20px 60px rgba(0,0,0,0.4),
                0 0 0 1px rgba(255,255,255,0.06),
                0 0 40px -8px var(--kpi-color, var(--accent));
}

.kpi-card:hover::before { opacity: .12; }

.kpi-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 16px;
    color: var(--kpi-color, var(--accent));
    flex-shrink: 0;
}

.kpi-icon svg { width: 20px; height: 20px; }

.kpi-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 8px;
}

.kpi-title {
    font-size: 11px; font-weight: 600; color: var(--text-2);
    text-transform: uppercase; letter-spacing: .07em; line-height: 1.4;
    max-width: 140px;
}

.kpi-dot {
    width: 7px; height: 7px; border-radius: 50%;
    flex-shrink: 0; margin-top: 3px; opacity: .8;
}

.kpi-value {
    font-size: 36px; font-weight: 800;
    color: var(--text-1);
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    margin-bottom: 14px;
    min-height: 42px;
}

.kpi-null { font-size: 18px; font-weight: 400; color: var(--text-3); letter-spacing: 0; }

.kpi-footer {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 11px;
    display: flex; align-items: center; justify-content: space-between;
}

.kpi-label {
    font-size: 10px; color: var(--text-3);
    font-family: 'Consolas', monospace;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px;
}

/* ── KPI Selected State ──────────────────────────────────────────────────── */
.kpi-card { cursor: pointer; }

.kpi-card.selected {
    background: var(--bg-card-h) !important;
    border-color: rgba(255,255,255,0.16) !important;
    border-top-color: var(--kpi-color, var(--accent)) !important;
    box-shadow: 0 0 0 1.5px var(--kpi-color, var(--accent)),
                0 12px 40px rgba(0,0,0,0.5) !important;
    transform: translateY(-4px);
}

/* ── KPI Detail Panel ────────────────────────────────────────────────────── */
.kpi-panel {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-h);
    border-radius: var(--radius);
    padding: 24px 22px;
    margin-bottom: 32px;
    animation: slideDown .35s cubic-bezier(.16,1,.3,1);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.kpi-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}

.kpi-panel-meta { display: flex; align-items: center; gap: 12px; }

.kpi-panel-badge {
    font-size: 10px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase;
    background: rgba(0,196,179,0.12);
    border: 1px solid rgba(0,196,179,0.3);
    color: #00c4b3; border-radius: 20px; padding: 3px 10px;
}

.kpi-panel-header h3 { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }

.kpi-panel-body {
    display: grid;
    grid-template-columns: 240px 1fr 1fr;
    gap: 16px;
}

.kpi-panel-visual {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    text-align: center;
    gap: 12px;
}

.kpi-panel-visual svg { filter: drop-shadow(0 0 16px currentColor); }

.panel-visual-label {
    font-size: 11px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase;
}

.panel-visual-desc {
    font-size: 12px; color: var(--text-2); line-height: 1.6;
}

@media (max-width: 900px) {
    .kpi-panel-body { grid-template-columns: 1fr 1fr; }
    .kpi-panel-visual { display: none; }
}

.kpi-panel-chart {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
}

.panel-chart-title {
    font-size: 12px; font-weight: 600; color: var(--text-2);
    text-transform: uppercase; letter-spacing: .06em;
    margin-bottom: 14px;
}

.panel-chart-body { height: 240px; position: relative; }
.panel-chart-body canvas { width: 100% !important; height: 100% !important; }

@media (max-width: 640px) { .kpi-panel-body { grid-template-columns: 1fr; } .kpi-panel-visual { display: none; } }

/* ── Charts ──────────────────────────────────────────────────────────────── */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.chart-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 22px;
    animation: fadeUp .5s cubic-bezier(.16,1,.3,1) both;
    transition: border-color .25s, box-shadow .25s;
}

.chart-card:hover {
    border-color: var(--border-h);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.chart-header { margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; }

.chart-header h3 { font-size: 14px; font-weight: 600; letter-spacing: -.2px; }

.chart-body { height: 280px; position: relative; }
.chart-body canvas { width: 100% !important; height: 100% !important; }

.chart-placeholder {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-3); font-size: 12px; text-align: center;
    border: 1px dashed rgba(255,255,255,0.06); border-radius: var(--radius-sm); padding: 20px;
    line-height: 1.6;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 28px;
    border-top: 1px solid var(--border);
    font-size: 11px; color: var(--text-3);
    background: rgba(7,11,18,0.6);
    backdrop-filter: blur(20px);
}

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes fadeUp  { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74,222,128,.5); }
    50%       { box-shadow: 0 0 0 5px rgba(74,222,128,0); }
}

/* Staggered card delays */
.kpi-card:nth-child(1) { animation-delay: .05s; }
.kpi-card:nth-child(2) { animation-delay: .10s; }
.kpi-card:nth-child(3) { animation-delay: .15s; }
.kpi-card:nth-child(4) { animation-delay: .20s; }
.kpi-card:nth-child(5) { animation-delay: .25s; }
.kpi-card:nth-child(6) { animation-delay: .30s; }

/* ── Tab Navigation ──────────────────────────────────────────────────────── */
.tab-nav {
    display: flex;
    gap: 4px;
    margin: 0 auto 28px;
    background: rgba(0,38,62,0.5);
    border: 1px solid rgba(0,196,179,0.12);
    border-radius: 14px;
    padding: 4px;
    width: fit-content;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: none;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    padding: 9px 22px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(.16,1,.3,1);
    white-space: nowrap;
    letter-spacing: -.1px;
}

.tab-btn:hover {
    color: var(--text-1);
    background: rgba(255,255,255,0.04);
}

.tab-btn.active {
    background: rgba(0,196,179,0.14);
    color: var(--accent);
    border: 1px solid rgba(0,196,179,0.28);
    box-shadow: 0 2px 12px rgba(0,196,179,0.12);
}

.tab-pane { animation: fadeUp .35s cubic-bezier(.16,1,.3,1); }

/* ── BI Portal Tab ───────────────────────────────────────────────────────── */
#tab-bi-portal {
    margin: -32px -28px -32px;
    padding: 20px 28px 0;
}

.bi-portal-rotate-overlay {
    display: none;
}

@media screen and (max-width: 768px) and (orientation: portrait) {
    #tab-bi-portal .bi-portal-rotate-overlay {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 20px;
        position: fixed;
        inset: 0;
        z-index: 9999;
        background: #0f172a;
        color: #e2e8f0;
        text-align: center;
        padding: 32px;
    }
    #tab-bi-portal .bi-portal-rotate-overlay p {
        font-size: 16px;
        font-weight: 500;
        max-width: 240px;
        line-height: 1.6;
        color: #94a3b8;
    }
    #tab-bi-portal .bi-portal-rotate-overlay svg {
        color: #38bdf8;
    }
    #tab-bi-portal .bi-portal-notice,
    #tab-bi-portal .bi-portal-wrap {
        display: none;
    }
}
.tab-btn[data-tab="bi-portal"] {
    color: #fbbf24;
    border-color: rgba(234, 179, 8, 0.25);
}
.tab-btn[data-tab="bi-portal"]:hover {
    background: rgba(234, 179, 8, 0.08);
    color: #fcd34d;
    border-color: rgba(234, 179, 8, 0.4);
}
.tab-btn[data-tab="bi-portal"].active {
    background: rgba(234, 179, 8, 0.15);
    color: #fbbf24;
    border-color: rgba(234, 179, 8, 0.5);
    box-shadow: 0 2px 10px rgba(234, 179, 8, 0.2);
}
.bi-portal-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 9px 14px;
    border-radius: var(--radius-sm, 8px);
    background: rgba(234, 179, 8, 0.12);
    border: 1px solid rgba(234, 179, 8, 0.45);
    color: #fbbf24;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.bi-portal-wrap {
    height: calc(100vh - 130px);
    min-height: 540px;
    border-radius: var(--radius);
    overflow: hidden;
}
.bi-portal-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ── Countries Tab — Fullscreen Globe + Slide Panel ─────────────────────── */
.globe-full-wrap {
    display: flex;
    height: calc(100vh - 200px);
    min-height: 540px;
    gap: 10px;
    border-radius: var(--radius);
    overflow: visible;
    border: none;
    background: none;
}

#globe-fullscreen,
#imp-globe-fullscreen,
#rpt-globe-fullscreen,
#rpt2-globe-fullscreen {
    flex: 1;
    position: relative;
    min-width: 0;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid rgba(60,207,195,0.12);
    background: rgba(4,15,28,0.7);
}

#globe-svg-container,
#imp-globe-svg-container,
#rpt-globe-svg-container,
#rpt2-globe-svg-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#globe-tooltip,
#imp-globe-tooltip,
#rpt-globe-tooltip,
#rpt2-globe-tooltip {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    background: rgba(6,43,68,0.96);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(60,207,195,0.3);
    border-radius: 14px;
    padding: 14px 16px;
    display: none;
    pointer-events: auto;
    z-index: 10;
    max-width: 340px;
}

/* Embedded globe section inside Impact tab */
.imp-globe-wrap {
    margin: 8px 0 24px;
}

/* Zoom controls */
.globe-zoom-btns {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
}

.globe-zoom-btn {
    width: 28px; height: 28px;
    background: rgba(60,207,195,0.12);
    border: 1px solid rgba(60,207,195,0.28);
    border-radius: 8px;
    color: #3ccfc3;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.globe-zoom-btn:hover:not(:disabled) { background: rgba(60,207,195,0.26); border-color: rgba(60,207,195,0.5); }
.globe-zoom-btn:disabled { opacity: 0.28; cursor: default; }

/* "Countries" open-panel button */
.globe-countries-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(0,196,179,0.12);
    border: 1px solid rgba(0,196,179,0.3);
    border-radius: 10px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    padding: 7px 14px 7px 10px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    letter-spacing: .02em;
}
.globe-countries-btn:hover { background: rgba(0,196,179,0.22); border-color: rgba(0,196,179,0.5); }
.globe-countries-btn.active { background: rgba(0,196,179,0.22); border-color: rgba(0,196,179,0.55); box-shadow: 0 0 12px rgba(0,196,179,0.2); }

.globe-footer-label {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 6px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255,255,255,0.3);
    pointer-events: none;
    white-space: nowrap;
}

/* ── Slide-out Countries Panel ───────────────────────────────────────────── */
.countries-panel {
    flex-shrink: 0;
    width: 0;
    overflow: hidden;
    background: rgba(2,12,24,0.98);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(0,196,179,0.14);
    border-radius: var(--radius);
    transition: width 0.45s cubic-bezier(.16,1,.3,1);
}

.countries-panel.open {
    width: 340px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(60,207,195,0.25) transparent;
}
.countries-panel.open::-webkit-scrollbar { width: 5px; }
.countries-panel.open::-webkit-scrollbar-track { background: transparent; }
.countries-panel.open::-webkit-scrollbar-thumb { background: rgba(60,207,195,0.25); border-radius: 4px; }

/* Fixed-width inner so content never squishes during transition */
.countries-panel-inner {
    width: 340px;
    padding: 20px 18px 28px;
}

.countries-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.countries-panel-head h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-1);
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* ── Summary cards ───────────────────────────────────────────────────────── */
.countries-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

.summary-card {
    background: rgba(0,38,62,0.6);
    border: 1px solid rgba(0,196,179,0.14);
    border-top: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.summary-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 6px;
}

.summary-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-1);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

/* ── Country Cards ───────────────────────────────────────────────────────── */
.country-card {
    background: rgba(0,26,46,0.5);
    border: 1px solid rgba(0,196,179,0.1);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .2s;
}
.country-card:hover {
    background: rgba(0,38,62,0.8);
    border-color: rgba(0,196,179,0.28);
    transform: translateX(2px);
}
.country-card.selected {
    background: rgba(0,196,179,0.08);
    border-color: rgba(0,196,179,0.5);
    box-shadow: 0 0 0 1px rgba(0,196,179,0.25), inset 0 0 20px rgba(0,196,179,0.04);
}

.country-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 9px;
}

.country-flag-name { display: flex; align-items: center; gap: 10px; }

.country-name { font-size: 13px; font-weight: 600; color: var(--text-1); line-height: 1.3; }
.country-bene { font-size: 11px; color: var(--accent); margin-top: 2px; }
.country-pct  { font-size: 12px; font-weight: 700; color: var(--text-2); white-space: nowrap; flex-shrink: 0; }

.country-bar-wrap {
    height: 2px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    margin-bottom: 9px;
    overflow: hidden;
}
.country-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00c4b3, #3ccfc3);
    border-radius: 2px;
}

/* ── Country Search Bar ──────────────────────────────────────────────────── */
.countries-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 14px;
}

.countries-search-icon {
    position: absolute;
    left: 11px;
    color: var(--text-2);
    pointer-events: none;
    flex-shrink: 0;
}

.countries-search-input {
    width: 100%;
    background: rgba(0,38,62,0.6);
    border: 1px solid rgba(0,196,179,0.18);
    border-radius: 10px;
    color: var(--text-1);
    font-family: inherit;
    font-size: 12px;
    padding: 9px 34px 9px 32px;
    outline: none;
    transition: border-color .2s, background .2s;
}
.countries-search-input::placeholder { color: var(--text-2); }
.countries-search-input:focus {
    border-color: rgba(0,196,179,0.5);
    background: rgba(0,38,62,0.9);
}

.countries-search-clear {
    position: absolute;
    right: 8px;
    background: rgba(255,255,255,0.08);
    border: none;
    border-radius: 5px;
    color: var(--text-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px; height: 20px;
    transition: background .15s, color .15s;
}
.countries-search-clear:hover { background: rgba(255,255,255,0.15); color: var(--text-1); }

/* ── Countries Toggle ────────────────────────────────────────────────────── */
.countries-toggle-wrap {
    margin: 10px 0 12px;
}
.countries-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    user-select: none;
}
.countries-toggle-switch {
    position: relative;
    width: 34px;
    height: 18px;
    flex-shrink: 0;
}
.countries-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.countries-toggle-track {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.12);
    border-radius: 9px;
    transition: background .2s;
    cursor: pointer;
}
.countries-toggle-track::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    left: 3px;
    top: 3px;
    background: rgba(255,255,255,0.45);
    border-radius: 50%;
    transition: transform .2s, background .2s;
}
.countries-toggle-switch input:checked + .countries-toggle-track {
    background: rgba(0,196,179,0.65);
}
.countries-toggle-switch input:checked + .countries-toggle-track::before {
    transform: translateX(16px);
    background: #fff;
}
.countries-toggle-text {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    line-height: 1.3;
    transition: color .2s;
}
.countries-toggle-label:hover .countries-toggle-text { color: rgba(255,255,255,0.7); }
.countries-toggle-switch input:checked ~ .countries-toggle-text { color: #3ccfc3; }
.light-theme .countries-toggle-track          { background: rgba(0,100,90,0.18); }
.light-theme .countries-toggle-track::before  { background: rgba(0,100,90,0.5); }
.light-theme .countries-toggle-text           { color: var(--text-2); }
.light-theme .countries-toggle-label:hover .countries-toggle-text { color: var(--text-1); }
.light-theme .countries-toggle-switch input:checked ~ .countries-toggle-text { color: #00a093; }

.countries-no-results {
    text-align: center;
    color: var(--text-2);
    font-size: 12px;
    padding: 32px 16px;
    border: 1px dashed rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
}

.country-progs { display: flex; flex-wrap: wrap; gap: 4px; }
.prog-tag {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid;
    letter-spacing: .03em;
}

/* ── Theme toggle icons ──────────────────────────────────────────────────── */
.theme-toggle .icon-moon { display: none; }
.light-theme .theme-toggle .icon-sun  { display: none; }
.light-theme .theme-toggle .icon-moon { display: block; }

/* ── Light Theme ─────────────────────────────────────────────────────────── */
.light-theme,
.light-theme body {
    --bg:        #d4ede9;
    --bg-card:   #ffffff;
    --bg-card-h: #ffffff;
    --border:    rgba(0,160,147,0.38);
    --border-h:  rgba(0,160,147,0.65);
    --text-1:    #0a1f1c;
    --text-2:    #2a6b63;
    --text-3:    #5a9a91;
    background-color: var(--bg);
    color: var(--text-1);
}

/* Login */
.light-theme .overlay {
    background: radial-gradient(ellipse at 50% 40%, #b8e0da 0%, #9ed0c9 70%);
}
.light-theme .login-card {
    background: #ffffff;
    border-color: rgba(0,160,147,0.4);
    box-shadow: 0 32px 80px rgba(0,0,0,0.14), inset 0 1px 0 rgba(255,255,255,1);
}
.light-theme .login-card h1 { color: var(--text-1); }
.light-theme .login-card > p { color: var(--text-2); }
.light-theme .login-note     { color: var(--text-3); }

/* Header — already white, no overrides needed */
.light-theme .refresh-time   { color: var(--text-2); }

/* Loading / Error */
.light-theme .spinner        { border-color: rgba(0,0,0,0.1); border-top-color: #00c4b3; }
.light-theme .loading-state p { color: var(--text-2); }

/* Hero */
.light-theme .hero {
    background: linear-gradient(135deg, rgba(0,196,179,0.18) 0%, rgba(255,255,255,0.7) 100%);
    border-color: rgba(0,160,147,0.35);
}
.light-theme .hero-tag { background: rgba(0,196,179,0.14); border-color: rgba(0,160,147,0.35); color: #007a71; }

/* Sections */
.light-theme .section-title  { color: var(--text-2); }
.light-theme .section-badge  { background: rgba(0,196,179,0.12); border-color: rgba(0,160,147,0.35); color: #007a71; }

/* KPI Cards */
.light-theme .kpi-card {
    background: #ffffff;
    border-color: rgba(0,160,147,0.28);
    box-shadow: 0 2px 12px rgba(0,100,90,0.08);
}
.light-theme .kpi-card:hover {
    background: #ffffff;
    border-color: rgba(0,160,147,0.55);
    box-shadow: 0 16px 48px rgba(0,100,90,0.14), 0 0 32px -8px var(--kpi-color, var(--accent));
}
.light-theme .kpi-card.selected {
    box-shadow: 0 0 0 2px var(--kpi-color, var(--accent)), 0 12px 40px rgba(0,100,90,0.15) !important;
}
.light-theme .kpi-value  { color: var(--text-1); }
.light-theme .kpi-title  { color: var(--text-2); }
.light-theme .kpi-label  { color: var(--text-3); }
.light-theme .kpi-null   { color: var(--text-3); }
.light-theme .kpi-footer { border-top-color: rgba(0,100,90,0.1); }
.light-theme .kpi-icon   { background: rgba(0,196,179,0.12); border-color: rgba(0,160,147,0.3); }

/* KPI Detail Panel */
.light-theme .kpi-panel         { background: #ffffff; border-color: rgba(0,160,147,0.38); box-shadow: 0 8px 40px rgba(0,100,90,0.1); }
.light-theme .kpi-panel-header h3 { color: var(--text-1); }
.light-theme .kpi-panel-badge   { background: rgba(0,196,179,0.14); border-color: rgba(0,160,147,0.4); color: #007a71; }
.light-theme .kpi-panel-visual,
.light-theme .kpi-panel-chart   { background: rgba(0,196,179,0.05); border-color: rgba(0,160,147,0.25); }
.light-theme .panel-chart-title { color: var(--text-2); }

/* Tabs */
.light-theme .tab-nav  { background: #ffffff; border-color: rgba(0,160,147,0.35); box-shadow: 0 2px 10px rgba(0,100,90,0.08); }
.light-theme .tab-btn  { color: var(--text-2); }
.light-theme .tab-btn:hover  { background: rgba(0,196,179,0.12); color: var(--text-1); }
.light-theme .tab-btn.active { background: #00c4b3; color: #fff; border-color: #00a899; box-shadow: 0 2px 10px rgba(0,196,179,0.35); }

/* Globe fullscreen wrap */
.light-theme .globe-full-wrap     { background: none; border-color: transparent; }
.light-theme #globe-fullscreen,
.light-theme #imp-globe-fullscreen,
.light-theme #rpt-globe-fullscreen,
.light-theme #rpt2-globe-fullscreen { background: #b8d8ea; border-color: rgba(10,55,95,0.18); }
.light-theme .globe-countries-btn { background: #ffffff; border-color: rgba(0,160,147,0.5); color: #007a71; box-shadow: 0 2px 8px rgba(0,100,90,0.15); }
.light-theme .globe-countries-btn:hover  { background: #f0faf9; border-color: #00c4b3; }
.light-theme .globe-countries-btn.active { background: #00c4b3; color: #fff; border-color: #00a899; }
.light-theme .globe-zoom-btn  { background: #ffffff; border-color: rgba(0,160,147,0.45); color: #007a71; box-shadow: 0 2px 6px rgba(0,100,90,0.12); }
.light-theme .globe-zoom-btn:hover:not(:disabled) { background: #00c4b3; color: #fff; border-color: #00a899; }
.light-theme .globe-footer-label { color: rgba(0,60,50,0.35); }

/* Globe tooltip stays dark for contrast against the globe SVG */
.light-theme #globe-tooltip,
.light-theme #imp-globe-tooltip,
.light-theme #rpt-globe-tooltip,
.light-theme #rpt2-globe-tooltip { background: rgba(6,43,68,0.96); border-color: rgba(60,207,195,0.45); }

/* Countries slide panel */
.light-theme .countries-panel       { background: #f0faf8; }
.light-theme .countries-panel.open  { border-right: 1.5px solid rgba(0,160,147,0.3); scrollbar-color: rgba(0,160,147,0.3) transparent; }
.light-theme .countries-panel.open::-webkit-scrollbar-thumb { background: rgba(0,160,147,0.3); }
.light-theme .countries-panel-head h3 { color: var(--text-1); }

/* Summary cards */
.light-theme .summary-card   { background: #ffffff; border-color: rgba(0,160,147,0.3); box-shadow: 0 2px 10px rgba(0,100,90,0.08); }
.light-theme .summary-label  { color: var(--text-2); }
.light-theme .summary-value  { color: var(--text-1); }

/* Country cards */
.light-theme .country-card        { background: #ffffff; border-color: rgba(0,160,147,0.22); }
.light-theme .country-card:hover  { background: #f0faf8; border-color: rgba(0,160,147,0.5); box-shadow: 0 4px 16px rgba(0,100,90,0.1); }
.light-theme .country-card.selected { background: rgba(0,196,179,0.1); border-color: #00c4b3; box-shadow: 0 0 0 1.5px rgba(0,196,179,0.35); }
.light-theme .country-name  { color: var(--text-1); }
.light-theme .country-pct   { color: var(--text-2); }
.light-theme .country-bar-wrap { background: rgba(0,100,90,0.1); }

/* Search bar */
.light-theme .countries-search-input { background: #ffffff; border-color: rgba(0,160,147,0.35); color: var(--text-1); }
.light-theme .countries-search-input:focus { background: #fff; border-color: #00c4b3; box-shadow: 0 0 0 3px rgba(0,196,179,0.18); }
.light-theme .countries-search-input::placeholder { color: var(--text-3); }
.light-theme .countries-search-clear { background: rgba(0,100,90,0.1); color: var(--text-2); }
.light-theme .countries-no-results   { color: var(--text-2); border-color: rgba(0,100,90,0.12); }

/* Footer */
.light-theme .footer { background: #ffffff; border-top: 1.5px solid rgba(0,160,147,0.25); color: var(--text-2); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 960px)  { .charts-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px)  { .kpi-grid { grid-template-columns: 1fr 1fr; } .main { padding: 16px; } .header { padding: 0 16px; } .refresh-time { display: none; } .globe-countries-btn { display: none !important; } .live-label { display: none; } .live-badge { padding: 5px 7px; } }
@media (max-width: 420px)  { .kpi-grid { grid-template-columns: 1fr; } }

@media (max-width: 900px) {
    .globe-full-wrap { height: calc(100vh - 170px); min-height: 420px; }
    .countries-panel.open { width: 300px; }
    .countries-panel-inner { width: 300px; }
}
@media (max-width: 640px) {
    .tab-nav { width: 100%; }
    .tab-btn { flex: 1; justify-content: center; padding: 9px 12px; font-size: 12px; }
    .globe-full-wrap { height: calc(100vh - 160px); min-height: 380px; border-radius: var(--radius-sm); }
    .countries-panel.open { width: 280px; }
    .countries-panel-inner { width: 280px; padding: 16px 14px 20px; }
    #globe-tooltip, #imp-globe-tooltip, #rpt-globe-tooltip, #rpt2-globe-tooltip { max-width: none; }

}

/* ═══════════════════════════════════════════════════════════════════════════
   TDS IMPACT TAB  (v2 — carousel + redesigned programs)
═══════════════════════════════════════════════════════════════════════════ */

/* ── Shared section wrapper ──────────────────────────────────────────────── */
.imp-section { margin-bottom: 52px; }
.imp-section-title {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .1em;
    color: var(--text-2);
    margin-bottom: 22px; padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

/* ── Section 1: Static KPI cards ────────────────────────────────────────── */
.imp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.imp-kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: 3px solid var(--kc, var(--accent));
    border-radius: var(--radius);
    padding: 32px 28px;
    text-align: center;
    animation: impFadeUp .5s cubic-bezier(.16,1,.3,1) both;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.imp-kpi-card:hover {
    border-color: var(--kc, var(--accent));
    box-shadow: 0 12px 40px rgba(0,0,0,0.25), 0 0 0 1px var(--kc, var(--accent));
    transform: translateY(-2px);
}
.imp-kpi-value {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 10px;
}
.imp-kpi-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    letter-spacing: .02em;
}

@keyframes impFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Section 2: Coverflow carousel ───────────────────────────────────────── */
.imp-carousel-outer {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px 18px;
    margin-bottom: 20px;
}
.imp-carousel-loading {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: 60px 0; color: var(--text-2); font-size: 13px;
}
.imp-cf-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.imp-carousel-search-wrap {
    position: relative; flex: 1; max-width: 280px;
}
.imp-search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-2); pointer-events: none;
}
.imp-carousel-search {
    width: 100%; background: rgba(0,38,62,.6);
    border: 1px solid var(--border); border-radius: 10px;
    color: var(--text-1); font-family: inherit; font-size: 13px;
    padding: 9px 14px 9px 34px; outline: none;
    transition: border-color .2s, background .2s;
}
.imp-carousel-search:focus { border-color: rgba(0,196,179,.5); background: rgba(0,38,62,.9); }
.imp-carousel-search::placeholder { color: var(--text-2); }
.imp-cf-count { font-size: 12px; color: var(--text-2); white-space: nowrap; }

/* Row: nav buttons + coverflow stage */
.imp-cf-frame {
    display: flex; align-items: center; gap: 8px;
}
.imp-nav-btn {
    flex-shrink: 0; width: 40px; height: 40px;
    background: rgba(0,38,62,.6); border: 1px solid var(--border);
    border-radius: 50%; color: var(--text-2);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .2s, color .2s, border-color .2s;
    align-self: center;
}
.imp-nav-btn:hover:not(:disabled) {
    background: rgba(0,196,179,.15); color: var(--accent); border-color: var(--border-h);
}
.imp-nav-btn:disabled { opacity: .25; cursor: not-allowed; }

/* Coverflow stage — cards are absolute inside */
.imp-cf-stage {
    flex: 1; position: relative;
    height: 290px; /* card height 260 + 30px breathing room */
    overflow: hidden;
    /* Fade edges so side cards bleed out gracefully */
    mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

/* ── Coverflow cards ─────────────────────────────────────────────────────── */
.imp-cf-card {
    width: 200px; height: 260px;
    cursor: pointer;
}
.imp-cf-card.center { cursor: pointer; }
.imp-cf-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius); }

.imp-cf-inner {
    position: relative; width: 100%; height: 100%;
    transform-style: preserve-3d;
    transition: transform .5s cubic-bezier(.4,0,.2,1);
    border-radius: var(--radius);
}
.imp-cf-card.flipped .imp-cf-inner { transform: rotateY(180deg); }

/* Front — flag as hero */
.imp-cf-front, .imp-cf-back {
    position: absolute; inset: 0;
    border-radius: var(--radius);
    backface-visibility: hidden; -webkit-backface-visibility: hidden;
    overflow: hidden;
    border: 1px solid var(--border);
    display: flex; flex-direction: column;
}
.imp-cf-front {
    background: linear-gradient(160deg, rgba(0,30,55,.85) 0%, rgba(0,10,25,.95) 100%);
    align-items: center; justify-content: space-between;
}
.imp-cf-card.center .imp-cf-front {
    border-color: rgba(0,196,179,.35);
    box-shadow: 0 8px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(0,196,179,.2);
}

/* The flag takes up most of the front card */
.imp-cf-flag-hero {
    flex: 1; display: flex; align-items: center; justify-content: center;
    filter: drop-shadow(0 6px 16px rgba(0,0,0,.5));
    user-select: none;
}

/* flag-icons size modifiers — flag-icons renders via background-image, sized by width+height */
.fi.imp-fi-hero {
    width: 100px; height: 70px;
    border-radius: 6px;
    box-shadow: 0 4px 18px rgba(0,0,0,.45);
    display: block; flex-shrink: 0;
}
.fi.imp-fi-sm {
    width: 22px; height: 16px;
    border-radius: 2px;
    display: block; flex-shrink: 0;
}
.fi.imp-fi-back {
    width: 36px; height: 26px;
    border-radius: 3px;
    display: block; position: relative;
}
.fi.imp-fi-wm {
    /* Watermark — large, low-opacity */
    width: 180px; height: 126px;
    border-radius: 8px;
    opacity: .09;
    display: block;
}
/* Fallback when no ISO2 code */
.fi-fallback { font-size: 72px; line-height: 1; }

/* Bottom nameplate */
.imp-cf-nameplate {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 12px 12px;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(6px);
    border-top: 1px solid rgba(255,255,255,.06);
}
.imp-cf-flag-sm  { display: flex; align-items: center; flex-shrink: 0; }
.imp-cf-cname    { font-size: 12px; font-weight: 700; color: #e8f4f8; text-align: center; line-height: 1.3; }

/* Back — large flag watermark + details */
.imp-cf-back {
    transform: rotateY(180deg);
    background: linear-gradient(160deg, rgba(0,40,68,.97) 0%, rgba(0,18,38,.99) 100%);
    border-color: rgba(0,196,179,.3);
    align-items: center; justify-content: flex-start;
    padding: 16px 14px 14px;
    gap: 0;
}
/* Giant flag watermark in background */
.imp-cf-wm {
    position: absolute; opacity: .09;
    top: -10px; right: -10px; pointer-events: none; user-select: none;
    transform: rotate(12deg);
    display: flex; align-items: center;
}
.imp-cf-back-flag { margin-bottom: 5px; position: relative; display: flex; align-items: center; }
.imp-cf-back-name {
    font-size: 13px; font-weight: 800; color: var(--accent);
    text-align: center; line-height: 1.3; margin-bottom: 10px; position: relative;
}
.imp-cf-sep { width: 100%; height: 1px; background: var(--border); margin: 6px 0; }
.imp-cf-bene-label {
    font-size: 9px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--text-2); margin-bottom: 3px; position: relative;
}
.imp-cf-bene-val {
    font-size: 28px; font-weight: 800; color: var(--text-1);
    letter-spacing: -1px; line-height: 1; margin-bottom: 10px; position: relative;
}
.imp-cf-progs { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; position: relative; }
.imp-flip-prog {
    font-size: 9px; font-weight: 600; padding: 3px 8px; border-radius: 4px;
    background: rgba(0,196,179,.15); border: 1px solid rgba(0,196,179,.3); color: var(--accent);
}
.imp-cf-no-prog { font-size: 10px; color: var(--text-2); }

/* Hint bar below stage */
.imp-cf-hint-bar {
    text-align: center; margin-top: 12px;
    font-size: 11px; color: var(--text-2); opacity: .7;
}

/* ── Beneficiaries · Countries table ────────────────────────────────────── */
.ict-section {
    margin: 28px 0 24px;
}

.ict-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.ict-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.01em;
}

.ict-dot {
    color: #00c4b3;
    font-size: 18px;
    line-height: 1;
    font-weight: 300;
}

.ict-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    background: rgba(60,207,195,0.1);
    border: 1px solid rgba(60,207,195,0.2);
    padding: 2px 10px;
    border-radius: 20px;
}

.ict-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.ict-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ict-th {
    padding: 0 16px;
    height: 42px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-2);
    background: rgba(60,207,195,0.06);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    vertical-align: middle;
}

/* Country header cell holds the search input */
.ict-th-search { padding: 6px 12px; width: 200px; min-width: 170px; }

.ict-search-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 10px;
}

.ict-search-icon { color: var(--text-2); flex-shrink: 0; }

.ict-search {
    background: none;
    border: none;
    outline: none;
    font-size: 12px;
    font-family: inherit;
    color: var(--text-1);
    width: 100%;
    min-width: 0;
}
.ict-search::placeholder { color: var(--text-3); }

.ict-row {
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}

.ict-row:last-child { border-bottom: none; }
.ict-row:hover { background: rgba(60,207,195,0.05); }

/* Fixed column widths — prevents collision */
.ict-col-country  { padding: 10px 16px; width: 200px; min-width: 170px; }
.ict-col-bar      { padding: 10px 16px; width: 260px; min-width: 220px; white-space: nowrap; }
.ict-col-programs { padding: 10px 16px; }

.ict-country-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ict-flag {
    width: 28px;
    height: 20px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}

.ict-flag-fb { font-size: 18px; flex-shrink: 0; }

.ict-country-name {
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

/* Bar: fixed-width track so number never drifts into Programs column */
.ict-col-bar {
    display: table-cell;
    vertical-align: middle;
}

.ict-bar-track {
    display: inline-block;
    width: 140px;
    height: 8px;
    background: rgba(60,207,195,0.1);
    border-radius: 4px;
    vertical-align: middle;
    flex-shrink: 0;
    overflow: hidden;
    margin-right: 10px;
}

.ict-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #00c4b3, #3ccfc3);
    transition: width .4s ease;
}

.ict-bar-num {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    white-space: nowrap;
    vertical-align: middle;
    min-width: 70px;
}

.ict-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ict-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid;
    white-space: nowrap;
}

.ict-row-hidden { display: none; }

.ict-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 11px 16px;
    background: rgba(60,207,195,0.06);
    border: none;
    border-top: 1px solid var(--border);
    color: #3ccfc3;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, color .15s;
    letter-spacing: .02em;
}
.ict-expand-btn:hover { background: rgba(60,207,195,0.13); color: #00c4b3; }

/* Light theme overrides */
.light-theme .ict-table-wrap  { border-color: rgba(0,160,147,0.2); }
.light-theme .ict-th          { background: rgba(0,196,179,0.06); border-color: rgba(0,160,147,0.2); color: var(--text-2); }
.light-theme .ict-row         { border-color: rgba(0,160,147,0.12); }
.light-theme .ict-row:hover   { background: rgba(0,196,179,0.05); }
.light-theme .ict-expand-btn  { border-color: rgba(0,160,147,0.2); color: #007a71; }
.light-theme .ict-expand-btn:hover { background: rgba(0,196,179,0.1); color: #00a899; }
.light-theme .ict-search-wrap { background: #ffffff; border-color: rgba(0,160,147,0.3); }
.light-theme .ict-bar-track   { background: rgba(0,196,179,0.12); }

/* ── Program definitions ─────────────────────────────────────────────────── */
.imp-prog-defs-wrap {
    display: flex; flex-wrap: wrap; gap: 10px;
    padding: 14px 0 0; border-top: 1px solid var(--border);
}
.imp-prog-def {
    font-size: 11px; color: var(--text-2); padding: 5px 14px;
    border-radius: 20px; background: var(--bg-card); border: 1px solid var(--border);
}
.imp-prog-def strong { color: var(--accent); font-weight: 700; }
.imp-no-data { color: var(--text-2); text-align: center; padding: 32px; font-size: 13px; }

/* ── Section 3: Strategic Programs ──────────────────────────────────────── */
.imp-prog-tabs {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;
}
.imp-prog-tab {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-2); border-radius: 24px;
    padding: 9px 20px; font-size: 13px; font-weight: 500;
    font-family: inherit; cursor: pointer;
    transition: all .2s; white-space: nowrap;
}
.imp-prog-tab-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; opacity: .6;
    transition: opacity .2s;
}
.imp-prog-tab:hover { border-color: var(--border-h); color: var(--text-1); }
.imp-prog-tab:hover .imp-prog-tab-dot { opacity: 1; }
.imp-prog-tab.active {
    color: #fff; font-weight: 600;
    background: rgba(0,0,0,.15);
    border-color: var(--prog-color, var(--accent));
    box-shadow: 0 0 0 1px var(--prog-color, var(--accent)), 0 4px 20px rgba(0,0,0,.2);
}
.imp-prog-tab.active .imp-prog-tab-dot { opacity: 1; }

/* Panel outer */
.imp-prog-panel {
    border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border);
    animation: impFadeUp .35s cubic-bezier(.16,1,.3,1) both;
}
.imp-prog-panel-inner { background: var(--bg-card); }

/* Panel header stripe */
.imp-prog-panel-header {
    padding: 28px 36px 24px;
    border-bottom: 1px solid var(--border);
    border-left: 5px solid var(--prog-color, var(--accent));
}
.imp-prog-badge {
    display: inline-block; font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em;
    padding: 4px 12px; border-radius: 20px; border: 1px solid;
    margin-bottom: 14px;
}
.imp-prog-name {
    font-size: 26px; font-weight: 800; color: var(--text-1);
    letter-spacing: -.4px; margin-bottom: 8px; line-height: 1.2;
}
.imp-prog-tagline {
    font-size: 15px; color: var(--prog-color, var(--accent));
    font-weight: 500; line-height: 1.5;
}

/* Panel body */
.imp-prog-panel-body {
    display: grid; grid-template-columns: 1fr 320px; gap: 0;
}
.imp-prog-left {
    padding: 28px 32px; border-right: 1px solid var(--border);
}
.imp-prog-desc {
    font-size: 14px; color: var(--text-2); line-height: 1.75;
    margin-bottom: 24px;
}
.imp-feat-title {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: var(--text-2); margin-bottom: 14px;
}
.imp-feat-list {
    list-style: none; display: flex; flex-direction: column; gap: 11px;
}
.imp-feat-list li {
    font-size: 13.5px; color: var(--text-1);
    display: flex; align-items: flex-start; gap: 10px; line-height: 1.5;
}
.imp-feat-dot {
    flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%;
    margin-top: 6px;
}

/* Right column */
.imp-prog-right {
    padding: 28px 24px; display: flex; flex-direction: column; gap: 24px;
    background: rgba(0,0,0,.1);
}
.imp-prog-stats-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.imp-prog-stat-card {
    background: rgba(0,38,62,.6); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 16px 12px; text-align: center;
    transition: border-color .2s;
}
.imp-prog-stat-card:hover { border-color: var(--prog-color, var(--accent)); }
.imp-stat-value {
    font-size: 26px; font-weight: 800; letter-spacing: -1px; line-height: 1; margin-bottom: 6px;
}
.imp-stat-label { font-size: 10px; color: var(--text-2); line-height: 1.3; }

/* Logo placeholder */
.imp-logo-placeholder {
    border: 2px dashed; border-radius: var(--radius);
    padding: 20px 14px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    min-height: 100px;
}
.imp-logo-text {
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.imp-logo-sub { font-size: 10px; color: var(--text-2); }

.imp-partners-block {}
.imp-partners-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--text-2); margin-bottom: 10px;
}
.imp-partners-list { display: flex; flex-wrap: wrap; gap: 6px; }
.imp-partner-badge {
    font-size: 11px; font-weight: 500; padding: 5px 12px; border-radius: 7px;
    background: rgba(0,38,62,.6); border: 1px solid var(--border); color: var(--text-2);
    transition: border-color .15s, color .15s, background .15s;
}
.imp-partner-badge:hover {
    border-color: var(--prog-color, var(--accent));
    color: var(--text-1); background: rgba(0,38,62,.9);
}

/* ── Light theme overrides ───────────────────────────────────────────────── */
.light-theme .imp-kpi-card         { background: #fff; box-shadow: 0 2px 12px rgba(0,100,90,.06); }
.light-theme .imp-kpi-label        { color: var(--text-2); }
.light-theme .imp-carousel-outer   { background: #fff; border-color: rgba(0,160,147,.3); }
.light-theme .imp-carousel-search  { background: #fff; border-color: rgba(0,160,147,.35); color: var(--text-1); }
.light-theme .imp-carousel-search:focus { border-color: #00c4b3; }
.light-theme .imp-nav-btn          { background: #f0faf8; border-color: rgba(0,160,147,.3); color: var(--text-2); }
.light-theme .imp-nav-btn:hover:not(:disabled) { background: rgba(0,196,179,.15); }
.light-theme .imp-flip-front       { background: #fff; border-color: rgba(0,160,147,.22); }
.light-theme .imp-flip-back        { background: #f0faf8; border-color: rgba(0,160,147,.22); }
.light-theme .imp-card-name        { color: var(--text-1); }
.light-theme .imp-prog-def         { background: #fff; border-color: rgba(0,160,147,.25); }
.light-theme .imp-prog-tab         { background: #fff; border-color: rgba(0,160,147,.3); }
.light-theme .imp-prog-tab:hover   { background: #f0faf8; }
.light-theme .imp-prog-panel-inner { background: #fff; }
.light-theme .imp-prog-left        { border-right-color: rgba(0,160,147,.2); }
.light-theme .imp-prog-right       { background: rgba(0,196,179,.04); }
.light-theme .imp-prog-stat-card   { background: #fff; border-color: rgba(0,160,147,.22); }
.light-theme .imp-partner-badge    { background: #fff; border-color: rgba(0,160,147,.25); }
.light-theme .imp-prog-panel       { border-color: rgba(0,160,147,.3); }
.light-theme .imp-prog-panel-header { border-bottom-color: rgba(0,160,147,.2); }
.light-theme .imp-prog-name        { color: var(--text-1); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .imp-carousel-viewport { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
    .imp-kpi-grid                  { grid-template-columns: repeat(2, 1fr); }
    #tab-impact-report .imp-kpi-grid,
    #tab-impact-report-2 .imp-kpi-grid { grid-template-columns: repeat(3, 1fr); }
    .imp-carousel-viewport         { grid-template-columns: repeat(3, 1fr); }
    .imp-prog-panel-body           { grid-template-columns: 1fr; }
    .imp-prog-right                { border-top: 1px solid var(--border); background: none; }
    .imp-prog-stats-grid           { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 640px) {
    .imp-kpi-value                 { font-size: 36px; }
    .imp-kpi-card                  { padding: 22px 16px; }
    #tab-impact-report .imp-kpi-grid,
    #tab-impact-report-2 .imp-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .imp-carousel-viewport         { grid-template-columns: repeat(2, 1fr); }
    .imp-country-card              { height: 200px; }
    .imp-card-flag                 { font-size: 40px; }
    .imp-prog-panel-header         { padding: 20px 20px 18px; }
    .imp-prog-left                 { padding: 20px; }
    .imp-prog-right                { padding: 16px 20px; }
    .imp-prog-name                 { font-size: 20px; }
    .imp-prog-stats-grid           { grid-template-columns: 1fr 1fr; }
    .imp-prog-tabs                 { gap: 6px; }
    .imp-prog-tab                  { font-size: 12px; padding: 8px 14px; }

    /* Hide countries panel on mobile so globe fills full width */
    .countries-panel,
    .countries-panel.open          { display: none !important; }
}

/* ── Section switcher (Programs ↔ Projects) ────────────────────────────── */
.imp-sec-switch {
    display: flex;
    border-top: 1px solid var(--border);
    border-bottom: 2px solid var(--border);
    background: rgba(0,0,0,.22);
    margin-top: 32px;
    border-radius: var(--radius) var(--radius) 0 0;
}
.imp-sec-btn {
    flex: 1;
    padding: 16px 24px;
    font-size: 14px; font-weight: 700;
    letter-spacing: .02em;
    background: none; border: none;
    color: var(--text-2);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color .2s, border-color .2s, background .2s;
    font-family: inherit;
}
.imp-sec-btn:hover  { color: var(--text-1); background: rgba(255,255,255,.06); }

/* Programs → teal, Projects → purple — always distinct, stronger when active */
.imp-sec-btn[data-sec="programs"] {
    color: #3ccfc3;
    background: rgba(60,207,195,.06);
    border-bottom: 3px solid rgba(60,207,195,.25);
    margin-bottom: -2px;
}
.imp-sec-btn[data-sec="programs"].active {
    color: #3ccfc3;
    border-bottom-color: #3ccfc3;
    background: rgba(60,207,195,.16);
}
.imp-sec-btn[data-sec="projects"] {
    color: #b49dfc;
    background: rgba(180,157,252,.06);
    border-bottom: 3px solid rgba(180,157,252,.25);
    margin-bottom: -2px;
}
.imp-sec-btn[data-sec="projects"].active {
    color: #b49dfc;
    border-bottom-color: #b49dfc;
    background: rgba(180,157,252,.16);
}

.imp-sec-body { display: block; }
.imp-sec-body.hidden { display: none !important; }

/* ── Our Partners section ────────────────────────────────────────────────── */
.imp-partners-section {
    margin-top: 48px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.imp-partners-header {
    margin-bottom: 24px;
}

.imp-partners-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.01em;
}

.light-theme .imp-partners-section { border-color: rgba(0,160,147,0.2); }

/* ── Section spacing inside TDS Impact tab ──────────────────────────────── */
#tab-tds-impact .imp-kpi-grid      { margin-bottom: 28px; }
#tab-tds-impact .imp-carousel-outer { margin-bottom: 8px; }
#tab-tds-impact .imp-prog-defs-wrap { margin-bottom: 0; }

/* ── TDS Overview tabs: always 5-column KPI row (shrinks on mobile) ──────── */
#tab-impact-report .imp-kpi-grid,
#tab-impact-report-2 .imp-kpi-grid  { grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 0; }
#tab-impact-report .imp-kpi-card,
#tab-impact-report-2 .imp-kpi-card  { padding: 22px 14px; }
#tab-impact-report .imp-kpi-value,
#tab-impact-report-2 .imp-kpi-value { font-size: 34px; letter-spacing: -1px; margin-bottom: 6px; }
#tab-impact-report .imp-kpi-label,
#tab-impact-report-2 .imp-kpi-label { font-size: 11px; }
@media (max-width: 900px) {
    #tab-impact-report .imp-kpi-grid,
    #tab-impact-report-2 .imp-kpi-grid { gap: 10px; }
    #tab-impact-report .imp-kpi-card,
    #tab-impact-report-2 .imp-kpi-card  { padding: 16px 10px; }
    #tab-impact-report .imp-kpi-value,
    #tab-impact-report-2 .imp-kpi-value { font-size: 26px; }
}
@media (max-width: 640px) {
    #tab-impact-report .imp-kpi-grid,
    #tab-impact-report-2 .imp-kpi-grid { gap: 5px; }
    #tab-impact-report .imp-kpi-card,
    #tab-impact-report-2 .imp-kpi-card  { padding: 10px 5px; }
    #tab-impact-report .imp-kpi-value,
    #tab-impact-report-2 .imp-kpi-value { font-size: 17px; letter-spacing: 0; margin-bottom: 3px; }
    #tab-impact-report .imp-kpi-label,
    #tab-impact-report-2 .imp-kpi-label { font-size: 8px; }
}
/* Breathing room between prog defs and the first section */
#tab-impact-report .imp-prog-defs-wrap,
#tab-impact-report-2 .imp-prog-defs-wrap { margin-bottom: 48px; }


/* ── Strategic Project card ─────────────────────────────────────────────── */
.imp-proj-card {
    padding: 0;
    animation: impFadeUp 0.42s cubic-bezier(.16,1,.3,1) both;
}
.imp-proj-card-hd {
    display: flex; align-items: flex-start; gap: 18px;
    padding: 24px 28px;
    margin-bottom: 0;
}
.imp-proj-logo-ph {
    flex-shrink: 0;
    width: 243px; height: 78px;
    border: 2px dashed;
    border-radius: 12px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 6px;
}
.imp-proj-title {
    font-size: 20px; font-weight: 700;
    color: var(--text-1); line-height: 1.25;
    margin: 0 0 6px;
}
.imp-proj-tagline-txt {
    font-size: 13px; font-weight: 500;
    margin: 0; line-height: 1.4;
}
/* Two-column layout: left text, right photo */
.imp-proj-body-grid {
    display: grid;
    grid-template-columns: 1fr 640px;
    border-top: 1px solid var(--border);
}
.imp-proj-body {
    padding: 20px 28px 28px;
    border-right: 1px solid var(--border);
}
.imp-proj-photo-img {
    width: 640px;
    height: 424px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    transition: transform 0.5s cubic-bezier(.25,.46,.45,.94);
}
.imp-proj-photo-col:hover .imp-proj-photo-img {
    transform: scale(1.06);
}
.imp-proj-photo-col {
    padding: 0;
    width: 640px;
    height: 424px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: rgba(0,0,0,.08);
    overflow: hidden;
}
.imp-proj-photo-ph {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 2px dashed;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.light-theme .imp-proj-photo-col { background: rgba(0,100,90,.03); }
.light-theme .imp-proj-body      { border-right-color: rgba(0,160,147,.2); }
@media (max-width: 900px) {
    .imp-proj-body-grid           { grid-template-columns: 1fr; }
    .imp-proj-body                { border-right: none; }
    .imp-proj-photo-col           { border-top: 1px solid var(--border); background: none; width: 100%; height: 260px; }
    .imp-proj-photo-img           { width: 100%; height: 260px; }
    .imp-proj-photo-ph            { max-width: 320px; }
    .imp-proj-photo-img           { object-fit: cover; }
}
.imp-proj-desc {
    font-size: 15px;
    line-height: 1.8;
    color: rgba(255,255,255,0.78);
    background: rgba(255,255,255,0.04);
    border-left: 3px solid rgba(255,255,255,0.18);
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    max-width: 560px;
    margin-bottom: 14px;
}
.light-theme .imp-proj-desc {
    color: #374151;
    background: rgba(0,0,0,0.03);
    border-left-color: rgba(0,0,0,0.15);
}
.imp-proj-desc:last-child { margin-bottom: 0; }
.imp-proj-features { margin-top: 4px; }

/* light theme */
.light-theme .imp-sec-switch { background: rgba(0,100,90,.04); border-color: rgba(0,160,147,.25); }
.light-theme .imp-sec-btn    { color: var(--text-2); }
.light-theme .imp-sec-btn[data-sec="programs"] {
    color: #007a71;
    background: rgba(0,160,147,.07);
    border-bottom-color: rgba(0,160,147,.3);
}
.light-theme .imp-sec-btn[data-sec="programs"].active {
    color: #007a71;
    border-bottom-color: #007a71;
    background: rgba(0,160,147,.14);
}
.light-theme .imp-sec-btn[data-sec="projects"] {
    color: #f97316;
    background: rgba(91,33,182,.06);
    border-bottom-color: rgba(91,33,182,.25);
}
.light-theme .imp-sec-btn[data-sec="projects"].active {
    color: #f97316;
    border-bottom-color: #f97316;
    background: rgba(91,33,182,.13);
}
.light-theme .imp-proj-desc  { color: #4b5563; }
.imp-sec-body.hidden { display: none; }

/* Project tabs reuse prog-tab styles; panel mirrors prog-panel */
.imp-sp-col .imp-proj-tabs {
    flex-shrink: 0;
    padding: 8px 12px; margin-bottom: 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto; white-space: nowrap;
    scrollbar-width: none;
}
.imp-sp-col .imp-proj-tabs::-webkit-scrollbar { display: none; }
.imp-sp-col .imp-proj-panel {
    flex: 1; min-height: 0;
    overflow-y: auto;
    border: none; border-radius: 0;
    animation: none;
}
.imp-proj-placeholder {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 48px 20px; gap: 14px;
    color: var(--text-2); font-size: 13px; text-align: center;
}

/* ── Light-mode: flip card back text must stay light (bg is always dark) ── */
.light-theme .imp-cf-front {
    background: linear-gradient(160deg, rgba(0,30,55,.88) 0%, rgba(0,10,25,.96) 100%);
}
.light-theme .imp-cf-back .imp-cf-bene-val   { color: #e8f4f8; }
.light-theme .imp-cf-back .imp-cf-bene-label { color: rgba(232,244,248,.65); }
.light-theme .imp-cf-back .imp-cf-no-prog    { color: rgba(232,244,248,.5); }
.light-theme .imp-cf-back .imp-flip-prog {
    color: #00c4b3;
    background: rgba(0,196,179,.2);
    border-color: rgba(0,196,179,.4);
}


/* ── TDS Programs Widget (live API) ───────────────────────────────────────── */
.tdsp-loading,
.tdsp-error {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 12px; padding: 32px 16px; text-align: center; font-size: 13px;
}
.tdsp-loading { color: var(--text-2); }
.tdsp-error   { color: #f0444c; }

/* ── Tab bar — pill style ───────────────────────────────────────────────── */
.tdsp-tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 0 20px;
    overflow-x: auto; scrollbar-width: none;
    border-bottom: 1px solid var(--border, rgba(255,255,255,.1));
    margin-bottom: 20px;
}
.tdsp-tab-bar::-webkit-scrollbar { display: none; }

/* Text-only program tabs — large pill */
.tdsp-tab {
    flex: 1;
    min-width: 120px;
    padding: 14px 22px;
    font-size: 13px; font-weight: 600; line-height: 1.35;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.04);
    color: var(--text-2);
    border-radius: 999px;
    transition: all .22s ease;
    font-family: inherit;
    white-space: normal; text-align: center;
}
.tdsp-tab:hover {
    color: var(--text-1);
    border-color: rgba(255,255,255,.25);
    background: rgba(255,255,255,.08);
}
/* dark mode: active tab — white text over the tinted bg */
.tdsp-tab.active { color: #e8f4f8; }

/* light mode: tabs look like proper segmented pills */
.light-theme .tdsp-tab {
    border-color: #d1d5db;
    background: #f4f6f8;
    color: #6b7280;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.light-theme .tdsp-tab:hover {
    border-color: #9ca3af;
    background: #e9ecef;
    color: #374151;
}
/* active: solid border + white bg + dark text */
.light-theme .tdsp-tab.active {
    color: #062b44 !important;
    background: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

/* Static bullet entrance animation */
@keyframes bulletSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Hide API content in programs widget — replaced by static bullets */
#tds-programs .tds-w-desc          { display: none !important; }
#tds-programs .tds-w-section-label { display: none !important; }
#tds-programs .tds-w-features      { display: none !important; }

/* Desktop: strip tab padding so logos fill edge-to-edge, no gray gap */
@media (min-width: 641px) {
    #tds-programs .tds-w-tab {
        padding: 0 !important;
        overflow: hidden !important;
        line-height: 0 !important;
    }
    #tds-programs .tds-w-tab img {
        width: 100% !important;
        height: auto !important;
        max-width: unset !important;
        display: block !important;
    }
}

/* ── Mobile: fix 1.1 — widget program tabs scrollable + abbreviated ── */
@media (max-width: 640px) {
    #tds-programs .tds-w-tabs {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    #tds-programs .tds-w-tabs::-webkit-scrollbar { display: none; }
    #tds-programs .tds-w-tab {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        font-size: 0 !important;        /* hide any text node */
    }
    #tds-programs .tds-w-tab > * { display: none !important; } /* hide logos/images */
    /* inject abbreviations via CSS — React cannot override pseudo-elements */
    #tds-programs .tds-w-tabs .tds-w-tab:nth-child(1)::after { content: 'K-12'; }
    #tds-programs .tds-w-tabs .tds-w-tab:nth-child(2)::after { content: 'DEGA'; }
    #tds-programs .tds-w-tabs .tds-w-tab:nth-child(3)::after { content: 'Skilled'; }
    #tds-programs .tds-w-tabs .tds-w-tab:nth-child(4)::after { content: 'BEST'; }
    #tds-programs .tds-w-tabs .tds-w-tab:nth-child(5)::after { content: 'DYOD'; }
    #tds-programs .tds-w-tab::after {
        font-size: 12px !important;
        font-weight: 700;
        font-family: inherit;
        color: currentColor;
    }
}

/* ── Mobile: fix 1.2 — header logo shrinks on small screens ── */
@media (max-width: 640px) {
    .header-left { flex-shrink: 1; min-width: 0; }
    .header-left img { max-width: 160px !important; width: 160px !important; height: auto !important; }
}

/* ── Mobile: theme toggle as slide-in side tab ── */
@media (max-width: 640px) {
    .btn-icon.theme-toggle {
        position: fixed !important;
        right: 0;
        top: 50%;
        transform: translateY(-50%) translateX(calc(100% - 14px));
        transition: transform 0.32s cubic-bezier(.16,1,.3,1);
        z-index: 500;
        border-radius: 10px 0 0 10px !important;
        border-right: none !important;
        width: 48px !important;
        height: 48px !important;
        box-shadow: -4px 0 18px rgba(0,0,0,0.22);
        background: rgba(0,196,179,0.22) !important;
        border-color: rgba(0,196,179,0.45) !important;
    }
    .btn-icon.theme-toggle.side-open {
        transform: translateY(-50%) translateX(0) !important;
    }
    .light-theme .btn-icon.theme-toggle {
        background: #ffffff !important;
        border-color: rgba(0,160,147,0.5) !important;
        box-shadow: -4px 0 18px rgba(0,0,0,0.12);
    }
}


/* ══════════════════════════════════════════════════════════════════════════
   PROGRAMS & PROJECTS REPORT TAB  (Board-Level)
══════════════════════════════════════════════════════════════════════════ */

/* ── Report Header ──────────────────────────────────────────────────────── */
.rpt-report-hd {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    padding: 32px 0 36px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 52px;
    flex-wrap: wrap;
}

.rpt-rh-eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--accent);
    margin-bottom: 10px;
    opacity: .8;
}

.rpt-rh-title {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.8px;
    color: var(--text-1);
    margin-bottom: 8px;
    line-height: 1.15;
}

.rpt-rh-sub {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.55;
    max-width: 500px;
}

.rpt-rh-stats {
    display: flex;
    gap: 28px;
    flex-shrink: 0;
    align-items: flex-start;
    flex-wrap: wrap;
}

.rpt-rh-stat {
    text-align: center;
}

.rpt-rh-stat-v {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 5px;
}

.rpt-rh-stat-l {
    font-size: 10px;
    color: var(--text-2);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* ── Section wrapper ────────────────────────────────────────────────────── */
.rpt-section {
    margin-bottom: 64px;
}

.rpt-sec-hd {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.rpt-sec-num {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
    color: var(--accent);
    background: rgba(0,196,179,0.1);
    border: 1px solid rgba(0,196,179,0.25);
    border-radius: 6px;
    padding: 4px 10px;
    flex-shrink: 0;
}

.rpt-sec-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.3px;
    color: var(--text-1);
    margin: 0;
}

.rpt-sec-count {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-2);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 3px 14px;
    border-radius: 20px;
    flex-shrink: 0;
}

/* ── Program Cards ──────────────────────────────────────────────────────── */
.rpt-programs {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.rpt-prog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}

.rpt-prog-card:hover {
    border-color: var(--border-h);
    box-shadow: 0 10px 36px rgba(0,0,0,0.22);
}

.rpt-prog-top-bar {
    height: 5px;
    width: 100%;
}

.rpt-prog-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 28px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.rpt-prog-num {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    border-radius: 6px;
    border: 1px solid;
    padding: 5px 11px;
    flex-shrink: 0;
    margin-top: 2px;
}

.rpt-prog-logo-ph {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    border: 1.5px dashed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.02);
}

.rpt-prog-title-wrap {
    flex: 1;
    min-width: 0;
}

.rpt-prog-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 3px 10px;
    border-radius: 100px;
    border: 1px solid;
    margin-bottom: 8px;
}

.rpt-prog-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.3px;
    color: var(--text-1);
    margin: 0 0 5px;
    line-height: 1.25;
}

.rpt-prog-tagline {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.5;
    margin: 0;
}

.rpt-prog-body {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    min-height: 200px;
}

.rpt-prog-body.rpt-flip {
    flex-direction: row-reverse;
}

.rpt-prog-content {
    flex: 1;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-width: 0;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.rpt-flip .rpt-prog-content {
    border-right: none;
    border-left: 1px solid rgba(255,255,255,0.05);
}

/* Stats 2×2 grid */
.rpt-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
}

.rpt-stat {
    background: var(--bg-card);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rpt-stat-v {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.5px;
    line-height: 1;
}

.rpt-stat-l {
    font-size: 11px;
    color: var(--text-2);
    font-weight: 500;
    line-height: 1.3;
}

/* Program description */
.rpt-prog-desc {
    margin: 0;
    font-size: 15px;
    line-height: 1.8;
    color: rgba(255,255,255,0.78);
    background: rgba(255,255,255,0.04);
    border-left: 3px solid rgba(255,255,255,0.18);
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    max-width: 560px;
}
.light-theme .rpt-prog-desc {
    color: #374151;
    background: rgba(0,0,0,0.03);
    border-left-color: rgba(0,0,0,0.15);
}

/* Bullet list */
.rpt-bullets {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.rpt-bullets li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--text-1);
    line-height: 1.55;
    opacity: .88;
}

.rpt-bullet-dot {
    font-size: 10px;
    flex-shrink: 0;
    margin-top: 4px;
    line-height: 1;
}

/* Photo column */
.rpt-prog-photo-col {
    width: 340px;
    flex-shrink: 0;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.14);
}

.rpt-photo-ph {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 10px;
    border: 1.5px dashed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(255,255,255,0.02);
}

.rpt-photo-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    opacity: .45;
}

/* Partners footer */
.rpt-partners-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 28px;
    background: rgba(0,0,0,0.14);
    flex-wrap: wrap;
}

.rpt-partners-lbl {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-2);
    flex-shrink: 0;
    padding-top: 3px;
    opacity: .65;
}

.rpt-partner-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.rpt-partner-chip {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-2);
    cursor: pointer;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 6px;
    padding: 3px 9px;
    transition: background .15s, color .15s;
}

.rpt-partner-chip:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-1);
}

/* ── Logo Partners Strip ────────────────────────────────────────────────── */
.rpt-logo-partners-row {
    padding: 16px 28px 20px;
    background: rgba(0,0,0,0.10);
    border-top: 1px solid rgba(255,255,255,0.05);
}

.rpt-logo-partners-lbl {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-2);
    opacity: .65;
    margin-bottom: 12px;
}

.rpt-logo-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.rpt-logo-tile {
    background: #ffffff;
    border-radius: 8px;
    padding: 12px 20px;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rpt-logo-tile img {
    height: 52px;
    width: auto;
    max-width: 195px;
    object-fit: contain;
    display: block;
}

/* ── Project Cards ──────────────────────────────────────────────────────── */
.rpt-projects {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.rpt-proj-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: 4px solid transparent;
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow .2s;
}

.rpt-proj-card:hover {
    box-shadow: 0 10px 36px rgba(0,0,0,0.22);
}

.rpt-proj-hd {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 28px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.rpt-proj-num-badge {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .1em;
    border: 1px solid;
    border-radius: 8px;
    padding: 6px 12px;
    flex-shrink: 0;
    margin-top: 2px;
}

.rpt-proj-logo-box {
    width: 200px;
    height: 52px;
    flex-shrink: 0;
    overflow: hidden;
}

.rpt-proj-logo-img {
    width: 200px;
    height: 52px;
    object-fit: contain;
    object-position: left center;
    display: block;
}

.rpt-proj-logo-ph {
    width: 100%;
    height: 100%;
    border: 1.5px dashed;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.02);
}

.rpt-proj-hd-text {
    flex: 1;
    min-width: 0;
}

.rpt-proj-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.3px;
    color: var(--text-1);
    margin: 0 0 5px;
    line-height: 1.3;
}

.rpt-proj-tagline {
    font-size: 13px;
    font-weight: 500;
    margin: 0;
    line-height: 1.4;
}

.rpt-proj-body-row {
    display: flex;
}

.rpt-proj-desc-col {
    flex: 1;
    padding: 22px 28px;
    border-right: 1px solid rgba(255,255,255,0.05);
    min-width: 0;
}

.rpt-proj-desc-p {
    font-size: 15px;
    line-height: 1.8;
    color: rgba(255,255,255,0.78);
    background: rgba(255,255,255,0.04);
    border-left: 3px solid rgba(255,255,255,0.18);
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    max-width: 560px;
    margin-bottom: 14px;
}
.rpt-proj-desc-p:last-child { margin-bottom: 0; }
.light-theme .rpt-proj-desc-p {
    color: #374151;
    background: rgba(0,0,0,0.03);
    border-left-color: rgba(0,0,0,0.15);
}

.rpt-proj-features {
    margin-top: 18px;
}

.rpt-proj-feat-lbl {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-bottom: 12px;
}

.rpt-proj-feat-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 9px;
    font-size: 13px;
    color: var(--text-1);
    line-height: 1.5;
    opacity: .88;
}

.rpt-proj-feat-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.rpt-proj-photo-col {
    width: 300px;
    flex-shrink: 0;
    padding: 22px;
    background: rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
}

.rpt-proj-photo-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.rpt-proj-photo-ph {
    width: 100%;
    height: 220px;
    border-radius: 10px;
    border: 1.5px dashed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255,255,255,0.02);
}

/* ── Countries Table ────────────────────────────────────────────────────── */
.rct-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.rct-search-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    max-width: 300px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 14px;
    color: var(--text-2);
    transition: border-color .2s;
}

.rct-search-wrap:focus-within {
    border-color: var(--border-h);
}

.rct-search {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-1);
    min-width: 0;
}

.rct-search::placeholder {
    color: var(--text-2);
    opacity: .65;
}

.rct-count {
    font-size: 12px;
    color: var(--text-2);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 4px 14px;
    border-radius: 20px;
    margin-left: auto;
    white-space: nowrap;
}

.rct-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
}

.rct-table {
    width: 100%;
    border-collapse: collapse;
}

.rct-thead-row {
    background: rgba(0,196,179,0.05);
}

.rct-th {
    padding: 11px 14px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.rct-th-rank { width: 44px; text-align: center; }
.rct-th-bene { text-align: right; }

.rct-row { transition: background .12s; }

.rct-row:not(:last-child) .rct-td {
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.rct-row:hover .rct-td {
    background: rgba(0,196,179,0.04);
}

.rct-td {
    padding: 10px 14px;
    vertical-align: middle;
}

.rct-rank-col {
    width: 44px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
}

.rct-country-col { min-width: 160px; }

.rct-country-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rct-flag {
    width: 26px;
    height: 19px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.rct-flag-fb { font-size: 20px; line-height: 1; }

.rct-cname {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
}

.rct-bar-col { width: 180px; min-width: 100px; }

.rct-bar-wrap {
    height: 6px;
    background: rgba(255,255,255,0.07);
    border-radius: 3px;
    overflow: hidden;
}

.rct-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00c4b3, #3ccfc3);
    border-radius: 3px;
    min-width: 3px;
    transition: width .4s ease;
}

.rct-bene-col {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
    text-align: right;
}

.rct-tags-col { max-width: 280px; }

.rct-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid;
    margin: 2px 2px 2px 0;
    white-space: nowrap;
}

/* ── Global Reach expand button ─────────────────────────────────────────── */
.rct-expand-row {
    text-align: center;
    padding: 18px 0 4px;
    border-top: 1px solid var(--border);
    margin-top: 2px;
}
.rct-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 9px 22px;
    transition: color .15s, border-color .15s, background .15s;
}
.rct-expand-btn:hover {
    color: #00c4b3;
    border-color: rgba(60,207,195,0.4);
    background: rgba(60,207,195,0.05);
}
.rct-expand-btn svg { transition: transform .2s; }
.light-theme .rct-expand-btn { background: #fff; }
.light-theme .rct-expand-btn:hover { color: #00a093; border-color: rgba(0,160,147,0.4); background: #f0faf8; }

/* ── Light theme overrides ──────────────────────────────────────────────── */
.light-theme .rpt-report-hd     { border-bottom-color: rgba(0,160,147,.25); }
.light-theme .rpt-sec-hd        { border-bottom-color: rgba(0,160,147,.25); }
.light-theme .rpt-sec-num       { background: rgba(0,196,179,.1); border-color: rgba(0,160,147,.3); }
.light-theme .rpt-sec-count     { background: #fff; border-color: rgba(0,160,147,.25); }
.light-theme .rpt-prog-card     { background: #fff; box-shadow: 0 2px 12px rgba(0,100,90,.06); border-color: rgba(0,160,147,.28); }
.light-theme .rpt-prog-card:hover { box-shadow: 0 10px 32px rgba(0,100,90,.12); border-color: rgba(0,160,147,.5); }
.light-theme .rpt-prog-header   { border-bottom-color: rgba(0,160,147,.1); }
.light-theme .rpt-prog-body     { border-bottom-color: rgba(0,160,147,.1); }
.light-theme .rpt-prog-content  { border-right-color: rgba(0,160,147,.12); }
.light-theme .rpt-flip .rpt-prog-content { border-left-color: rgba(0,160,147,.12); }
.light-theme .rpt-stats-grid    { background: rgba(0,196,179,.06); }
.light-theme .rpt-stat          { background: #fff; }
.light-theme .rpt-stat-l        { color: var(--text-2); }
.light-theme .rpt-bullets li    { color: var(--text-1); opacity: 1; }
.light-theme .rpt-prog-photo-col { background: rgba(0,100,90,.04); }
.light-theme .rpt-partners-row  { background: rgba(0,196,179,.04); }
.light-theme .rpt-partner-chip  { background: rgba(0,196,179,.07); border-color: rgba(0,160,147,.2); color: var(--text-2); }
.light-theme .rpt-partner-chip:hover { background: rgba(0,196,179,.14); color: var(--text-1); }
.light-theme .rpt-proj-card     { background: #fff; border-color: rgba(0,160,147,.28); box-shadow: 0 2px 12px rgba(0,100,90,.06); }
.light-theme .rpt-proj-hd       { border-bottom-color: rgba(0,160,147,.12); }
.light-theme .rpt-proj-desc-col { border-right-color: rgba(0,160,147,.12); }
.light-theme .rpt-proj-desc-p   { color: #4b5563; }
.light-theme .rpt-proj-photo-col { background: rgba(0,100,90,.04); }
.light-theme .rct-table-wrap    { background: #fff; border-color: rgba(0,160,147,.25); }
.light-theme .rct-thead-row     { background: rgba(0,196,179,.05); }
.light-theme .rct-th            { color: var(--text-2); border-bottom-color: rgba(0,160,147,.2); }
.light-theme .rct-row:not(:last-child) .rct-td { border-bottom-color: rgba(0,160,147,.08); }
.light-theme .rct-row:hover .rct-td { background: rgba(0,196,179,.04); }
.light-theme .rct-cname         { color: var(--text-1); }
.light-theme .rct-bene-col      { color: var(--text-1); }
.light-theme .rct-bar-wrap      { background: rgba(0,196,179,.1); }
.light-theme .rct-search-wrap   { background: #fff; border-color: rgba(0,160,147,.3); }
.light-theme .rct-count         { background: #fff; border-color: rgba(0,160,147,.25); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .rpt-report-hd              { flex-direction: column; gap: 20px; }
    .rpt-rh-stats               { gap: 20px; }
    .rpt-prog-body,
    .rpt-prog-body.rpt-flip     { flex-direction: column; }
    .rpt-prog-photo-col         { width: 100%; padding: 16px; background: none; }
    .rpt-photo-ph               { aspect-ratio: 16/9; max-height: 200px; }
    .rpt-prog-content           { border-right: none !important; border-left: none !important; }
    .rpt-proj-body-row          { flex-direction: column; }
    .rpt-proj-desc-col          { border-right: none; }
    .rpt-proj-photo-col         { width: 100%; }
    .rpt-proj-photo-img,
    .rpt-proj-photo-ph          { height: 200px; }
}

@media (max-width: 640px) {
    .rpt-rh-title               { font-size: 22px; }
    .rpt-stats-grid             { grid-template-columns: 1fr 1fr; }
    .rpt-stat-v                 { font-size: 22px; }
    .rpt-prog-header            { padding: 16px 18px 14px; gap: 12px; }
    .rpt-prog-name              { font-size: 17px; }
    .rpt-prog-content           { padding: 18px; }
    .rpt-partners-row           { padding: 12px 18px; }
    .rpt-proj-hd                { padding: 16px 18px 14px; gap: 12px; }
    .rpt-proj-name              { font-size: 16px; }
    .rpt-proj-desc-col          { padding: 18px; }
}

/* ── Accordion Cards (Programs & Projects) ──────────────────────────────── */

/* Base card — shared by programs and projects */
.rpt-acc-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}

.rpt-acc-card:hover {
    border-color: var(--border-h);
}

.rpt-acc-card.rpt-acc-open {
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
}

/* Program top bar stays from .rpt-prog-top-bar */

/* Head row — always visible */
.rpt-acc-head {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 18px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
}

/* Left identity block */
.rpt-acc-identity {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.rpt-acc-title-wrap {
    flex: 1;
    min-width: 0;
}

.rpt-acc-name {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.25px;
    color: var(--text-1);
    margin: 0 0 4px;
    line-height: 1.25;
}

.rpt-acc-tagline {
    font-size: 12.5px;
    color: var(--text-2);
    line-height: 1.45;
    margin: 0;
}

/* Toggle button */
.rpt-acc-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    margin-left: 16px;
    align-self: center;
    white-space: nowrap;
}

.rpt-acc-toggle:hover {
    background: rgba(0,196,179,0.12);
    color: var(--accent);
    border-color: var(--border-h);
}

.rpt-acc-open .rpt-acc-toggle {
    background: rgba(0,196,179,0.12);
    color: var(--accent);
    border-color: rgba(0,196,179,0.3);
}

.rpt-acc-chevron {
    transition: transform .3s cubic-bezier(.16,1,.3,1);
    flex-shrink: 0;
}

.rpt-acc-open .rpt-acc-chevron {
    transform: rotate(180deg);
}

/* Inline stats row (always visible for programs) */
.rpt-stats-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 0 20px 16px;
    background: rgba(0,0,0,0.08);
}

.rpt-stat-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 18px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    min-width: 90px;
    flex: 1;
}

.rpt-stat-chip-v {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.4px;
    line-height: 1;
}

.rpt-stat-chip-l {
    font-size: 10px;
    color: var(--text-2);
    font-weight: 500;
    text-align: center;
    line-height: 1.3;
}

/* Project description preview (always visible) */
.rpt-proj-preview {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.6;
    padding: 10px 20px 14px;
    margin: 0;
    opacity: .8;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.rpt-acc-open .rpt-proj-preview {
    display: none;
}

/* Expandable body — hidden by default, shown when .rpt-acc-open */
.rpt-acc-body {
    display: none;
}

.rpt-acc-open .rpt-acc-body {
    display: block;
    animation: rptAccOpen .3s cubic-bezier(.16,1,.3,1) both;
}

@keyframes rptAccOpen {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Project card variant: top border only (no top bar strip) */
.rpt-proj-acc {
    border-top: 4px solid transparent;
}

/* Program logo box — wide banner shape (logos are ~3:1 ratio) */
.rpt-prog-logo-box {
    height: 52px;
    width: 200px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.rpt-prog-logo-img {
    width: 200px;
    height: 52px;
    object-fit: contain;
    object-position: left center;
    display: block;
    border-radius: 6px;
}

/* Program photo image inside expanded body */
.rpt-prog-photo-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}

/* Project logo box inside accordion — same wide-banner size as program logos */
.rpt-proj-logo-box {
    width: 200px;
    height: 52px;
    flex-shrink: 0;
    overflow: hidden;
}

.rpt-proj-logo-img {
    width: 200px;
    height: 52px;
    object-fit: contain;
    object-position: left center;
    display: block;
}

.rpt-proj-logo-ph {
    width: 100%;
    height: 100%;
    border: 1.5px dashed;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.02);
}

/* ── Light theme overrides — accordion ──────────────────────────────────── */
.light-theme .rpt-acc-card        { background: #fff; border-color: rgba(0,160,147,.28); }
.light-theme .rpt-acc-card:hover  { border-color: rgba(0,160,147,.5); }
.light-theme .rpt-acc-card.rpt-acc-open { box-shadow: 0 8px 28px rgba(0,100,90,.12); }
.light-theme .rpt-acc-head        { border-bottom-color: rgba(0,160,147,.1); }
.light-theme .rpt-acc-toggle      { background: rgba(0,196,179,.07); border-color: rgba(0,160,147,.3); color: var(--text-2); }
.light-theme .rpt-acc-toggle:hover { background: rgba(0,196,179,.14); color: #007a71; }
.light-theme .rpt-acc-open .rpt-acc-toggle { background: rgba(0,196,179,.14); color: #007a71; border-color: rgba(0,160,147,.5); }
.light-theme .rpt-stats-inline    { background: rgba(0,100,90,.04); }
.light-theme .rpt-stat-chip       { background: rgba(0,196,179,.06); }
.light-theme .rpt-proj-preview    { border-bottom-color: rgba(0,160,147,.1); }

/* ── Accordion responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .rpt-acc-open .rpt-prog-body,
    .rpt-acc-open .rpt-prog-body.rpt-flip { flex-direction: column; }
    .rpt-acc-open .rpt-prog-photo-col     { width: 100%; background: none; }
    .rpt-acc-open .rpt-prog-content       { border-right: none !important; border-left: none !important; }
    .rpt-acc-open .rpt-proj-body-row      { flex-direction: column; }
    .rpt-acc-open .rpt-proj-desc-col      { border-right: none; }
    .rpt-acc-open .rpt-proj-photo-col     { width: 100%; }
    .rpt-acc-open .rpt-proj-photo-img,
    .rpt-acc-open .rpt-proj-photo-ph      { height: 200px; }
}

@media (max-width: 640px) {
    /* Stack logo above title — removes the "blank column" beside the logo */
    .rpt-acc-identity   { flex-direction: column; gap: 6px; }
    .rpt-acc-name       { font-size: 15px; }
    .rpt-acc-toggle     { padding: 6px 10px; font-size: 11px; }
    .rpt-stat-chip-v    { font-size: 18px; }
    .rpt-stats-inline   { padding: 0 14px 12px; }
    .rpt-acc-head       { padding: 14px 14px 12px; }
    .rpt-proj-preview   { padding: 8px 14px 12px; }
    .rpt-prog-logo-box,
    .rpt-proj-logo-box  { width: 110px; height: 32px; }
    .rpt-prog-logo-img,
    .rpt-proj-logo-img  { width: 110px; height: 32px; }

    /* Program card body: stack vertically so photo is a banner, content fills below */
    .rpt-prog-body,
    .rpt-prog-body.rpt-flip        { flex-direction: column; min-height: 0; }
    .rpt-prog-photo-col            { width: 100%; height: 160px; padding: 10px 10px 0; flex-shrink: 0; }
    .rpt-prog-photo-col > img      { width: 100%; height: 140px; object-fit: cover; border-radius: 10px; display: block; }
    .rpt-prog-photo-ph             { width: 100%; height: 140px; border-radius: 10px; }
    .rpt-prog-content              { border-right: none !important; border-left: none !important; }

    /* Project body: same column stacking */
    .rpt-proj-body-row             { flex-direction: column; }
    .rpt-proj-desc-col             { border-right: none; }
    .rpt-proj-photo-col            { width: 100%; }
    .rpt-proj-photo-img,
    .rpt-proj-photo-ph             { height: 160px; width: 100%; object-fit: cover; border-radius: 10px; }

    /* Global Reach table — hide bar + programs on mobile, show rank/country/beneficiaries */
    .rct-th:nth-child(3), .rct-td.rct-bar-col   { display: none; }
    .rct-th:nth-child(5), .rct-td.rct-tags-col  { display: none; }
    .rct-country-col                             { min-width: 0; }
    .rct-bene-col                                { text-align: left; }
}

/* ── Partner detail popup ─────────────────────────────────────────────────── */
.rpt-partner-popup {
    position: fixed;
    z-index: 9500;
    background: #00263e;
    border: 1px solid rgba(60,207,195,0.2);
    border-radius: 12px;
    padding: 14px 16px 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.7);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease;
}
.rpt-partner-popup.rpt-pp-show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.rpt-pp-close {
    position: absolute;
    top: 8px; right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-2);
    font-size: 13px;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 4px;
    transition: color .15s, background .15s;
}
.rpt-pp-close:hover { color: var(--text-1); background: rgba(255,255,255,.08); }
.rpt-pp-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-1);
    line-height: 1.4;
    margin-bottom: 7px;
    padding-right: 22px;
}
.rpt-pp-desc {
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.6;
    margin-bottom: 10px;
}
.rpt-pp-url {
    font-size: 11px;
    color: #00c4b3;
    text-decoration: none;
    word-break: break-all;
    display: inline-block;
}
.rpt-pp-url:hover { text-decoration: underline; }
.light-theme .rpt-partner-popup { background: #fff; box-shadow: 0 8px 32px rgba(0,60,50,0.15); }
.light-theme .rpt-pp-close:hover { background: rgba(0,0,0,.06); }

/* ── Presentation Mode ───────────────────────────────────────────────────── */
#rpt2-present-mode {
    top: auto;
    left: auto;
    bottom: 12px;
    right: 12px;
}

.presentation-close-btn {
    display: none;
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10001;
    width: 44px;
    height: 44px;
    background: rgba(0,196,179,0.14);
    border: 1px solid rgba(0,196,179,0.4);
    border-radius: 10px;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.presentation-close-btn:hover {
    background: rgba(0,196,179,0.26);
    border-color: rgba(0,196,179,0.6);
    box-shadow: 0 0 16px rgba(0,196,179,0.25);
}

#dashboard.presentation-mode .presentation-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

#dashboard.presentation-mode {
    overflow: hidden;
    height: 100vh;
}

#dashboard.presentation-mode .header { display: none; }
#dashboard.presentation-mode .footer { display: none; }
#dashboard.presentation-mode .tab-nav { display: none; }
#dashboard.presentation-mode #tab-impact-report-2 > *:not(.imp-kpi-grid):not(.imp-globe-wrap) { display: none; }

#dashboard.presentation-mode main {
    overflow: hidden;
    height: 100vh;
    padding: 12px 28px 12px 28px;
}

#dashboard.presentation-mode #tab-impact-report-2 {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    margin-bottom: 0 !important;
}

