/* REMSIM — habillage du portail Boston Scientific LATITUDE NXT.
   Couleurs et polices relevées en direct sur le portail réel (voir
   docs/BOSTON-SCIENTIFIC.md) : Arial/sans-serif, corps 14px #333,
   bandeau bleu marine avec échancrure blanche, onglets en cases bordées. */

.bo-bg { background: #fff; }

.bo-shell { font: 14px/1.4 Arial, sans-serif; color: #333; max-width: 1060px; margin: 0 auto; padding-bottom: 40px; }

/* ---------------- bandeau ---------------- */
.bo-header {
  position: relative;
  background: #fff;
  color: #123f6f;
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #dde2e8;
}
.bo-logo { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 10px; }
.bo-logo-img { height: 20px; width: auto; display: block; }
.bo-logo-product { font-size: 12.5px; font-weight: 700; color: #123f6f; letter-spacing: .02em; }

/* ---------------- fiche patient ---------------- */
.bo-body { padding: 16px 20px; }
.bo-patient { display: flex; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.bo-patient-box { border: 1px solid #999; padding: 10px 14px; font-size: 12.5px; flex: 1 1 420px; min-width: 0; }
.bo-patient-box b { font-weight: 700; }
.bo-id-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.bo-devtag { text-align: center; font-size: 10px; color: #333; flex: 0 0 auto; }
.bo-devtag-ico { width: 22px; height: 16px; margin: 0 auto 2px; border: 1px solid #666; border-radius: 2px; background: repeating-linear-gradient(135deg,#eef3f8 0 3px,#fff 3px 6px); }
/* auto-flow: column pour remplir la 1re colonne en entier avant la 2e,
   comme sur le portail réel (Patient/Device/DOB/Age puis Group/Tags/Statut). */
.bo-patient-grid { display: grid; grid-auto-flow: column; grid-template-columns: minmax(0,1fr) minmax(0,1fr); grid-template-rows: repeat(3, auto); gap: 2px 18px; margin-top: 6px; }
.bo-patient-actions { display: flex; flex-direction: column; gap: 4px; flex: 1 1 220px; min-width: 0; }
.bo-btn { border: 1px solid #999; background: #f2f2f2; padding: 4px 8px; font-size: 12px; text-align: left; cursor: pointer; color: #333; }
.bo-btn:hover { background: #e6e6e6; }
.bo-notes { border: 1px solid #999; background: #fff; font-size: 10.5px; color: #333; padding: 4px 6px; margin-top: 2px; height: 52px; overflow-y: auto; font-style: italic; color: #777; }

/* ---------------- onglets patient ---------------- */
.bo-tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid #999; margin-bottom: 14px; row-gap: 2px; }
.bo-tab { border: 1px solid #999; border-bottom: none; padding: 6px 16px; font-size: 12.5px; font-weight: 700; color: #333; text-decoration: none; margin-right: 2px; background: #f7f7f7; }
.bo-tab.on { background: #fff; border-bottom: 1px solid #fff; margin-bottom: -1px; }
.bo-tab:hover { background: #eee; }

/* ---------------- sections génériques ---------------- */
.bo-h { font-size: 13px; font-weight: 700; margin: 18px 0 6px; }
.bo-h a { font-weight: 400; font-size: 11.5px; margin-left: 8px; }
.bo-note { background: #fff8dd; border: 1px solid #e0c860; padding: 6px 10px; font-size: 12px; margin: 6px 0; }
.bo-egm-note-i { font-size: 11.5px; font-style: italic; color: #666; margin: 2px 0 6px; }

.bo-batt-wrap { text-align: center; margin: 4px 0 8px; font-size: 11.5px; color: #444; }
.bo-batt-svg { width: 220px; max-width: 100%; height: auto; display: block; margin: 0 auto; }

table.bo-tbl { border-collapse: collapse; width: 100%; font-size: 12.5px; margin-bottom: 10px; }
table.bo-tbl th { text-align: left; font-weight: 700; border-bottom: 1px solid #999; padding: 3px 8px 3px 0; }
table.bo-tbl td { padding: 2px 8px 2px 0; vertical-align: top; }
table.bo-tbl tr.bo-band td { font-weight: 700; background: #d8d8d8; padding: 3px 8px; }
/* Tables de compteurs (Diagnostics, AT/AF, Health, Events counts) : le
   portail réel centre les colonnes de valeurs sous leur en-tête, seule la
   1re colonne (libellé) reste à gauche. */
table.bo-tbl.bo-tbl-center th:not(:first-child),
table.bo-tbl.bo-tbl-center td:not(:first-child) { text-align: center; }
table.bo-tbl .bo-lead-atrial { color: #396ba5; font-weight: 700; }
table.bo-tbl .bo-lead-rv { color: #8c0063; font-weight: 700; }
table.bo-tbl .bo-lead-lv { color: #d2691e; font-weight: 700; }
.bo-egm-icon { display: inline-block; vertical-align: middle; line-height: 0; }
.bo-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.bo-sq { display: inline-block; width: 8px; height: 8px; margin-right: 5px; }
.bo-dia { display: inline-block; width: 8px; height: 8px; margin-right: 5px; transform: rotate(45deg); }

.bo-cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; }

/* ---------------- sélecteur de période ---------------- */
.bo-timescale { margin: 4px 0 14px; }
.bo-ts-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #333; }
.bo-ts-opts { display: flex; gap: 6px; }
.bo-ts-opts span { padding: 1px 6px; border: 1px solid #ccc; }
.bo-ts-opts span.on { background: #0057b8; color: #fff; border-color: #0057b8; font-weight: 700; }
.bo-ts-dates { display: flex; justify-content: space-between; font-size: 10.5px; color: #666; margin-top: 6px; border-top: 1px solid #ccc; padding-top: 3px; }

/* ---------------- courbes tendance ---------------- */
.bo-trend-row { display: flex; gap: 10px; align-items: flex-start; border-bottom: 1px dotted #ddd; padding: 8px 0; }
.bo-trend-lab { flex: 0 0 150px; font-size: 12px; }
.bo-trend-lab .bo-dot, .bo-trend-lab .bo-sq, .bo-trend-lab .bo-dia { margin-right: 4px; }
.bo-trend-box { flex: 0 0 90px; border: 1px solid #ccc; font-size: 11px; text-align: center; padding: 4px 2px; }
.bo-trend-box .d { color: #666; font-size: 10px; }
.bo-trend-box .v { font-weight: 700; font-size: 13px; }
.bo-trend-svg-holder { flex: 1 1 auto; position: relative; }

.bo-hist-legend { font-size: 11px; color: #555; margin-bottom: 4px; }
.bo-hist-periods { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; font-size: 11px; color: #555; margin-bottom: 4px; }
.bo-hist-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 10px; }
.bo-hist-svg { width: 100%; height: auto; display: block; }
.bo-trend-svg { width: 100%; height: 90px; display: block; }
.bo-trend-tip {
  display: none; position: absolute; transform: translate(-50%, -115%);
  background: #fff; border: 1px solid #888; box-shadow: 0 1px 5px rgba(0,0,0,.25);
  font-size: 11px; line-height: 1.4; padding: 4px 8px; white-space: nowrap;
  pointer-events: none; z-index: 5;
}

/* ---------------- journal d'arythmies ---------------- */
.bo-filters { font-size: 12.5px; margin: 6px 0 10px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.bo-filters a { color: #0057b8; text-decoration: none; margin: 0 3px; }
.bo-events-report { margin-left: auto; }
table.bo-events td:first-child, table.bo-events td:nth-child(2) { text-align: center; }
table.bo-events { border-collapse: collapse; width: 100%; font-size: 12px; }
table.bo-events th { text-align: left; border-bottom: 1px solid #999; padding: 4px 8px 4px 0; }
table.bo-events td { padding: 3px 8px 3px 0; border-bottom: 1px solid #eee; }
table.bo-events a.bo-ev-link { color: #0057b8; text-decoration: none; font-weight: 700; }
table.bo-events a.bo-ev-link:hover { text-decoration: underline; }

/* ---------------- EGM ---------------- */
.bo-egm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: flex-start; justify-content: center; z-index: 80; padding: 30px 12px; overflow: auto; }
.bo-egm-modal { background: #fff; border: 1px solid #888; max-width: 980px; width: 100%; box-shadow: 0 4px 18px rgba(0,0,0,.3); }
.bo-egm-head { display: flex; align-items: center; justify-content: space-between; background: #eee; border-bottom: 1px solid #999; padding: 6px 12px; font-weight: 700; font-size: 13px; }
.bo-egm-head button { border: none; background: none; font-size: 16px; cursor: pointer; color: #666; }
.bo-egm-nav { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; font-size: 12px; }
.bo-egm-nav a { color: #0057b8; text-decoration: none; }
.bo-egm-title { padding: 0 12px; font-size: 12.5px; font-weight: 700; }
.bo-egm-sub { padding: 2px 12px 6px; font-size: 11.5px; color: #444; }
/* Le tracé réel fait souvent >2500px de large avec des annotations à
   8-9px : le réduire pour « tenir » à l'écran (mobile ou desktop) rend le
   texte illisible et rate l'objectif pédagogique. On l'affiche donc
   toujours à taille native, dans un cadre qui défile horizontalement —
   comme le fait le portail d'origine — plutôt que de le compresser. */
.bo-egm-stage { padding: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid #ccc; margin: 0 12px 10px; background: #fff; }
.bo-egm-img { display: block; }
.bo-egm-full { display: block; margin: 0 12px 12px; font-size: 11.5px; color: #0057b8; text-decoration: none; }
.bo-egm-full:hover { text-decoration: underline; }
.bo-egm-mini { margin: 0 12px 12px; border: 1px solid #ccc; overflow: hidden; }
.bo-egm-detail { padding: 0 12px 8px; }
table.bo-egm-onset { font-size: 12px; margin: 0 12px 14px; border-collapse: collapse; }
table.bo-egm-onset td { padding: 2px 14px 2px 0; }
table.bo-egm-onset td:first-child { color: #444; }

/* ---------------- retour d'accueil / lien pédagogique ---------------- */
.bo-caselink { padding: 8px 20px; font-size: 12px; background: #f2f2f2; border-top: 1px solid #ccc; display: flex; justify-content: space-between; }

/* ---------------- mobile ---------------- */
@media (max-width: 640px) {
  /* L'échancrure décorative est calibrée pour la largeur du bandeau
     desktop : sur un écran étroit elle mord sur le texte du titre
     (« Switch to LATITUDE Clarity » coupé). Plus simple à retirer qu'à
     recalibrer proportionnellement. */
  .bo-header::after { display: none; }
  .bo-header { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px; }
  .bo-body, .bo-caselink { padding-left: 14px; padding-right: 14px; }

  .bo-patient { flex-direction: column; }
  .bo-patient-grid { grid-template-columns: 1fr; }

  .bo-tab { padding: 6px 10px; font-size: 11.5px; }

  .bo-cols2 { grid-template-columns: 1fr; gap: 0; }

  /* La ligne label+valeur+courbe ne tient plus sur une largeur de
     téléphone : la courbe passe sous le reste plutôt que d'être écrasée
     à quelques pixels de large. */
  .bo-trend-row { flex-wrap: wrap; }
  .bo-trend-svg-holder { flex-basis: 100%; }

  .bo-hist-periods, .bo-hist-row { grid-template-columns: 1fr; gap: 4px; }
}
