/* ═══════════════════════════════════════════
   PatrimoineIA — Styles custom
   ═══════════════════════════════════════════ */

/* ── Scrollbar ── */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Onglets navigation ── */
.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}

.dark .tab-btn {
    color: #94A3B8;
}
.tab-btn {
    color: #64748b;
}

.dark .tab-btn:hover {
    color: #e2e8f0;
    background: rgba(99, 102, 241, 0.08);
}
.tab-btn:hover {
    color: #1e293b;
    background: rgba(99, 102, 241, 0.05);
}

.dark .tab-btn.active {
    color: #818cf8;
    border-bottom-color: #6366f1;
}
.tab-btn.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
}

/* ── Cards ── */
.card {
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: background-color 0.3s;
}
.dark .card {
    background: #1A1D2E;
    border: 1px solid #2A2D3E;
}
.card {
    background: white;
    border: 1px solid #e2e8f0;
}

.card-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.dark .card-title { color: #cbd5e1; }
.card-title { color: #334155; }

/* ── KPI Cards ── */
.kpi-card {
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.dark .kpi-card {
    background: #1A1D2E;
    border: 1px solid #2A2D3E;
}
.kpi-card {
    background: white;
    border: 1px solid #e2e8f0;
}
.kpi-card:hover {
    transform: translateY(-1px);
}
.dark .kpi-card:hover {
    border-color: #6366f1;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2);
}
.kpi-card:hover {
    border-color: #6366f1;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.1);
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
}
.dark .kpi-label { color: #94A3B8; }
.kpi-label { color: #64748b; }

.kpi-value {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.dark .kpi-value { color: #f1f5f9; }
.kpi-value { color: #0f172a; }

.kpi-sparkline-container { height: 50px; width: 100%; position: relative; margin-top: 0.25rem; }

/* ── Chart container ── */
.chart-container {
    position: relative;
    height: 260px;
}

/* ── Formulaires ── */
.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
}
.dark .form-label { color: #94A3B8; }
.form-label { color: #64748b; }

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.15s;
    outline: none;
}
.dark .form-input {
    background: #0F1117;
    border: 1px solid #2A2D3E;
    color: #f1f5f9;
}
.form-input {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0f172a;
}
.dark .form-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}
.form-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}
.dark .form-input::placeholder { color: #475569; }
.form-input::placeholder { color: #94a3b8; }

/* ── Boutons ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    background: #6366f1;
    color: white;
    border-radius: 0.5rem;
    transition: all 0.15s;
    border: none;
    cursor: pointer;
}
.btn-primary:hover { background: #4f46e5; }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.15s;
    border: none;
    cursor: pointer;
}
.dark .btn-secondary {
    background: #2A2D3E;
    color: #94A3B8;
}
.btn-secondary {
    background: #f1f5f9;
    color: #64748b;
}
.dark .btn-secondary:hover { background: #353849; }
.btn-secondary:hover { background: #e2e8f0; }

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    background: #ef4444;
    color: white;
    border-radius: 0.5rem;
    transition: all 0.15s;
    border: none;
    cursor: pointer;
}
.btn-danger:hover { background: #dc2626; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    transition: all 0.15s;
    border: none;
    cursor: pointer;
    background: transparent;
}
.dark .btn-icon { color: #94A3B8; }
.btn-icon { color: #64748b; }
.dark .btn-icon:hover { background: #2A2D3E; color: #e2e8f0; }
.btn-icon:hover { background: #f1f5f9; color: #0f172a; }

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: none;
}
.modal-overlay > * {
    position: relative;
    z-index: 1;
}
.modal-content {
    position: relative;
    width: 100%;
    border-radius: 1rem;
    padding: 1.5rem;
    max-height: 90vh;
    overflow-y: auto;
    animation: modal-in 0.2s ease-out;
}
.dark .modal-content {
    background: #1A1D2E;
    border: 1px solid #2A2D3E;
}
.modal-content {
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: 9999px;
    white-space: nowrap;
}
.badge-indigo { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.badge-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-red { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-slate { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.badge-sky { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.badge-violet { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.badge-rose { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
.badge-teal { background: rgba(20, 184, 166, 0.15); color: #2dd4bf; }
.badge-orange { background: rgba(249, 115, 22, 0.15); color: #fb923c; }

/* ── Toast ── */
.toast {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: toast-in 0.3s ease-out;
    min-width: 280px;
    max-width: 400px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}
.dark .toast {
    background: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
}
.toast {
    background: white;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}
.toast-success { border-left: 3px solid #10b981; }
.toast-error { border-left: 3px solid #ef4444; }
.toast-warning { border-left: 3px solid #f59e0b; }
.toast-info { border-left: 3px solid #6366f1; }
.toast-close { cursor: pointer; background: none; border: none; color: inherit; padding: 0; }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

/* ── Tableau actifs ── */
.actif-row {
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.15s;
    cursor: default;
    position: relative;
    overflow: hidden;
}
.dark .actif-row {
    background: #1A1D2E;
    border: 1px solid #2A2D3E;
}
.actif-row {
    background: white;
    border: 1px solid #e2e8f0;
}
.dark .actif-row:hover {
    border-color: #3f3f6b;
}
.actif-row:hover {
    border-color: #c7d2fe;
}

/* Édition inline */
.inline-edit {
    background: transparent;
    border: none;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    width: auto;
    min-width: 80px;
    outline: none;
    cursor: text;
}
.dark .inline-edit:focus {
    background: #0F1117;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
}
.inline-edit:focus {
    background: #f0f4ff;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

/* ── Groupe (enveloppe/catégorie) ── */
.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    cursor: pointer;
    user-select: none;
}
.group-header:hover .group-title {
    color: #6366f1;
}
.group-title {
    font-size: 0.9375rem;
    font-weight: 600;
    transition: color 0.15s;
}
.dark .group-title { color: #e2e8f0; }
.group-title { color: #1e293b; }

.group-total {
    font-size: 0.875rem;
    font-weight: 600;
}
.dark .group-total { color: #94A3B8; }
.group-total { color: #64748b; }

/* ── Vide state ── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}
.dark .empty-state { color: #475569; }
.empty-state { color: #94a3b8; }

/* ── Transitions ── */
.tab-content {
    animation: fade-in 0.2s ease-out;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Status indicators ── */
.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-ok {
    background: #10b981;
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.5);
}
.status-error {
    background: #ef4444;
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
}
.status-warning {
    background: #f59e0b;
    box-shadow: 0 0 4px rgba(245, 158, 11, 0.5);
}
.status-checking {
    background: #94a3b8;
    animation: pulse-dot 1s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ── Actif dette (style négatif) ── */
.dark .actif-row-dette {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.25);
}
.actif-row-dette {
    background: rgba(239, 68, 68, 0.04);
    border-color: rgba(239, 68, 68, 0.2);
}
.dark .actif-row-dette:hover {
    border-color: rgba(239, 68, 68, 0.4);
}
.actif-row-dette:hover {
    border-color: rgba(239, 68, 68, 0.35);
}

/* ── Jauge proportionnelle actif ── */
.actif-gauge {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    border-radius: 0 0 0 0.75rem;
    opacity: 0.5;
    transition: width 0.3s ease;
}

/* ── Mini-jauge KPI ── */
.kpi-gauge {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    border-radius: 0.75rem 0.75rem 0 0;
    transition: width 0.4s ease;
    opacity: 0.8;
}

/* ── Performance colors ── */
.perf-positive { color: #10b981; }
.perf-negative { color: #ef4444; }
.perf-neutral { color: #94a3b8; }

/* ── Trend indicators (immobilier) ── */
.trend-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.1rem 0.45rem;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 9999px;
    white-space: nowrap;
}
.trend-hausse_forte { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.trend-hausse       { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.trend-stable       { background: rgba(148, 163, 184, 0.12); color: #94a3b8; }
.trend-baisse       { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.trend-baisse_forte { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* ── Tag pills (actif rows) ── */
.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.62rem;
    font-weight: 500;
    background: rgba(99, 102, 241, 0.12);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.2);
    white-space: nowrap;
    line-height: 1.4;
}

/* ── Filter pills (patrimoine filter bar) ── */
.filter-pill {
    padding: 0.25rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
}
.filter-pill:hover {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}
.filter-pill.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: #818cf8;
}

/* ── Drag & Drop (déplacement entre enveloppes) ── */
.draggable-row {
    cursor: grab;
}
.draggable-row:active {
    cursor: grabbing;
}
.draggable-row.is-dragging {
    opacity: 0.35;
    transform: scale(0.98);
    transition: opacity 0.1s, transform 0.1s;
}
.group-drop-zone {
    border-radius: 0.75rem;
    transition: outline 0.12s, background 0.12s;
}
.group-drop-zone.drop-active {
    outline: 2px dashed #6366f1;
    outline-offset: 2px;
    background: rgba(99, 102, 241, 0.04);
}
.group-drop-zone.drop-active .group-header {
    background: rgba(99, 102, 241, 0.08);
    border-radius: 0.6rem;
}

/* ── Watchlist — Cartes indicateurs ── */
.watchlist-card {
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    position: relative;
}
.watchlist-card:hover {
    transform: translateY(-2px);
}
.dark .watchlist-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.watchlist-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.watchlist-card:active {
    cursor: grabbing;
}
.watchlist-card.is-dragging {
    opacity: 0.3;
    transform: scale(0.95);
}
.watchlist-card.drag-over {
    outline: 2px dashed #6366f1;
    outline-offset: 3px;
}

/* Watchlist — Groupes par tag */
.watchlist-group .group-header {
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.15s;
    cursor: pointer;
    user-select: none;
}
.dark .watchlist-group .group-header:hover {
    background: rgba(148, 163, 184, 0.08);
}
.watchlist-group .group-header:hover {
    background: rgba(148, 163, 184, 0.04);
}
.watchlist-group.collapsed .watchlist-grid {
    display: none;
}
.watchlist-group.collapsed .group-chevron {
    transform: rotate(-90deg);
}
.group-chevron {
    transition: transform 0.2s;
}

/* Watchlist — Chart container dans les cartes */
.watchlist-chart-container {
    height: 80px;
    width: 100%;
    position: relative;
}

/* Watchlist — Barre de recommandation analystes */
.reco-bar {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    gap: 1px;
}
.reco-bar .seg-strong-buy { background: #059669; }
.reco-bar .seg-buy { background: #10b981; }
.reco-bar .seg-hold { background: #6b7280; }
.reco-bar .seg-sell { background: #f59e0b; }
.reco-bar .seg-strong-sell { background: #ef4444; }

/* Watchlist — Traductions recommandation */
.reco-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.reco-buy { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.reco-strong-buy { background: rgba(5, 150, 105, 0.2); color: #059669; }
.reco-hold { background: rgba(107, 114, 128, 0.15); color: #9ca3af; }
.reco-sell { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.reco-strong-sell { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* Watchlist — Pilules filtre tag */
.filter-pill {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    border: 1px solid transparent;
}
.dark .filter-pill {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.08);
}
.filter-pill {
    color: #64748b;
    background: rgba(148, 163, 184, 0.06);
}
.dark .filter-pill:hover {
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.15);
}
.filter-pill:hover {
    color: #1e293b;
    background: rgba(148, 163, 184, 0.12);
}
.dark .filter-pill.active {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.3);
}
.filter-pill.active {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    border-color: rgba(99, 102, 241, 0.2);
}

/* Watchlist — Résultats recherche modal */
.search-result-row {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.12s;
}
.dark .search-result-row:hover {
    background: rgba(99, 102, 241, 0.12);
}
.search-result-row:hover {
    background: rgba(99, 102, 241, 0.06);
}

/* Watchlist — Modal overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 6rem;
}
.modal-overlay.hidden {
    display: none;
}

/* ── Performance — Onglets période ── */
.period-tab {
    padding: 0.375rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
    white-space: nowrap;
}
.dark .period-tab {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.08);
}
.period-tab {
    color: #64748b;
    background: rgba(148, 163, 184, 0.06);
}
.dark .period-tab:hover {
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.15);
}
.period-tab:hover {
    color: #1e293b;
    background: rgba(148, 163, 184, 0.12);
}
.dark .period-tab.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: #818cf8;
}
.period-tab.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: #6366f1;
}

/* ── Performance — Tableau ── */
.perf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.perf-table th {
    cursor: pointer;
    padding: 0.625rem 0.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    user-select: none;
    transition: color 0.15s;
}
.dark .perf-table th { color: #64748b; }
.perf-table th { color: #94a3b8; }
.dark .perf-table th:hover { color: #818cf8; }
.perf-table th:hover { color: #6366f1; }
.perf-table td {
    padding: 0.5rem;
}
.dark .perf-table td {
    border-top: 1px solid #2A2D3E;
}
.perf-table td {
    border-top: 1px solid #f1f5f9;
}

/* ── Performance — Valeurs colorées ── */
.perf-value-pos { color: #10b981; font-weight: 600; }
.perf-value-neg { color: #ef4444; font-weight: 600; }
.perf-value-null { color: #475569; font-style: italic; }

/* ── Performance — Cellule éditable ── */
.perf-editable {
    cursor: pointer;
    border-bottom: 1px dashed currentColor;
    transition: opacity 0.15s;
}
.perf-editable:hover {
    opacity: 0.7;
}

/* ── Performance — Badge annuelle ── */
.perf-annual-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.6rem;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.4;
}
.perf-annual-badge.perf-value-pos {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.perf-annual-badge.perf-value-neg {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.perf-annual-badge.perf-value-null {
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.15);
    font-style: normal;
}
.perf-annual-badge.frais-badge {
    background: rgba(251, 146, 60, 0.12);
    border: 1px solid rgba(251, 146, 60, 0.25);
    color: #fb923c;
    font-weight: 500;
}
.perf-annual-badge.frais-badge.frais-null {
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.15);
    color: inherit;
    font-weight: normal;
}
.perf-annual-badge.entree-badge {
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.25);
    color: #a855f7;
    font-weight: 500;
}
.perf-annual-badge.entree-badge.entree-null {
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.15);
    color: inherit;
    font-weight: normal;
}

/* ── Loading state boutons ── */
.btn-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ═══════════════════════════════════════════
   Help Tooltips — Infobulles contextuelles
   ═══════════════════════════════════════════ */

.help-tooltip {
    position: fixed;
    z-index: 9999;
    max-width: 320px;
    min-width: 180px;
    padding: 0.75rem 1rem;
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.help-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Dark mode */
.dark .help-tooltip {
    background: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
/* Light mode */
.help-tooltip {
    background: white;
    border: 1px solid #e2e8f0;
    color: #334155;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Titre du tooltip */
.help-tooltip-title {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.375rem;
    color: #818cf8;
}

/* Flèche */
.help-tooltip::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    transform: rotate(45deg);
}
.dark .help-tooltip::before {
    background: #1e293b;
    border-color: #334155;
}
.help-tooltip::before {
    background: white;
    border-color: #e2e8f0;
}
.help-tooltip.pos-bottom::before {
    top: -5px;
    left: 50%;
    margin-left: -4px;
    border-top: 1px solid;
    border-left: 1px solid;
    border-bottom: none;
    border-right: none;
}
.help-tooltip.pos-top::before {
    bottom: -5px;
    left: 50%;
    margin-left: -4px;
    border-bottom: 1px solid;
    border-right: 1px solid;
    border-top: none;
    border-left: none;
}

/* Icône "?" pour les graphiques */
.chart-help-icon {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    cursor: help;
    z-index: 5;
    transition: all 0.15s;
}
.dark .chart-help-icon {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}
.chart-help-icon {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.2);
}
.chart-help-icon:hover {
    background: rgba(99, 102, 241, 0.35);
}
