/* ============================================================
   css/07-anthropic-analysis.css
   ============================================================
   Vue "Analyse Anthropic Model Sonnet 4.6" : sous-vue de la modale
   Recommandations. La structure visuelle (sidebar + onglets, KPIs,
   timeline, cartes recommandations, etc.) est calquée sur le rapport
   d'origine, mais adaptée aux variables CSS et au mode sombre du
   projet MSSS pour rester cohérente avec le reste de l'interface.
   ============================================================ */

  /* === Tokens spécifiques à la vue Anthropic ===
     On définit ses couleurs sémantiques dans une plage qui vit bien
     en clair ET en sombre (cf. body.dark plus bas). */
  :root {
    --anthropic-blue:   #1B4F8A;
    --anthropic-good:   #2D6E2D;
    --anthropic-warn:   #B07314;
    --anthropic-danger: #C4381A;
    --anthropic-purple: #4B3A8C;

    --anthropic-blue-light:   rgba(27,79,138,0.10);
    --anthropic-good-light:   rgba(45,110,45,0.10);
    --anthropic-warn-light:   rgba(176,115,20,0.12);
    --anthropic-danger-light: rgba(196,56,26,0.10);
    --anthropic-purple-light: rgba(75,58,140,0.10);

    --anthropic-card-bg:     #ffffff;
    --anthropic-card-border: #e0e3e7;
    --anthropic-section-bg:  #f5f7f9;
    --anthropic-shadow:      0 1px 3px rgba(0,0,0,0.06), 0 0 0 0.5px rgba(0,0,0,0.05);
    --anthropic-shadow-md:   0 4px 12px rgba(0,0,0,0.08), 0 0 0 0.5px rgba(0,0,0,0.05);
  }
  body.dark {
    --anthropic-blue:   #6cb6ee;
    --anthropic-good:   #6ec46e;
    --anthropic-warn:   #e3b86a;
    --anthropic-danger: #ee7a5d;
    --anthropic-purple: #a896e8;

    --anthropic-blue-light:   rgba(108,182,238,0.14);
    --anthropic-good-light:   rgba(110,196,110,0.14);
    --anthropic-warn-light:   rgba(227,184,106,0.14);
    --anthropic-danger-light: rgba(238,122,93,0.14);
    --anthropic-purple-light: rgba(168,150,232,0.14);

    --anthropic-card-bg:     #28333b;
    --anthropic-card-border: #354450;
    --anthropic-section-bg:  #1e2830;
    --anthropic-shadow:      0 1px 3px rgba(0,0,0,0.4), 0 0 0 0.5px rgba(255,255,255,0.04);
    --anthropic-shadow-md:   0 4px 14px rgba(0,0,0,0.5), 0 0 0 0.5px rgba(255,255,255,0.04);
  }

  /* ============================================================
     Carte d'accès en haut de la vue principale (recommandations)
     ============================================================ */
  .anthropic-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    width: 100%;
    text-align: left;
    background: linear-gradient(135deg, var(--text-accent) 0%, #1565a0 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 18px 20px;
    margin: 18px 0 22px 0;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(10,61,98,0.25);
    transition: transform .15s ease, box-shadow .15s ease;
    font-family: inherit;
  }
  body.dark .anthropic-card {
    background: linear-gradient(135deg, #14507a 0%, #1d6ea3 100%);
    box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  }
  .anthropic-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(10,61,98,0.35);
  }
  .anthropic-card-eyebrow {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.78;
    margin-bottom: 4px;
  }
  .anthropic-card-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 6px;
  }
  .anthropic-card-title em {
    font-style: italic;
    color: #ffd28a;
    font-weight: 500;
  }
  body.dark .anthropic-card-title em { color: #ffd54f; }
  .anthropic-card-sub {
    font-size: 12.5px;
    line-height: 1.5;
    opacity: 0.88;
  }
  .anthropic-card-cta {
    background: rgba(255,255,255,0.15);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }

  /* ============================================================
     Bouton "← Retour aux Recommandations"
     ============================================================ */
  .anthropic-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-modal-source);
    color: var(--text-accent);
    border: 1px solid var(--border-modal-divider);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
    font-family: inherit;
    transition: background .15s ease, color .15s ease;
  }
  .anthropic-back-btn:hover {
    background: var(--text-accent);
    color: #fff;
  }
  body.dark .anthropic-back-btn:hover {
    background: var(--bg-header-btn);
    color: #fff;
  }

  /* ============================================================
     Header du rapport
     ============================================================ */
  .anthropic-header {
    background: var(--text-accent);
    color: #fff;
    border-radius: 14px;
    padding: 28px 28px 22px;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
  }
  body.dark .anthropic-header {
    background: linear-gradient(135deg, #0a1f2e 0%, #14507a 100%);
  }
  .anthropic-header::before {
    content: '';
    position: absolute;
    top: -50px; right: -60px;
    width: 220px; height: 220px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
  }
  .anthropic-header-eyebrow {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    margin-bottom: 8px;
    font-weight: 500;
  }
  .anthropic-header-title {
    font-size: clamp(1.25rem, 2.4vw, 1.85rem);
    color: #fff;
    line-height: 1.2;
    margin: 0 0 14px 0;
    font-weight: 600;
    max-width: 620px;
  }
  .anthropic-header-title em {
    color: #ffd28a;
    font-style: italic;
    font-weight: 500;
  }
  body.dark .anthropic-header-title em { color: #ffd54f; }
  .anthropic-header-meta {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 0.5px solid rgba(255,255,255,0.14);
  }
  .anthropic-meta-item {
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    line-height: 1.45;
  }
  .anthropic-meta-item strong {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.92);
    font-weight: 500;
  }

  /* ============================================================
     Layout 2 colonnes : sidebar + content
     ============================================================ */
  .anthropic-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 18px;
    align-items: start;
  }
  .anthropic-sidebar {
    position: sticky;
    top: 0;
  }
  .anthropic-nav-label {
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0 8px;
    margin-bottom: 6px;
  }
  .anthropic-nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--anthropic-card-bg);
    border: 1px solid var(--anthropic-card-border);
    border-radius: 12px;
    box-shadow: var(--anthropic-shadow);
    overflow: hidden;
  }
  .anthropic-nav-menu li { border-bottom: 0.5px solid var(--anthropic-card-border); }
  .anthropic-nav-menu li:last-child { border-bottom: none; }
  .anthropic-nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-default);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background .15s ease, color .15s ease;
  }
  .anthropic-nav-btn:hover {
    background: var(--anthropic-section-bg);
  }
  .anthropic-nav-btn.active {
    background: var(--anthropic-blue-light);
    color: var(--text-accent);
    font-weight: 600;
  }
  .anthropic-nav-icon {
    width: 24px; height: 24px;
    display: inline-flex;
    align-items: center; justify-content: center;
    background: var(--anthropic-section-bg);
    border-radius: 6px;
    flex-shrink: 0;
    font-size: 13px;
  }
  .anthropic-nav-btn.active .anthropic-nav-icon {
    background: var(--anthropic-blue);
    color: #fff;
  }
  .anthropic-sidebar-note {
    margin-top: 10px;
    background: var(--anthropic-card-bg);
    border: 1px solid var(--anthropic-card-border);
    border-left: 3px solid var(--text-accent);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    box-shadow: var(--anthropic-shadow);
  }
  .anthropic-sidebar-note strong {
    display: block;
    color: var(--text-default);
    margin-bottom: 4px;
    font-weight: 600;
  }

  .anthropic-content { min-width: 0; }

  /* ============================================================
     Sections, intro box, labels
     ============================================================ */
  .anthropic-section-label {
    font-size: 9.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
    margin: 22px 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 0.5px solid var(--anthropic-card-border);
  }
  .anthropic-content > .anthropic-section-label:first-child,
  .anthropic-content > .anthropic-intro-box + .anthropic-section-label {
    margin-top: 4px;
  }
  .anthropic-intro-box {
    background: var(--text-accent);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 14px;
    color: #fff;
  }
  body.dark .anthropic-intro-box {
    background: linear-gradient(135deg, #0a1f2e 0%, #1a3a52 100%);
  }
  .anthropic-intro-box p {
    font-size: 13px;
    line-height: 1.65;
    color: rgba(255,255,255,0.82);
    margin: 0;
  }
  .anthropic-intro-box p + p { margin-top: 8px; }
  .anthropic-intro-box strong { color: #fff; font-weight: 600; }

  /* ============================================================
     KPIs
     ============================================================ */
  .anthropic-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
  }
  .anthropic-kpi {
    background: var(--anthropic-card-bg);
    border: 1px solid var(--anthropic-card-border);
    border-top: 3px solid var(--anthropic-card-border);
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: var(--anthropic-shadow);
  }
  .anthropic-kpi-danger { border-top-color: var(--anthropic-danger); }
  .anthropic-kpi-warn   { border-top-color: var(--anthropic-warn); }
  .anthropic-kpi-ok     { border-top-color: var(--anthropic-good); }
  .anthropic-kpi-info   { border-top-color: var(--anthropic-blue); }
  .anthropic-kpi-label  { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; font-weight: 500; }
  .anthropic-kpi-value  { font-size: 22px; font-weight: 700; color: var(--text-default); line-height: 1.1; font-variant-numeric: tabular-nums; }
  .anthropic-kpi-danger .anthropic-kpi-value { color: var(--anthropic-danger); }
  .anthropic-kpi-warn   .anthropic-kpi-value { color: var(--anthropic-warn); }
  .anthropic-kpi-ok     .anthropic-kpi-value { color: var(--anthropic-good); }
  .anthropic-kpi-info   .anthropic-kpi-value { color: var(--anthropic-blue); }
  .anthropic-kpi-sub    { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

  /* ============================================================
     Findings (constats structurels)
     ============================================================ */
  .anthropic-finding {
    background: var(--anthropic-card-bg);
    border: 1px solid var(--anthropic-card-border);
    border-left: 3px solid var(--anthropic-card-border);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    box-shadow: var(--anthropic-shadow);
  }
  .anthropic-finding-danger  { border-left-color: var(--anthropic-danger); }
  .anthropic-finding-warn    { border-left-color: var(--anthropic-warn); }
  .anthropic-finding-info    { border-left-color: var(--anthropic-blue); }
  .anthropic-finding-neutral { border-left-color: var(--text-muted); }
  .anthropic-finding-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
  }
  .anthropic-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .anthropic-badge-danger  { background: var(--anthropic-danger-light); color: var(--anthropic-danger); }
  .anthropic-badge-warn    { background: var(--anthropic-warn-light); color: var(--anthropic-warn); }
  .anthropic-badge-info    { background: var(--anthropic-blue-light); color: var(--anthropic-blue); }
  .anthropic-badge-neutral { background: var(--bg-modal-source); color: var(--text-muted); }
  .anthropic-finding-title { font-size: 13.5px; font-weight: 600; color: var(--text-default); }
  .anthropic-finding-body  { font-size: 12.5px; color: var(--text-default); line-height: 1.6; margin: 0; opacity: 0.92; }

  /* ============================================================
     Charts (SVG natifs — pas besoin de Chart.js)
     ============================================================ */
  .anthropic-chart-box {
    background: var(--anthropic-card-bg);
    border: 1px solid var(--anthropic-card-border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
    box-shadow: var(--anthropic-shadow);
  }
  .anthropic-chart-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-default);
    margin-bottom: 10px;
  }
  .anthropic-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
  }
  .anthropic-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: var(--text-default);
  }
  .anthropic-legend-source { color: var(--text-muted); font-size: 10.5px; font-style: italic; }
  .anthropic-legend-dot {
    width: 10px; height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
    display: inline-block;
  }
  .anthropic-svg-chart {
    width: 100%;
    height: auto;
    display: block;
    background: transparent;
  }
  .anthropic-svg-axis {
    font-size: 10px;
    fill: var(--text-muted);
    font-family: inherit;
  }
  .anthropic-svg-axis-small {
    font-size: 10px;
    fill: var(--text-default);
    font-family: inherit;
    font-variant-numeric: tabular-nums;
  }
  .anthropic-svg-grid {
    stroke: var(--anthropic-card-border);
    stroke-width: 1;
    opacity: 0.6;
  }
  .anthropic-svg-line {
    fill: none;
    stroke: var(--anthropic-blue);
    stroke-width: 2.2;
    stroke-linejoin: round;
    stroke-linecap: round;
  }
  .anthropic-svg-area {
    fill: var(--anthropic-blue);
    fill-opacity: 0.10;
  }
  .anthropic-svg-dot {
    fill: var(--anthropic-blue);
    stroke: var(--anthropic-card-bg);
    stroke-width: 1.5;
  }
  .anthropic-svg-bar-good   { fill: var(--anthropic-good); }
  .anthropic-svg-bar-warn   { fill: var(--anthropic-warn); }
  .anthropic-svg-bar-danger { fill: var(--anthropic-danger); }

  /* ============================================================
     Tableau régions
     ============================================================ */
  .anthropic-table-wrap {
    background: var(--anthropic-card-bg);
    border: 1px solid var(--anthropic-card-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 14px;
    box-shadow: var(--anthropic-shadow);
  }
  table.anthropic-rt { width: 100%; border-collapse: collapse; }
  table.anthropic-rt thead th {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 10px 14px;
    background: var(--anthropic-section-bg);
    text-align: left;
    border-bottom: 1px solid var(--anthropic-card-border);
  }
  table.anthropic-rt tbody td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--anthropic-card-border);
    font-size: 12.5px;
    color: var(--text-default);
    vertical-align: middle;
  }
  table.anthropic-rt tbody tr:last-child td { border-bottom: none; }
  table.anthropic-rt tbody tr:hover { background: var(--anthropic-section-bg); }
  .anthropic-rt-name { font-weight: 600; }
  .anthropic-rt-val  { font-weight: 600; font-variant-numeric: tabular-nums; }
  .anthropic-rt-good   { color: var(--anthropic-good); }
  .anthropic-rt-warn   { color: var(--anthropic-warn); }
  .anthropic-rt-danger { color: var(--anthropic-danger); }
  .anthropic-rt-best { color: var(--text-muted); font-variant-numeric: tabular-nums; }
  .anthropic-trend-bad  { color: var(--anthropic-danger); font-size: 11.5px; }
  .anthropic-trend-flat { color: var(--text-muted); font-size: 11.5px; }
  .anthropic-vs-bad  { color: var(--anthropic-danger); font-weight: 600; font-size: 11.5px; font-variant-numeric: tabular-nums; }
  .anthropic-vs-good { color: var(--anthropic-good); font-weight: 600; font-size: 11.5px; font-variant-numeric: tabular-nums; }
  .anthropic-bar-wrap { display: flex; align-items: center; gap: 8px; min-width: 120px; }
  .anthropic-bar-bg { flex: 1; height: 5px; background: var(--anthropic-section-bg); border-radius: 3px; overflow: hidden; }
  .anthropic-bar-fill { height: 100%; border-radius: 3px; }
  .anthropic-bar-good   { background: var(--anthropic-good); }
  .anthropic-bar-warn   { background: var(--anthropic-warn); }
  .anthropic-bar-danger { background: var(--anthropic-danger); }

  /* ============================================================
     Cartes comparatif international
     ============================================================ */
  .anthropic-comp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
  }
  .anthropic-comp-card {
    background: var(--anthropic-card-bg);
    border: 1px solid var(--anthropic-card-border);
    border-top: 2px solid var(--anthropic-card-border);
    border-radius: 10px;
    padding: 11px 13px;
    box-shadow: var(--anthropic-shadow);
  }
  .anthropic-comp-good { border-top-color: var(--anthropic-good); }
  .anthropic-comp-warn { border-top-color: var(--anthropic-warn); }
  .anthropic-comp-danger { border-top-color: var(--anthropic-danger); }
  .anthropic-comp-flag    { font-size: 10.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
  .anthropic-comp-metric  { font-size: 14px; font-weight: 600; color: var(--text-default); margin-bottom: 4px; }
  .anthropic-comp-detail  { font-size: 11.5px; color: var(--text-default); line-height: 1.5; opacity: 0.88; }

  /* ============================================================
     Cartes recommandations
     ============================================================ */
  .anthropic-rec-card {
    background: var(--anthropic-card-bg);
    border: 1px solid var(--anthropic-card-border);
    border-left: 4px solid var(--anthropic-card-border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: var(--anthropic-shadow);
  }
  .anthropic-rec-p1 { border-left-color: var(--anthropic-danger); }
  .anthropic-rec-p2 { border-left-color: var(--anthropic-warn); }
  .anthropic-rec-p3 { border-left-color: var(--anthropic-blue); }
  .anthropic-rec-p4 { border-left-color: var(--anthropic-good); }
  .anthropic-rec-p5 { border-left-color: var(--anthropic-purple); }
  .anthropic-rec-num {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .anthropic-rec-priority {
    display: inline-block;
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.05em;
  }
  .anthropic-rec-p1-badge { background: var(--anthropic-danger-light); color: var(--anthropic-danger); }
  .anthropic-rec-p2-badge { background: var(--anthropic-warn-light);   color: var(--anthropic-warn); }
  .anthropic-rec-p3-badge { background: var(--anthropic-blue-light);   color: var(--anthropic-blue); }
  .anthropic-rec-p4-badge { background: var(--anthropic-good-light);   color: var(--anthropic-good); }
  .anthropic-rec-p5-badge { background: var(--anthropic-purple-light); color: var(--anthropic-purple); }
  .anthropic-rec-title {
    font-size: 15px;
    color: var(--text-default);
    line-height: 1.3;
    margin-bottom: 8px;
    font-weight: 600;
  }
  .anthropic-rec-body {
    font-size: 12.5px;
    color: var(--text-default);
    line-height: 1.65;
    margin-bottom: 8px;
    opacity: 0.92;
  }
  .anthropic-rec-ref {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    padding-top: 8px;
    border-top: 1px solid var(--anthropic-card-border);
  }
  .anthropic-rec-ref strong {
    font-style: normal;
    font-weight: 600;
    color: var(--text-default);
  }

  /* ============================================================
     Responsive : la modale est déjà à 92 % de width et plafonne
     à 800 px. Sur très petite largeur (< 700 px), on bascule la
     sidebar au-dessus du contenu.
     ============================================================ */
  @media (max-width: 700px) {
    .anthropic-layout {
      grid-template-columns: 1fr;
    }
    .anthropic-sidebar {
      position: static;
    }
    .anthropic-nav-menu {
      display: flex;
      overflow-x: auto;
    }
    .anthropic-nav-menu li {
      border-bottom: none;
      border-right: 0.5px solid var(--anthropic-card-border);
      flex-shrink: 0;
    }
    .anthropic-nav-menu li:last-child { border-right: none; }
    .anthropic-header-meta { gap: 12px; }
    .anthropic-header-title { font-size: 1.15rem; }
  }
