/* MR TRAINING · PROJECT T · SALUD V4.2 — leyendas en minipíldoras. */
.lab-main{padding-top:15px;padding-bottom:14px}
.lab-legend{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;padding:10px 13px;margin:0 0 11px;background:#fff;border:1px solid #c8d0da;border-radius:13px;color:#65748a;font-size:11px}
.lab-legend-items{display:flex;flex-wrap:wrap;align-items:center;gap:8px 18px}
.lab-legend-items span{display:inline-flex;align-items:center;gap:7px}
.status-dot{display:inline-block;width:9px;height:9px;border-radius:50%;flex:none}
.status-dot.green{background:#10a45e}.status-dot.orange{background:#f07820}.status-dot.red{background:#e63c50}.status-dot.gray{background:#96a4b5}
.lab-heading-right{display:flex;flex-direction:column;gap:5px;min-width:220px;color:#7c8ba0;font-size:11px}
.lab-heading-right select{width:100%;min-height:39px;padding:8px 11px;border:1px solid #c7d0db;border-radius:10px;background:#fff;color:#23344a;font:inherit;font-size:12px}
.lab-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:11px}
.lab-summary>div{min-width:0;padding:11px 14px;background:#fff;border:1px solid #c7d0db;border-radius:12px;box-shadow:0 2px 7px #12233d06}
.lab-summary small{display:block;font-size:10px;color:#8291a5}
.lab-summary strong{display:block;margin-top:5px;color:#0786ff;font-size:20px;line-height:1.2;overflow-wrap:anywhere}
.lab-columns{display:flex;flex-direction:column;gap:11px}
.lab-match-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;align-items:stretch}
.lab-match-column{min-width:0;display:flex;flex-direction:column;gap:11px}
.lab-match-column>.lab-panel:last-child{flex:1}
.lab-panel{min-width:0;padding:12px;background:#fff;border:1px solid #c7d0db;border-radius:14px;box-shadow:0 2px 8px #12233d06}
.lab-panel h2{margin:0 0 3px;font-size:14px;color:inherit}
.lab-panel .lab-sub{margin:0 0 10px;color:#8a98aa;font-size:10px}
.lab-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;align-content:start}
.lab-tile{min-width:0;min-height:91px;padding:8px 5px 7px;border:1px solid #bcc6d2;border-radius:11px;background:linear-gradient(155deg,#fff,#f6f9fc);box-shadow:0 1px 3px #14253b09,inset 0 1px 0 #fff;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;text-align:center;overflow:hidden}
.lab-tile .lab-name{display:grid;place-items:center;min-height:23px;max-width:100%;font-size:9.5px;line-height:1.2;color:#64748b;overflow-wrap:anywhere}
.lab-tile .lab-value{display:block;max-width:100%;margin-top:4px;color:#1881e9;font-size:clamp(18px,1.25vw,24px);font-weight:800;letter-spacing:-.5px;line-height:1.12;overflow-wrap:anywhere}
.lab-tile .lab-unit{display:block;margin-top:3px;color:#8795a9;font-size:9px;overflow-wrap:anywhere}
.lab-tile .lab-state{display:block;margin-top:auto;padding-top:5px;color:#8795a9;font-size:8px;line-height:1.2}
.lab-tile.review{background:linear-gradient(155deg,#fffaf4,#fff5e9);border-color:#edc69b}
.lab-tile.review .lab-value,.lab-tile.review .lab-state{color:#ed751a}
.lab-tile.unverified .lab-value{color:#1881e9}
body.theme-dark .lab-panel,body.theme-dark .lab-summary>div,body.theme-dark .lab-legend{background:#1c2938;border-color:#526075;color:#e8f0fa}
body.theme-dark .lab-tile{background:linear-gradient(155deg,#2c3a4b,#243449);border-color:#69788c}
body.theme-dark .lab-tile.review{background:#433328;border-color:#9c6b40}
body.theme-dark .lab-tile.normal .lab-value,body.theme-dark .lab-tile.unverified .lab-value{color:#64b5ff}
body.theme-dark .lab-tile .lab-name{color:#c0ccda}
body.theme-dark .lab-tile .lab-unit,body.theme-dark .lab-tile .lab-state{color:#aab8c9}
body.theme-dark .lab-heading-right select{background:#243449;color:#e8f0fa;border-color:#69788c}
body.theme-dark .lab-summary small{color:#a8b9cd}
@media(max-width:1450px) and (min-width:1051px){.lab-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:1050px){.lab-match-row{grid-template-columns:minmax(0,1fr)}.lab-match-column>.lab-panel:last-child{flex:initial}.lab-grid{grid-template-columns:repeat(5,minmax(0,1fr))}}
@media(max-width:700px){.lab-legend{align-items:stretch;flex-direction:column}.lab-heading-right{width:100%;min-width:0}.lab-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.lab-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.lab-panel{padding:10px}.lab-tile{min-height:89px}.lab-tile .lab-value{font-size:clamp(17px,4.5vw,23px)}}
@media(max-width:360px){.lab-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* V4.2 — cuatro leyendas como minipíldoras cromáticas. No afecta al selector. */
.lab-legend-items{gap:7px;align-items:center}
.lab-legend-items span{padding:10px 12px;border:1px solid var(--legend-border);border-radius:10px;background:var(--legend-bg);color:var(--legend-text);font-weight:600;line-height:1.2;white-space:normal}
.lab-legend-items span:nth-child(1){--legend-border:#9edec0;--legend-bg:#effaf4;--legend-text:#15844e}
.lab-legend-items span:nth-child(2){--legend-border:#f3c69f;--legend-bg:#fff6ed;--legend-text:#b85a13}
.lab-legend-items span:nth-child(3){--legend-border:#f2b5bd;--legend-bg:#fff1f3;--legend-text:#bc3044}
.lab-legend-items span:nth-child(4){--legend-border:#cbd4df;--legend-bg:#f4f6f9;--legend-text:#69798d}
body.theme-dark .lab-legend-items span:nth-child(1){--legend-border:#2d7855;--legend-bg:#173c2d;--legend-text:#8fe2b2}
body.theme-dark .lab-legend-items span:nth-child(2){--legend-border:#97643a;--legend-bg:#453020;--legend-text:#ffbf89}
body.theme-dark .lab-legend-items span:nth-child(3){--legend-border:#a44b58;--legend-bg:#482831;--legend-text:#ffadb7}
body.theme-dark .lab-legend-items span:nth-child(4){--legend-border:#69788c;--legend-bg:#2b394a;--legend-text:#c3cfdf}
@media(max-width:700px){.lab-legend-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.lab-legend-items span{padding:9px 10px;font-size:10px}}
@media(max-width:380px){.lab-legend-items{grid-template-columns:1fr}}

/* V4.3 — leyendas distribuidas en el espacio libre y alineadas con el selector. */
@media(min-width:1051px){
  .lab-legend{display:grid;grid-template-columns:minmax(0,1fr) 230px;align-items:end;column-gap:20px}
  .lab-legend-items{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:clamp(8px,1vw,18px);align-items:stretch;min-width:0}
  .lab-legend-items span{min-width:0;min-height:39px;justify-content:center;text-align:center;padding:9px 8px;font-size:clamp(9px,.75vw,11px)}
  .lab-heading-right{min-width:0;width:100%}
}
@media(min-width:701px) and (max-width:1050px){
  .lab-legend-items{flex:1 1 100%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}
  .lab-legend-items span{justify-content:center;text-align:center}
}
