/* ==========================================================================
   AURA WEALTH - Modern Design System & CSS Stylesheet
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-dark: #080c14;
    --bg-surface: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.75);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(16, 185, 129, 0.25);
    
    /* Brand Colors */
    --primary: #10b981;          /* Emerald Green */
    --primary-glow: rgba(16, 185, 129, 0.4);
    --accent-blue: #3b82f6;       /* Sapphire Blue */
    --accent-purple: #8b5cf6;     /* Amethyst Violet */
    --accent-gold: #f59e0b;       /* Warm Gold */
    --accent-red: #ef4444;        /* Crimson Red */
    
    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Fonts */
    --font-heading: 'Outfit', -apple-system, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
    
    /* Transitions & Radius */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-glass: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* Reset & Base Setup */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Layout Container */
.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header & Brand */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
}

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

.brand-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.brand-text h1 span {
    background: linear-gradient(135deg, var(--primary), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text .tagline {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

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

.action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.header-cortex-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #38bdf8;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.header-cortex-badge:hover {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.4);
}
.header-cortex-badge .pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 10px #38bdf8;
}
.header-cortex-badge .badge-sub {
    color: #fbbf24;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(251, 191, 36, 0.12);
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-selector-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-glass);
}

.profile-select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

.profile-select option {
    background-color: var(--bg-surface);
    color: var(--text-primary);
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #059669);
    color: #fff;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-color: var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.btn-danger-soft {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger-soft:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
}

.btn-outline.active, .btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(16, 185, 129, 0.08);
}

.btn-outline-success {
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--primary);
    background: rgba(16, 185, 129, 0.05);
}

.btn-outline-success:hover {
    background: rgba(16, 185, 129, 0.18);
}

.btn-outline-danger {
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.05);
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.18);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.btn-text {
    background: transparent;
    padding: 0;
    font-size: 0.85rem;
}

/* Navigation Tabs */
.main-nav {
    display: flex;
    gap: 8px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    padding: 6px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    overflow-x: auto;
}

.nav-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.nav-tab.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(59, 130, 246, 0.18));
    color: #fff;
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Main Content & Tab Panes */
.main-content {
    display: flex;
    flex-direction: column;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out forwards;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

/* Glass Panels */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-glass);
    transition: var(--transition);
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.panel-header h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* TAB 1: DASHBOARD */
.dashboard-hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 20px;
}

.hero-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-glass);
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent-blue));
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-subtitle {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.net-worth-amount {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 12px 0;
}

.net-worth-breakdown {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
}

.nw-item {
    display: flex;
    flex-direction: column;
}

.nw-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nw-val {
    font-weight: 700;
    font-size: 1.05rem;
}

.nw-item.assets .nw-val { color: var(--primary); }
.nw-item.liabilities .nw-val { color: var(--accent-red); }
.nw-divider {
    width: 1px;
    height: 28px;
    background: var(--border-glass);
}

/* Score Ring */
.score-display-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
}

.score-ring-container {
    position: relative;
    width: 90px;
    height: 90px;
    flex-shrink: 0;
}

.score-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 8;
}

.score-ring-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease-in-out, stroke 0.3s ease;
}

.score-inner-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    line-height: 1;
}

.score-num {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.score-max {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.score-status-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
}

.score-status-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Cashflow Metrics */
.cashflow-metrics {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.cf-metric {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
}

.cf-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.cf-metric.income .cf-icon { background: rgba(16, 185, 129, 0.15); color: var(--primary); }
.cf-metric.expenses .cf-icon { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.cf-metric.net-savings .cf-icon { background: rgba(245, 158, 11, 0.15); color: var(--accent-gold); }

.cf-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: block;
}

.cf-val {
    font-weight: 700;
    font-size: 0.95rem;
}

/* Dashboard Charts Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.wide-panel {
    grid-column: 1 / -1;
}

.chart-container {
    position: relative;
    height: 260px;
    width: 100%;
}

/* Quick Insights Panel */
.quick-insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
}

.insight-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: var(--transition);
}

.insight-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.insight-card-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.insight-card-icon.high { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.insight-card-icon.medium { background: rgba(245, 158, 11, 0.15); color: var(--accent-gold); }
.insight-card-icon.low { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }

.insight-card-body h4 {
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 700;
}

.insight-card-body p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--primary); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-primary { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--accent-gold); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-glass); }

/* TAB 2: AI FINANCIAL ADVISOR */
.ai-advisor-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 20px;
}

.audit-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Persona Selector */
.persona-selector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.persona-option {
    cursor: pointer;
}

.persona-option input {
    display: none;
}

.persona-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}

.persona-box i {
    font-size: 1.2rem;
}

.persona-option input:checked + .persona-box {
    background: rgba(16, 185, 129, 0.12);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

/* Diagnostics List */
.diagnostic-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.diag-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
}

.diag-title {
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.diag-value {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
}

/* Roadmap Steps */
.roadmap-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: rgba(255, 255, 255, 0.03);
    padding: 14px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--border-glass);
}

.step-item.priority-1 { border-left-color: var(--accent-red); }
.step-item.priority-2 { border-left-color: var(--accent-gold); }
.step-item.priority-3 { border-left-color: var(--accent-blue); }
.step-item.priority-4 { border-left-color: var(--primary); }

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.step-content h4 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
}

.step-content p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Chat Column */
.ai-chat-panel {
    display: flex;
    flex-direction: column;
    height: 680px;
    padding: 0;
    overflow: hidden;
}

.chat-header {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}

.chat-title h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
}

.status-online {
    font-size: 0.72rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-online i {
    font-size: 0.5rem;
}

/* Prompt Chips */
.prompt-chips-wrapper {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
}

.chips-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.chips-container {
    display: flex;
    gap: 8px;
}

.chip-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    padding: 5px 12px;
    font-size: 0.78rem;
    font-family: var(--font-body);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.chip-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.msg-wrapper {
    display: flex;
    gap: 12px;
    max-width: 85%;
}

.msg-wrapper.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.msg-wrapper.ai .msg-avatar {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    color: #fff;
}

.msg-wrapper.user .msg-avatar {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.msg-bubble {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    line-height: 1.5;
}

.msg-wrapper.ai .msg-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    border-top-left-radius: 4px;
}

.msg-wrapper.user .msg-bubble {
    background: linear-gradient(135deg, var(--primary), #059669);
    color: #fff;
    border-top-right-radius: 4px;
}

.msg-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* Chat Input Form */
.chat-input-form {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--border-glass);
    display: flex;
    gap: 10px;
}

.chat-input-form input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.chat-input-form input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.25);
}

/* TAB 3: CALCULATORS & FIRE */
.calc-subnav {
    display: flex;
    gap: 10px;
    background: var(--bg-card);
    padding: 6px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
}

.sub-tab {
    padding: 10px 18px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sub-tab:hover {
    color: var(--text-primary);
}

.sub-tab.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--primary);
    border: 1px solid var(--border-glow);
}

.subtab-content {
    display: none;
}

.subtab-content.active {
    display: block;
}

.calc-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
}

.calc-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.calc-controls h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    margin-bottom: 4px;
}

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

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.form-group label span {
    color: var(--primary);
    font-weight: 700;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group input[type="date"],
.form-group select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.form-group select option {
    background: var(--bg-surface);
}

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

/* Custom Range Sliders */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary-glow);
    transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Calc Summary Cards */
.calc-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.mini-stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    margin: 4px 0;
}

.stat-sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* Text Accent Colors */
.text-emerald { color: var(--primary) !important; }
.text-gold { color: var(--accent-gold) !important; }
.text-blue { color: var(--accent-blue) !important; }
.text-amber { color: #f59e0b !important; }
.text-red { color: var(--accent-red) !important; }
.text-accent { color: var(--accent-purple) !important; }

/* Debt Strategy comparison */
.debt-strategy-compare {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.strategy-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px;
}

.strategy-box h4 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.strategy-box p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Budget target cards */
.budget-rule-preset {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.budget-target-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.budget-target-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
}

.budget-target-card.needs { border-top: 4px solid var(--accent-blue); }
.budget-target-card.wants { border-top: 4px solid var(--accent-gold); }
.budget-target-card.savings { border-top: 4px solid var(--primary); }

.budget-target-card h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
}

.budget-target-card .b-amount {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    margin: 8px 0;
}

.budget-target-card .b-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* TAB 4: GOALS & MILESTONES */
.goals-header-panel {
    margin-bottom: 10px;
}

.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.goal-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    box-shadow: var(--shadow-glass);
    transition: var(--transition);
}

.goal-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.16);
}

.goal-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.goal-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.goal-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.goal-title-group h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
}

.goal-category-tag {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.goal-actions {
    display: flex;
    gap: 4px;
}

.goal-progress-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.goal-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent-blue));
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

.goal-amounts-flex {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.goal-current-val {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
}

.goal-target-val {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.goal-meta-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding-top: 10px;
    border-top: 1px solid var(--border-glass);
}

/* TAB 5: NET WORTH & LEDGER */
.ledger-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ledger-column {
    display: flex;
    flex-direction: column;
}

.ledger-table-wrapper {
    overflow-x: auto;
}

.ledger-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.ledger-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-glass);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.ledger-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.ledger-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.ledger-item-name {
    font-weight: 600;
}

.ledger-item-cat {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.ledger-item-val {
    font-weight: 700;
}

/* MODAL DIALOGS */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-backdrop.active {
    display: flex;
}

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

/* Responsive Media Queries */
@media (max-width: 1100px) {
    .dashboard-hero {
        grid-template-columns: 1fr;
    }
    .ai-advisor-layout {
        grid-template-columns: 1fr;
    }
    .calc-grid {
        grid-template-columns: 1fr;
    }
    .ledger-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
    .header-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
}

/* Live Economic Indicators & Market Research Styles */
.economic-indicators-card {
    margin-bottom: 16px;
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-glass);
}

.header-with-privacy {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.privacy-tag {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    background: rgba(16, 185, 129, 0.12);
    color: var(--primary);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.market-indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.market-pill {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: var(--transition);
}

.market-pill:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2);
}

.market-pill-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.market-pill-val {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.market-pill-sub {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.privacy-badge-banner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    margin-top: 8px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    color: var(--accent-purple);
}
