/* INVESTMENT-ANALYST — Bleu finance classique */
:root {
  --primary-900: #0A2540;
  --primary-700: #1E3A8A;
  --primary-500: #2563EB;
  --primary-300: #93C5FD;
  --primary-100: #DBEAFE;

  --success: #059669;
  --warning: #D97706;
  --danger:  #DC2626;
  --info:    #0891B2;

  --gray-900: #111827;
  --gray-700: #374151;
  --gray-500: #6B7280;
  --gray-300: #D1D5DB;
  --gray-100: #F3F4F6;
  --white:    #FFFFFF;

  --bg: var(--white);
  --surface: var(--white);
  --border: var(--gray-300);
  --text: var(--gray-900);
  --text-muted: var(--gray-500);
  --header-bg: var(--primary-900);
  --header-text: var(--white);
  --link: var(--primary-500);
  --accent: var(--primary-700);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Roboto Mono', ui-monospace, SFMono-Regular, monospace;
  --radius: 4px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
}

[data-theme="dark"] {
  --bg: #0F172A;
  --surface: #1E293B;
  --border: #334155;
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --header-bg: #020617;
  --header-text: #F1F5F9;
  --gray-100: #1E293B;
  --gray-300: #334155;
  --accent: #93C5FD;
}
[data-theme="dark"] .alert-error { background: #3F1212; color: #FCA5A5; }
[data-theme="dark"] .alert-success { background: #052E1B; color: #6EE7B7; }
[data-theme="dark"] .alert-warning { background: #3B2A0E; color: #FCD34D; }
[data-theme="dark"] .badge-primary { background: #1E3A8A; color: #BFDBFE; }
[data-theme="dark"] .badge-success { background: #052E1B; color: #6EE7B7; }
[data-theme="dark"] .badge-danger { background: #3F1212; color: #FCA5A5; }
[data-theme="dark"] table th { background: #0F172A; }
[data-theme="dark"] .heatmap td { color: #0F172A; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--accent); font-weight: 600; margin: 0 0 12px; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }

.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.app-header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 12px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.app-header nav { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }
.app-header nav a { margin-left: 0 !important; font-size: 13px; }
.app-header .brand {
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--white);
}
.app-header nav a { color: var(--header-text); margin-left: 20px; opacity: 0.9; }
.app-header nav a:hover { opacity: 1; }

.app-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary-500);
  border-radius: var(--radius);
  padding: 16px;
}
.kpi .label { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi .value { font-family: var(--font-mono); font-size: 22px; font-weight: 600; margin-top: 6px; }
.kpi.positive { border-left-color: var(--success); }
.kpi.negative { border-left-color: var(--danger); }

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 500;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}
.btn-primary { background: var(--primary-500); color: var(--white); }
.btn-primary:hover { background: var(--primary-700); }
.btn-secondary { background: transparent; color: var(--primary-500); border-color: var(--primary-500); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-block { width: 100%; }

input, select, textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

label { display: block; margin: 12px 0 4px; font-weight: 500; font-size: 13px; }

table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
table th { background: var(--gray-100); font-weight: 600; font-size: 12px; text-transform: uppercase; color: var(--text-muted); }
table td.num, table th.num { text-align: right; }
table td.num { font-family: var(--font-mono); }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; border-left: 4px solid; }
.alert-error { background: #FEE2E2; color: #991B1B; border-color: var(--danger); }
.alert-success { background: #D1FAE5; color: #065F46; border-color: var(--success); }
.alert-warning { background: #FEF3C7; color: #92400E; border-color: var(--warning); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}
.badge-primary { background: var(--primary-100); color: var(--primary-700); }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-danger { background: #FEE2E2; color: #991B1B; }

.positive { color: var(--success); }
.negative { color: var(--danger); }
.muted { color: var(--text-muted); }

.wizard-steps { display: flex; gap: 0; margin-bottom: 24px; }
.wizard-steps .step {
  flex: 1;
  padding: 12px;
  background: var(--gray-100);
  border-right: 2px solid var(--bg);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.wizard-steps .step.active { background: var(--primary-500); color: var(--white); font-weight: 600; }
.wizard-steps .step.done { background: var(--primary-100); color: var(--primary-700); }

.login-wrap {
  max-width: 380px;
  margin: 80px auto;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.login-wrap h1 { text-align: center; margin-bottom: 24px; color: var(--primary-900); }

.flex { display: flex; gap: 12px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mt-3 { margin-top: 24px; }
.mb-3 { margin-bottom: 24px; }
