/* ----------------------------------------------------------------------------
   ACE NUTRITIONS. — Hoja de Componente 23
   Extraida de `tokens.css` en la Iteracion 07.7 (Regla #011).
   El ORDEN de carga en `app-shell.html` reproduce el del archivo original:
   la cascada CSS depende de el y no debe alterarse.
   -------------------------------------------------------------------------- */
/* ============================================================================
   HOJA DE RESULTADOS MEDICOS ANTROPOMETRICOS & COMPOSICION 3D (INBODY / ISAK)
   ============================================================================ */
.cz-med-report-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 16px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.76);
  backdrop-filter: blur(8px);
}

.cz-med-report-dialog {
  width: 100%;
  max-width: 1080px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.36);
  overflow: hidden;
}

.cz-med-report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: var(--bg-studio);
  border-bottom: 1px solid var(--border-soft);
}

.cz-med-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cz-med-toolbar-file {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}

.cz-med-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cz-med-sheet {
  padding: 22px 24px 26px;
  background: rgb(255, 255, 255);
  color: rgb(15, 23, 42);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cz-med-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: rgb(15, 32, 48);
  color: rgb(248, 250, 252);
  border-radius: 12px;
  border-left: 6px solid var(--jade);
}

.cz-med-sheet-brand {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgb(94, 234, 212);
}

.cz-med-sheet-title {
  margin: 4px 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: rgb(255, 255, 255);
}

.cz-med-sheet-sub {
  margin: 0;
  font-size: 12px;
  color: rgb(203, 213, 225);
}

.cz-med-sheet-score-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 10px 16px;
  background: rgba(13, 148, 136, 0.22);
  border: 1px solid rgba(94, 234, 212, 0.35);
  border-radius: 10px;
  min-width: 155px;
}

.cz-med-score-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgb(153, 246, 228);
}

.cz-med-score-val {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  color: rgb(255, 255, 255);
}

.cz-med-score-val span {
  font-size: 13px;
  font-weight: 600;
  color: rgb(203, 213, 225);
}

.cz-med-score-sub {
  font-size: 10.5px;
  color: rgb(203, 213, 225);
}

.cz-med-patient-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 16px;
  background: rgb(241, 245, 249);
  border: 1px solid rgb(203, 213, 225);
  border-radius: 10px;
}

.cz-med-patient-strip > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cz-med-patient-strip span {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgb(100, 116, 139);
}

.cz-med-patient-strip strong {
  font-size: 12.5px;
  font-weight: 700;
  color: rgb(15, 23, 42);
}

.cz-med-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.cz-med-panel {
  padding: 14px 16px;
  background: rgb(255, 255, 255);
  border: 1px solid rgb(203, 213, 225);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cz-med-panel-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.cz-med-panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgb(15, 32, 48);
}

.cz-med-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.cz-med-table th {
  text-align: left;
  padding: 7px 10px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgb(241, 245, 249);
  color: rgb(71, 85, 105);
  border-bottom: 1px solid rgb(203, 213, 225);
}

.cz-med-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgb(226, 232, 240);
  color: rgb(30, 41, 59);
}

.cz-med-table-compact td {
  padding: 5px 10px;
}

.cz-med-row-total td {
  background: rgba(13, 148, 136, 0.09);
  color: rgb(15, 23, 42);
  border-top: 1.5px solid var(--jade);
}

.cz-med-bars-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cz-med-bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cz-med-bar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
}

.cz-med-bar-track {
  width: 100%;
  height: 12px;
  background: rgb(226, 232, 240);
  border-radius: 999px;
  overflow: hidden;
}

.cz-med-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.cz-med-bar-tone-weight {
  background: rgb(37, 99, 235);
}

.cz-med-bar-tone-smm {
  background: rgb(13, 148, 136);
}

.cz-med-bar-tone-fat {
  background: rgb(234, 88, 12);
}

.cz-med-bar-w-60 { width: 38%; }
.cz-med-bar-w-70 { width: 45%; }
.cz-med-bar-w-80 { width: 52%; }
.cz-med-bar-w-90 { width: 60%; }
.cz-med-bar-w-100 { width: 66%; }
.cz-med-bar-w-110 { width: 73%; }
.cz-med-bar-w-120 { width: 80%; }
.cz-med-bar-w-130 { width: 86%; }
.cz-med-bar-w-140 { width: 92%; }
.cz-med-bar-w-150 { width: 96%; }
.cz-med-bar-w-160 { width: 100%; }

.cz-med-indices-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.cz-med-index-card {
  padding: 8px 10px;
  background: rgb(248, 250, 252);
  border: 1px solid rgb(203, 213, 225);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cz-med-index-card span {
  font-size: 9.5px;
  font-weight: 700;
  color: rgb(100, 116, 139);
}

.cz-med-index-card strong {
  font-size: 16px;
  font-weight: 800;
  color: rgb(13, 148, 136);
}

.cz-med-index-card small {
  font-size: 10px;
  color: rgb(71, 85, 105);
}

.cz-med-3d-and-rx {
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.cz-med-3d-frame {
  background: rgb(15, 23, 42);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.cz-med-3d-snapshot-img {
  width: 100%;
  height: 170px;
  object-fit: contain;
  border-radius: 6px;
}

.cz-med-3d-fallback {
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  color: rgb(148, 163, 184);
  padding: 8px;
}

.cz-med-3d-caption {
  font-size: 10px;
  color: rgb(203, 213, 225);
  text-align: center;
  margin-top: 4px;
}

.cz-med-rx-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: rgb(248, 250, 252);
  border: 1px solid rgb(203, 213, 225);
  border-radius: 10px;
}

.cz-med-rx-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  padding-bottom: 4px;
  border-bottom: 1px dashed rgb(203, 213, 225);
}

.cz-med-rx-macros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.cz-med-rx-macros > div {
  padding: 6px 8px;
  background: rgba(13, 148, 136, 0.1);
  border-radius: 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.cz-med-rx-macros span {
  font-size: 9px;
  font-weight: 700;
  color: rgb(15, 118, 110);
}

.cz-med-rx-macros strong {
  font-size: 14px;
  font-weight: 800;
  color: rgb(15, 23, 42);
}

.cz-med-notes-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  align-items: end;
  padding-top: 8px;
  border-top: 1px solid rgb(226, 232, 240);
}

.cz-med-notes-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgb(71, 85, 105);
}

.cz-med-notes-copy {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: rgb(30, 41, 59);
  line-height: 1.45;
}

.cz-med-signature-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}

.cz-med-signature-line {
  width: 100%;
  border-top: 1.5px solid rgb(51, 65, 85);
  margin-bottom: 4px;
}

.cz-med-signature-box strong {
  font-size: 11.5px;
  color: rgb(15, 23, 42);
}

.cz-med-signature-box small {
  font-size: 9.5px;
  color: rgb(100, 116, 139);
}

@media (max-width: 900px) {
  .cz-med-patient-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .cz-med-sheet-grid,
  .cz-med-3d-and-rx,
  .cz-med-notes-footer {
    grid-template-columns: 1fr;
  }
  .cz-med-indices-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
