/* ============================================================
   Invest Dashboard Pro — CSS principal — Mode clair
   ============================================================ */

:root {
    --bg-base:      #f1f5f9;
    --bg-card:      #ffffff;
    --bg-card-alt:  #f8fafc;
    --bg-hover:     #f1f5f9;
    --border:       #e2e8f0;
    --border-light: #f1f5f9;

    --text-primary:   #0f172a;
    --text-secondary: #475569;
    --text-muted:     #94a3b8;

    --green:      #16a34a;
    --green-bg:   #dcfce7;
    --red:        #dc2626;
    --red-bg:     #fee2e2;
    --blue:       #0284c7;
    --blue-dark:  #0369a1;
    --yellow:     #d97706;
    --purple:     #7c3aed;

    --radius:    10px;
    --radius-sm:  6px;
    --shadow:    0 1px 4px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
    --transition: 0.15s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

/* ── Layout ── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
    width: 220px;
    min-width: 220px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}

.sidebar-logo {
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.sidebar-logo .logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; margin-bottom: 8px;
}
.sidebar-logo h1  { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.sidebar-logo span { font-size: 0.72rem; color: var(--text-muted); }

.sidebar-nav { flex: 1; padding: 0 12px; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 2px;
    text-decoration: none;
}
.nav-item:hover  { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: #eff6ff; color: var(--blue-dark); font-weight: 600; }
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-footer {
    padding: 16px 20px 0;
    border-top: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ── Main content ── */
.main-content {
    margin-left: 220px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    position: sticky; top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.topbar-title  { font-size: 1.05rem; font-weight: 600; color: var(--text-primary); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

/* ── Boutons ── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    border: none; border-radius: var(--radius-sm);
    font-size: 0.82rem; font-weight: 600;
    cursor: pointer; transition: var(--transition);
    text-decoration: none;
}
.btn-primary  { background: var(--blue-dark); color: #fff; }
.btn-primary:hover { background: #0c4a6e; }
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-danger  { background: #fee2e2; color: var(--red); border: 1px solid #fecaca; }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 5px 10px; font-size: 0.75rem; }

/* ── Page body ── */
.page-body { padding: 24px 28px; flex: 1; }

/* ── KPI Cards ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.kpi-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.kpi-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    font-weight: 600;
}
.kpi-value {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.kpi-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.kpi-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.75rem; font-weight: 600;
    padding: 2px 8px; border-radius: 20px; margin-top: 6px;
}
.kpi-badge.up   { background: var(--green-bg); color: var(--green); }
.kpi-badge.down { background: var(--red-bg);   color: var(--red);   }
.kpi-badge.neu  { background: var(--bg-base);  color: var(--text-muted); }
.kpi-icon { float: right; font-size: 1.5rem; opacity: 0.2; margin-top: -2px; }

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card-alt);
}
.card-title { font-size: 0.88rem; font-weight: 600; color: var(--text-primary); }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
thead th {
    padding: 10px 16px;
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--bg-card-alt);
    white-space: nowrap;
    font-weight: 600;
}
tbody tr { border-bottom: 1px solid var(--border-light); transition: var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }
tbody td { padding: 11px 16px; color: var(--text-primary); vertical-align: middle; }

/* ── Cellules ── */
.symbol-cell  { font-weight: 700; color: var(--blue-dark); letter-spacing: 0.02em; }
.name-cell    { color: var(--text-secondary); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num-cell     { text-align: right; font-variant-numeric: tabular-nums; }
.positive     { color: var(--green); font-weight: 600; }
.negative     { color: var(--red);   font-weight: 600; }

.type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}
.type-stock  { background: #dbeafe; color: #1d4ed8; }
.type-etf    { background: #dcfce7; color: #15803d; }
.type-crypto { background: #ede9fe; color: #6d28d9; }
.type-bond   { background: #fef3c7; color: #b45309; }
.type-other  { background: var(--bg-base); color: var(--text-muted); }

.actions-cell { display: flex; gap: 6px; justify-content: flex-end; }
.price-loading { color: var(--text-muted); font-style: italic; }

/* ── Score badge ── */
.score-bar {
    width: 48px; height: 5px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
}
.score-fill { height: 100%; border-radius: 3px; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 0.88rem; }

/* ── Topbar select ── */
.topbar-select {
    padding: 7px 12px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
    min-width: 180px;
}
.topbar-select:focus {
    outline: none;
    border-color: var(--blue-dark);
    box-shadow: 0 0 0 3px rgba(3,105,161,0.1);
}

/* ── Refresh indicator ── */
.refresh-info {
    font-size: 0.82rem; color: var(--text-secondary);
    display: flex; align-items: center; gap: 6px;
    white-space: nowrap;
}
.refresh-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--green);
    animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ── Loader ── */
.loader-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(241,245,249,0.7);
    z-index: 999; align-items: center; justify-content: center;
}
.loader-overlay.active { display: flex; }
.loader-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--blue-dark);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
.toast-container {
    position: fixed; bottom: 24px; right: 24px;
    display: flex; flex-direction: column; gap: 8px; z-index: 1000;
}
.toast {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    font-size: 0.83rem; min-width: 260px;
    animation: slideIn 0.2s ease;
    color: var(--text-primary);
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--blue); }
@keyframes slideIn { from{transform:translateX(40px);opacity:0} to{transform:translateX(0);opacity:1} }

/* ── Modal ── */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(15,23,42,0.4);
    z-index: 200; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%; max-width: 520px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
    animation: modalIn 0.2s ease;
}
@keyframes modalIn { from{transform:translateY(-16px);opacity:0} to{transform:translateY(0);opacity:1} }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card-alt);
    border-radius: var(--radius) var(--radius) 0 0;
}
.modal-title { font-size: 0.95rem; font-weight: 600; }
.modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 1.1rem; cursor: pointer; padding: 4px; transition: var(--transition);
    line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }
.modal-body   { padding: 20px 24px; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-card-alt);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ── Formulaires ── */
.form-group { margin-bottom: 14px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label {
    display: block; font-size: 0.75rem;
    color: var(--text-secondary); margin-bottom: 5px; font-weight: 600;
}
input, select, textarea {
    width: 100%; padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem; font-family: inherit;
    transition: var(--transition);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blue-dark);
    box-shadow: 0 0 0 3px rgba(3,105,161,0.1);
}
input::placeholder { color: var(--text-muted); }
.input-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }

/* ── Search ── */
.search-row { display: flex; gap: 8px; margin-bottom: 10px; }
.search-results {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 200px; overflow-y: auto; margin-bottom: 12px;
    box-shadow: var(--shadow);
}
.search-result-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 12px; cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition); font-size: 0.82rem;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-hover); }
.result-symbol { font-weight: 700; color: var(--blue-dark); min-width: 80px; }
.result-name   { color: var(--text-secondary); flex: 1; padding: 0 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-meta   { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; }

/* ── Tooltips ⓘ — overlay JS, jamais coupé ── */
.info-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px; height: 15px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    font-style: normal;
    cursor: help;
    margin-left: 3px;
    vertical-align: middle;
    flex-shrink: 0;
    user-select: none;
}
/* L'overlay est rendu en position:fixed via JS — aucun risque de coupure */
#tooltip-overlay {
    position: fixed;
    background: #1e293b;
    color: #f1f5f9;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    line-height: 1.55;
    max-width: 340px;
    z-index: 9999;
    display: none;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
    text-align: left;
    word-wrap: break-word;
    white-space: pre-wrap;
    font-family: var(--font-mono, monospace);
}

/* ── Entonnoir simulateur ── */
.funnel-container { display: flex; flex-direction: column; gap: 0; }

/* Bloc = barre + description dessous */
.funnel-entry { margin-bottom: 10px; }

/* Piste : 100% de la largeur disponible, clip strict */
.funnel-track { width: 100%; overflow: hidden; }

/* La barre colorée — texte à l'intérieur, jamais plus large que le track */
.funnel-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: #fff;
    min-height: 42px;
    overflow: hidden;        /* clip le contenu si barre trop étroite */
    white-space: nowrap;
    gap: 12px;
    box-sizing: border-box;
    max-width: 100%;
    transition: width 0.5s ease;
}
.funnel-bar-label  { font-size: 0.82rem; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.funnel-bar-amount { font-size: 0.92rem; font-weight: 700; flex-shrink: 0; }

/* Description en dessous de la barre */
.funnel-bar-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 3px;
    padding-left: 4px;
}

.funnel-invest { background: linear-gradient(90deg, #475569, #64748b); }
.funnel-start  { background: linear-gradient(90deg, #0369a1, #0284c7); }
.funnel-mid1   { background: linear-gradient(90deg, #16a34a, #22c55e); }
.funnel-mid2   { background: linear-gradient(90deg, #d97706, #f59e0b); }
.funnel-end    { background: linear-gradient(90deg, #7c3aed, #9333ea); }

.funnel-deduction {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0 3px 12px;
    margin-bottom: 4px;
}
.funnel-arrow { color: var(--red); font-size: 1rem; flex-shrink: 0; }
.funnel-deduct-body { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; flex-wrap: wrap; }
.funnel-deduct-label  { color: var(--text-secondary); }
.funnel-deduct-amount { color: var(--red); font-weight: 700; }
.funnel-deduct-pct    { color: var(--text-muted); font-size: 0.72rem; }

/* ── Simulateur de frais (EPIC 12) ── */
.sim-info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 0.82rem;
    color: #1d4ed8;
    margin-bottom: 20px;
    line-height: 1.6;
}
.sim-input-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
}
.sim-input {
    width: 72px;
    text-align: right;
    padding: 5px 8px;
    font-size: 0.82rem;
}
.sim-unit {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 28px;
}
.sim-data-note {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.sim-warn { color: var(--yellow); }
.sim-missing { color: var(--text-muted); font-style: italic; }
.sim-vfinal { color: var(--blue-dark); font-weight: 700; }
.sim-total-row {
    background: var(--bg-card-alt);
    border-top: 2px solid var(--border);
    font-weight: 600;
}

/* ── Modal Analyse technique — textes didactiques ── */
.tech-explain {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
    background: var(--bg-card-alt);
    border-left: 3px solid var(--border);
    padding: 8px 12px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 8px;
}
.tech-reading {
    display: none;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.5;
    padding: 5px 0 8px 2px;
}

/* ── Modal Recommandations — indicateurs éducatifs ── */
.reco-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 10px;
}
.ind-panels {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ind-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.ind-panel-head {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-card-alt);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}
.ind-panel-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
}
.ind-panel-values {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-light);
}
.ind-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 18px;
    font-size: 0.82rem;
    padding: 3px 0;
}
.ind-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}
.ind-val {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.ind-interp {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 12px;
    line-height: 1.4;
}

/* ── Analyse technique — modal graphiques ── */
.tech-chart-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.tech-legend {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
}
.tech-legend span {
    width: 20px;
    height: 3px;
    border-radius: 2px;
    display: inline-block;
    flex-shrink: 0;
}
.tech-pill {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 56px;
}
.tech-pill-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
}
.tech-pill-value {
    font-size: 0.82rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ── Recommandations IA (EPIC 8) ── */
.action-badge {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.action-buy  { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.action-sell { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.action-hold { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

.confidence-badge {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}
.conf-high { background: #dcfce7; color: #15803d; }
.conf-med  { background: #fef3c7; color: #92400e; }
.conf-low  { background: var(--bg-base); color: var(--text-muted); border: 1px solid var(--border); }

.reco-alert-dot {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 0.72rem;
    color: var(--yellow);
    margin-left: 6px;
    vertical-align: middle;
}

/* ── Tableau groupé par symbole ── */
.asset-row-group {
    background: var(--bg-card);
    font-weight: 500;
}
.asset-row-group.group-clickable {
    cursor: pointer;
}
.asset-row-group:hover {
    background: var(--bg-card-alt);
}
.asset-row-detail {
    background: #f8fafc;
    font-size: 0.82rem;
}
.asset-row-detail:hover {
    background: #f1f5f9;
}
.asset-row-detail td {
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding-top: 5px;
    padding-bottom: 5px;
}
.group-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 0.6rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 3px;
    margin-right: 4px;
    user-select: none;
    transition: transform 0.15s;
}
.group-chevron:hover {
    background: var(--border);
    color: var(--text-primary);
}
.group-chevron-empty {
    cursor: default;
    opacity: 0.3;
}
.detail-date-cell {
    padding-left: 32px !important;
    color: var(--text-muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

/* ── Bloc "Pourquoi cette recommandation" — langage débutant ── */
.why-box {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.why-intro {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}
.why-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.why-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}
.why-point {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
    padding-left: 14px;
    border-left: 3px solid var(--border);
}
.why-summary {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2px;
}
.why-conclusion {
    border-top: 1px solid var(--border);
    padding-top: 14px;
}
.why-bullets {
    margin: 6px 0 0 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.why-bullets li {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ── Market Brief ── */
.market-brief {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--blue);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow: hidden;
    transition: border-left-color var(--transition);
}
.market-brief.bullish { border-left-color: var(--green); }
.market-brief.bearish { border-left-color: var(--red); }
.market-brief.neutral { border-left-color: var(--blue); }
.market-brief.loading { border-left-color: var(--text-muted); }

.brief-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-light);
}
.brief-sentiment-badge { font-size: 1.3rem; flex-shrink: 0; }
.brief-headline-wrap   { flex: 1; min-width: 0; }
.brief-headline {
    display: block;
    font-weight: 600;
    font-size: 0.93rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brief-meta {
    display: block;
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 1px;
}
.brief-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.brief-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.brief-highlights-col,
.brief-impacts-col    { padding: 14px 18px; }
.brief-highlights-col { border-right: 1px solid var(--border-light); }

.brief-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.brief-highlight-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 11px;
}
.brief-highlight-item:last-child { margin-bottom: 0; }
.brief-highlight-icon    { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.brief-highlight-title   { font-weight: 600; font-size: 0.86rem; color: var(--text-primary); }
.brief-highlight-detail  { font-size: 0.81rem; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; }

.brief-impact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
}
.brief-impact-item:last-child { border-bottom: none; }
.brief-impact-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.brief-impact-dot.positive { background: var(--green); }
.brief-impact-dot.negative { background: var(--red); }
.brief-impact-dot.neutral  { background: var(--text-muted); }
.brief-impact-symbol {
    font-weight: 700;
    font-size: 0.86rem;
    color: var(--text-primary);
    min-width: 58px;
    flex-shrink: 0;
}
.brief-impact-reason {
    font-size: 0.81rem;
    color: var(--text-secondary);
    flex: 1;
    min-width: 0;
    line-height: 1.4;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .page-body { padding: 16px; }
}
