/* ===== Variables ===== */
:root {
  --c-navy:       #1e3a5f;
  --c-navy-light: #254b7a;
  --c-blue:       #3b82f6;
  --c-green:      #16a34a;
  --c-red:        #dc2626;
  --c-gray:       #94a3b8;
  --c-bg:         #f1f5f9;
  --c-border:     #e2e8f0;
  --c-text:       #1e293b;
  --c-muted:      #64748b;
  --sidebar-w:    220px;
  --radius:       8px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--c-text);
  background: var(--c-bg);
  min-height: 100vh;
}

/* ===== Login ===== */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,.12);
  padding: 2.5rem;
  width: 360px;
}
.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo h1 {
  font-size: 1.3rem;
  color: var(--c-navy);
  margin-top: .75rem;
}
.login-logo p {
  color: var(--c-muted);
  font-size: .85rem;
}
.login-error {
  color: var(--c-red);
  font-size: .85rem;
  margin-top: .75rem;
  min-height: 1.2em;
}

/* ===== App layout ===== */
#app {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
#sidebar {
  width: var(--sidebar-w);
  background: var(--c-navy);
  color: white;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 10;
}
.sidebar-brand {
  padding: 1.1rem 1rem .95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  text-align: center;
}
.sidebar-brand .brand-text h2 {
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.2;
}
.sidebar-brand .brand-text p {
  font-size: .72rem;
  opacity: .6;
}
.sidebar-nav {
  flex: 1;
  padding: .5rem 0;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .65rem 1rem;
  cursor: pointer;
  color: rgba(255,255,255,.72);
  transition: background .15s, color .15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: .88rem;
  font-family: inherit;
}
.nav-item:hover  { background: rgba(255,255,255,.1);  color: white; }
.nav-item.active { background: rgba(255,255,255,.16); color: white; font-weight: 600; }
.nav-icon        { width: 18px; text-align: center; flex-shrink: 0; font-style: normal; }
.sidebar-footer  { padding: .5rem 0; border-top: 1px solid rgba(255,255,255,.1); }

/* ===== Main content ===== */
#main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.section         { flex: 1; padding: 1.5rem; }
.page-header     { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.page-header h2  { font-size: 1.2rem; font-weight: 700; color: var(--c-navy); }

/* ===== Calendario: contenedor ocupa el viewport ===== */
#sec-calendario { padding-bottom: 0; }
#calendar-container {
  height: calc(100vh - 110px);
  min-height: 500px;
}

/* ===== FullCalendar overrides ===== */
.fc {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  padding: .75rem;
}
.fc .fc-button {
  background:    var(--c-navy)  !important;
  border-color:  var(--c-navy)  !important;
  font-size:     .8rem          !important;
  padding:       .35rem .7rem   !important;
  border-radius: 6px            !important;
  text-transform: none          !important;
  font-family:   inherit        !important;
  box-shadow:    none           !important;
}
.fc .fc-button:hover:not(:disabled) {
  background:   var(--c-navy-light) !important;
  border-color: var(--c-navy-light) !important;
}
.fc .fc-button-active,
.fc .fc-button:not(:disabled):active {
  background:   var(--c-blue) !important;
  border-color: var(--c-blue) !important;
}
.fc .fc-button-group .fc-button              { border-radius: 0        !important; }
.fc .fc-button-group .fc-button:first-child  { border-radius: 6px 0 0 6px !important; }
.fc .fc-button-group .fc-button:last-child   { border-radius: 0 6px 6px 0 !important; }
.fc .fc-toolbar-title { font-size: 1rem; font-weight: 700; color: var(--c-navy); }
.fc .fc-col-header-cell-cushion { color: var(--c-navy); font-weight: 600; text-decoration: none; }
.fc .fc-daygrid-day-number { color: var(--c-muted); text-decoration: none; }
.fc-event { border-radius: 4px !important; font-size: .78rem !important; cursor: pointer; }
.fc-event .fc-event-title { font-weight: 500; }
.fc-daygrid-event  { padding: 2px 4px !important; }
.fc-timegrid-event .fc-event-main { padding: 3px 5px !important; }
.fc-timegrid-slot  { height: 3.5rem !important; }

/* ===== Placeholder sections ===== */
.section-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  color: var(--c-muted);
  text-align: center;
  gap: .75rem;
}
.section-placeholder .ph-icon { font-size: 2.8rem; }
.section-placeholder h3 { font-size: 1.05rem; color: var(--c-text); font-weight: 600; }
.section-placeholder p  { font-size: .875rem; line-height: 1.5; }

/* ===== Forms ===== */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: .8rem;
  color: var(--c-muted);
  font-weight: 500;
  margin-bottom: .3rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: .55rem .75rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: inherit;
  color: var(--c-text);
  background: white;
  transition: border-color .15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--c-blue); }
.field textarea    { resize: vertical; min-height: 80px; }
.field-hint        { font-size: .78rem; color: var(--c-muted); margin-top: .25rem; }

/* ===== Patient search combobox ===== */
.search-combo { position: relative; }
.search-results {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: white;
  border: 1px solid var(--c-border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  z-index: 200;
  max-height: 220px;
  overflow-y: auto;
}
.search-result-item {
  padding: .55rem .75rem;
  cursor: pointer;
  transition: background .1s;
}
.search-result-item:hover  { background: var(--c-bg); }
.result-name               { font-weight: 600; font-size: .88rem; }
.result-sub                { font-size: .76rem; color: var(--c-muted); }
.selected-patient {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: .55rem .75rem;
}
.selected-patient .sel-name { font-weight: 600; font-size: .9rem; }
.selected-patient .sel-sub  { font-size: .76rem; color: var(--c-muted); }
.btn-clear {
  background: none; border: none; cursor: pointer;
  color: var(--c-muted); font-size: 1.1rem; line-height: 1;
  padding: 0 .2rem; flex-shrink: 0;
}
.btn-clear:hover { color: var(--c-red); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem; font-weight: 500; font-family: inherit;
  cursor: pointer; border: 1px solid transparent;
  transition: background .15s, border-color .15s;
  text-decoration: none; white-space: nowrap;
}
.btn-primary   { background: var(--c-navy);  color: white; }
.btn-primary:hover { background: var(--c-navy-light); }
.btn-secondary { background: white; color: var(--c-text); border-color: var(--c-border); }
.btn-secondary:hover { background: var(--c-bg); }
.btn-danger    { background: var(--c-red);  color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm        { padding: .35rem .75rem; font-size: .8rem; }
.btn-xs        { padding: .2rem .5rem;  font-size: .74rem; border-radius: 5px; }
.btn-block     { width: 100%; justify-content: center; }
.btn:disabled  { opacity: .45; cursor: not-allowed; }

/* ===== Badges ===== */
.badge           { display: inline-block; padding: .2rem .65rem; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-agendada  { background: #dbeafe; color: #1d4ed8; }
.badge-realizada { background: #dcfce7; color: #15803d; }
.badge-cancelada { background: #f1f5f9; color: var(--c-muted); }

/* ===== Modal overlay ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 100; display: none;
}
.modal-overlay.visible { display: block; }

/* ===== Modal ===== */
.modal {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
  width: 490px;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  z-index: 101;
  display: none;
}
.modal.visible { display: block; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.5rem .8rem;
  border-bottom: 1px solid var(--c-border);
}
.modal-header h3 { font-size: .975rem; font-weight: 700; color: var(--c-navy); }
.modal-body      { padding: 1.25rem 1.5rem; }
.modal-footer {
  display: flex; gap: .5rem; justify-content: flex-end; align-items: center;
  padding: .8rem 1.5rem 1.1rem;
  border-top: 1px solid var(--c-border);
  flex-wrap: wrap;
}
.btn-close {
  background: none; border: none;
  font-size: 1.4rem; color: var(--c-muted);
  cursor: pointer; line-height: 1; padding: 0;
}
.btn-close:hover { color: var(--c-text); }

/* ===== Detalle de cita ===== */
.detalle-grid { display: grid; gap: .7rem; }
.detalle-row  { display: grid; grid-template-columns: 110px 1fr; gap: .5rem; align-items: start; }
.detalle-label { font-size: .79rem; color: var(--c-muted); font-weight: 500; padding-top: 2px; }
.detalle-value { font-size: .9rem; }
.detalle-spacer { margin: .5rem 0; border: none; border-top: 1px solid var(--c-border); }

/* ===== Toast ===== */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 300;
  display: flex; flex-direction: column; gap: .5rem;
  pointer-events: none;
}
.toast {
  padding: .6rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem; font-weight: 500; color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  animation: toast-in .2s ease;
}
.toast-ok   { background: var(--c-green); }
.toast-err  { background: var(--c-red); }
.toast-info { background: var(--c-navy); }
@keyframes toast-in {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ===== Utilidades ===== */
.spacer { flex: 1; }
.form-row { display: grid; gap: .75rem; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-error { color: var(--c-red); font-size: .82rem; margin-top: .25rem; min-height: 1.1em; }

/* ===== Tabla de datos ===== */
.list-toolbar {
  margin-bottom: 1rem;
}
.search-input {
  width: 100%; max-width: 420px;
  padding: .55rem .75rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: .9rem; font-family: inherit;
  color: var(--c-text); background: white;
  transition: border-color .15s;
}
.search-input:focus { outline: none; border-color: var(--c-blue); }

.table-wrapper {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  overflow: hidden;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.data-table thead tr {
  background: var(--c-bg);
  border-bottom: 2px solid var(--c-border);
}
.data-table th {
  padding: .6rem 1rem;
  text-align: left;
  font-size: .78rem;
  font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
}
.data-table td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .td-small { font-size: .8rem; color: var(--c-muted); }
.clickable-row { cursor: pointer; transition: background .1s; }
.clickable-row:hover { background: #f8fafc; }

.table-empty {
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--c-muted);
  font-size: .875rem;
}
.table-loading {
  padding: 1.5rem 1.5rem;
  text-align: center;
  color: var(--c-muted);
  font-size: .875rem;
}

/* ===== Ficha de paciente ===== */
.ficha-back-header {
  display: flex; align-items: center; gap: .75rem;
}
.tabs-bar {
  display: flex; gap: .25rem;
  border-bottom: 2px solid var(--c-border);
  margin-bottom: 1rem;
}
.tab-btn {
  padding: .5rem .9rem;
  font-size: .85rem; font-weight: 500; font-family: inherit;
  color: var(--c-muted);
  background: none; border: none; border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover  { color: var(--c-text); }
.tab-btn.active { color: var(--c-navy); border-bottom-color: var(--c-navy); font-weight: 600; }

.tab-panel {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  padding: 1.25rem;
}

/* Grid de datos personales */
.ficha-grid { display: grid; gap: .6rem; }
.ficha-row  {
  display: grid; grid-template-columns: 140px 1fr;
  gap: .5rem; align-items: start;
  padding: .4rem 0;
  border-bottom: 1px solid var(--c-border);
}
.ficha-row:last-child { border-bottom: none; }
.ficha-label {
  font-size: .79rem; color: var(--c-muted); font-weight: 500; padding-top: 2px;
}
.ficha-consent-fecha { font-size: .78rem; color: var(--c-muted); }

/* Cabecera de sub-sección en tabs */
.ficha-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .9rem;
}
.ficha-section-header h3 {
  font-size: .95rem; font-weight: 700; color: var(--c-navy);
}

/* Fila de inscripción */
.insc-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 0;
  border-bottom: 1px solid var(--c-border);
}
.insc-row:last-child { border-bottom: none; }
.insc-nombre { font-weight: 600; font-size: .9rem; margin-bottom: .2rem; }
.insc-meta   { font-size: .78rem; color: var(--c-muted); }

/* Seguimiento: bloque de título */
.sesiones-block-title {
  font-size: .88rem; font-weight: 700; color: var(--c-navy);
  margin-bottom: .6rem;
}

/* Filtro de ruta en tab Seguimiento */
.ruta-filter-select {
  padding: .4rem .65rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: .85rem; font-family: inherit;
  color: var(--c-text); background: white;
  cursor: pointer;
}
.ruta-filter-select:focus { outline: none; border-color: var(--c-blue); }

/* ===== Gráficas ===== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: .5rem;
}
.chart-wrap {
  background: var(--c-bg);
  border-radius: var(--radius);
  padding: .9rem;
}
.chart-label {
  font-size: .8rem; font-weight: 600; color: var(--c-navy);
  margin-bottom: .5rem; text-align: center;
}

/* ===== Modal ancho (sesión) ===== */
.modal-wide { width: 620px; }

/* ===== Modal sesión ===== */
.sesion-cita-info {
  background: var(--c-bg);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  margin-bottom: 1.1rem;
  font-size: .875rem;
}
.sesion-info-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .75rem;
}
.sesion-info-lbl {
  display: block;
  font-size: .72rem; color: var(--c-muted); font-weight: 500;
  margin-bottom: .1rem;
}
.sesion-block-label {
  font-size: .8rem; font-weight: 600; color: var(--c-muted);
  text-transform: uppercase; letter-spacing: .03em;
  margin-bottom: .6rem;
}
.sesion-prod-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .5rem;
}

/* Parámetros dinámicos */
.params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .5rem .75rem;
  margin-bottom: 1rem;
}
.param-field { margin-bottom: 0; }

/* Filas de productos */
#sesion-productos-rows { display: flex; flex-direction: column; gap: .4rem; }
.product-row {
  display: grid;
  grid-template-columns: 1fr 72px 32px;
  gap: .4rem;
  align-items: center;
}
.prod-input-wrap { position: relative; }
.prod-nombre  {
  width: 100%; padding: .48rem .65rem;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  font-size: .88rem; font-family: inherit; color: var(--c-text);
}
.prod-nombre:focus { outline: none; border-color: var(--c-blue); }
.prod-cantidad {
  width: 100%; padding: .48rem .5rem;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  font-size: .88rem; font-family: inherit; color: var(--c-text); text-align: center;
}
.prod-cantidad:focus { outline: none; border-color: var(--c-blue); }
.prod-sugg {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
}
.btn-remove-prod {
  background: none; border: none; cursor: pointer;
  color: var(--c-muted); font-size: 1.1rem; line-height: 1;
  padding: 0; display: flex; align-items: center; justify-content: center;
  height: 100%;
}
.btn-remove-prod:hover { color: var(--c-red); }

/* ===== RGPD consent box ===== */
.rgpd-box {
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: .9rem 1rem;
  margin-top: .85rem;
}
.checkbox-label {
  display: flex; gap: .65rem; align-items: flex-start;
  font-size: .875rem; line-height: 1.45; cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  width: 16px; height: 16px; flex-shrink: 0;
  margin-top: 2px; cursor: pointer; accent-color: var(--c-navy);
}

/* ===== Modal ancho en pantallas pequeñas ===== */
@media (max-width: 680px) {
  .modal-wide { width: calc(100vw - 2rem); }
  .sesion-info-grid { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
}

/* ===== Admin: filas de parámetros de ruta ===== */
#ruta-params-rows { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .5rem; }
.ruta-param-header,
.ruta-param-row {
  display: grid;
  grid-template-columns: 1fr 120px 110px 32px;
  gap: .4rem;
  align-items: center;
}
.ruta-param-header {
  font-size: .74rem; font-weight: 600; color: var(--c-muted);
  text-transform: uppercase; letter-spacing: .03em;
  padding: 0 0 .2rem;
}
.rp-nombre,
.rp-unidad,
.rp-tipo {
  width: 100%;
  padding: .45rem .6rem;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  font-size: .86rem; font-family: inherit; color: var(--c-text);
  background: white;
}
.rp-nombre:focus,
.rp-unidad:focus,
.rp-tipo:focus { outline: none; border-color: var(--c-blue); }

/* ===== Botón extra pequeño (acciones en tablas) ===== */
.btn-xs { padding: .22rem .5rem; font-size: .75rem; }

/* ===== Selector de color para trabajadores ===== */
.color-picker {
  width: 100%;
  height: 40px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 2px 4px;
  background: white;
}

/* ===== Sesiones: fila de controles (selector + botón informe) ===== */
.sesiones-controls {
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ===== Sesiones: barra de resumen ===== */
.sesiones-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  padding: .75rem 1.1rem;
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  align-items: center;
}
.sesiones-summary-item { display: flex; flex-direction: column; gap: .08rem; }
.sesiones-summary-lbl {
  font-size: .68rem;
  font-weight: 700;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.sesiones-summary-val {
  font-size: .95rem;
  font-weight: 700;
  color: var(--c-navy);
}

/* ===== Sesión: tarjetas (rediseño) ===== */
.sesiones-list { display: flex; flex-direction: column; gap: .55rem; margin-bottom: 1.5rem; }
.sesiones-history-title {
  font-size: .78rem; font-weight: 700; color: var(--c-navy);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: .55rem; margin-top: .5rem;
}

.sesion-card {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .15s;
}
.sesion-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.09); }

.sesion-card-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .52rem .85rem;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
}
.sesion-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  background: #cbd5e1;
  color: #475569;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}
.sesion-card-date { font-size: .87rem; font-weight: 600; color: var(--c-navy); flex: 1; }
.badge-ultima {
  background: var(--c-navy);
  color: white;
  font-size: .66rem;
  font-weight: 700;
  padding: .13rem .5rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .05em;
  flex-shrink: 0;
}
.sesion-card-actions { display: flex; gap: .3rem; }

.sesion-card-body { padding: .65rem .85rem; }

/* Parámetros */
.sesion-params-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }
.sesion-param-chip {
  display: inline-flex;
  align-items: baseline;
  gap: .2rem;
  background: #f8fafc;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: .28rem .65rem;
  font-size: .83rem;
}
.sesion-param-name { color: var(--c-muted); font-size: .73rem; margin-right: .08rem; }
.sesion-param-val  { font-weight: 700; color: var(--c-navy); font-size: .9rem; }
.sesion-param-unit { color: var(--c-muted); font-size: .72rem; }
.trend-up   { color: #f97316; font-size: .78rem; font-weight: 700; }
.trend-down { color: #6366f1; font-size: .78rem; font-weight: 700; }
.trend-eq   { color: var(--c-muted); font-size: .78rem; }

/* Líneas de texto */
.sesion-card-line { font-size: .82rem; color: var(--c-text); margin-bottom: .28rem; line-height: 1.5; }
.sesion-card-line:last-child { margin-bottom: 0; }
.sesion-lbl {
  font-size: .69rem; font-weight: 700;
  color: var(--c-muted); text-transform: uppercase; letter-spacing: .04em;
  margin-right: .3rem;
}

/* Última sesión destacada */
.sesion-card-latest { border-left: 3px solid var(--c-navy); }
.sesion-card-latest .sesion-card-header { background: #f0f4ff; }
.sesion-card-latest .sesion-num-badge   { background: var(--c-navy); color: white; }

/* ===== Estadísticas de parámetros ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .65rem;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: .8rem .75rem;
  text-align: center;
}
.stat-card-name {
  font-size: .72rem;
  color: var(--c-muted);
  font-weight: 500;
  margin-bottom: .4rem;
  line-height: 1.3;
}
.stat-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-navy);
  line-height: 1;
  margin-bottom: .35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .2rem;
}
.stat-card-meta {
  font-size: .69rem;
  color: var(--c-muted);
  display: flex;
  justify-content: center;
  gap: .5rem;
}

/* ===== Historial: iniciativa de paciente - avatar ===== */
.pac-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--c-navy);
  color: white;
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-right: .5rem;
}
.pac-row-inner { display: flex; align-items: center; }


/* ===== Historial: indicador de sesión registrada ===== */
.hist-has-sesion td { background: inherit; }
.hist-ver-sesion-hint {
  font-size: .72rem;
  color: var(--c-blue);
  font-weight: 500;
  display: block;
  margin-top: .1rem;
}
