/* trade-republic-history.css — Historique Trade Republic
   Classes préfixées trh-. Thème sombre Warren (#102f39).
   Ne pas modifier le scoring A01 ni les classes existantes.
*/

/* ── conteneur global ─────────────────────────────────────────────────── */
.trh-global {
  padding: 0 0 2rem;
  max-width: 900px;
}

/* ── en-tête scope ────────────────────────────────────────────────────── */
.trh-scope-header {
  border-left: 3px solid #2ca4ab;
  padding: .5rem 1rem;
  margin-bottom: 1rem;
  background: rgba(44,164,171,.07);
  border-radius: 0 6px 6px 0;
}
.trh-scope-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #d4eef0;
  margin: 0 0 .2rem;
}
.trh-scope-meta,
.trh-scope-synthetic {
  font-size: .78rem;
  color: #7ab8bf;
  margin: 0;
}
.trh-scope-synthetic {
  margin-top: .2rem;
  font-style: italic;
}

/* ── avertissements ───────────────────────────────────────────────────── */
.trh-limits {
  background: rgba(255,200,0,.07);
  border: 1px solid rgba(255,200,0,.25);
  border-radius: 6px;
  padding: .6rem 1rem;
  margin-bottom: 1.2rem;
}
.trh-limits-title {
  font-size: .75rem;
  font-weight: 700;
  color: #e6b800;
  margin: 0 0 .4rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.trh-limits-list {
  margin: 0;
  padding-left: 1.2rem;
  color: #c8b870;
  font-size: .78rem;
}
.trh-limits-list li { margin: .1rem 0; }

/* ── filtres ──────────────────────────────────────────────────────────── */
.trh-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1rem;
  align-items: flex-end;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 8px;
  padding: .8rem 1rem;
  margin-bottom: 1rem;
}
.trh-filter-label {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  font-size: .75rem;
  color: #7ab8bf;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.trh-filter-input,
.trh-filter-select {
  background: #0e2830;
  color: #d4eef0;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 5px;
  padding: .35rem .55rem;
  font-size: .85rem;
  min-width: 140px;
}
.trh-filter-input:focus,
.trh-filter-select:focus,
.trh-instrument-input:focus {
  outline: 2px solid #2ca4ab;
  outline-offset: 1px;
}

/* ── découverte instrument ────────────────────────────────────────────── */
.trh-instrument-section {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  flex: 1 1 260px;
  min-width: 220px;
}
.trh-instrument-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.trh-instrument-input {
  background: #0e2830;
  color: #d4eef0;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 5px;
  padding: .35rem .55rem;
  font-size: .85rem;
  width: 100%;
}
.trh-instrument-selected {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: rgba(44,164,171,.15);
  border: 1px solid #2ca4ab;
  border-radius: 5px;
  padding: .25rem .55rem;
  font-size: .8rem;
  color: #a4dfe3;
}
.trh-tag-text { flex: 1; font-family: monospace; font-size: .78rem; }
.trh-tag-clear {
  background: none;
  border: none;
  color: #e06060;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 .2rem;
  line-height: 1;
}
.trh-tag-clear:hover { color: #ff8080; }

/* catalogue résultats */
.trh-catalog-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  max-height: 220px;
  overflow-y: auto;
  background: #0e2830;
  border: 1px solid rgba(44,164,171,.3);
  border-radius: 5px;
}
.trh-catalog-list:empty { display: none; }
.trh-catalog-item {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,.05);
  padding: .45rem .7rem;
  text-align: left;
  cursor: pointer;
  color: #d4eef0;
}
.trh-catalog-item:hover { background: rgba(44,164,171,.12); }
.trh-catalog-name { font-size: .88rem; font-weight: 600; }
.trh-catalog-meta { font-size: .72rem; color: #7ab8bf; font-family: monospace; }
.trh-catalog-empty { font-size: .8rem; color: #7ab8bf; padding: .5rem .7rem; margin: 0; }

/* ── bouton reset filtres ─────────────────────────────────────────────── */
.trh-reset-btn {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 5px;
  color: #7ab8bf;
  cursor: pointer;
  font-size: .8rem;
  padding: .4rem .8rem;
  align-self: flex-end;
  transition: background .15s;
}
.trh-reset-btn:hover { background: rgba(255,255,255,.1); color: #d4eef0; }

/* ── compteur ─────────────────────────────────────────────────────────── */
.trh-count {
  font-size: .8rem;
  color: #7ab8bf;
  margin: 0 0 .5rem;
}

/* ── pagination ───────────────────────────────────────────────────────── */
.trh-pagination,
.trh-pagination-top,
.trh-pagination-bot {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: .5rem 0;
}
.trh-page-btn {
  background: rgba(44,164,171,.12);
  border: 1px solid rgba(44,164,171,.3);
  border-radius: 5px;
  color: #2ca4ab;
  cursor: pointer;
  font-size: .82rem;
  padding: .3rem .7rem;
  transition: background .15s;
}
.trh-page-btn:hover:not(:disabled) { background: rgba(44,164,171,.25); }
.trh-page-btn:disabled { opacity: .35; cursor: default; }
.trh-page-info { font-size: .78rem; color: #7ab8bf; }

/* ── liste événements ─────────────────────────────────────────────────── */
.trh-events {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin: .5rem 0;
}

/* ── événement ────────────────────────────────────────────────────────── */
.trh-event {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 7px;
  padding: .7rem 1rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .25rem .8rem;
}
.trh-event--compact {
  padding: .4rem .7rem;
  border-radius: 5px;
  gap: .15rem .6rem;
}
.trh-event-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.trh-event-instrument,
.trh-event-qp,
.trh-event-fees,
.trh-annotations,
.trh-event-tech,
.trh-asset-link {
  grid-column: 1 / -1;
}

/* badges opération */
.trh-op {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: .15rem .45rem;
  border-radius: 4px;
  flex-shrink: 0;
}
.trh-op--buy  { background: rgba(40,180,80,.18); color: #4de88a; border: 1px solid rgba(40,180,80,.3); }
.trh-op--sell { background: rgba(220,80,80,.15);  color: #f08080; border: 1px solid rgba(220,80,80,.28); }

/* date */
.trh-date { font-size: .8rem; color: #a4dfe3; font-family: monospace; }
.trh-date-warn {
  font-size: .7rem;
  color: #e6b800;
  background: rgba(230,184,0,.1);
  border: 1px solid rgba(230,184,0,.3);
  border-radius: 3px;
  padding: .1rem .35rem;
}

/* instrument */
.trh-instrument-name { font-size: .9rem; font-weight: 600; color: #d4eef0; }
.trh-instrument-id {
  font-size: .72rem;
  color: #5a8a90;
  font-family: monospace;
  margin-left: .4rem;
}
.trh-event-instrument { display: flex; align-items: baseline; flex-wrap: wrap; gap: .2rem; }

/* quantités, prix */
.trh-event-qp { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .85rem; color: #b4d4d8; }
.trh-qty, .trh-price { font-family: monospace; }
.trh-sep { color: #5a8a90; }
.trh-amount { color: #7ab8bf; font-family: monospace; }

/* frais */
.trh-event-fees { display: flex; align-items: center; gap: .4rem; font-size: .78rem; }
.trh-label { color: #5a8a90; }
.trh-fees-val { font-family: monospace; color: #a4b8bc; }

/* annotations */
.trh-annotations { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .15rem; }
.trh-annotation {
  font-size: .7rem;
  background: rgba(200,180,50,.1);
  border: 1px solid rgba(200,180,50,.3);
  color: #c8b434;
  border-radius: 4px;
  padding: .1rem .35rem;
}

/* lien fiche */
.trh-asset-link {
  display: inline-block;
  margin-top: .3rem;
  font-size: .78rem;
  color: #2ca4ab;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.trh-asset-link:hover { color: #4de8f0; }

/* détails techniques repliés */
.trh-event-tech {
  margin-top: .3rem;
  font-size: .75rem;
}
.trh-event-tech > summary {
  cursor: pointer;
  color: #5a8a90;
  font-size: .73rem;
  user-select: none;
}
.trh-event-tech > summary:hover { color: #7ab8bf; }
.trh-tech-body {
  background: #0a1e26;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 4px;
  padding: .5rem;
  font-size: .7rem;
  color: #5a8a90;
  overflow-x: auto;
  white-space: pre;
  margin-top: .3rem;
}

/* ── états chargement/erreur/vide ─────────────────────────────────────── */
.trh-loading, .trh-error, .trh-empty {
  text-align: center;
  padding: 1.5rem;
  font-size: .85rem;
  color: #7ab8bf;
}
.trh-error { color: #f08080; }
.trh-empty { color: #5a8a90; }

/* ── panneau fiche asset ──────────────────────────────────────────────── */
.trh-asset-panel {
  border-top: 1px solid rgba(44,164,171,.2);
  padding-top: .8rem;
  margin-top: .5rem;
}
.trh-asset-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #2ca4ab;
  margin: 0 0 .5rem;
}
.trh-asset-info { font-size: .78rem; color: #7ab8bf; margin: 0 0 .5rem; }
.trh-asset-more { font-size: .75rem; color: #5a8a90; font-style: italic; margin-top: .4rem; }
.trh-asset-error { font-size: .8rem; color: #f08080; }

/* ── notice aperçu synthétique ────────────────────────────────────────── */
.trh-synthetic-notice {
  background: repeating-linear-gradient(45deg, rgba(255,200,0,.04), rgba(255,200,0,.04) 10px, transparent 10px, transparent 20px);
  border: 2px dashed rgba(255,200,0,.4);
  border-radius: 8px;
  padding: .8rem 1.2rem;
  margin-bottom: 1.2rem;
  font-size: .8rem;
  color: #e6b800;
}
.trh-synthetic-notice strong { font-size: .85rem; display: block; margin-bottom: .3rem; }

/* ── responsive ───────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .trh-filters { flex-direction: column; gap: .5rem; }
  .trh-event { padding: .5rem .7rem; }
  .trh-pagination { flex-wrap: wrap; gap: .4rem; }
}

/* Match the existing light My-Warren components; never style global elements. */
.trh-global,.trh-asset-panel { color:#18343c; min-width:0; max-width:100%; overflow-wrap:anywhere; }
.trh-scope-header { display:block; height:auto; background:#e8f3f0; border-color:#126a60; }
.trh-scope-title,.trh-instrument-name,.trh-qty,.trh-price,.trh-amount { color:#18343c; }
.trh-scope-meta,.trh-scope-synthetic,.trh-label,.trh-filter-label,.trh-count,.trh-page-info,.trh-date,.trh-instrument-id,.trh-catalog-meta,.trh-asset-info,.trh-asset-limits,.trh-source-class { color:#46616a; }
.trh-filters,.trh-event,.trh-catalog-list { background:#fff; border-color:#dce4e8; }
.trh-instrument-input,.trh-filter-input,.trh-filter-select { color:#18343c; background:#fff; border-color:#ccd8de; }
.trh-catalog-item { color:#18343c; background:#f4f7f8; border-color:#dce4e8; max-width:100%; }
.trh-catalog-name,.trh-fees-val { color:#18343c; }
.trh-catalog-item:hover { background:#e8f3f0; }
.trh-limits { background:#fff5dc; border-color:#e5cf96; }
.trh-limits-title,.trh-limits-list,.trh-date-warn { color:#785921; }
.trh-annotation { background:#fff5dc; color:#785921; max-width:100%; }
.trh-event-tech>summary,.trh-asset-title,.trh-asset-link { color:#126a60; }
.trh-tech-body { white-space:pre-wrap; overflow-wrap:anywhere; background:#f4f7f8; color:#18343c; border-color:#dce4e8; max-width:100%; }
.trh-page-btn,.trh-reset-btn { background:#126a60; color:#fff; border-color:#126a60; }
.trh-error,.trh-asset-error { color:#9c2c2c; }
.trh-event-qp { align-items:baseline; gap:.5rem; color:#18343c; }
.trh-source-class,.trh-asset-limits { font-size:.8rem; line-height:1.5; }
.trh-catalog-pagination { position:relative; }
.trh-catalog-results { max-height:20rem; overflow-y:auto; }
@media(max-width:600px) { .trh-filter-label,.trh-instrument-section { width:100%; min-width:0; } .trh-instrument-section { flex:0 0 auto; min-height:0; } .trh-catalog-list { position:relative; } }
