:root {
    /* Market Watch Light Theme Palette */
    --bg-app: #f8fafc;       /* Lightest Gray */
    --bg-panel: #ffffff;     /* White for cards */
    --bg-hover: #e2e8f0;     /* Light gray hover */
    
    --text-primary: #0f172a; /* Dark Blue */
    --text-secondary: #334155; /* Medium Gray */
    --text-muted: #64748b;   /* Muted Gray */
    
    --accent: #3b82f6;       /* Blue */
    --accent-glow: rgba(59, 130, 246, 0.1);
    
    --success: #10b981;      /* Emerald */
    --danger: #ef4444;       /* Red */
    --warning: #f59e0b;      /* Amber */
    
    --border: 1px solid #e2e8f0; /* Light Gray Border */
    --radius: 12px;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; padding: 0; }

/* --- LAYOUT --- */
.app-layout {
    display: flex;
    min-height: 100vh;
    max-width: 1800px;
    margin: 0 auto;
}

.sidebar-nav {
    width: 260px;
    background: var(--bg-panel); /* Light background for sidebar */
    border-right: var(--border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    padding: 3rem 4rem;
    max-width: 1000px;
}

.sidebar-context {
    width: 320px;
    border-left: var(--border);
    padding: 2rem;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    background: var(--bg-panel); /* Light background for context sidebar */
    box-shadow: -2px 0 5px rgba(0,0,0,0.02); /* Subtle shadow */
}

/* --- COMPONENTS --- */

/* Brand */
.brand {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary); /* Dark text for brand */
    display: flex;
    align-items: center;
    margin-bottom: 3rem;
}
.brand img { height: 32px; margin-right: 12px; }

/* Nav Links */
.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-muted); /* Muted text */
    font-weight: 500;
    border-radius: var(--radius);
    margin-bottom: 4px;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-link.active { background: var(--accent); color: white; box-shadow: 0 4px 12px var(--accent-glow); }
.nav-link i { width: 24px; margin-right: 8px; opacity: 0.8; }

/* Cards */
.mw-card {
    background: var(--bg-panel);
    border: var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02); /* Light shadow for cards */
}
.mw-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: var(--border);
    padding-bottom: 0.75rem;
}
.mw-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary); /* Dark text for card titles */
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-green { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-red { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: var(--accent); border: 1px solid rgba(59, 130, 246, 0.2); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }

/* Typography */
h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 0; color: var(--text-primary); }
h2 { font-size: 1.5rem; font-weight: 700; margin-top: 3rem; color: var(--text-primary); border-left: 4px solid var(--accent); padding-left: 1rem; }
h3 { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); }
h4 { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
p { color: var(--text-secondary); margin-bottom: 1.5rem; }
strong { color: var(--text-primary); font-weight: 600; } /* Ensure strong is visible */

/* Data Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-bottom: 1.5rem;}
.data-table th { text-align: left; color: var(--text-muted); padding: 12px; font-weight: 600; border-bottom: var(--border); }
.data-table td { padding: 12px; border-bottom: var(--border); color: var(--text-secondary); }
.data-table tr:last-child td { border-bottom: none; }

/* Utilities */
.text-green { color: var(--success); }
.text-red { color: var(--danger); }
.text-blue { color: var(--accent); }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

.alert-box {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-top: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
    background: rgba(59, 130, 246, 0.05); /* Lighter background for light theme */
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--text-primary);
}
.alert-box strong { color: var(--text-primary); }

/* Mobile */
@media (max-width: 1200px) { .sidebar-context { display: none; } }
@media (max-width: 900px) {
    .app-layout { flex-direction: column; }
    .sidebar-nav { width: 100%; height: auto; border-right: none; border-bottom: var(--border); position: relative; }
    .main-content { padding: 2rem; }
}
