/* Nouvelle charte (/v2/nouveau) : structure + recoloration des composants existants.
   Chargé après /v2/static/css/app.css : les rendus existants gardent leur logique,
   seules couleurs, polices, bordures et espacements changent. */
:root {
    --bg: #0b0e14; --surface: #121722; --surface-2: #171d2a; --surface-3: #1e2534;
    --border: #232b3a; --border-strong: #313b4f;
    --text: #e8ebf1; --text-2: #a7b0c0; --text-3: #6f7a8c;
    --gold: #e8b447; --gold-soft: rgba(232,180,71,.12);
    --blue: #4ea1ff; --blue-soft: rgba(78,161,255,.12);
    --red: #f0625d; --red-soft: rgba(240,98,93,.12);
    --orange: #ff9f43; --orange-soft: rgba(255,159,67,.12);
    --green: #3ecf8e; --green-soft: rgba(62,207,142,.12);
}

body.nv { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, system-ui, sans-serif; font-feature-settings: "tnum"; }
body.nv a { color: inherit; }
.nv-muted { color: var(--text-2); font-size: 13px; }
.nv-good { color: var(--green); font-weight: 600; }
.nv-bad { color: var(--red); font-weight: 600; }

/* ---------- Barre du haut ---------- */
.nv-topbar { display: flex; align-items: center; gap: 18px; height: 56px; padding: 0 22px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 20; }
.nv-logo { font-weight: 700; letter-spacing: .08em; color: var(--gold) !important; text-decoration: none; white-space: nowrap; }
.nv-logo span { color: var(--text-2); font-weight: 500; letter-spacing: 0; margin-left: 6px; }
.nv-crumbs { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; min-width: 0; overflow: hidden; white-space: nowrap; }
.nv-crumbs a { text-decoration: none; color: var(--text-2); }
.nv-crumbs a:hover { color: var(--text); }
.nv-crumbs i { color: var(--text-3); font-size: 14px; }
.nv-crumbs b { color: var(--text); font-weight: 600; }
.nv-top-actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------- Boutons ---------- */
.nv-btn, body.nv button.nv-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; margin: 0; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: 500 13px Inter, sans-serif; cursor: pointer; text-decoration: none; white-space: nowrap; opacity: 1; }
body.nv .nv-btn:hover { border-color: var(--text-3); }
/* Même spécificité que « body.nv button.nv-btn » : sinon le bouton doré restait gris. */
body.nv .nv-btn.primary { background: var(--gold); border-color: var(--gold); color: #1b1407; font-weight: 600; }
body.nv .nv-btn.primary:hover { filter: brightness(1.06); border-color: var(--gold); }
body.nv .nv-btn.ghost { background: transparent; }
body.nv .nv-btn.selected { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
body.nv .nv-btn.big { height: 44px; padding: 0 22px; font-size: 15px; border-radius: 10px; }
.nv-btn i { font-size: 16px; }

/* ---------- Mise en page ---------- */
.nv-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.nv-sidebar { border-right: 1px solid var(--border); background: var(--surface); padding: 18px 14px; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; }
.nv-main { padding: 22px 28px 80px; width: 100%; max-width: 1320px; min-width: 0; margin: 0 auto; }
.nv-label { color: var(--text-3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin: 0 6px 8px; }
body.nv select.nv-select { width: 100%; padding: 10px 12px; font: 500 13px Inter, sans-serif; background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); border-radius: 8px; }

.nv-boss { border-radius: 8px; margin-bottom: 4px; }
.nv-boss.open { background: var(--surface-2); padding-bottom: 8px; }
body.nv button.nv-boss-head { display: flex; align-items: center; gap: 7px; width: 100%; margin: 0; padding: 9px 10px; background: transparent; border: 0; color: var(--text); font: 600 13px Inter, sans-serif; text-align: left; cursor: pointer; border-radius: 8px; }
body.nv button.nv-boss-head:hover { background: var(--surface-3); }
.nv-boss-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-pill { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-2); white-space: nowrap; }
.nv-pill.kill { color: var(--green); border-color: rgba(62,207,142,.4); background: var(--green-soft); }
/* Difficultés : NM vert, HM violet, MM orange (teintes douces de la charte) */
.nv-pill.diff { font-weight: 700; letter-spacing: .03em; }
.nv-pill.diff-1 { color: var(--text-2); }
.nv-pill.diff-3 { color: #3ecf8e; border-color: rgba(62,207,142,.45); background: rgba(62,207,142,.10); }
.nv-pill.diff-4 { color: #b197fc; border-color: rgba(177,151,252,.45); background: rgba(177,151,252,.10); }
.nv-pill.diff-5 { color: #ff9f43; border-color: rgba(255,159,67,.45); background: rgba(255,159,67,.10); }
.nv-fights { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 10px 0; }
.nv-fight, body.nv button.nv-fight { font: 500 12px Inter, sans-serif; margin: 0; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border-strong); background: transparent; color: var(--text-2); text-decoration: none; cursor: pointer; }
.nv-fight:hover { border-color: var(--text-3); color: var(--text); }
.nv-fight.kill { color: var(--green); }
.nv-fight.active { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }
.nv-fight.more { color: var(--text-3); }

/* ---------- Cartes ---------- */
.nv-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; }
.nv-fight-head { display: flex; align-items: center; gap: 14px; }
/* Encadré « Analyse du raid » à droite de l'en-tête du combat (bien visible). */
.nv-raid-cta { margin-left: auto; display: flex; align-items: center; gap: 16px; padding: 10px 10px 10px 16px; border: 1px solid var(--gold); border-radius: 12px; background: var(--gold-soft); }
.nv-raid-cta-text b { display: block; font-weight: 700; color: var(--gold); }
.nv-raid-cta-text small { display: block; color: var(--text-2); font-size: 12px; }
.nv-raid-cta.active { background: transparent; }
.nv-fight-title { font-size: 20px; font-weight: 700; }
.nv-roster { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px; margin-top: 16px; }
.nv-roster-side { display: grid; gap: 14px; align-content: start; }
.nv-role-title { color: var(--text-3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.nv-role-title span { color: var(--text-3); font-weight: 500; }
.nv-players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.nv-role-dps .nv-players { grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); }
.nv-player { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid transparent; border-left: 3px solid var(--c); text-decoration: none; min-width: 0; }
.nv-player:hover { border-color: var(--border-strong); border-left-color: var(--c); background: var(--surface-3); }
/* Le nom passe en priorité : c'est la spé qui se raccourcit si la case est étroite. */
.nv-player b { color: var(--c); font-weight: 600; white-space: nowrap; flex-shrink: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.nv-player small { color: var(--text-3); margin-left: auto; font-size: 11px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nv-player.active { border-color: var(--gold); background: var(--gold-soft); border-left-color: var(--c); }
.nv-hint { margin-top: 14px; color: var(--text-3); font-size: 13px; display: flex; gap: 6px; align-items: center; }

.nv-player-head { display: flex; align-items: center; gap: 16px; }
.nv-avatar { width: 46px; height: 46px; border-radius: 10px; border: 2px solid; }
.nv-player-name { font-size: 22px; font-weight: 700; line-height: 1.15; }
.nv-parse { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 66px; height: 50px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--p); background: color-mix(in srgb, var(--p) 12%, transparent); }
.nv-parse b { font-size: 20px; color: var(--p); line-height: 1; }
.nv-parse small { font-size: 10px; color: var(--text-2); }
.nv-steps { margin-left: auto; display: flex; gap: 8px; }
.nv-next { display: flex; align-items: center; gap: 18px; margin: 0 0 16px; padding: 18px 22px; border-radius: 14px; border: 1px solid var(--gold); background: var(--gold-soft); }
.nv-next-icon { font-size: 30px; color: var(--gold); }
.nv-next-title { font-size: 16px; font-weight: 700; }
.nv-next-text { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.nv-next .nv-btn { margin-left: auto; }

.nv-criteria { color: var(--text-2); font-size: 13px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 2px 0 6px; }
.nv-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); margin: 6px 0 4px; overflow-x: auto; }
body.nv button.nv-tab { display: flex; gap: 6px; align-items: center; margin: 0; padding: 10px 0; background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--text-2); font: 500 14px Inter, sans-serif; cursor: pointer; white-space: nowrap; }
body.nv button.nv-tab:hover { color: var(--text); }
body.nv button.nv-tab.active { color: var(--text); border-bottom-color: var(--gold); }
.nv-count { font-size: 11px; background: var(--orange-soft); color: var(--orange); border-radius: 999px; padding: 0 6px; font-weight: 600; }

.nv-empty { margin: 60px auto; max-width: 520px; text-align: center; padding: 40px 24px; border: 1px dashed var(--border-strong); border-radius: 14px; }
.nv-empty i { font-size: 34px; color: var(--gold); }
.nv-empty-title { font-size: 18px; font-weight: 600; margin: 8px 0 4px; }

/* ---------- Recoloration des composants existants ---------- */
.nv-main h2, .nv-main h3 { font-weight: 600; }
.nv-main .small-note { color: var(--text-2); }
.nv-main .quick-compare, .nv-main .log-state, .nv-main .priority-box, .nv-main .individual-summary,
.nv-main .cycle-section, .nv-main .raid-audit-box, .nv-main .talents-v2, .nv-main .summary-box,
.nv-main .beta-timeline, .nv-main .raid-audit-priority {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.nv-main .quick-compare, .nv-main .talents-v2 { margin-top: 0; margin-bottom: 16px; }
.nv-main .quick-stat, .nv-main .stat, .nv-main .priority-card, .nv-main .raid-audit-stat, .nv-main .opener-sequence,
.nv-main .death-v2, .nv-main .rot-finding, .nv-main .raid-audit-row, .nv-main .opener-info, .nv-main .death-v2-hit {
    background: var(--surface-2); border-color: var(--border);
}
.nv-main .stat-value, .nv-main .quick-stat-value { color: var(--text); }
.nv-main .reference-link { color: var(--gold); }
.nv-main .quick-table th, .nv-main .quick-table td, .nv-main .comparison-table th, .nv-main .comparison-table td,
.nv-main .reference-table th, .nv-main .reference-table td { border-bottom-color: var(--border); }
.nv-main .quick-table th, .nv-main .comparison-table th, .nv-main .reference-table th { color: var(--text-3); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.nv-main .spell-icon { border-color: var(--border-strong); }
.nv-main .analysis-tab-panel { padding-top: 16px; }
.nv-main .raid-audit-tabs, .nv-main .analysis-tabs { gap: 22px; border-bottom: 1px solid var(--border); }
.nv-main .analysis-tab-button { margin: 0; padding: 10px 0; background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--text-2); font: 500 14px Inter, sans-serif; }
.nv-main .analysis-tab-button:hover { color: var(--text); border-color: transparent; }
.nv-main .analysis-tab-button.active { background: transparent; color: var(--text); border-bottom-color: var(--gold); }
.nv-main .raid-audit-title { font-size: 18px; font-weight: 700; }
.nv-main .priority-title, .nv-main .individual-summary-title, .nv-main .raid-audit-priority-title { font-weight: 700; }
.nv-main .talents-v2-mode.active { background: var(--gold); border-color: var(--gold); }
.nv-main .opener-sequence-chip { background: var(--surface-3); border-color: var(--border-strong); }
.nv-main .timing-ok { color: var(--green); }
.nv-main .timing-warn { color: var(--orange); }
.nv-main .status-missing, .nv-main .status-below { color: var(--red); }
.nv-main .status-above { color: var(--orange); }
.nv-main .death-v2.avoidable { border-left-color: var(--red); }
.nv-main .death-v2.strategy { border-left-color: var(--orange); }
.nv-main .death-v2.raid { border-left-color: var(--blue); }

@media (max-width: 1100px) {
    .nv-layout { grid-template-columns: 240px minmax(0, 1fr); }
    .nv-main { padding: 18px 16px 60px; }
    .nv-roster { grid-template-columns: 1fr; }
    .nv-player-head { flex-wrap: wrap; }
    .nv-fight-head { flex-wrap: wrap; }
    .nv-raid-cta { margin-left: 0; }
    .nv-crumbs { display: none; }
}
@media (max-width: 760px) {
    .nv-layout { grid-template-columns: 1fr; }
    .nv-sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
    .nv-top-actions .nv-btn span { display: none; }
}

/* Barre latérale : raids récents */
.nv-raid { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; border: 1px solid transparent; margin-bottom: 3px; }
.nv-raid b { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-raid small { display: block; color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-raid:hover { background: var(--surface-2); }
.nv-raid.active { background: var(--gold-soft); border-color: rgba(232,180,71,.45); }
.nv-raid.active b { color: var(--gold); }

/* Accueil d'un raid : cartes des boss */
.nv-overview-head { margin-bottom: 12px; }
.nv-boss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.nv-boss-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.nv-boss-card:hover { border-color: var(--border-strong); }
.nv-boss-card.killed { border-top: 3px solid var(--green); }
.nv-boss-card-head { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.nv-boss-card-name { font-size: 16px; font-weight: 700; flex: 1; }
.nv-boss-card-head:hover .nv-boss-card-name { color: var(--gold); }
.nv-boss-card-status { display: flex; align-items: center; gap: 6px; margin: 6px 0 10px; color: var(--text-2); font-size: 13px; }
.nv-boss-card-status i { color: var(--text-3); }
.nv-boss-card .nv-fights { padding: 0; }
