/* ============================================
   MF Portfolio Monitor — Design System
   ============================================ */

/* CSS Custom Properties */
:root {
    --bg-primary: #0a0f1e;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-card-hover: rgba(30, 41, 59, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-blue: #667eea;
    --accent-purple: #764ba2;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-amber: #f59e0b;
    --accent-gold: #fbbf24;
    --accent-pink: #ec4899;

    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #10b981, #059669);
    --gradient-danger: linear-gradient(135deg, #ef4444, #dc2626);
    --gradient-warning: linear-gradient(135deg, #f59e0b, #d97706);
    --gradient-gold: linear-gradient(135deg, #fbbf24, #f59e0b);
    --gradient-cyan: linear-gradient(135deg, #06b6d4, #0891b2);

    --border-color: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(102, 126, 234, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.15);

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

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

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

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated Background */
.bg-gradient {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 20%, rgba(102, 126, 234, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(118, 75, 162, 0.10) 0%, transparent 50%),
        radial-gradient(ellipse 40% 60% at 50% 50%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
    z-index: 0;
    animation: bgPulse 12s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: rgba(10, 15, 30, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

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

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

.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.logo-icon svg {
    width: 22px;
    height: 22px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

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

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

.header-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.btn-refresh {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: var(--font-main);
}

.btn-refresh:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.btn-refresh:active {
    transform: translateY(0);
}

.btn-refresh.running {
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Alert Banner */
.alert-banner {
    position: relative;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 32px;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
    animation: slideDown 0.4s ease;
}

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

/* Data Source Indicator */
.data-source-banner {
    position: relative;
    z-index: 49;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 32px;
    font-size: 0.78rem;
    animation: slideDown 0.4s ease;
}

.data-source-banner.source-saved {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.03));
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

.data-source-banner.source-default {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.10), rgba(102, 126, 234, 0.03));
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    color: var(--accent-blue);
}

.alert-icon {
    font-size: 1.2rem;
    animation: alertPulse 2s ease-in-out infinite;
}

@keyframes alertPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.alert-text {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.alert-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-fast);
}

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

/* Summary Section */
.summary-section {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 24px 32px;
}

.summary-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-total::before { background: var(--gradient-primary); }
.card-invested::before { background: var(--gradient-cyan); }
.card-xirr::before { background: var(--gradient-success); }
.card-health::before { background: var(--gradient-warning); }

.summary-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.card-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.card-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.card-sub {
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.positive { color: var(--accent-green); }
.negative { color: var(--accent-red); }
.neutral { color: var(--text-secondary); }
.warning { color: var(--accent-amber); }

/* Tab Navigation */
.tab-nav {
    position: relative;
    z-index: 10;
    display: flex;
    gap: 4px;
    padding: 0 32px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-base);
    white-space: nowrap;
    font-family: var(--font-main);
    position: relative;
}

.tab-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-glass);
}

.tab-btn.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.tab-badge {
    background: var(--accent-red);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}

/* Tab Content */
.tab-content {
    display: none;
    position: relative;
    z-index: 10;
    padding: 24px 32px;
    animation: fadeIn 0.3s ease;
}

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

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

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.btn-secondary {
    padding: 8px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: var(--font-main);
}

.btn-secondary:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-glow);
    color: var(--text-primary);
}

/* Filter Pills */
.filter-pills {
    display: flex;
    gap: 6px;
}

.pill {
    padding: 6px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: var(--font-main);
}

.pill:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-glow);
}

.pill.active {
    background: rgba(102, 126, 234, 0.15);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* Holdings Grid */
.holdings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.fund-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.fund-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.fund-card.status-keep { border-left: 3px solid var(--accent-green); }
.fund-card.status-consolidate { border-left: 3px solid var(--accent-amber); }
.fund-card.status-exit { border-left: 3px solid var(--accent-red); }
.fund-card.status-decide { border-left: 3px solid var(--accent-cyan); }

.fund-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.fund-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    color: white;
    flex-shrink: 0;
    letter-spacing: -0.5px;
}

.fund-info {
    flex: 1;
    min-width: 0;
}

.fund-name {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1.3;
}

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

.fund-status-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.badge-keep { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.badge-consolidate { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.badge-exit { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.badge-decide { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }

.fund-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.metric {
    text-align: center;
}

.metric-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.metric-value {
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.fund-bar-container {
    margin-bottom: 10px;
}

.fund-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.fund-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.fund-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 1s ease;
}

.fund-advice {
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--accent-blue);
    line-height: 1.5;
}

/* SIP Plan Styles */
.sip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.sip-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition-base);
}

.sip-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.sip-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.sip-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: white;
    flex-shrink: 0;
}

.sip-name {
    font-size: 0.9rem;
    font-weight: 700;
}

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

.sip-amount {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 12px;
    font-family: var(--font-mono);
}

.sip-amount span {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
}

.sip-allocation {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    margin-bottom: 8px;
    overflow: hidden;
}

.sip-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 1s ease;
}

.sip-percent {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.sip-role {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.sip-verdict {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    display: inline-block;
}

.sip-verdict.positive {
    background: rgba(16, 185, 129, 0.1);
}

.sip-status-badge {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
}

.sip-status-badge.positive {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.sip-total-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.sip-total-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.sip-total-amount {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--font-mono);
}

/* Alerts Container */
.alerts-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-card {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    animation: fadeIn 0.4s ease;
}

.alert-card:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
}

.alert-card.severity-critical {
    border-left: 3px solid var(--accent-red);
    background: rgba(239, 68, 68, 0.04);
}

.alert-card.severity-warning {
    border-left: 3px solid var(--accent-amber);
    background: rgba(245, 158, 11, 0.04);
}

.alert-card.severity-info {
    border-left: 3px solid var(--accent-blue);
    background: rgba(102, 126, 234, 0.04);
}

.alert-card.severity-success {
    border-left: 3px solid var(--accent-green);
    background: rgba(16, 185, 129, 0.04);
}

.alert-emoji {
    font-size: 1.4rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-body {
    flex: 1;
}

.alert-title {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.alert-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.alert-action {
    margin-top: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 4px;
}

.alert-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.85rem;
}

/* Consolidation Timeline */
.consolidation-timeline {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.timeline-phase {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.phase-header {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.phase-now { background: rgba(239, 68, 68, 0.08); border-bottom: 1px solid rgba(239, 68, 68, 0.15); }
.phase-wait { background: rgba(245, 158, 11, 0.08); border-bottom: 1px solid rgba(245, 158, 11, 0.15); }
.phase-decide { background: rgba(6, 182, 212, 0.08); border-bottom: 1px solid rgba(6, 182, 212, 0.15); }

.phase-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.phase-title {
    font-size: 1rem;
    font-weight: 700;
}

.phase-items {
    padding: 12px 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.phase-item {
    display: flex;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.phase-item:hover {
    background: var(--bg-glass-hover);
}

.item-status {
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 2px;
}

.item-detail {
    flex: 1;
}

.item-detail strong {
    font-size: 0.88rem;
}

.item-detail p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.5;
}

/* Review Calendar */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.calendar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition-base);
}

.calendar-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.calendar-month {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-blue);
    margin-bottom: 6px;
}

.calendar-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.calendar-tasks {
    list-style: none;
}

.calendar-tasks li {
    font-size: 0.78rem;
    color: var(--text-secondary);
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
}

.calendar-tasks li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-blue);
}

/* Reminder Setup */
.reminder-setup {
    margin-top: 8px;
}

.reminder-setup h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.reminder-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.reminder-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition-base);
    cursor: pointer;
}

.reminder-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.reminder-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.reminder-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.reminder-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.reminder-steps {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.6;
    background: var(--bg-glass);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
}

.reminder-steps p {
    margin-bottom: 4px;
}

.reminder-btn {
    display: inline-block;
    padding: 8px 18px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-base);
    font-family: var(--font-main);
}

.reminder-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

/* Alert Settings Tab */
.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-group {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.settings-group-header {
    padding: 16px 24px;
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-group-icon {
    font-size: 1.2rem;
}

.settings-group-title {
    font-size: 0.95rem;
    font-weight: 700;
}

.settings-group-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: auto;
}

.settings-items {
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    flex: 1;
}

.setting-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.setting-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    transition: var(--transition-base);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition-base);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-blue);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

/* Threshold Input */
.threshold-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.threshold-input input {
    width: 70px;
    padding: 6px 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-family: var(--font-mono);
    text-align: center;
    outline: none;
    transition: border-color var(--transition-fast);
}

.threshold-input input:focus {
    border-color: var(--accent-blue);
}

.threshold-input .unit {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Save Settings Button */
.btn-save-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: var(--font-main);
}

.btn-save-settings:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 24px rgba(102, 126, 234, 0.4);
}

.btn-save-settings.saved {
    background: var(--gradient-success);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.4s ease, toastOut 0.4s ease 2.6s forwards;
    font-size: 0.85rem;
    font-weight: 500;
}

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

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

.toast-icon {
    font-size: 1.2rem;
}

/* Footer */
.footer {
    position: relative;
    z-index: 10;
    padding: 24px 32px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer p {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-sub {
    margin-top: 4px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive */
@media (max-width: 1024px) {
    .summary-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
    }

    .summary-section {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .tab-content {
        padding: 16px;
    }

    .holdings-grid {
        grid-template-columns: 1fr;
    }

    .sip-grid {
        grid-template-columns: 1fr;
    }

    .calendar-grid {
        grid-template-columns: 1fr;
    }

    .reminder-options {
        grid-template-columns: 1fr;
    }

    .tab-nav {
        padding: 0 16px;
    }
}

/* Health Score Animations */
.health-excellent { color: var(--accent-green); }
.health-good { color: var(--accent-blue); }
.health-moderate { color: var(--accent-amber); }
.health-poor { color: var(--accent-red); }

/* Score Animation */
@keyframes countUp {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

.score-animated {
    animation: countUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Notification Config Panel within Alerts */
.notification-config {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.notification-config h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.notification-config .subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.config-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.config-row:last-child {
    border-bottom: none;
}

.config-label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.config-emoji {
    font-size: 1.1rem;
}

.config-text {
    font-size: 0.82rem;
    font-weight: 500;
}

.config-text small {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2px;
}

.sip-expert-note {
    background: rgba(102, 126, 234, 0.06);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-top: 20px;
}

.sip-expert-note h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 8px;
}

.sip-expert-note ul {
    list-style: none;
    padding: 0;
}

.sip-expert-note li {
    font-size: 0.78rem;
    color: var(--text-secondary);
    padding: 3px 0;
    padding-left: 20px;
    position: relative;
}

.sip-expert-note li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-green);
    font-weight: 700;
}

/* Alert Settings Section */
.alert-settings-section {
    margin-top: 24px;
}

.alert-settings-section h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================
   Login Screen & Multi-User Support
   ============================================ */

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 15, 30, 0.85);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.login-modal {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    text-align: center;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.login-modal.success {
    transform: scale(0.95);
    opacity: 0;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: var(--gradient-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 10px 20px -5px rgba(102, 126, 234, 0.4);
}

.login-logo svg {
    width: 32px;
    height: 32px;
    color: white;
}

.login-modal h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(to right, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-modal p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.login-input-group {
    text-align: left;
    margin-bottom: 24px;
}

.login-input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-input-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.login-input-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.btn-login-main {
    width: 100%;
    padding: 14px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.btn-login-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.login-divider::before, .login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.login-divider span {
    padding: 0 12px;
}

.btn-login-guest {
    width: 100%;
    padding: 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-login-guest:hover {
    background: var(--bg-glass-hover);
    color: white;
}

.login-error {
    color: var(--accent-red) !important;
    font-size: 0.8rem !important;
    margin-top: 16px !important;
    margin-bottom: 0 !important;
    height: 20px;
}

/* User Badge */
.user-badge {
    margin-left: 16px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.user-badge.guest {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-amber);
    border-color: rgba(245, 158, 11, 0.2);
}
