.xtr-banner{background:rgba(124,106,252,.12);border:1px solid var(--border);border-radius:10px;padding:.7rem 1rem;font-size:.85rem;margin-bottom:1rem}
.xtr-banner .xtr-ts{color:var(--muted);font-size:.7rem;margin-left:.5rem}
.xtr-cols{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
.xtr-col{background:var(--sidebar);border:1px solid var(--border);border-radius:12px;padding:1rem}
.xtr-hermes{border-top:3px solid #7c6afc}.xtr-claude{border-top:3px solid #2dd4a7}
.xtr-col h3{font-size:.95rem;margin:0 0 .8rem;color:#fff}
.xtr-tag{font-size:.6rem;background:var(--border);color:var(--muted);padding:1px 7px;border-radius:10px;margin-left:.4rem;text-transform:uppercase}
.xtr-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:.5rem;margin-bottom:.8rem}
.xtr-kpi{text-align:center;background:var(--bg);border-radius:8px;padding:.5rem .2rem}
.xtr-kpi-v{display:block;font-size:1.15rem;font-weight:700;color:#fff}
.xtr-kpi-l{display:block;font-size:.6rem;color:var(--muted);margin-top:2px}
.xtr-table{width:100%;border-collapse:collapse;font-size:.78rem}
.xtr-table th{text-align:left;color:var(--muted);font-weight:600;padding:.35rem .4rem;border-bottom:1px solid var(--border)}
.xtr-table td{padding:.32rem .4rem;border-bottom:1px solid rgba(255,255,255,.04)}
.xtr-rows{max-height:340px;overflow-y:auto}
.q-ok{color:#2dd4a7;font-weight:700}.q-mid{color:#f5a623;font-weight:700}.q-low{color:#ff6b6b;font-weight:700}
.xtr-cmp .win-h{color:#7c6afc;font-weight:700}.xtr-cmp .win-c{color:#2dd4a7;font-weight:700}.xtr-cmp .win-eq{color:var(--muted)}
.xtr-empty{color:var(--muted);font-size:.8rem;padding:.8rem}
@media(max-width:768px){.xtr-cols{grid-template-columns:1fr}.xtr-kpis{grid-template-columns:repeat(2,1fr)}}
.xtr-filter{display:flex;gap:.4rem;align-items:center}
.xtr-fbtn{background:var(--bg);border:1px solid var(--border);color:var(--muted);padding:.3rem .7rem;border-radius:7px;font-size:.72rem;cursor:pointer}
.xtr-fbtn.active{background:var(--accent);color:#000;border-color:var(--accent);font-weight:600}
.xtr-search{background:var(--bg);border:1px solid var(--border);color:var(--text);padding:.3rem .6rem;border-radius:7px;font-size:.72rem;width:160px}
.xtr-all-table td{font-size:.74rem}
.xtr-count{color:var(--muted);font-size:.7rem;padding:.4rem}

/* --- File « À revoir » (machine + secours) --- */
.xtr-esc-group { margin: .6rem 0 1rem; }
.xtr-esc-group h4 { margin: .3rem 0; font-size: .9rem; }
.xtr-esc-human h4 { color: #e06c5e; }
.xtr-esc-open h4 { color: var(--muted, #8aa); }
.xtr-esc-human { border-left: 3px solid #e06c5e; padding-left: .6rem; }
.xtr-esc-open { border-left: 3px solid #6b7a8a; padding-left: .6rem; }
.xtr-reason { font-family: monospace; font-size: .78rem; background: rgba(255,255,255,.06); padding: 1px 5px; border-radius: 4px; }
.xtr-note { font-size: .78rem; color: var(--muted, #8aa); max-width: 38ch; }

/* --- APIs & conso + logs (Recherche Produits) --- */
.xtr-quotas .xtr-table { width:100%; }
.xtr-gauge { display:inline-block; width:90px; height:8px; background:rgba(255,255,255,.12); border-radius:4px; vertical-align:middle; overflow:hidden; }
.xtr-gauge-fill { height:100%; border-radius:4px; }
.xtr-gauge-pct { font-size:.75rem; color:var(--muted,#8aa); margin-left:6px; }
.xtr-logs { background:#0c0f14; color:#cfe; padding:10px 12px; border-radius:8px; font-size:.72rem; line-height:1.4; max-height:280px; overflow:auto; white-space:pre-wrap; word-break:break-word; }

/* ============================================================
   RECHERCHE PRODUITS — refonte esthétique (hub à sous-onglets)
   ============================================================ */
#section-extraction { max-width: none; width: 100%; }
#section-extraction .xtr-rows, #section-extraction .rp-card,
#section-extraction .rp-card-wrap, #section-extraction .rp-tabs { width: 100%; box-sizing: border-box; }

.rp-head { margin-bottom: 18px; display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.rp-title { font-size: 1.55rem; font-weight: 700; margin: 0; letter-spacing: -.02em;
  color: var(--accent); }            /* couleur pleine (pas de clip → jamais invisible) */
.rp-sub { color: var(--muted); font-size: .9rem; margin: 4px 0 0; }
.rp-refresh { background: var(--accent); color: #fff; border: none; cursor: pointer;
  padding: 9px 16px; border-radius: 10px; font-size: .82rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px; transition: filter .15s; white-space: nowrap; }
.rp-refresh:hover { filter: brightness(1.12); }
.rp-refresh.spin { opacity: .6; pointer-events: none; }
.rp-updated { color: var(--muted); font-size: .72rem; margin-left: 10px; }

/* KPIs bandeau */
.rp-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 20px; }
.rp-kpi { background: linear-gradient(160deg, var(--card), rgba(124,106,252,.05));
  border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px; transition: transform .15s, border-color .15s; }
.rp-kpi:hover { transform: translateY(-2px); border-color: rgba(124,106,252,.4); }
.rp-kpi-v { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.rp-kpi-l { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.rp-kpi-ok .rp-kpi-v { color: #5ec27e; }
.rp-kpi-mid .rp-kpi-v { color: #e0b65e; }
.rp-kpi-low .rp-kpi-v { color: #e06c5e; }

/* Sous-onglets (pills) */
.rp-tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 6px; }
.rp-tab { flex: 1; min-width: 130px; padding: 10px 14px; border: none; cursor: pointer;
  background: transparent; color: var(--muted); font-size: .85rem; font-weight: 600;
  border-radius: 10px; transition: all .15s; white-space: nowrap; }
.rp-tab:hover { color: var(--text); background: rgba(124,106,252,.08); }
.rp-tab.active { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(124,106,252,.35); }

/* Panneaux */
.rp-panel { display: none; animation: rp-fade .25s ease; }
.rp-panel.active { display: block; }
@keyframes rp-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Cartes */
.rp-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 20px; margin-bottom: 16px; }
.rp-card h3 { margin: 0 0 14px; font-size: 1rem; font-weight: 650; }
.rp-card-wrap { background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 8px 6px; }
.rp-info { background: linear-gradient(160deg, rgba(124,106,252,.10), rgba(124,106,252,.02));
  border: 1px solid rgba(124,106,252,.25); border-radius: 12px; padding: 12px 16px;
  font-size: .85rem; margin-bottom: 16px; line-height: 1.6; }

/* Toolbar (filtres + recherche) */
.rp-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap; }
.rp-search { background: var(--card); border: 1px solid var(--border); color: var(--text);
  padding: 9px 14px; border-radius: 10px; font-size: .85rem; min-width: 220px; flex: 1; max-width: 320px; }
.rp-search:focus { outline: none; border-color: var(--accent); }

/* Tables modernisées */
.xtr-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.xtr-table th { text-align: left; padding: 10px 12px; color: var(--muted);
  font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card); }
.xtr-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.04); }
.xtr-table tbody tr { transition: background .12s; }
.xtr-table tbody tr:hover { background: rgba(124,106,252,.06); }
.xtr-table tbody tr:last-child td { border-bottom: none; }
.q-ok { color: #5ec27e; font-weight: 650; }
.q-mid { color: #e0b65e; font-weight: 650; }
.q-low { color: #e06c5e; font-weight: 650; }

/* Colonnes Hermès/Claude */
.xtr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.xtr-tag { font-size: .65rem; background: rgba(124,106,252,.18); color: var(--accent);
  padding: 2px 8px; border-radius: 20px; font-weight: 600; margin-left: 6px; vertical-align: middle; }
.xtr-kpis { display: flex; gap: 14px; margin: 8px 0 12px; flex-wrap: wrap; }
.xtr-kpi { display: flex; flex-direction: column; }
.xtr-kpi-v { font-size: 1.15rem; font-weight: 700; }
.xtr-kpi-l { font-size: .68rem; color: var(--muted); }
.xtr-rows { max-height: 360px; overflow: auto; }
.xtr-empty { color: var(--muted); padding: 18px; text-align: center; font-size: .85rem; }
.xtr-reason { font-family: ui-monospace, monospace; font-size: .72rem;
  background: rgba(255,255,255,.06); padding: 2px 7px; border-radius: 6px; }
.xtr-note { font-size: .76rem; color: var(--muted); max-width: 40ch; }
.win-h { color: #7c9cfc; } .win-c { color: #5ec27e; } .win-eq { color: var(--muted); }

@media (max-width: 760px) {
  .rp-kpis { grid-template-columns: repeat(2, 1fr); }
  .xtr-cols { grid-template-columns: 1fr; }
  .rp-tab { min-width: 0; flex: 1 1 40%; }
}

/* ===== Correctifs lisibilité / dynamisme ===== */
/* KPIs Hermès/Claude : chips contrastés (valeurs blanches étaient illisibles) */
.xtr-kpi { background: rgba(124,106,252,.10); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 13px; min-width: 78px; }
.xtr-kpi-v { font-size: 1.25rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.xtr-kpi-l { font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* Indicateur LIVE pulsant (preuve de rafraîchissement) */
.rp-live { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #5ec27e; vertical-align: middle; margin-right: 4px;
  animation: rp-pulse 1.6s infinite; }
@keyframes rp-pulse {
  0% { box-shadow: 0 0 0 0 rgba(94,194,126,.55); }
  70% { box-shadow: 0 0 0 7px rgba(94,194,126,0); }
  100% { box-shadow: 0 0 0 0 rgba(94,194,126,0); }
}
.rp-updated { font-weight: 600; color: #5ec27e !important; }

/* Cartes À revoir : 2 rubriques distinctes */
.xtr-count-badge { background: var(--accent); color: #fff; border-radius: 20px;
  padding: 1px 10px; font-size: .72rem; font-weight: 600; margin-left: 6px; }
.xtr-card-sub { color: var(--muted); font-size: .78rem; margin: -6px 0 14px; }
.xtr-esc-human { border-left: 3px solid #e06c5e; }
.xtr-esc-open  { border-left: 3px solid var(--accent); }
.xtr-esc-human h3 { color: #e8897d; }
.xtr-esc-open h3  { color: #9b8cfd; }

/* Boutons moins gris : onglets inactifs + filtres plus lisibles */
.rp-tab { color: #b8b8cc; }
.rp-tab:hover { color: #fff; }
.xtr-fbtn { background: var(--card); border: 1px solid var(--border); color: #b8b8cc;
  padding: 7px 14px; border-radius: 9px; font-size: .8rem; font-weight: 600; cursor: pointer;
  transition: all .15s; }
.xtr-fbtn:hover { color: #fff; border-color: var(--accent); }
.xtr-fbtn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.xtr-filter { display: flex; gap: 6px; }

/* ===== Sous-rubriques « À revoir » (cliquables) ===== */
.rp-subtabs { display: flex; gap: 8px; margin-bottom: 14px; }
.rp-subtab { padding: 9px 18px; border: 1px solid var(--border); background: var(--card);
  color: #b8b8cc; font-size: .85rem; font-weight: 600; border-radius: 10px; cursor: pointer;
  transition: all .15s; display: inline-flex; align-items: center; gap: 8px; }
.rp-subtab:hover { color: #fff; border-color: var(--accent); }
.rp-subtab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.rp-subtab.active .xtr-count-badge { background: rgba(255,255,255,.25); }
.rp-subpanel { display: none; animation: rp-fade .2s ease; }
.rp-subpanel.active { display: block; }

/* ===== Barres de répartition (Vue d'ensemble) ===== */
.xtr-bar-row { display: flex; align-items: center; gap: 12px; margin: 7px 0; }
.xtr-bar-lbl { width: 160px; font-size: .8rem; color: var(--text); flex-shrink: 0; }
.xtr-bar { flex: 1; height: 16px; background: rgba(255,255,255,.06); border-radius: 8px; overflow: hidden; }
.xtr-bar-fill { height: 100%; border-radius: 8px; transition: width .4s ease; min-width: 2px; }
.xtr-bar-n { width: 36px; text-align: right; font-size: .82rem; font-weight: 700; color: var(--text); }

/* ===== Badge richesse (Tous les crawls) ===== */
.rich-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.rich-high { background: #2dd4a7; box-shadow: 0 0 6px rgba(45,212,167,.5); }
.rich-mid  { background: #a3d65e; }
.rich-low  { background: #e89060; }
.rich-dead { background: #e06c5e; opacity: .55; }

/* tri */
.rp-sortwrap { display: flex; align-items: center; gap: 8px; }
.rp-sortlbl { font-size: .78rem; color: var(--muted); }
#xtr-sortdir { min-width: 36px; }

/* ===== Lignes colorées « Tous les crawls » (toute la case) ===== */
.rrow td { border-left: none; }
.rrow.rich-high { background: rgba(45,212,167,.10); }
.rrow.rich-high:hover { background: rgba(45,212,167,.18); }
.rrow.rich-mid  { background: rgba(163,214,94,.09); }
.rrow.rich-mid:hover  { background: rgba(163,214,94,.16); }
.rrow.rich-low  { background: rgba(232,144,96,.10); }
.rrow.rich-low:hover  { background: rgba(232,144,96,.18); }
.rrow.rich-dead { background: rgba(224,108,94,.10); }
.rrow.rich-dead:hover { background: rgba(224,108,94,.18); }
.rrow td:first-child { border-left: 3px solid transparent; }
.rrow.rich-high td:first-child { border-left-color: #2dd4a7; }
.rrow.rich-mid  td:first-child { border-left-color: #a3d65e; }
.rrow.rich-low  td:first-child { border-left-color: #e89060; }
.rrow.rich-dead td:first-child { border-left-color: #e06c5e; }

/* ===== En-tête panneau APIs (live + refresh) ===== */
.xtr-quota-head { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; font-size: .8rem; color: #5ec27e; font-weight: 600; }

/* Badges 3-voies « mort » : verrouillée (login) / pas de doc / vraiment morte */
.dc-badge{display:inline-block;padding:2px 8px;border-radius:11px;font-size:11.5px;
  font-weight:650;white-space:nowrap;border:1px solid transparent;line-height:1.5}
.dc-login{color:#e0b65e;background:rgba(224,182,94,.12);border-color:rgba(224,182,94,.35)}
.dc-nodoc{color:#9b8cfd;background:rgba(155,140,253,.12);border-color:rgba(155,140,253,.35)}
.dc-mort{color:#e06c5e;background:rgba(224,108,94,.12);border-color:rgba(224,108,94,.35)}
.dc-api{color:#5ec8e0;background:rgba(94,200,224,.12);border-color:rgba(94,200,224,.35)}
.dc-unk{color:var(--muted);background:rgba(140,140,140,.10);border-color:rgba(140,140,140,.3)}

/* Panneau Découverte (étage 2 Claude Code) */
.dsc-box{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:14px 16px;margin:10px 0 14px}
.dsc-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.dsc-title{font-weight:650}.dsc-title small{color:var(--muted);font-weight:400}
.dsc-btn{background:var(--accent);color:#fff;border:0;border-radius:9px;padding:8px 14px;font-weight:650;cursor:pointer}
.dsc-btn:disabled{opacity:.5;cursor:default}
.dsc-status{margin-top:8px;color:var(--text);font-size:13px}
.dsc-recent{margin-top:10px;display:flex;flex-wrap:wrap;gap:6px}
.dsc-chip{font-size:11px;padding:2px 8px;border-radius:10px;border:1px solid var(--border);background:rgba(140,140,140,.08)}
.dsc-chip b{font-weight:700}
.dsc-win{color:#2dd4a7;border-color:rgba(45,212,167,.4);background:rgba(45,212,167,.1)}
.dsc-mid{color:#e0b65e;border-color:rgba(224,182,94,.4);background:rgba(224,182,94,.1)}
.dsc-no{color:var(--muted)}

/* « Pourquoi cette note » — phrase lisible posée par cl_explain.py */
.xtr-why { display:inline-block; max-width:280px; overflow:hidden; text-overflow:ellipsis;
  white-space:nowrap; vertical-align:bottom; cursor:help; color:var(--muted,#9aa); font-size:.92em; }
.xtr-why-none { color:var(--border,#444); }
