/* ============================================================
   PayPulse — NatWest SME Risk Intelligence Platform
   Full Visual Overhaul
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Variables ── */
:root {
    --bg: #0a0e1a;
    --bg-card: rgba(15, 20, 40, 0.7);
    --bg-card-border: rgba(120, 80, 255, 0.1);
    --bg-card-hover: rgba(124, 92, 252, 0.06);
    --bg-input: rgba(12, 16, 32, 0.9);

    --text: #e8e6f0;
    --text-dim: #8b86a3;
    --text-muted: #5a5672;

    --purple: #7c5cfc;
    --purple-hover: #6a4ae8;
    --purple-glow: rgba(124, 92, 252, 0.25);
    --green: #00e676;
    --amber: #ffab00;
    --red: #ff1744;

    --radius: 14px;
    --radius-sm: 8px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(124, 92, 252, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(0, 230, 118, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: bgPulse 8s ease-in-out infinite;
}

#app { position: relative; z-index: 1; }

/* ── Views ── */
.view { display: none; }
.view.active { display: block; }

/* ══════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════ */

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

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

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--purple-glow); }
    50% { box-shadow: 0 0 0 10px rgba(124, 92, 252, 0); }
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; text-shadow: 0 0 8px currentColor; }
    50% { opacity: 0.7; text-shadow: 0 0 16px currentColor; }
}

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

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
}

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

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes modePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes pipelineDraw {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes bgPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

@keyframes ringPulse {
    0%, 100% { opacity: 0.15; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.03); }
}

@keyframes pipelineFlow {
    0% { left: -60%; }
    100% { left: 160%; }
}

@keyframes cardGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(124, 92, 252, 0); }
    50% { box-shadow: 0 0 20px 2px rgba(124, 92, 252, 0.06); }
}

/* Staggered entrance animations */
.anim-item {
    opacity: 0;
    transform: translateY(20px);
}

.page.active .anim-item,
.anim-item.visible {
    animation: fadeInUp 0.5s ease both;
}

.page.active .anim-item:nth-child(1) { animation-delay: 0.05s; }
.page.active .anim-item:nth-child(2) { animation-delay: 0.12s; }
.page.active .anim-item:nth-child(3) { animation-delay: 0.19s; }
.page.active .anim-item:nth-child(4) { animation-delay: 0.26s; }
.page.active .anim-item:nth-child(5) { animation-delay: 0.33s; }
.page.active .anim-item:nth-child(6) { animation-delay: 0.40s; }

/* ══════════════════════════════════════
   LANDING PAGE — SPLIT SCREEN
   ══════════════════════════════════════ */

#view-landing.active {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.landing {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 40px 48px;
    gap: 48px;
}

/* Floating background orbs */
.landing-bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: -1;
}

.landing-bg-orb-1 {
    width: 500px;
    height: 500px;
    background: rgba(124, 92, 252, 0.08);
    top: -100px;
    left: -100px;
    animation: orbFloat 12s ease-in-out infinite;
}

.landing-bg-orb-2 {
    width: 400px;
    height: 400px;
    background: rgba(0, 230, 118, 0.04);
    bottom: -100px;
    right: -100px;
    animation: orbFloat 15s ease-in-out infinite reverse;
}

.landing-bg-orb-3 {
    width: 300px;
    height: 300px;
    background: rgba(255, 171, 0, 0.03);
    top: 40%;
    left: 40%;
    animation: orbFloat 18s ease-in-out infinite 3s;
}

/* ── Left Panel: Content ── */
.landing-left {
    flex: 1;
    max-width: 480px;
    z-index: 2;
}

.landing-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    animation: fadeInUp 0.5s ease both;
}

.landing-tagline {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--purple);
    font-weight: 600;
    margin-bottom: 16px;
    animation: fadeInUp 0.5s ease 0.1s both;
}

.landing-headline {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
    margin-bottom: 20px;
    letter-spacing: -0.5px;
    animation: fadeInUp 0.5s ease 0.2s both;
}

.gradient-text {
    background: linear-gradient(135deg, var(--purple), var(--amber), var(--purple));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s ease-in-out infinite;
}

.landing-sub {
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.75;
    margin-bottom: 36px;
    max-width: 420px;
    animation: fadeInUp 0.5s ease 0.3s both;
}

.landing-sub strong {
    color: var(--purple);
    font-weight: 700;
}

/* Entry buttons */
.landing-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    animation: fadeInUp 0.5s ease 0.4s both;
}

.landing-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(124, 92, 252, 0.12), rgba(124, 92, 252, 0.04));
    border: 1px solid rgba(124, 92, 252, 0.2);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    color: var(--text);
    font-family: 'Inter', sans-serif;
}

.landing-btn:hover {
    background: linear-gradient(135deg, rgba(124, 92, 252, 0.2), rgba(124, 92, 252, 0.08));
    border-color: rgba(124, 92, 252, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(124, 92, 252, 0.15);
}

.landing-btn:active { transform: translateY(0) scale(0.98); }

.landing-btn svg {
    width: 24px;
    height: 24px;
    color: var(--purple);
    flex-shrink: 0;
}

.landing-btn-alt {
    background: linear-gradient(135deg, rgba(255, 171, 0, 0.08), rgba(255, 171, 0, 0.02));
    border-color: rgba(255, 171, 0, 0.15);
}

.landing-btn-alt:hover {
    background: linear-gradient(135deg, rgba(255, 171, 0, 0.15), rgba(255, 171, 0, 0.05));
    border-color: rgba(255, 171, 0, 0.3);
    box-shadow: 0 8px 30px rgba(255, 171, 0, 0.1);
}

.landing-btn-alt svg { color: var(--amber); }

.landing-btn-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
}

.landing-btn-sub {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.landing-tour-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    transition: all 0.2s ease;
    margin-bottom: 32px;
    animation: fadeInUp 0.5s ease 0.5s both;
}

.landing-tour-link:hover { color: var(--purple); }
.landing-tour-link svg { color: inherit; }

.landing-credit {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    animation: fadeIn 0.5s ease 0.6s both;
}

/* ── Right Panel: Visual Showcase ── */
.landing-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    animation: fadeIn 0.8s ease 0.3s both;
}

.landing-showcase {
    position: relative;
    padding: 40px 32px;
    width: 100%;
    max-width: 420px;
}

.showcase-glow {
    position: absolute;
    inset: -60px;
    background: radial-gradient(circle at center, rgba(124, 92, 252, 0.1), transparent 65%);
    border-radius: 50%;
    animation: bgPulse 4s ease-in-out infinite;
    pointer-events: none;
}

.showcase-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(124, 92, 252, 0.08);
    pointer-events: none;
}

.ring-1 { inset: -10px; animation: ringPulse 3s ease-in-out infinite; }
.ring-2 { inset: -40px; animation: ringPulse 3s ease-in-out infinite 0.6s; }
.ring-3 { inset: -70px; animation: ringPulse 3s ease-in-out infinite 1.2s; }

.showcase-content { position: relative; z-index: 2; }

/* Comparison cards — vertical in showcase */
.landing-comparison {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.landing-compare-card {
    width: 100%;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease both;
    backdrop-filter: blur(12px);
}

.landing-compare-card:first-child { animation-delay: 0.4s; }
.landing-compare-card:last-child { animation-delay: 0.6s; }

.landing-compare-card:hover {
    border-color: rgba(124, 92, 252, 0.25);
    box-shadow: 0 4px 24px rgba(124, 92, 252, 0.08);
}

.landing-compare-highlight {
    border-color: rgba(255, 171, 0, 0.2);
    background: linear-gradient(135deg, rgba(15, 20, 40, 0.85), rgba(255, 171, 0, 0.04));
    box-shadow: 0 0 30px rgba(255, 171, 0, 0.06);
}

.landing-compare-highlight:hover {
    border-color: rgba(255, 171, 0, 0.35);
    box-shadow: 0 4px 30px rgba(255, 171, 0, 0.1);
}

.landing-compare-icon { width: 24px; height: 24px; color: var(--text-muted); }
.landing-compare-highlight .landing-compare-icon { color: var(--amber); }

.landing-compare-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.landing-compare-badge { font-size: 1.3rem; font-weight: 800; letter-spacing: 2px; }
.landing-compare-badge.green { color: var(--green); }
.landing-compare-badge.amber { color: var(--amber); }
.landing-compare-badge.red { color: var(--red); }

.pulse-glow { animation: pulseGlow 2s ease-in-out infinite; }

.landing-compare-sub { font-size: 0.72rem; color: var(--text-muted); line-height: 1.4; }

.landing-compare-vs {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    animation: fadeIn 0.5s ease 0.5s both;
}

/* Hero stat in showcase */
.landing-hero-stat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px 0;
    animation: countUp 0.6s ease 0.7s both;
}

.landing-hero-number {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--purple);
    line-height: 1;
    letter-spacing: -2px;
}

.landing-hero-unit {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 500;
    line-height: 1.3;
}

/* Stats strip in showcase */
.landing-stats-strip {
    display: flex;
    justify-content: center;
    gap: 24px;
    animation: fadeIn 0.5s ease 0.9s both;
}

.landing-mini-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.lms-value { font-size: 1rem; font-weight: 800; color: var(--text); }

.lms-label {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 600;
}

/* ══════════════════════════════════════
   SHARED COMPONENTS
   ══════════════════════════════════════ */

.logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--purple), #6246ea);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}

.logo-pulse {
    animation: pulse 2.5s ease-in-out infinite;
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.brand-tag {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--purple);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 2px 8px;
    border: 1px solid rgba(124, 92, 252, 0.25);
    border-radius: 4px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    padding: 12px 24px;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--purple);
    color: white;
}
.btn-primary:hover { background: var(--purple-hover); transform: translateY(-1px); }

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--bg-card-border);
}
.btn-outline:hover {
    border-color: rgba(124, 92, 252, 0.3);
    color: var(--purple);
    background: rgba(124, 92, 252, 0.04);
}

.btn-full { width: 100%; }

.btn .spinner-sm {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.75rem;
}

/* ══════════════════════════════════════
   APP SHELL — HEADER + NAV
   ══════════════════════════════════════ */

#view-app {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid rgba(124, 92, 252, 0.08);
    gap: 12px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: opacity 0.2s ease;
}

.header-brand:hover { opacity: 0.8; }

.header .logo { width: 30px; height: 30px; font-size: 14px; }
.header .brand-name { font-size: 1rem; }

.nav {
    display: flex;
    gap: 2px;
}

.nav-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-btn svg {
    width: 14px;
    height: 14px;
}

.nav-btn:hover {
    color: var(--text-dim);
    background: rgba(124, 92, 252, 0.05);
}

.nav-btn.active {
    color: var(--text);
    background: rgba(124, 92, 252, 0.1);
    border-color: rgba(124, 92, 252, 0.2);
}

.header-report-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(124, 92, 252, 0.06);
    border: 1px solid rgba(124, 92, 252, 0.15);
    border-radius: var(--radius-sm);
    color: var(--purple);
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.header-report-btn svg {
    width: 14px;
    height: 14px;
}

.header-report-btn:hover {
    background: rgba(124, 92, 252, 0.12);
    border-color: rgba(124, 92, 252, 0.3);
    transform: translateY(-1px);
}

.header-report-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.report-chevron {
    width: 12px;
    height: 12px;
    transition: transform 0.25s ease;
    opacity: 0.7;
}

.report-dropdown-wrap.open .report-chevron {
    transform: rotate(180deg);
}

/* ── Report Dropdown Menu ── */
.report-dropdown-wrap {
    position: relative;
}

.report-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: linear-gradient(135deg, rgba(20, 24, 44, 0.98), rgba(12, 16, 32, 0.99));
    border: 1px solid rgba(124, 92, 252, 0.18);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(124, 92, 252, 0.06);
    backdrop-filter: blur(20px);
    z-index: 100;
    animation: reportDropIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.report-dropdown-wrap.open .report-dropdown {
    display: block;
}

@keyframes reportDropIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.report-dropdown-header {
    padding: 12px 16px 8px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}

.report-dropdown-list {
    max-height: 260px;
    overflow-y: auto;
    padding: 0 6px;
}

.report-dropdown-list::-webkit-scrollbar { width: 4px; }
.report-dropdown-list::-webkit-scrollbar-track { background: transparent; }
.report-dropdown-list::-webkit-scrollbar-thumb { background: rgba(124, 92, 252, 0.2); border-radius: 4px; }

.report-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.report-dropdown-item:hover {
    background: rgba(124, 92, 252, 0.08);
    color: var(--text);
}

.report-dropdown-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-muted);
}

.report-dropdown-item:hover svg {
    color: var(--purple);
}

.report-item-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.report-item-name {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-item-meta {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.report-item-risk {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.report-item-risk.green { background: var(--green); box-shadow: 0 0 6px rgba(0, 230, 118, 0.3); }
.report-item-risk.amber { background: var(--amber); box-shadow: 0 0 6px rgba(255, 171, 0, 0.3); }
.report-item-risk.red { background: var(--red); box-shadow: 0 0 6px rgba(255, 23, 68, 0.3); }

.report-dropdown-divider {
    height: 1px;
    margin: 4px 12px;
    background: rgba(124, 92, 252, 0.1);
}

.report-dropdown-all {
    margin: 2px 6px 6px;
    color: var(--purple);
    font-weight: 600;
}

.report-dropdown-all svg {
    color: var(--purple);
    opacity: 0.7;
}

.report-dropdown-all:hover {
    background: rgba(124, 92, 252, 0.12);
}

.report-dropdown-item.generating {
    pointer-events: none;
    opacity: 0.65;
}

.report-dropdown-item .report-item-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(124, 92, 252, 0.2);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}


/* ══════════════════════════════════════
   ALERT TOAST
   ══════════════════════════════════════ */

.alert-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(255, 171, 0, 0.12), rgba(15, 20, 40, 0.95));
    border: 1px solid rgba(255, 171, 0, 0.25);
    border-radius: var(--radius);
    max-width: 380px;
    z-index: 1000;
    backdrop-filter: blur(12px);
    animation: slideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.alert-toast.dismissing {
    animation: slideOutRight 0.3s ease forwards;
}

.alert-toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 171, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-toast-icon svg {
    width: 16px;
    height: 16px;
    color: var(--amber);
}

.alert-toast-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--amber);
}

.alert-toast-msg {
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.5;
    margin-top: 2px;
}

.alert-toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0 0 8px;
    line-height: 1;
    transition: color 0.2s ease;
}

.alert-toast-close:hover { color: var(--text); }

/* ══════════════════════════════════════
   VIEW TOGGLE (SME / Bank Risk)
   ══════════════════════════════════════ */

.view-toggle-bar {
    display: flex;
    justify-content: center;
    padding: 16px 0 4px;
}

.view-toggle {
    display: inline-flex;
    position: relative;
    background: rgba(15, 20, 40, 0.8);
    border: 1px solid var(--bg-card-border);
    border-radius: 100px;
    padding: 3px;
}

.toggle-btn {
    position: relative;
    z-index: 2;
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 7px 20px;
    cursor: pointer;
    transition: color 0.25s ease;
    border-radius: 100px;
}

.toggle-btn.active { color: white; }

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    height: calc(100% - 6px);
    width: calc(50% - 3px);
    background: var(--purple);
    border-radius: 100px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.view-toggle.bank-active .toggle-slider {
    transform: translateX(100%);
}

/* ══════════════════════════════════════
   WELCOME BAR
   ══════════════════════════════════════ */

.welcome-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 12px;
}

.welcome-bar #welcome-msg {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.risk-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.risk-badge.green { background: rgba(0, 230, 118, 0.08); color: var(--green); border: 1px solid rgba(0, 230, 118, 0.2); }
.risk-badge.amber { background: rgba(255, 171, 0, 0.08); color: var(--amber); border: 1px solid rgba(255, 171, 0, 0.2); }
.risk-badge.red { background: rgba(255, 23, 68, 0.08); color: var(--red); border: 1px solid rgba(255, 23, 68, 0.2); }

/* ══════════════════════════════════════
   LOADING STATE
   ══════════════════════════════════════ */

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(124, 92, 252, 0.15);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ══════════════════════════════════════
   PAGES
   ══════════════════════════════════════ */

.page { display: none; padding-bottom: 40px; }
.page.active { display: block; animation: fadeIn 0.3s ease; }

/* ── Hero ── */
.hero { text-align: center; padding: 48px 0 32px; }
.hero.hero-compact { padding: 32px 0 20px; }

.hero-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--purple);
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.hero-label svg { color: var(--purple); }

.hero-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: 20px;
    letter-spacing: -0.3px;
}

.hero-sub {
    font-size: 0.95rem;
    color: var(--text-dim);
    max-width: 500px;
    margin: 0 auto;
}

/* ══════════════════════════════════════
   EARLY DETECTION BANNER
   ══════════════════════════════════════ */

.early-detect {
    margin-bottom: 8px;
}

.early-detect-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(124, 92, 252, 0.08), rgba(0, 230, 118, 0.04));
    border: 1px solid rgba(124, 92, 252, 0.15);
    border-radius: var(--radius);
    animation: fadeInUp 0.5s ease;
}

.early-detect-icon {
    width: 36px;
    height: 36px;
    color: var(--purple);
    flex-shrink: 0;
}

.early-detect-text {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.early-detect-label {
    font-size: 0.82rem;
    color: var(--text-dim);
    font-weight: 500;
}

.early-detect-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--purple);
    line-height: 1;
    letter-spacing: -1px;
}

/* ── Status Compare ── */
.status-compare {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 4px;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dim);
}

.status-pill strong { margin-left: 4px; }
.status-pill.green { background: rgba(0, 230, 118, 0.06); border: 1px solid rgba(0, 230, 118, 0.15); }
.status-pill.green strong { color: var(--green); }
.status-pill.amber { background: rgba(255, 171, 0, 0.06); border: 1px solid rgba(255, 171, 0, 0.15); }
.status-pill.amber strong { color: var(--amber); }
.status-pill.red { background: rgba(255, 23, 68, 0.06); border: 1px solid rgba(255, 23, 68, 0.15); }
.status-pill.red strong { color: var(--red); }

.status-divider { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.green { background: var(--green); }
.status-dot.amber { background: var(--amber); }
.status-dot.red { background: var(--red); }

/* ── Key Insight ── */
.insight-block {
    text-align: center;
    padding: 28px 0;
    border-top: 1px solid rgba(124, 92, 252, 0.06);
}

.key-insight {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto 16px;
}

.action-rec {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 100px;
    display: inline-block;
    color: var(--amber);
    background: rgba(255, 171, 0, 0.06);
    border: 1px solid rgba(255, 171, 0, 0.12);
}

.action-rec.red { color: var(--red); background: rgba(255, 23, 68, 0.06); border-color: rgba(255, 23, 68, 0.12); }
.action-rec.green { color: var(--green); background: rgba(0, 230, 118, 0.06); border-color: rgba(0, 230, 118, 0.12); }

/* ══════════════════════════════════════
   RISK TIMELINE
   ══════════════════════════════════════ */

.risk-timeline-section {
    padding: 8px 0 16px;
    border-top: 1px solid rgba(124, 92, 252, 0.06);
}

.risk-timeline {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 12px 0;
    overflow-x: auto;
}

.risk-tl-week {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 40px;
    position: relative;
}

.risk-tl-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    transition: transform 0.2s ease;
}

.risk-tl-dot:hover { transform: scale(1.4); }
.risk-tl-dot.green { background: var(--green); box-shadow: 0 0 8px rgba(0, 230, 118, 0.3); }
.risk-tl-dot.amber { background: var(--amber); box-shadow: 0 0 8px rgba(255, 171, 0, 0.3); }
.risk-tl-dot.red { background: var(--red); box-shadow: 0 0 8px rgba(255, 23, 68, 0.3); }

.risk-tl-label {
    font-size: 0.55rem;
    color: var(--text-muted);
    font-weight: 500;
}

.risk-tl-line {
    position: absolute;
    top: 5px;
    left: 50%;
    width: 100%;
    height: 2px;
    z-index: 1;
}

.risk-tl-line.green { background: rgba(0, 230, 118, 0.2); }
.risk-tl-line.amber { background: rgba(255, 171, 0, 0.2); }
.risk-tl-line.red { background: rgba(255, 23, 68, 0.2); }

.risk-tl-phase-label {
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: -2px;
}

/* ══════════════════════════════════════
   "WHY AM I SEEING THIS?"
   ══════════════════════════════════════ */

.why-section {
    border-top: 1px solid rgba(124, 92, 252, 0.06);
    padding-top: 20px;
    margin-bottom: 8px;
}

.why-toggle {
    background: none;
    border: none;
    color: var(--purple);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.why-toggle::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid var(--purple);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform 0.2s ease;
}

.why-toggle.open::before { transform: rotate(90deg); }

.why-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.why-content.open { max-height: 400px; padding: 12px 0; }

.why-content ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.why-content li {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.6;
    padding: 10px 16px;
    background: rgba(124, 92, 252, 0.03);
    border-left: 3px solid var(--purple);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.why-content li strong { color: var(--text); }

/* ── Section Label ── */
.section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 16px;
    padding-top: 24px;
    border-top: 1px solid rgba(124, 92, 252, 0.06);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-label svg { color: var(--purple); opacity: 0.6; }

/* ── Chart ── */
.chart-wrap { width: 100%; height: 280px; position: relative; }
.chart-wrap canvas { width: 100% !important; height: 100% !important; }
.chart-wrap-sm { height: 220px; margin-top: 24px; }

/* ── Affected Suppliers ── */
.affected-list { display: flex; flex-direction: column; gap: 8px; }

.affected-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.affected-item:hover {
    border-color: rgba(124, 92, 252, 0.3);
    background: var(--bg-card-hover);
    box-shadow: 0 4px 24px rgba(124, 92, 252, 0.1), 0 0 0 1px rgba(124, 92, 252, 0.05);
    transform: translateY(-1px);
}

.affected-name { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.affected-detail { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.affected-delay { font-size: 1.3rem; font-weight: 700; text-align: right; }
.affected-delay.amber { color: var(--amber); }
.affected-delay.red { color: var(--red); }
.affected-delay.green { color: var(--green); }
.affected-trend { font-size: 0.7rem; color: var(--text-muted); text-align: right; margin-top: 2px; }

/* ══════════════════════════════════════
   CONSUMER DUTY OUTREACH
   ══════════════════════════════════════ */

.outreach-section { margin-bottom: 4px; }

.outreach-card {
    padding: 22px 24px;
    background: var(--bg-card);
    border: 1px solid rgba(124, 92, 252, 0.12);
    border-radius: var(--radius);
    border-left: 3px solid var(--purple);
    transition: all 0.3s ease;
}

.outreach-card:hover { box-shadow: 0 4px 20px rgba(124, 92, 252, 0.06); }

.outreach-section.high .outreach-card { border-left-color: var(--amber); }

.outreach-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.outreach-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(124, 92, 252, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.outreach-section.high .outreach-icon-wrap { background: rgba(255, 171, 0, 0.1); }
.outreach-icon-wrap svg { color: var(--purple); }
.outreach-section.high .outreach-icon-wrap svg { color: var(--amber); }

.outreach-title { font-size: 0.9rem; font-weight: 700; color: var(--text); margin: 0; }
.outreach-subtitle {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
    margin: 2px 0 0;
}

.outreach-preview {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 16px;
}

.outreach-expand-btn {
    display: inline-block;
    padding: 8px 20px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: var(--purple);
    background: rgba(124, 92, 252, 0.08);
    border: 1px solid rgba(124, 92, 252, 0.18);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.outreach-expand-btn:hover {
    background: rgba(124, 92, 252, 0.14);
    border-color: rgba(124, 92, 252, 0.3);
}

.outreach-full {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(124, 92, 252, 0.08);
    animation: fadeIn 0.3s ease;
}

.outreach-message { font-size: 0.88rem; color: var(--text-dim); line-height: 1.75; }
.outreach-message p { margin-bottom: 12px; }
.outreach-message .outreach-greeting { font-weight: 600; color: var(--text); }
.outreach-message .outreach-sign { margin-top: 20px; color: var(--text); }

.outreach-message ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0 16px;
    padding: 0;
}

.outreach-message li {
    padding: 10px 16px;
    background: rgba(124, 92, 252, 0.03);
    border: 1px solid rgba(124, 92, 252, 0.06);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    line-height: 1.6;
}

.outreach-message li strong { color: var(--text); }

.outreach-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.outreach-copied {
    font-size: 0.75rem;
    color: var(--green);
    font-weight: 600;
}

/* ══════════════════════════════════════
   TRIAGE SCORE
   ══════════════════════════════════════ */

.triage-score-section { margin-top: 8px; }

.triage-score-card {
    padding: 22px 24px;
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.triage-score-card:hover { box-shadow: 0 4px 20px rgba(124, 92, 252, 0.06); }

.triage-score-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.triage-score-display { display: flex; align-items: baseline; gap: 4px; }

.triage-score-number { font-size: 2rem; font-weight: 800; line-height: 1; }
.triage-score-number.red { color: var(--red); }
.triage-score-number.amber { color: var(--amber); }
.triage-score-number.green { color: var(--green); }

.triage-score-max { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }

.triage-score-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
    padding: 5px 14px;
    border-radius: 6px;
}

.triage-score-badge.high { color: var(--red); background: rgba(255, 23, 68, 0.1); border: 1px solid rgba(255, 23, 68, 0.15); }
.triage-score-badge.medium { color: var(--amber); background: rgba(255, 171, 0, 0.1); border: 1px solid rgba(255, 171, 0, 0.15); }
.triage-score-badge.low { color: var(--green); background: rgba(0, 230, 118, 0.1); border: 1px solid rgba(0, 230, 118, 0.15); }

.triage-score-bar-wrap {
    height: 6px;
    background: rgba(124, 92, 252, 0.08);
    border-radius: 3px;
    margin-bottom: 14px;
    overflow: hidden;
}

.triage-score-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease;
}

.triage-score-bar.red { background: linear-gradient(90deg, var(--amber), var(--red)); }
.triage-score-bar.amber { background: linear-gradient(90deg, var(--green), var(--amber)); }
.triage-score-bar.green { background: var(--green); }

.triage-score-explanation { font-size: 0.85rem; color: var(--text-dim); line-height: 1.6; }

/* ══════════════════════════════════════
   PORTFOLIO DASHBOARD (BANK VIEW)
   ══════════════════════════════════════ */

.portfolio-header {
    text-align: center;
    padding: 28px 0 20px;
    border-bottom: 1px solid rgba(255, 171, 0, 0.08);
}

.portfolio-title { font-size: 1.6rem; font-weight: 800; color: var(--text); margin-bottom: 6px; line-height: 1.2; }
.portfolio-subtitle { font-size: 0.88rem; color: var(--text-dim); margin-bottom: 20px; }

.portfolio-summary { display: flex; justify-content: center; gap: 12px; }

.portfolio-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    min-width: 90px;
}

.portfolio-stat.ps-red { background: rgba(255, 23, 68, 0.06); border: 1px solid rgba(255, 23, 68, 0.12); }
.portfolio-stat.ps-amber { background: rgba(255, 171, 0, 0.06); border: 1px solid rgba(255, 171, 0, 0.12); }
.portfolio-stat.ps-green { background: rgba(0, 230, 118, 0.06); border: 1px solid rgba(0, 230, 118, 0.12); }

.ps-count { font-size: 1.4rem; font-weight: 800; line-height: 1; }
.ps-red .ps-count { color: var(--red); }
.ps-amber .ps-count { color: var(--amber); }
.ps-green .ps-count { color: var(--green); }

.ps-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.portfolio-list-section { padding-top: 20px; }

.portfolio-list-header {
    display: grid;
    grid-template-columns: 1fr 60px 50px 75px;
    gap: 12px;
    align-items: center;
    padding: 0 16px 10px;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 1px solid rgba(124, 92, 252, 0.06);
}

.portfolio-list { display: flex; flex-direction: column; gap: 0; }

.portfolio-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(124, 92, 252, 0.04);
    transition: background 0.2s ease;
}

.portfolio-row:hover { background: rgba(124, 92, 252, 0.03); }
.portfolio-row:last-child { border-bottom: none; }

.portfolio-row-main {
    display: grid;
    grid-template-columns: 1fr 60px 50px 75px;
    gap: 12px;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.portfolio-biz { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.portfolio-biz-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portfolio-biz-reason {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portfolio-meta { display: contents; }

.portfolio-risk-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 4px;
    width: fit-content;
}

.portfolio-risk-tag.red { color: var(--red); background: rgba(255, 23, 68, 0.1); border: 1px solid rgba(255, 23, 68, 0.15); }
.portfolio-risk-tag.amber { color: var(--amber); background: rgba(255, 171, 0, 0.1); border: 1px solid rgba(255, 171, 0, 0.15); }
.portfolio-risk-tag.green { color: var(--green); background: rgba(0, 230, 118, 0.1); border: 1px solid rgba(0, 230, 118, 0.15); }

.portfolio-trend { font-size: 1rem; font-weight: 700; text-align: center; }
.portfolio-trend.increasing { color: var(--red); }
.portfolio-trend.stable { color: var(--text-muted); }
.portfolio-trend.decreasing { color: var(--green); }

.portfolio-priority {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    text-align: center;
    width: fit-content;
}

.portfolio-priority.high { color: var(--red); background: rgba(255, 23, 68, 0.08); }
.portfolio-priority.medium { color: var(--amber); background: rgba(255, 171, 0, 0.08); }
.portfolio-priority.low { color: var(--green); background: rgba(0, 230, 118, 0.08); }

.portfolio-details-btn {
    background: none;
    border: 1px solid rgba(124, 92, 252, 0.15);
    color: var(--purple);
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 12px;
}

.portfolio-details-btn:hover {
    background: rgba(124, 92, 252, 0.1);
    border-color: rgba(124, 92, 252, 0.3);
    transform: translateY(-1px);
}

/* ══════════════════════════════════════
   SIMULATOR
   ══════════════════════════════════════ */

.sim-controls { display: flex; align-items: flex-end; gap: 12px; padding: 0 0 24px; }
.sim-field { flex: 1; }

.sim-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.sim-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b86a3' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.sim-select:focus { outline: none; border-color: var(--purple); }
.sim-select option { background: #0d1224; color: var(--text); }

.sim-result { animation: fadeIn 0.3s ease; }

.sim-custom-controls { padding: 0 0 20px; animation: fadeIn 0.3s ease; }
.sim-custom-row { display: flex; gap: 16px; align-items: flex-end; }

.sim-slider-wrap { display: flex; align-items: center; gap: 12px; padding: 8px 0; }

.sim-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(124, 92, 252, 0.15);
    border-radius: 3px;
    outline: none;
}

.sim-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--purple);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.15s ease;
}

.sim-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }

.sim-slider-value { font-size: 0.85rem; font-weight: 700; color: var(--amber); min-width: 65px; text-align: right; }
.sim-slider-value.high { color: var(--red); }
.sim-slider-value.medium { color: var(--amber); }
.sim-slider-value.low { color: var(--green); }

/* ── Comparison Cards ── */
.sim-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.sim-compare-card {
    flex: 1;
    max-width: 220px;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius);
    text-align: center;
}

.sim-compare-card.scenario { border-color: rgba(255, 23, 68, 0.15); }
.sim-compare-card.scenario.improving { border-color: rgba(0, 230, 118, 0.2); }
.sim-compare-card.scenario.deteriorating { border-color: rgba(255, 23, 68, 0.2); }

.sim-compare-label {
    display: block;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 12px;
}

.sim-compare-metric { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
.sim-compare-title { font-size: 0.75rem; color: var(--text-dim); }
.sim-compare-value { font-size: 0.95rem; font-weight: 800; }
.sim-compare-value.red { color: var(--red); }
.sim-compare-value.amber { color: var(--amber); }
.sim-compare-value.green { color: var(--green); }

.sim-compare-arrow { font-size: 1.4rem; color: var(--text-muted); font-weight: 300; }
.sim-compare-arrow.improving { color: var(--green); font-size: 1.6rem; font-weight: 700; }
.sim-compare-arrow.deteriorating { color: var(--red); font-size: 1.6rem; font-weight: 700; }

.sim-compare-value-row { display: flex; align-items: center; gap: 6px; }

.sim-compare-delta { font-size: 0.7rem; font-weight: 700; padding: 1px 5px; border-radius: 4px; }
.sim-compare-delta.worse { color: var(--red); background: rgba(255, 23, 68, 0.1); }
.sim-compare-delta.better { color: var(--green); background: rgba(0, 230, 118, 0.1); }

/* ── Forecast ── */
.sim-forecast-range {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    margin-bottom: 16px;
    background: rgba(124, 92, 252, 0.04);
    border: 1px solid rgba(124, 92, 252, 0.1);
    border-radius: var(--radius-sm);
}

.sim-forecast-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 600; }
.sim-forecast-value { font-size: 1rem; font-weight: 800; color: var(--purple); }
.sim-forecast-note { font-size: 0.7rem; color: var(--text-muted); font-style: italic; }

.sim-summary {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto;
}

.sim-explanation {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 560px;
    margin: 8px auto 0;
    font-style: italic;
}

/* ── Intervention ── */
.sim-intervention {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    margin-bottom: 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.5;
}

.sim-intervention.positive { background: rgba(0, 230, 118, 0.06); border: 1px solid rgba(0, 230, 118, 0.15); color: var(--green); }
.sim-intervention.negative { background: rgba(255, 23, 68, 0.06); border: 1px solid rgba(255, 23, 68, 0.15); color: var(--red); }
.sim-intervention.neutral { background: rgba(255, 171, 0, 0.06); border: 1px solid rgba(255, 171, 0, 0.12); color: var(--amber); }

.sim-intervention-icon { font-size: 1rem; flex-shrink: 0; }
.sim-intervention-text { flex: 1; }

/* ══════════════════════════════════════
   VISUAL PIPELINE (How It Works)
   ══════════════════════════════════════ */

.pipeline {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    padding: 16px 0 40px;
    overflow-x: auto;
}

.pipeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    flex: 0 0 140px;
    position: relative;
}

.pipeline-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(124, 92, 252, 0.15), rgba(124, 92, 252, 0.05));
    border: 2px solid rgba(124, 92, 252, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.pipeline-step:hover .pipeline-icon-wrap {
    border-color: var(--purple);
    box-shadow: 0 0 20px rgba(124, 92, 252, 0.2);
    transform: scale(1.08);
}

.pipeline-icon-wrap svg {
    width: 24px;
    height: 24px;
    color: var(--purple);
}

.pipeline-num {
    position: absolute;
    top: -6px;
    right: 38px;
    width: 20px;
    height: 20px;
    background: var(--purple);
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 800;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.pipeline-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
}

.pipeline-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 130px;
}

.pipeline-connector {
    display: flex;
    align-items: center;
    padding-top: 28px;
    flex: 0 0 40px;
}

.pipeline-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, rgba(124, 92, 252, 0.4), rgba(124, 92, 252, 0.15));
    position: relative;
    overflow: hidden;
}

.pipeline-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--purple), transparent);
    animation: pipelineFlow 2.5s ease-in-out infinite;
}

/* ── Explanation Cards ── */
.explain-section { display: flex; flex-direction: column; gap: 16px; }

.explain-card {
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.explain-card:hover {
    border-color: rgba(124, 92, 252, 0.3);
    box-shadow: 0 8px 32px rgba(124, 92, 252, 0.1), 0 0 0 1px rgba(124, 92, 252, 0.05);
    transform: translateY(-2px);
}

.explain-card-header { margin-bottom: 10px; }

.explain-card h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.explain-card ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.explain-card li {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.6;
    padding-left: 16px;
    position: relative;
}

.explain-card li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--purple);
    opacity: 0.5;
}

.explain-card li strong { color: var(--text); }
.dot-inline { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.dot-inline.green { background: var(--green); }
.dot-inline.amber { background: var(--amber); }
.dot-inline.red { background: var(--red); }

.explain-card-highlight {
    border-color: rgba(124, 92, 252, 0.2);
    background: linear-gradient(135deg, rgba(15, 20, 40, 0.8), rgba(124, 92, 252, 0.04));
}

.signal-badge-inline {
    display: inline-block;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: var(--purple);
    background: rgba(124, 92, 252, 0.08);
    border: 1px solid rgba(124, 92, 252, 0.15);
    padding: 3px 10px;
    border-radius: 4px;
}

.signal-badge-inline.amber-badge { color: var(--amber); background: rgba(255, 171, 0, 0.08); border-color: rgba(255, 171, 0, 0.15); }
.signal-badge-inline.green-badge { color: var(--green); background: rgba(0, 230, 118, 0.08); border-color: rgba(0, 230, 118, 0.15); }

/* ══════════════════════════════════════
   MODE INDICATOR + VIEWING BAR
   ══════════════════════════════════════ */

.mode-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: rgba(124, 92, 252, 0.06);
    border: 1px solid rgba(124, 92, 252, 0.12);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    margin-top: 8px;
}

.mode-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--purple);
    box-shadow: 0 0 6px rgba(124, 92, 252, 0.5);
    animation: modePulse 2s ease-in-out infinite;
}

.mode-indicator-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--purple);
}

.mode-indicator-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: auto;
}

.mode-indicator.mode-bank {
    background: rgba(255, 171, 0, 0.05);
    border-color: rgba(255, 171, 0, 0.15);
}

.mode-indicator.mode-bank .mode-indicator-dot { background: var(--amber); box-shadow: 0 0 6px rgba(255, 171, 0, 0.5); }
.mode-indicator.mode-bank .mode-indicator-label { color: var(--amber); }

.viewing-sme-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(124, 92, 252, 0.04);
    border: 1px solid rgba(124, 92, 252, 0.1);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease;
}

.viewing-sme-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.viewing-sme-name { font-size: 0.88rem; font-weight: 700; color: var(--text); }

.viewing-sme-back {
    margin-left: auto;
    background: none;
    border: 1px solid rgba(124, 92, 252, 0.15);
    color: var(--purple);
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.viewing-sme-back:hover {
    background: rgba(124, 92, 252, 0.1);
    border-color: rgba(124, 92, 252, 0.3);
}

/* ══════════════════════════════════════
   FOOTER — BRANDED
   ══════════════════════════════════════ */

.natwest-footer {
    position: relative;
    padding: 28px 0 36px;
    margin-top: 24px;
}

.footer-glow-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--purple), transparent);
    margin-bottom: 24px;
    opacity: 0.3;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.footer-brand-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dim);
}

.footer-brand-badge {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--purple);
    font-weight: 600;
}

.footer-center {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.footer-right {
    display: flex;
    align-items: center;
}

.footer-hackathon-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--purple);
    background: rgba(124, 92, 252, 0.06);
    border: 1px solid rgba(124, 92, 252, 0.15);
    padding: 5px 12px;
    border-radius: 100px;
    letter-spacing: 0.5px;
}

.footer-hackathon-badge svg { color: var(--purple); opacity: 0.7; }

.footer-sep { color: rgba(124, 92, 252, 0.3); }

/* ══════════════════════════════════════
   GUIDED TOUR
   ══════════════════════════════════════ */

.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
}

.tour-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.tour-tooltip {
    position: fixed;
    z-index: 2001;
    padding: 24px;
    background: rgba(15, 20, 40, 0.98);
    border: 1px solid rgba(124, 92, 252, 0.3);
    border-radius: var(--radius);
    max-width: 360px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    animation: fadeInUp 0.3s ease;
}

.tour-step-count {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--purple);
    font-weight: 700;
    margin-bottom: 8px;
}

.tour-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.tour-desc {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 20px;
}

.tour-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tour-actions-right {
    display: flex;
    gap: 8px;
}

.tour-btn {
    padding: 7px 16px;
    background: none;
    border: 1px solid rgba(124, 92, 252, 0.15);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tour-btn:hover {
    border-color: rgba(124, 92, 252, 0.3);
    color: var(--text);
}

.tour-btn-primary {
    background: var(--purple);
    border-color: var(--purple);
    color: white;
}

.tour-btn-primary:hover {
    background: var(--purple-hover);
    border-color: var(--purple-hover);
    color: white;
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

@media (max-width: 768px) {
    .landing { flex-direction: column; padding: 40px 24px; gap: 32px; min-height: auto; }
    .landing-left { max-width: 100%; text-align: center; }
    .landing-left .landing-brand { justify-content: center; }
    .landing-headline { font-size: 2rem; }
    .landing-sub { margin: 0 auto 32px; text-align: center; }
    .landing-actions { align-items: center; }
    .landing-credit { justify-content: center; }
    .landing-right { width: 100%; }
    .landing-showcase { max-width: 100%; padding: 20px; }
    .landing-comparison { flex-direction: column; gap: 10px; }
    .landing-compare-card { max-width: 100%; }
    .landing-hero-number { font-size: 3rem; }
    .landing-stats-strip { gap: 20px; }
    .landing-btn { width: 100%; justify-content: center; }
    .showcase-ring { display: none; }
    .showcase-glow { inset: -20px; }
    .pipeline { flex-wrap: wrap; gap: 8px; }
    .pipeline-connector { display: none; }
    .pipeline-step { flex: 0 0 calc(50% - 8px); }
}

@media (max-width: 640px) {
    #view-app { padding: 0 16px; }
    .header { flex-wrap: wrap; gap: 8px; }
    .header-left { width: 100%; justify-content: space-between; }
    .header-report-btn { order: 2; }
    .nav { flex-wrap: wrap; width: 100%; }
    .hero-title { font-size: 1.5rem; }
    .status-compare { flex-direction: column; gap: 8px; }
    .status-divider { display: none; }
    .sim-controls { flex-direction: column; }
    .sim-controls .btn { width: 100%; }
    .sim-custom-row { flex-direction: column; }
    .sim-comparison { flex-direction: column; gap: 10px; }
    .sim-compare-card { max-width: 100%; }
    .sim-compare-arrow { transform: rotate(90deg); }
    .key-insight { font-size: 1.1rem; }
    .welcome-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
    .portfolio-summary { flex-wrap: wrap; gap: 8px; }
    .portfolio-stat { min-width: 70px; padding: 10px 14px; }
    .portfolio-list-header { display: none; }
    .portfolio-row-main { grid-template-columns: 1fr; gap: 8px; }
    .portfolio-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 16px;
        border: 1px solid rgba(124, 92, 252, 0.06);
        border-radius: var(--radius-sm);
        margin-bottom: 6px;
    }
    .portfolio-meta { display: flex; gap: 8px; align-items: center; }
    .portfolio-details-btn { margin-left: 0; width: 100%; text-align: center; }
    .mode-indicator-sub { display: none; }
    .early-detect-inner { flex-direction: column; text-align: center; }
    .early-detect-text { justify-content: center; }
    .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
    .footer-center { order: -1; }
    .footer-right { margin-top: 4px; }
    .risk-timeline { justify-content: flex-start; }
}

/* ══════════════════════════════════════
   AUTH PAGES — SPLIT SCREEN LOGIN/SIGNUP
   ══════════════════════════════════════ */

.auth-page {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.auth-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: linear-gradient(135deg, rgba(124, 92, 252, 0.06), rgba(0, 230, 118, 0.02));
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 92, 252, 0.08), transparent 70%);
    top: -100px;
    left: -100px;
    animation: orbFloat 12s ease-in-out infinite;
    pointer-events: none;
}

.auth-left::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 230, 118, 0.04), transparent 70%);
    bottom: -80px;
    right: -80px;
    animation: orbFloat 16s ease-in-out infinite reverse;
    pointer-events: none;
}

.auth-context {
    max-width: 400px;
    z-index: 2;
    animation: fadeInUp 0.5s ease both;
}

.auth-context-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
}

.auth-context-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: 16px;
    letter-spacing: -0.3px;
}

.auth-context-desc {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 32px;
}

.auth-context-desc strong {
    color: var(--purple);
    font-weight: 700;
}

.auth-context-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
}

.auth-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.auth-stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}

.auth-stat-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.auth-context-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.auth-context-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.auth-context-features li svg {
    color: var(--green);
    flex-shrink: 0;
}

.auth-context-badge {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    animation: fadeInUp 0.5s ease 0.15s both;
}

.auth-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
    text-align: center;
}

.auth-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
}

.auth-header p {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid rgba(124, 92, 252, 0.12);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
    -webkit-appearance: none;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-select:focus {
    border-color: rgba(124, 92, 252, 0.4);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.08);
}

.form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a5672' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.auth-error {
    font-size: 0.8rem;
    color: var(--red);
    min-height: 20px;
    margin: 0;
}

.auth-switch {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-top: 20px;
}

.auth-switch a {
    color: var(--purple);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-switch a:hover {
    color: var(--purple-hover);
}

.auth-back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    padding: 12px 0 0;
    margin-top: 12px;
    transition: color 0.2s ease;
    width: 100%;
}

.auth-back-link:hover {
    color: var(--purple);
}

/* ══════════════════════════════════════
   ONBOARDING PAGE
   ══════════════════════════════════════ */

.onboarding-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    position: relative;
    overflow: hidden;
}

.onboarding-bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
}

.onboarding-bg-orb-1 {
    width: 500px;
    height: 500px;
    background: rgba(124, 92, 252, 0.06);
    top: -80px;
    right: -100px;
    animation: orbFloat 12s ease-in-out infinite;
}

.onboarding-bg-orb-2 {
    width: 400px;
    height: 400px;
    background: rgba(0, 230, 118, 0.03);
    bottom: -80px;
    left: -80px;
    animation: orbFloat 16s ease-in-out infinite reverse;
}

.onboarding-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius);
    padding: 40px 36px;
    backdrop-filter: blur(16px);
    z-index: 2;
    position: relative;
    animation: fadeInUp 0.5s ease both;
}

.onboarding-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
    text-align: center;
}

.onboarding-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
}

.onboarding-header p {
    font-size: 0.85rem;
    color: var(--text-dim);
    max-width: 320px;
    line-height: 1.6;
}

.step-dots {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(124, 92, 252, 0.2);
    transition: all 0.3s ease;
}

.step-dot.active {
    background: var(--purple);
    box-shadow: 0 0 8px rgba(124, 92, 252, 0.4);
    width: 24px;
    border-radius: 4px;
}

.ob-step {
    display: none;
}

.ob-step.active {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.3s ease both;
}

/* ══════════════════════════════════════
   PROFILE DROPDOWN
   ══════════════════════════════════════ */

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-menu {
    position: relative;
}

.profile-trigger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.profile-trigger:hover {
    transform: scale(1.05);
}

.profile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--purple), #6246ea);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    font-family: 'Inter', sans-serif;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    background: rgba(15, 20, 40, 0.97);
    border: 1px solid rgba(124, 92, 252, 0.15);
    border-radius: var(--radius);
    backdrop-filter: blur(20px);
    padding: 16px;
    display: none;
    z-index: 100;
    animation: fadeIn 0.2s ease both;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.profile-dropdown.open {
    display: block;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(124, 92, 252, 0.08);
    margin-bottom: 12px;
}

.profile-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.profile-detail {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.profile-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(124, 92, 252, 0.08);
    margin-bottom: 12px;
}

.profile-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.profile-stat-value {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-weight: 600;
}

.profile-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-logout:hover {
    background: rgba(255, 23, 68, 0.06);
    color: var(--red);
}

/* ══════════════════════════════════════
   TOUR OVERLAY
   ══════════════════════════════════════ */

.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
}

.tour-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.tour-tooltip {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 440px;
    background: rgba(15, 20, 40, 0.98);
    border: 1px solid rgba(124, 92, 252, 0.2);
    border-radius: var(--radius);
    padding: 28px 28px 20px;
    z-index: 2001;
    animation: fadeInUp 0.3s ease both;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.tour-step-count {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--purple);
    font-weight: 700;
    margin-bottom: 12px;
}

.tour-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 10px;
}

.tour-desc {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 24px;
}

.tour-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tour-actions-right {
    display: flex;
    gap: 8px;
}

.tour-btn {
    background: none;
    border: 1px solid rgba(124, 92, 252, 0.15);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 8px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tour-btn:hover {
    border-color: rgba(124, 92, 252, 0.3);
    color: var(--text);
    background: rgba(124, 92, 252, 0.04);
}

.tour-btn-primary {
    background: var(--purple);
    border-color: var(--purple);
    color: white;
}

.tour-btn-primary:hover {
    background: var(--purple-hover);
    border-color: var(--purple-hover);
    color: white;
}

/* ── Auth / Onboarding Responsive ── */
@media (max-width: 768px) {
    .auth-page {
        flex-direction: column;
    }
    .auth-left {
        padding: 32px 24px;
        min-height: auto;
    }
    .auth-right {
        padding: 32px 24px;
    }
    .auth-context-title {
        font-size: 1.5rem;
    }
    .auth-context-stats {
        gap: 16px;
    }
    .onboarding-card {
        padding: 28px 20px;
    }
}


/* ═══════════════════════════════════════════
   AI INTELLIGENCE PAGE
   ═══════════════════════════════════════════ */

/* AI Model Status Cards */
.ai-status-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.ai-model-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.ai-model-card:hover {
    border-color: rgba(124, 92, 252, 0.3);
    box-shadow: 0 0 20px rgba(124, 92, 252, 0.08);
}

.ai-model-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.ai-model-icon svg {
    width: 24px;
    height: 24px;
}

.forecaster-icon {
    background: rgba(124, 92, 252, 0.15);
    color: var(--purple);
}

.forecaster-icon svg { stroke: var(--purple); }

.classifier-icon {
    background: rgba(0, 230, 118, 0.15);
    color: var(--green);
}

.classifier-icon svg { stroke: var(--green); }

.anomaly-icon {
    background: rgba(255, 171, 0, 0.15);
    color: var(--amber);
}

.anomaly-icon svg { stroke: var(--amber); }

.ai-model-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.ai-model-type {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: 'Courier New', monospace;
    background: rgba(124, 92, 252, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 16px;
}

.ai-model-metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ai-metric-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.ai-metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--purple);
}

/* AI Selector */
.ai-selector-section {
    margin-bottom: 32px;
}

.ai-selector-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

.ai-selector-row .sim-select {
    flex: 1;
    max-width: 400px;
}

/* AI Summary Card */
.ai-summary-card {
    background: linear-gradient(135deg, rgba(124, 92, 252, 0.1), rgba(124, 92, 252, 0.03));
    border: 1px solid rgba(124, 92, 252, 0.25);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 32px;
}

.ai-summary-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.ai-summary-header svg {
    stroke: var(--purple);
    flex-shrink: 0;
}

.ai-summary-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.ai-summary-text {
    color: var(--text-dim);
    line-height: 1.7;
    font-size: 0.92rem;
}

/* AI Risk Classification */
.ai-risk-result {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 32px;
}

.ai-risk-main {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 20px;
}

.ai-risk-badge {
    font-size: 1.3rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 8px 24px;
    border-radius: var(--radius-sm);
    letter-spacing: 1px;
}

.ai-risk-badge.risk-normal { background: rgba(0, 230, 118, 0.15); color: var(--green); }
.ai-risk-badge.risk-watch { background: rgba(0, 176, 255, 0.15); color: #00b0ff; }
.ai-risk-badge.risk-warning { background: rgba(255, 171, 0, 0.15); color: var(--amber); }
.ai-risk-badge.risk-critical { background: rgba(255, 23, 68, 0.15); color: var(--red); }

.ai-risk-confidence {
    display: flex;
    flex-direction: column;
}

.ai-confidence-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.ai-confidence-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
}

/* Risk probability bars */
.ai-risk-probs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.ai-prob-item {
    text-align: center;
}

.ai-prob-bar-wrap {
    height: 60px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-bottom: 6px;
}

.ai-prob-bar {
    width: 32px;
    border-radius: 4px 4px 0 0;
    min-height: 3px;
    transition: height 0.6s ease;
}

.ai-prob-bar.prob-normal { background: var(--green); }
.ai-prob-bar.prob-watch { background: #00b0ff; }
.ai-prob-bar.prob-warning { background: var(--amber); }
.ai-prob-bar.prob-critical { background: var(--red); }

.ai-prob-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
}

.ai-prob-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    display: block;
}

/* AI Forecast */
.ai-forecast-meta {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.ai-forecast-meta-item {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ai-forecast-meta-item .meta-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.ai-forecast-meta-item .meta-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

/* AI Anomaly */
.ai-anomaly-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ai-anomaly-stat {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    flex: 1;
    min-width: 140px;
}

.ai-anomaly-stat .anomaly-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.ai-anomaly-stat .anomaly-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
}

.ai-anomaly-stat .anomaly-stat-value.anomalous { color: var(--red); }
.ai-anomaly-stat .anomaly-stat-value.normal { color: var(--green); }

/* Feature Importances */
.ai-features-bars {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-feature-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-feature-name {
    width: 180px;
    font-size: 0.8rem;
    color: var(--text-dim);
    text-align: right;
    flex-shrink: 0;
    font-family: 'Courier New', monospace;
}

.ai-feature-bar-wrap {
    flex: 1;
    height: 20px;
    background: rgba(124, 92, 252, 0.06);
    border-radius: 10px;
    overflow: hidden;
}

.ai-feature-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--purple), rgba(124, 92, 252, 0.5));
    border-radius: 10px;
    transition: width 0.8s ease;
}

.ai-feature-value {
    width: 50px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* AI Loading */
.ai-loader {
    text-align: center;
    padding: 60px 0;
    color: var(--text-dim);
}

.ai-loader .spinner {
    margin: 0 auto 16px;
}

/* Model Comparison */
.ai-compare-chart-wrap { margin-bottom: 16px; }
.ai-compare-meta {
    display: flex; gap: 16px; flex-wrap: wrap;
}
.ai-compare-winner {
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.1), rgba(0, 230, 118, 0.03));
    border: 1px solid rgba(0, 230, 118, 0.25);
    border-radius: var(--radius-sm); padding: 16px 20px;
    flex: 1; min-width: 200px;
}
.ai-compare-winner .winner-label {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); display: block;
}
.ai-compare-winner .winner-value {
    font-size: 1.2rem; font-weight: 700; color: var(--green);
}

/* Clustering */
.ai-cluster-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px;
}
.ai-cluster-card {
    background: var(--bg-card); border: 1px solid var(--bg-card-border);
    border-radius: var(--radius); padding: 20px; border-left: 4px solid;
}
.ai-cluster-card h4 { font-size: 0.95rem; margin-bottom: 4px; }
.ai-cluster-card .cluster-badge {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    padding: 2px 8px; border-radius: 4px; display: inline-block; margin-bottom: 8px;
}
.ai-cluster-card .cluster-desc {
    font-size: 0.8rem; color: var(--text-dim); margin-bottom: 8px;
}
.ai-cluster-card .cluster-action {
    font-size: 0.75rem; color: var(--purple); font-weight: 500;
}

/* Live Simulation */
.ai-live-controls {
    display: flex; gap: 12px; align-items: center; margin-bottom: 16px;
}
.ai-live-status { font-size: 0.85rem; color: var(--text-dim); }
.ai-live-results {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px;
}
.ai-live-card {
    background: var(--bg-card); border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-sm); padding: 14px;
}
.ai-live-card .live-name { font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; }
.ai-live-card .live-delay { font-size: 1.3rem; font-weight: 700; }
.ai-live-card .live-status {
    font-size: 0.7rem; text-transform: uppercase; padding: 2px 6px;
    border-radius: 3px; display: inline-block; margin-top: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .ai-status-cards { grid-template-columns: 1fr; }
    .ai-risk-probs { grid-template-columns: repeat(2, 1fr); }
    .ai-feature-name { width: 100px; font-size: 0.7rem; }
    .ai-cluster-cards { grid-template-columns: 1fr; }
}
