:root {
  --navy: #1b2d41;
  --sky: #9ecbdd;
  --sand: #d8a271;
  --sage: #90a89b;
  --teal: #2f8893;
  --cream: #edece7;
  --ink: #1b2d41;
  --muted: #6b7888;
  --line: #e7e5dd;
  --white: #ffffff;
  --soft: #f8f8f5;
  --danger: #b94a48;
  --success: #45856c;
  --warning: #b77932;
  --shadow: 0 18px 45px rgba(27, 45, 65, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--cream);
}

body.nuuma-body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(158, 203, 221, 0.24), rgba(216, 162, 113, 0.12) 42%, rgba(144, 168, 155, 0.18)),
    var(--cream);
  color: var(--ink);
  font-family: "Poppins", Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
}

body.nuuma-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.32) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.28) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.42), transparent 72%);
}

.nuuma-login,
.nuuma-app {
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.nuuma-login {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, 1.1fr) minmax(360px, 0.9fr);
  overflow: hidden;
}

.login-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 40px;
  padding: 44px;
  color: var(--white);
  background:
    linear-gradient(145deg, rgba(27, 45, 65, 0.96), rgba(47, 136, 147, 0.78)),
    url("https://app.gonuuma.com/wp-content/uploads/2026/06/logo-03-scaled.png") center 86% / min(55vw, 620px) no-repeat;
}

.login-visual::after {
  content: "";
  position: absolute;
  inset: auto 32px 32px auto;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  opacity: 0.45;
}

.login-logo {
  width: 148px;
  height: auto;
  flex: none;
  align-self: flex-start;
  object-fit: contain;
}

.login-copy {
  position: relative;
  max-width: 560px;
  animation: nuuma-rise 0.55s ease both;
}

.login-copy span,
.panel-heading span,
.topbar span,
.section-head span,
.drawer-head span,
.team-box span,
.info-grid span {
  display: block;
  color: inherit;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0;
  opacity: 0.72;
}

.login-copy h1 {
  margin: 12px 0 14px;
  max-width: 560px;
  font-size: clamp(30px, 4.4vw, 54px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: 0;
}

.login-copy p {
  max-width: 420px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
}

.login-orbit {
  position: relative;
  display: flex;
  gap: 14px;
  z-index: 1;
}

.login-orbit div {
  min-width: 112px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.login-orbit strong {
  display: block;
  font-size: 22px;
  font-weight: 500;
}

.login-orbit span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
}

.login-panel {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  padding: 48px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
}

.login-panel::before {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--sky), var(--sand));
}

.panel-heading h2,
.topbar h1,
.section-head h2,
.drawer-head h2,
.modal-head h3,
.panel h3 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0;
}

.profile-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.profile-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 18px;
  background: var(--white);
  box-shadow: 0 6px 18px rgba(27, 45, 65, 0.05);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
}

.profile-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--teal), var(--sky));
}
.profile-card:nth-child(2n)::before { background: linear-gradient(180deg, var(--sage), var(--teal)); }
.profile-card:nth-child(3n)::before { background: linear-gradient(180deg, var(--sand), var(--sage)); }

/* Acento lateral compartido por otras tarjetas del panel. */
.kpi::before,
.professional-card::before,
.plan-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 8px 0 0 8px;
  background: linear-gradient(180deg, var(--teal), var(--sky));
}
.professional-card:nth-child(2n)::before { background: linear-gradient(180deg, var(--sage), var(--teal)); }
.professional-card:nth-child(3n)::before { background: linear-gradient(180deg, var(--sand), var(--sage)); }

.profile-card:hover,
.profile-card.is-active {
  transform: translateX(3px);
  border-color: rgba(47, 136, 147, 0.4);
  box-shadow: var(--shadow);
}

.profile-card__ic {
  flex: none;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 11px;
  background: rgba(158, 203, 221, 0.26);
  color: var(--teal);
}
.profile-card__ic .dashicons { font-size: 21px; width: 21px; height: 21px; }

.profile-card__txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.profile-card__txt strong {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.profile-card__txt span {
  color: var(--muted);
  font-size: 12.5px;
}

.profile-card__go {
  flex: none;
  margin-left: auto;
  color: var(--line);
  display: grid;
  place-items: center;
  transition: color 0.18s ease, transform 0.18s ease;
}
.profile-card__go .dashicons { font-size: 20px; width: 20px; height: 20px; }
.profile-card:hover .profile-card__go,
.profile-card.is-active .profile-card__go {
  color: var(--teal);
  transform: translateX(3px);
}

.access-form,
.login-panel[data-step="profiles"] .access-form {
  display: none;
}

.login-panel[data-step="form"] .profile-step {
  display: none;
}

.login-panel[data-step="form"] .access-form {
  display: grid;
  gap: 16px;
  animation: nuuma-rise 0.35s ease both;
}

.back-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--teal);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.back-link .dashicons {
  display: inline-grid;
  width: 14px;
  height: 14px;
  place-items: center;
  font-size: 13px;
  line-height: 1;
}

.back-link:hover {
  transform: translateX(-2px);
  border-color: rgba(47, 136, 147, 0.3);
  background: rgba(158, 203, 221, 0.18);
}

.login-form-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.profile-pill {
  display: inline-flex !important;
  min-height: 32px;
  align-items: center;
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(27, 45, 65, 0.08);
  color: var(--ink) !important;
  font-size: 11px !important;
  font-weight: 500;
  opacity: 1 !important;
  text-transform: none !important;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
  background: var(--white);
  color: var(--ink);
  font-weight: 400;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(47, 136, 147, 0.12);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.check-row input,
.mini-check input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--teal);
}

.btn,
.icon-btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 14px;
  background: var(--white);
  color: var(--ink);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

/* Los íconos del tema son dashicons (glyph de 20px en un <span>): dentro de un
   botón se centran y se igualan al tamaño del texto para que no queden altos. */
.btn .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--teal);
  color: var(--white);
}

.btn.ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.btn.wide {
  width: 100%;
}

.icon-btn {
  width: 38px;
  padding: 0;
}

.icon-btn.danger {
  color: var(--danger);
}

.support {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.support a,
.soft-link {
  color: var(--teal);
  font-weight: 500;
}

.nuuma-app {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 22px;
  padding: 28px 18px;
  background:
    linear-gradient(170deg, rgba(27, 45, 65, 0.98), rgba(27, 45, 65, 0.94) 56%, rgba(47, 136, 147, 0.72)),
    var(--navy);
  color: var(--white);
}

.brand {
  display: flex;
  align-items: center;
  padding: 0 8px 12px;
}

.brand img {
  width: 142px;
  height: auto;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav a,
.logout {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 400;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.side-nav a:hover,
.side-nav a.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  transform: translateX(2px);
}

.logout {
  margin-top: auto;
  color: rgba(255, 255, 255, 0.72);
}

.content-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(231, 229, 221, 0.8);
  padding: 16px clamp(18px, 3vw, 34px);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
}

.topbar h1 {
  font-size: 21px;
}

.mobile-menu {
  display: none;
}

/* El botón de logout de la topbar solo aparece en móvil (en desktop está en la sidebar). */
.topbar-logout {
  display: none;
}

/* Por defecto (desktop) se muestra el nombre completo; el corto es solo para la tab bar móvil. */
.nav-label-short {
  display: none;
}

/* El botón "Más" y su hoja emergente son elementos SOLO móviles. En desktop la
   sidebar lateral muestra todas las secciones, así que aquí se ocultan. */
.nav-more-btn,
.nav-more-sheet {
  display: none;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--white);
}

.user-pill > span,
.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: rgba(158, 203, 221, 0.35);
  color: var(--teal);
  font-weight: 500;
}

.user-pill strong,
.user-pill small {
  display: block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-pill strong {
  font-size: 13px;
  font-weight: 500;
}

.user-pill small {
  color: var(--muted);
  font-size: 11px;
}

.workspace {
  display: grid;
  gap: 20px;
  padding: clamp(18px, 3vw, 34px);
  animation: nuuma-rise 0.38s ease both;
}

.grid {
  display: grid;
  gap: 14px;
}

.kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* KPIs: el número de columnas sigue a la cantidad de cards para no dejar filas
   desbalanceadas (6 cards = 2 filas de 3 en vez de 4+2; 3 cards = 1 fila de 3
   en vez de 3+hueco). Gana sobre .grid.cards-count-* por especificidad. */
.grid.kpi-grid,
.grid.kpi-grid.compact,
.grid.kpi-grid.cards-count-4,
.grid.kpi-grid.cards-count-5 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid.kpi-grid.cards-count-3,
.grid.kpi-grid.cards-count-6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1120px) {
  .grid.kpi-grid,
  .grid.kpi-grid.compact,
  .grid.kpi-grid.cards-count-3,
  .grid.kpi-grid.cards-count-4,
  .grid.kpi-grid.cards-count-5,
  .grid.kpi-grid.cards-count-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.grid.cards-count-1,
.profile-grid.cards-count-1,
.professional-grid.cards-count-1,
.meal-view.cards-count-1 {
  grid-template-columns: minmax(0, 1fr);
}

.grid.cards-count-2,
.grid.cards-count-4,
.profile-grid.cards-count-2,
.profile-grid.cards-count-4,
.professional-grid.cards-count-2,
.professional-grid.cards-count-4,
.meal-view.cards-count-2,
.meal-view.cards-count-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cards-count-3,
.grid.cards-count-6,
.profile-grid.cards-count-3,
.profile-grid.cards-count-6,
.professional-grid.cards-count-3,
.professional-grid.cards-count-6,
.meal-view.cards-count-3,
.meal-view.cards-count-6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cards-count-5,
.profile-grid.cards-count-5,
.professional-grid.cards-count-5,
.meal-view.cards-count-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.grid.cards-count-7,
.grid.cards-count-8,
.profile-grid.cards-count-7,
.profile-grid.cards-count-8,
.professional-grid.cards-count-7,
.professional-grid.cards-count-8,
.meal-view.cards-count-7,
.meal-view.cards-count-8 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.cards-count-9,
.profile-grid.cards-count-9,
.professional-grid.cards-count-9,
.meal-view.cards-count-9 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cards-count-10,
.profile-grid.cards-count-10,
.professional-grid.cards-count-10,
.meal-view.cards-count-10 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.grid.cards-count-11,
.grid.cards-count-12,
.profile-grid.cards-count-11,
.profile-grid.cards-count-12,
.professional-grid.cards-count-11,
.professional-grid.cards-count-12,
.meal-view.cards-count-11,
.meal-view.cards-count-12 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ===== Profesionales · lista densa con horario (día → rangos) ===== */
.prof-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--white); }
.prof-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; }
.prof-row + .prof-row { border-top: 1px solid var(--line); }
.prof-avatar {
  flex: none; width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center; font-weight: 600; font-size: 15px;
  background: rgba(47, 136, 147, 0.14); color: #0f6e56;
}
.prof-row:nth-child(3n) .prof-avatar { background: rgba(216, 162, 113, 0.18); color: #8a5a24; }
.prof-row:nth-child(3n+2) .prof-avatar { background: rgba(144, 168, 155, 0.2); color: #4a6357; }
.prof-main { flex: 1; min-width: 0; }
.prof-name { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.prof-sub { font-size: 12.5px; color: var(--muted); margin: 2px 0 8px; }
.prof-sched { display: flex; flex-direction: column; gap: 4px; }
.prof-sched-row { display: flex; gap: 10px; font-size: 12.5px; align-items: baseline; }
.prof-sched-row .d { flex: none; width: 34px; color: var(--muted); font-weight: 600; }
.prof-sched-row .r { color: var(--ink); }
.prof-sched--empty { font-size: 12.5px; color: var(--muted); font-style: italic; }
.prof-edit-btn { flex: none; align-self: flex-start; }

.modal-sched-list { margin-top: 20px; }
.modal-sched-list .section-head { margin-bottom: 12px; }

@media (max-width: 640px) {
  .prof-row { flex-wrap: wrap; }
  .prof-edit-btn { width: 100%; justify-content: center; margin-top: 4px; }
}

.kpi {
  position: relative;
  overflow: hidden;
  display: grid;
  min-height: 118px;
  align-content: center;
  gap: 14px;
  border: 1px solid rgba(231, 229, 221, 0.8);
  border-radius: 8px;
  padding: 18px 18px 15px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 248, 245, 0.86)),
    var(--white);
  box-shadow: 0 12px 32px rgba(27, 45, 65, 0.07);
  isolation: isolate;
  animation: nuuma-card-in 0.48s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.kpi:hover {
  transform: translateY(-3px);
  border-color: rgba(47, 136, 147, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(158, 203, 221, 0.14)),
    var(--white);
}

.kpi::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(115deg, transparent 0 52%, rgba(47, 136, 147, 0.06) 52% 63%, transparent 63%),
    repeating-linear-gradient(135deg, transparent 0 13px, rgba(27, 45, 65, 0.025) 13px 14px);
  opacity: 0.9;
}

.kpi-grid .kpi:nth-child(2) {
  animation-delay: 0.06s;
}

.kpi-grid .kpi:nth-child(3) {
  animation-delay: 0.12s;
}

.kpi-grid .kpi:nth-child(4) {
  animation-delay: 0.18s;
}

.kpi-grid .kpi:nth-child(5) {
  animation-delay: 0.24s;
}

.kpi-grid .kpi:nth-child(6) {
  animation-delay: 0.3s;
}

.kpi-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.kpi-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(47, 136, 147, 0.08);
  background:
    linear-gradient(145deg, rgba(158, 203, 221, 0.34), rgba(255, 255, 255, 0.82));
  color: var(--teal);
}

.kpi.sage .kpi-icon {
  background: rgba(144, 168, 155, 0.24);
  color: var(--success);
}

.kpi.sand .kpi-icon {
  background: rgba(216, 162, 113, 0.22);
  color: var(--warning);
}

.kpi-content {
  display: grid;
  gap: 4px;
  min-width: 0;
  order: -1;
}

.kpi-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.kpi strong {
  display: block;
  color: var(--ink);
  font-size: clamp(24px, 2.3vw, 32px);
  font-weight: 500;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: 18px;
  align-items: stretch;
}

.split > .panel {
  height: 100%;
}

.panel {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border: 1px solid rgba(231, 229, 221, 0.9);
  border-radius: 8px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 44px rgba(27, 45, 65, 0.08);
  animation: nuuma-card-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(47, 136, 147, 0.9), rgba(158, 203, 221, 0.76), rgba(216, 162, 113, 0.64));
}

/* Paneles con selector de fechas: permiten que el calendario se desborde
   (si no, overflow:hidden lo recortaría). La barra superior conserva sus
   esquinas redondeadas. */
.panel-has-filter { overflow: visible; }
.panel-has-filter::before { border-radius: 8px 8px 0 0; }

.section-head,
.modal-head,
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: 18px;
}

.panel h3 {
  margin: 18px 0 12px;
  font-size: 16px;
}

.panel h4 {
  margin: 18px 0 10px;
  font-size: 13px;
  font-weight: 500;
}

.notice {
  border-radius: 8px;
  padding: 12px 14px;
  animation: nuuma-rise 0.28s ease both;
}

.notice.ok {
  border: 1px solid rgba(69, 133, 108, 0.24);
  background: rgba(144, 168, 155, 0.18);
  color: var(--success);
}

.notice.error {
  border: 1px solid rgba(185, 74, 72, 0.24);
  background: rgba(185, 74, 72, 0.08);
  color: var(--danger);
}

.notice.info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid rgba(47, 136, 147, 0.28);
  background: rgba(47, 136, 147, 0.08);
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.5;
}

.notice.info .notice-icon {
  color: var(--teal);
  flex: 0 0 auto;
  margin-top: 1px;
  display: inline-flex;
}

.notice.info .notice-icon svg {
  width: 17px;
  height: 17px;
}

.notice.info strong {
  font-weight: 600;
}

.mini-list,
.timeline {
  display: grid;
  gap: 10px;
}

.mini-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--white);
  animation: nuuma-soft-in 0.36s ease both;
}

.mini-list .mini-item:nth-child(2) {
  animation-delay: 0.04s;
}

.mini-list .mini-item:nth-child(3) {
  animation-delay: 0.08s;
}

.mini-list .mini-item:nth-child(4) {
  animation-delay: 0.12s;
}

.mini-list .mini-item:nth-child(5) {
  animation-delay: 0.16s;
}

.mini-item > div {
  min-width: 0;
}

.mini-item strong,
.professional-card h3 {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 500;
}

.mini-item small,
.mini-item em {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  margin-top: 3px;
}

.date-chip {
  display: grid;
  width: 42px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--cream);
}

.date-chip strong {
  line-height: 1;
}

.date-chip small {
  text-transform: uppercase;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 780px;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.data-table th {
  padding: 0 12px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-align: left;
  text-transform: uppercase;
}

.data-table td {
  padding: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--white);
  vertical-align: middle;
}

.data-table td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 8px 0 0 8px;
}

.data-table td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.rev-done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #2e7d5b;
  white-space: nowrap;
}
.rev-done .dashicons { color: #2e7d5b; font-size: 16px; width: 16px; height: 16px; }
.rev-none {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.inline-form select {
  min-width: 145px;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--cream);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.badge .dashicons {
  font-size: 14px;
  width: 14px;
  height: 14px;
}

.badge.solicitada,
.badge.borrador {
  background: rgba(216, 162, 113, 0.2);
  color: var(--warning);
}

.badge.confirmada,
.badge.publicado {
  background: rgba(158, 203, 221, 0.28);
  color: var(--teal);
}

.badge.rechazada,
.badge.danger {
  background: rgba(185, 74, 72, 0.1);
  color: var(--danger);
}

.badge.completada,
.badge.activo,
.badge.visible,
.badge.enviado {
  background: rgba(144, 168, 155, 0.22);
  color: var(--success);
}

.empty-state {
  display: grid;
  min-height: 152px;
  place-items: center;
  gap: 8px;
  border: 1px dashed rgba(107, 120, 136, 0.28);
  border-radius: 8px;
  padding: 22px;
  background: linear-gradient(145deg, rgba(237, 236, 231, 0.48), rgba(255, 255, 255, 0.64));
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-weight: 500;
}

.empty-state p {
  max-width: 360px;
  margin: 0;
  font-size: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid.form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stack-form {
  display: grid;
  gap: 13px;
}

.compact-form textarea {
  min-height: 70px;
}

.span-2 {
  grid-column: 1 / -1;
}

.actions {
  display: flex;
  justify-content: flex-end;
}

.search-box {
  display: flex;
  min-width: min(280px, 100%);
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--white);
  color: var(--muted);
}
.search-box .dashicons {
  order: 2;
  font-size: 18px;
  width: 18px;
  height: 18px;
  line-height: 1;
  color: var(--muted);
  flex-shrink: 0;
}

.search-box input {
  order: 1;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  border: 0;
  padding-inline: 0;
  box-shadow: none;
  background: transparent;
}

.progress {
  width: 100%;
  min-width: 120px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--cream);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--sky));
}

.drawer {
  position: fixed;
  z-index: 40;
  inset: 0 0 0 auto;
  width: min(680px, calc(100vw - 18px));
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: -20px 0 60px rgba(27, 45, 65, 0.18);
  animation: nuuma-slide 0.28s ease both;
}

.drawer-head {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
}

.drawer-body {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.drawer-section {
  display: grid;
  gap: 12px;
}

.tabs {
  position: sticky;
  top: 82px;
  z-index: 2;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.tabs a {
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.tabs a.is-active {
  background: rgba(47, 136, 147, 0.12);
  color: var(--teal);
}

.modal {
  width: min(720px, calc(100vw - 28px));
  max-height: min(86vh, 820px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.modal.wide {
  width: min(1040px, calc(100vw - 28px));
}

.modal::backdrop {
  background: rgba(27, 45, 65, 0.36);
  backdrop-filter: blur(4px);
}

.modal[open] {
  animation: nuuma-rise 0.22s ease both;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.info-grid div,
.team-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--white);
}

.info-grid strong,
.team-box strong {
  display: block;
  margin-top: 3px;
  font-weight: 500;
}

.timeline article {
  border-left: 3px solid var(--sky);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  background: var(--white);
}

.timeline span {
  color: var(--muted);
  font-size: 11px;
}

.timeline p {
  margin: 5px 0 8px;
}

.professional-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.professional-card,
.plan-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--white);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.professional-card:hover,
.plan-card:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 136, 147, 0.28);
  background: linear-gradient(180deg, var(--white), rgba(248, 248, 245, 0.82));
}

.professional-card > span {
  color: var(--muted);
  font-size: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.chips span {
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--cream);
  color: var(--muted);
  font-size: 11px;
}

.meal-editor {
  display: grid;
  gap: 14px;
  max-height: 480px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.meal-day {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
  min-width: 760px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--white);
}

.meal-day legend {
  padding: 0 6px;
  color: var(--teal);
  font-weight: 500;
}

.meal-view {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.meal-view > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--soft);
}

.meal-view strong {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.meal-view p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.meal-view span {
  display: block;
  color: var(--ink);
  font-weight: 500;
}

.weight-chart {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 340px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 248, 245, 0.78)),
    var(--white);
}

.chart-head {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.chart-head div {
  border: 1px solid rgba(231, 229, 221, 0.9);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.82);
}

.chart-head span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.chart-head strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 500;
}

.chart-canvas {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 8px 6px;
  background:
    linear-gradient(180deg, rgba(158, 203, 221, 0.1), rgba(255, 255, 255, 0.86)),
    var(--white);
}

.chart-svg {
  display: block;
  width: 100%;
  min-width: 620px;
  height: auto;
  min-height: 260px;
}

.grid-line {
  stroke: rgba(107, 120, 136, 0.18);
  stroke-width: 1;
}

.axis-label {
  fill: var(--muted);
  font-family: "Poppins", Arial, sans-serif;
  font-size: 11px;
}

.y-label {
  text-anchor: end;
}

.x-label {
  text-anchor: middle;
}

.line-area {
  fill: url(#nuumaChartFill);
}

.weight-line {
  fill: none;
  stroke: var(--teal);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.5;
  filter: none;
}

.weight-line.single {
  stroke-dasharray: 8 8;
  opacity: 0.68;
}

.weight-point {
  fill: var(--white);
  stroke: var(--teal);
  stroke-width: 3;
}

.point-label {
  fill: var(--ink);
  font-family: "Poppins", Arial, sans-serif;
  font-size: 12px;
  font-weight: 500;
}

.team-box {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding: 16px;
}

.team-title {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.team-member {
  display: grid;
  gap: 4px;
  padding-top: 2px;
}

.team-member + .team-member {
  border-top: 1px solid rgba(219, 216, 205, 0.8);
  padding-top: 12px;
}

.team-role {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.patient-progress-panel {
  display: flex;
  flex-direction: column;
}

.patient-progress-panel .stack-form {
  gap: 14px;
}

.patient-progress-panel .team-box {
  margin-top: 20px;
}

.mini-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

/* Acciones del examen alineadas a la derecha, con separación clara. */
.mini-actions {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

/* Grupo de permisos: casillas M / N + un botón de texto "Guardar" que solo
   pesa cuando hace falta. Sin píldora ni círculos que compitan visualmente. */
.exam-perms {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.exam-perms .mini-check {
  gap: 5px;
  color: var(--muted);
}

.exam-perms .save-perms {
  border: none;
  background: none;
  padding: 2px 4px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1;
}

.exam-perms .save-perms:hover {
  text-decoration: underline;
}

/* El eliminar se separa del resto para no confundirlo con compartir/guardar. */
.mini-actions > form:last-child {
  padding-left: 4px;
  margin-left: 4px;
  border-left: 1px solid var(--line);
}

@keyframes nuuma-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes nuuma-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes nuuma-sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes nuuma-card-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes nuuma-soft-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes nuuma-slide {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes nuuma-grow {
  from {
    transform: scaleY(0.85);
    transform-origin: bottom;
  }
  to {
    transform: scaleY(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 1120px) {
  .nuuma-login {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 42vh;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .grid.cards-count-4,
  .grid.cards-count-6,
  .profile-grid.cards-count-4,
  .profile-grid.cards-count-6,
  .professional-grid.cards-count-4,
  .professional-grid.cards-count-6,
  .meal-view.cards-count-4,
  .meal-view.cards-count-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.cards-count-8,
  .grid.cards-count-12,
  .profile-grid.cards-count-8,
  .profile-grid.cards-count-12,
  .professional-grid.cards-count-8,
  .professional-grid.cards-count-12,
  .meal-view.cards-count-8,
  .meal-view.cards-count-12 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .grid.cards-count-9,
  .profile-grid.cards-count-9,
  .professional-grid.cards-count-9,
  .meal-view.cards-count-9 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid.cards-count-10,
  .profile-grid.cards-count-10,
  .professional-grid.cards-count-10,
  .meal-view.cards-count-10 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .nuuma-app {
    grid-template-columns: 1fr;
  }

  /* La navegación móvil ahora es una tab bar inferior (ver bloque "MODO APP MÓVIL"
     al final de este archivo). Aquí solo quedan los ajustes de contenido. */

  .topbar {
    align-items: center;
  }

  .user-pill div {
    display: none;
  }

  .drawer {
    width: 100vw;
  }

  .tabs {
    overflow-x: auto;
  }

  .form-grid,
  .form-grid.form-grid-3,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .profile-grid,
  .kpi-grid,
  .kpi-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.kpi-grid,
  .grid.kpi-grid.compact,
  .grid.kpi-grid.cards-count-3,
  .grid.kpi-grid.cards-count-4,
  .grid.kpi-grid.cards-count-5,
  .grid.kpi-grid.cards-count-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.cards-count-3,
  .profile-grid.cards-count-3,
  .professional-grid.cards-count-3,
  .meal-view.cards-count-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid.cards-count-4,
  .grid.cards-count-6,
  .profile-grid.cards-count-4,
  .profile-grid.cards-count-6,
  .professional-grid.cards-count-4,
  .professional-grid.cards-count-6,
  .meal-view.cards-count-4,
  .meal-view.cards-count-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.cards-count-8,
  .grid.cards-count-12,
  .profile-grid.cards-count-8,
  .profile-grid.cards-count-12,
  .professional-grid.cards-count-8,
  .professional-grid.cards-count-12,
  .meal-view.cards-count-8,
  .meal-view.cards-count-12 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .chart-canvas {
    overflow-x: auto;
  }

  .span-2 {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  body.nuuma-body {
    font-size: 13px;
  }

  .login-panel,
  .login-visual {
    padding: 28px 20px;
  }

  .login-copy h1 {
    font-size: 31px;
  }

  .login-form-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .profile-grid,
  .kpi-grid,
  .kpi-grid.compact,
  .professional-grid,
  .meal-view,
  .grid[class*="cards-count-"],
  .profile-grid[class*="cards-count-"],
  .professional-grid[class*="cards-count-"],
  .meal-view[class*="cards-count-"] {
    grid-template-columns: 1fr;
  }

  .chart-head {
    grid-template-columns: 1fr;
  }

  .topbar {
    min-height: 70px;
    padding: 12px 14px;
  }

  .topbar h1 {
    font-size: 17px;
  }

  .workspace {
    gap: 14px;
    padding: 14px;
  }

  .panel {
    padding: 15px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-head-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .section-head .btn,
  .section-head .search-box {
    width: 100%;
  }

  .mini-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .row-actions {
    width: 100%;
  }

  .row-actions .btn {
    flex: 1 1 auto;
  }

  .login-orbit {
    display: none;
  }

  .modal {
    width: calc(100vw - 14px);
    padding: 15px;
  }
}

/* NUUMA 1.0.9 refinements: richer KPIs, protected resources, slot selector and cleaner logout */
.login-visual {
  background:
    radial-gradient(circle at 18% 16%, rgba(158, 203, 221, 0.28), transparent 28%),
    radial-gradient(circle at 82% 78%, rgba(216, 162, 113, 0.2), transparent 30%),
    linear-gradient(145deg, rgba(27, 45, 65, 0.98), rgba(47, 136, 147, 0.82)),
    url("https://app.gonuuma.com/wp-content/uploads/2026/06/logo-03-scaled.png") center 86% / min(54vw, 620px) no-repeat;
}

.login-panel {
  position: relative;
}

.login-panel::after {
  content: "Privado · Clinico · Seguro";
  position: absolute;
  top: 28px;
  right: 32px;
  border: 1px solid rgba(47, 136, 147, 0.14);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--teal);
  font-size: 11px;
  font-weight: 500;
}

.profile-card {
  border-radius: 14px;
}

.profile-card .dashicons {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: rgba(158, 203, 221, 0.22);
  color: var(--teal);
}

.side-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.logout {
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.9);
}

.logout:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.logout-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
}

.logout span:last-child {
  display: grid;
  gap: 2px;
}

.logout strong {
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
}

.logout small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
}

.kpi {
  min-height: 146px;
  border-radius: 16px;
  padding: 18px;
}

.kpi::before {
  width: 5px;
  border-radius: 16px 0 0 16px;
}

.kpi-content {
  gap: 6px;
}

.kpi-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.kpi-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.kpi-trend {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(47, 136, 147, 0.12);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(158, 203, 221, 0.14);
  color: var(--teal);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.kpi-trend .dashicons {
  width: 14px;
  height: 14px;
  font-size: 14px;
}

.kpi-foot small {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.kpi-spark {
  position: absolute;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: end;
  gap: 4px;
  opacity: 0.18;
}

.kpi-spark i {
  display: block;
  width: 5px;
  border-radius: 999px;
  background: var(--teal);
}

.kpi-spark i:nth-child(1) { height: 14px; }
.kpi-spark i:nth-child(2) { height: 22px; }
.kpi-spark i:nth-child(3) { height: 18px; }
.kpi-spark i:nth-child(4) { height: 30px; }

.slot-field select:disabled {
  opacity: 0.68;
}

.field-hint {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.resource-card {
  display: grid;
  min-height: 170px;
  align-content: space-between;
  gap: 18px;
  border: 1px solid rgba(231, 229, 221, 0.9);
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(248, 248, 245, 0.9));
  box-shadow: 0 12px 32px rgba(27, 45, 65, 0.06);
}

.resource-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.resource-card h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
}

.resource-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.resource-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.resource-foot small {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 1120px) {
  .resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .login-panel::after {
    position: static;
    width: fit-content;
  }

  .kpi-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .kpi-foot small {
    text-align: left;
  }

  .resource-grid {
    grid-template-columns: 1fr;
  }
}


/* NUUMA refinement: admin users layout should not stretch the create form on large screens */
.users-admin-layout {
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  align-items: start;
}

.users-admin-layout > .panel {
  height: auto;
}

.user-create-panel {
  align-self: start;
}

.users-list-panel {
  min-width: 0;
}

.users-table-wrap {
  max-height: calc(100vh - 250px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.users-table {
  min-width: 0;
  table-layout: fixed;
}

.users-table th,
.users-table td {
  padding-inline: 10px;
}

.users-table th:nth-child(1),
.users-table .user-name-cell {
  width: 24%;
}

.users-table th:nth-child(2),
.users-table .user-email-cell {
  width: 34%;
}

.users-table th:nth-child(3),
.users-table .user-role-cell {
  width: 19%;
}

.users-table th:nth-child(4),
.users-table .row-actions {
  width: 23%;
}

.user-email-cell {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.user-role-cell {
  line-height: 1.25;
}

.users-table .row-actions {
  flex-wrap: nowrap;
  gap: 8px;
}

.users-table .inline-form {
  min-width: 0;
  flex: 1 1 auto;
}

.users-table .inline-form select {
  min-width: 0;
  width: 100%;
}

.users-table .icon-btn {
  flex: 0 0 auto;
}

@media (min-width: 1280px) {
  .users-admin-layout {
    grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
  }

  .users-table-wrap {
    overflow-x: visible;
  }
}

@media (max-width: 1180px) {
  .users-admin-layout {
    grid-template-columns: 1fr;
  }

  .users-table-wrap {
    max-height: none;
    overflow-x: auto;
  }

  .users-table {
    min-width: 780px;
    table-layout: auto;
  }
}


/* NUUMA refinement: users list actions should feel tighter and cleaner */
.users-table th:nth-child(1),
.users-table .user-name-cell {
  width: 25%;
}

.users-table th:nth-child(2),
.users-table .user-email-cell {
  width: 31%;
}

.users-table th:nth-child(3),
.users-table .user-role-cell {
  width: 18%;
}

.users-table th:nth-child(4),
.users-table .row-actions {
  width: 26%;
}

.users-table th:last-child,
.users-table td.row-actions {
  text-align: right;
}

.users-table td.row-actions {
  padding-left: 0;
}

.users-table .row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
}

.users-table .inline-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.users-table .inline-form select.role-select {
  width: min(100%, 220px);
  min-width: 180px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 0 42px 0 14px;
  border-radius: 12px;
  background-color: var(--white);
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(88, 104, 123, 0.92) 50%),
    linear-gradient(135deg, rgba(88, 104, 123, 0.92) 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(50% - 3px), calc(100% - 14px) calc(50% - 3px);
  background-size: 7px 7px, 7px 7px;
  background-repeat: no-repeat;
  box-shadow: 0 1px 2px rgba(22, 41, 64, 0.04);
}

.users-table .inline-form select.role-select:focus {
  outline: none;
  border-color: rgba(47, 136, 147, 0.55);
  box-shadow: 0 0 0 3px rgba(47, 136, 147, 0.12);
}

.users-table .inline-form .icon-btn,
.users-table .row-actions > .inline-form + .inline-form .icon-btn {
  width: 40px;
  min-width: 40px;
  height: 40px;
}

@media (max-width: 1180px) {
  .users-table td.row-actions {
    text-align: left;
    padding-left: 10px;
  }

  .users-table .row-actions,
  .users-table .inline-form {
    justify-content: flex-start;
  }
}


/* NUUMA correction: keep visible role selector, but make the whole user row span the available width */
.users-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.users-table-wrap {
  overflow-x: hidden;
}

.users-table th:nth-child(1),
.users-table .user-name-cell {
  width: 25%;
}

.users-table th:nth-child(2),
.users-table .user-email-cell {
  width: 32%;
}

.users-table th:nth-child(3),
.users-table .user-role-cell {
  width: 18%;
}

.users-table th:nth-child(4),
.users-table td.row-actions {
  width: 25%;
}

.users-table td.row-actions {
  display: table-cell !important;
  text-align: right;
  vertical-align: middle;
  padding-left: 10px;
  white-space: nowrap;
}

.users-table td.row-actions > .inline-form,
.users-table td.row-actions > form {
  display: inline-flex;
  width: auto;
  vertical-align: middle;
}

.users-table td.row-actions > .inline-form {
  margin-right: 8px;
}

.users-table td.row-actions select.role-select {
  width: 220px;
  max-width: 100%;
  min-width: 180px;
}

.users-table td.row-actions .icon-btn {
  width: 40px;
  min-width: 40px;
  height: 40px;
}

@media (min-width: 1280px) {
  .users-table-wrap {
    overflow-x: hidden;
  }
}

@media (max-width: 1180px) {
  .users-table {
    min-width: 780px;
    table-layout: auto;
  }

  .users-table-wrap {
    overflow-x: auto;
  }

  .users-table td.row-actions {
    text-align: left;
  }
}


/* NUUMA correction: role column only shows the selector; actions keeps delete only */
.users-table th:nth-child(1),
.users-table .user-name-cell {
  width: 27%;
}

.users-table th:nth-child(2),
.users-table .user-email-cell {
  width: 34%;
}

.users-table th:nth-child(3),
.users-table .user-role-cell {
  width: 29%;
}

.users-table th:nth-child(4),
.users-table td.row-actions {
  width: 10%;
}

.users-table .user-role-cell {
  text-align: left;
}

.users-table .role-inline-form {
  display: flex;
  width: min(100%, 280px);
  align-items: center;
  gap: 8px;
}

.users-table .role-inline-form select.role-select {
  width: 100%;
  min-width: 190px;
}

.users-table .user-delete-cell {
  text-align: right;
  white-space: nowrap;
}

.users-table .user-delete-cell .inline-form {
  display: inline-flex;
  width: auto;
}

@media (max-width: 1180px) {
  .users-table .role-inline-form {
    width: 100%;
  }

  .users-table .user-delete-cell {
    text-align: left;
  }
}


/* NUUMA fix: patient expediente drawer must be a true full-height right sidebar */
.workspace {
  animation: none !important;
  transform: none !important;
}

.drawer {
  position: fixed !important;
  z-index: 1000;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  display: flex;
  width: min(760px, calc(100vw - 24px));
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: -24px 0 70px rgba(27, 45, 65, 0.22);
}

.drawer-head {
  position: relative;
  top: auto;
  flex: 0 0 auto;
}

.drawer .tabs {
  position: relative;
  top: auto;
  flex: 0 0 auto;
  overflow-x: auto;
}

.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 42px;
}

@media (max-width: 860px) {
  .drawer {
    width: 100vw;
    max-width: 100vw;
    border-left: 0;
  }

  .drawer-head {
    padding: 16px;
  }

  .drawer .tabs {
    padding-inline: 16px;
  }

  .drawer-body {
    padding: 16px;
    padding-bottom: 36px;
  }
}


/* NUUMA fix: compact patient drawer content */
.drawer-body {
  display: block;
  align-content: start;
}

.drawer .info-grid {
  align-content: start;
  align-items: start;
  grid-auto-rows: auto;
}

.drawer .info-grid div {
  min-height: 72px;
  align-content: start;
  padding: 14px 16px;
}

.drawer .info-grid strong {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.35;
}

.drawer .drawer-section {
  margin-bottom: 18px;
}

.drawer .drawer-section + .drawer-section {
  border-top: 1px solid rgba(231, 229, 221, 0.9);
  padding-top: 18px;
}

.drawer .empty-state {
  min-height: 120px;
}

@media (max-width: 860px) {
  .drawer .info-grid {
    grid-template-columns: 1fr;
  }

  .drawer .info-grid div {
    min-height: auto;
  }
}


/* NUUMA refinement: neutral empty states and clean close X behavior */
.empty-state {
  border: 1px dashed rgba(107, 120, 136, 0.26);
  background: rgba(248, 248, 245, 0.72);
  color: var(--muted);
}

.empty-state .dashicons {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  background: rgba(107, 120, 136, 0.08);
  color: rgba(107, 120, 136, 0.68);
  font-size: 22px;
  line-height: 1;
}

.empty-state strong {
  color: var(--muted);
  font-weight: 500;
}

.empty-state p {
  color: rgba(107, 120, 136, 0.82);
}

.modal-head .icon-btn,
.drawer-head .icon-btn {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--ink);
}

.modal-head .icon-btn .dashicons,
.drawer-head .icon-btn .dashicons {
  width: auto;
  height: auto;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  transition: font-weight 0.14s ease, color 0.14s ease;
}

.modal-head .icon-btn:hover,
.drawer-head .icon-btn:hover {
  transform: none !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

.modal-head .icon-btn:hover .dashicons,
.drawer-head .icon-btn:hover .dashicons {
  color: var(--navy);
  -webkit-text-stroke: 0.6px currentColor;
  text-shadow: 0 0 0.4px currentColor;
}


/* NUUMA fix: empty messages inside non-clinical patient tabs */
.drawer-section .empty-state {
  margin-top: 10px;
}


/* NUUMA route update: remove left login indicators and support patient-only login */
.login-orbit {
  display: none !important;
}

.login-panel[data-step="form"] .access-form {
  display: grid;
}

.login-panel[data-step="form"] .profile-step {
  display: none;
}

/* --- Cambios reunión NUUMA: seguimiento SOAP, perfil, consentimiento --- */
.numbered-list { list-style: none; counter-reset: nli; margin: 12px 0 0; padding-left: 0; display: grid; gap: 6px; }
.numbered-list li { counter-increment: nli; display: flex; align-items: center; gap: 8px; }
.numbered-list li::before { content: counter(nli) "."; flex: none; min-width: 18px; color: var(--muted); font-weight: 600; }
.numbered-list li > span { flex: 1; min-width: 0; }
.inline-add { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-add .grow { flex: 1 1 200px; }
.inline-add .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.doctor-card { margin-top: 16px; border: 1px solid var(--nuuma-border, #e5e7eb); border-radius: 12px; padding: 8px 12px; }
.doctor-card summary { cursor: pointer; font-weight: 500; }
.doctor-card-body { padding-top: 10px; display: grid; gap: 6px; }
.doctor-photo { max-width: 96px; border-radius: 12px; }
.doctor-registros { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: #4b5563; }
.doctor-registros span { font-weight: 500; color: #111827; }
.consent-box { margin-top: 16px; padding: 12px; border-radius: 12px; background: #f8fafc; }

/* --- Hover de botones de icono: sin sombra, solo icono más grueso --- */
.icon-btn .dashicons {
  transition: color 0.14s ease, -webkit-text-stroke-width 0.14s ease, text-shadow 0.14s ease;
  -webkit-text-stroke: 0 currentColor;
}
.icon-btn:hover {
  transform: none;
  box-shadow: none;
}
.icon-btn:hover .dashicons {
  /* Engrosa el trazo del icono sin cambiar su tamaño */
  -webkit-text-stroke: 0.6px currentColor;
  text-shadow: 0 0 0.4px currentColor;
}

/* --- Mi plan: selector de día + línea de tiempo (Propuesta A) --- */
.plan-timeline { margin-top: 8px; }
.plan-timeline .day-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.plan-timeline .day-pill {
  border: 1px solid var(--line); background: var(--white); border-radius: 999px;
  padding: 8px 16px; font: inherit; font-size: 13px; font-weight: 500; color: var(--muted);
  cursor: pointer; transition: .15s;
}
.plan-timeline .day-pill:hover { border-color: var(--teal); color: var(--teal); }
.plan-timeline .day-pill.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.plan-timeline .plan-day { display: none; }
.plan-timeline .plan-day.is-active { display: block; }

.plan-timeline .timeline { position: relative; padding-left: 26px; }
.plan-timeline .timeline::before {
  content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(var(--line), transparent);
}
.plan-timeline .tl-item {
  position: relative; display: grid; grid-template-columns: 74px 1fr; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--soft);
}
.plan-timeline .tl-item:last-child { border-bottom: 0; }
.plan-timeline .tl-item::before {
  content: ""; position: absolute; left: -21px; top: 20px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--c, var(--teal));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c, var(--teal)) 20%, white);
}
.plan-timeline .tl-time { font-size: 13px; font-weight: 600; color: var(--c, var(--teal)); }
.plan-timeline .tl-name { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.plan-timeline .food { font-size: 14.5px; line-height: 1.45; }
.plan-timeline .food.empty { color: #aab2bd; font-style: italic; }

/* Acentos por comida */
.plan-timeline .m-desayuno { --c: var(--teal); }
.plan-timeline .m-media    { --c: var(--sage); }
.plan-timeline .m-almuerzo { --c: var(--sand); }
.plan-timeline .m-merienda { --c: var(--sky); }
.plan-timeline .m-cena     { --c: var(--navy); }

/* Horarios de comida en el diálogo del plan */
.meal-times { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0; }
.meal-times legend { font-size: 13px; font-weight: 600; padding: 0 6px; }

@media (max-width: 560px) {
  .plan-timeline .tl-item { grid-template-columns: 60px 1fr; gap: 12px; }
}

/* --- Expediente a pantalla completa --- */
.expedient { }
.expedient-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; font-weight: 500; }
.expedient-header {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 22px; align-items: center;
  padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--soft);
  margin-bottom: 22px;
}
.expedient-id { display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
.avatar-lg {
  width: 64px; height: 64px; border-radius: 18px; flex: none;
  display: grid; place-items: center; font-size: 24px; font-weight: 600;
  color: #fff; background: linear-gradient(135deg, var(--teal), var(--navy));
}
.expedient-id h2 { margin: 4px 0 2px; font-size: 22px; }
.expedient-meta { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.consideraciones { margin: 0; font-size: 13.5px; line-height: 1.45; }
.consideraciones.muted { color: var(--muted); font-style: italic; }
.expedient-goal { min-width: 0; }
.expedient-goal .eyebrow { display: block; margin-bottom: 4px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.obj-chart { width: 100%; }
.obj-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.obj-ideal { fill: none; stroke: var(--sand); stroke-width: 1.6; stroke-linecap: round; opacity: .9; }
.obj-real { fill: none; stroke: var(--teal); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.obj-xlabel { fill: var(--muted); font-size: 10.5px; font-weight: 500; }
.obj-dot-now { fill: var(--teal); stroke: var(--white); stroke-width: 2.5; }
.obj-pill { fill: var(--navy); }
.obj-pill-text { fill: #fff; font-size: 11px; font-weight: 600; }
.obj-pill-soft { fill: #fff; stroke: var(--line); }
.obj-pill-soft-text { fill: var(--ink); font-size: 11px; font-weight: 600; }
.obj-empty { color: var(--muted); font-size: 13px; }
.obj-legend { display: flex; gap: 16px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.obj-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.obj-legend .dot-real { background: var(--teal); }
.obj-legend .dot-ideal { background: var(--sand); }

.expedient-tabs { margin-bottom: 18px; }

@media (max-width: 760px) {
  .expedient-header { grid-template-columns: 1fr; }
}

/* Barra superior del expediente (Volver + Historia clínica PDF) */
.expedient-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.expedient-topbar .expedient-back { margin-bottom: 0; }

/* Vista consolidada de la historia clínica (lectura, en la app) */
.hc-title h2 { margin: 0; font-size: 20px; }
.hc-sub { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.hc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0 6px; }
@media (max-width: 640px) { .hc-stats { grid-template-columns: repeat(2, 1fr); } }
.hc-stats > div { background: var(--soft); border-radius: 10px; padding: 10px 12px; }
.hc-stats span { display: block; font-size: 11px; color: var(--muted); }
.hc-stats b { font-size: 17px; color: var(--ink); font-weight: 600; }
.hc-block { padding: 18px 0; border-top: 1px solid var(--line); }
.hc-block > h3 { margin: 0 0 14px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); font-weight: 700; }
.hc-empty { font-size: 13px; color: var(--muted); font-style: italic; margin: 0; }
.hc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
@media (max-width: 640px) { .hc-grid { grid-template-columns: 1fr; } }
.hc-field { min-width: 0; }
.hc-field.full { grid-column: 1 / -1; }
.hc-field > span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.hc-field > strong { font-size: 14px; color: var(--ink); font-weight: 500; line-height: 1.5; }
.hc-ctrl { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.hc-ctrl-h { font-size: 13px; color: var(--ink); }
.hc-ctrl-h span { color: var(--muted); font-weight: 400; }
.hc-ctrl-body { margin: 8px 0 0; font-size: 13px; line-height: 1.6; color: var(--ink); }
.hc-ctrl-sub { margin-top: 10px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.hc-ctrl-list { margin: 4px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.hc-exams { list-style: none; margin: 0; padding: 0; }
.hc-exams li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.hc-exams li:last-child { border-bottom: 0; }
.hc-exam-name { font-weight: 500; color: var(--ink); }
.hc-exam-date { color: var(--muted); }
.hc-exam-ok { font-size: 11px; font-weight: 600; color: #4a6357; background: rgba(144,168,155,.24); padding: 2px 8px; border-radius: 999px; }
.hc-exam-link { color: var(--teal); }
.hc-consent { margin: 0; font-size: 14px; color: var(--muted); }
.hc-consent.ok { color: #4a6357; font-weight: 500; }

/* --- Renombrar archivo (recurso / examen) --- */
.rename { position: relative; display: inline-block; }
.rename > summary { list-style: none; cursor: pointer; }
.rename > summary::-webkit-details-marker { display: none; }
.rename[open] > summary { color: var(--teal); }
.rename-form {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
  display: flex; gap: 6px; align-items: center;
  background: var(--white); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px; box-shadow: var(--shadow); width: max-content;
}
.rename-form input[type="text"] {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
  font: inherit; font-size: 13px; min-width: 180px;
}
@media (max-width: 520px) {
  .rename-form { right: auto; left: 0; }
  .rename-form input[type="text"] { min-width: 140px; }
}

/* ===== Nueva cita: campos tipo bloque, interruptor y fichas de horario ===== */
.field-block { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 500; }

.seg { display: inline-flex; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 4px; gap: 4px; }
.seg.full { display: flex; width: 100%; }
.seg label {
  display: flex; align-items: center; justify-content: center; gap: 7px; flex: 1; margin: 0;
  min-height: 0; padding: 9px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: var(--muted); cursor: pointer; transition: background .15s ease, color .15s ease;
}
.seg label input { position: absolute; opacity: 0; width: 0; height: 0; min-height: 0; margin: 0; pointer-events: none; }
.seg label .dashicons { font-size: 16px; width: 16px; height: 16px; }
.seg label.on, .seg label:has(input:checked) { background: var(--white); color: var(--navy); box-shadow: 0 2px 6px rgba(27, 45, 65, 0.08); }

.slot-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-pills:empty::after { content: ""; }
.slot {
  border: 1px solid var(--line); background: var(--white); border-radius: 10px;
  padding: 9px 14px; font: inherit; font-size: 13px; font-weight: 500; color: var(--ink);
  cursor: pointer; transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.slot:hover { border-color: var(--teal); color: var(--teal); }
.slot.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ===== Agenda por día (selector de día + cambio de semana) ===== */
.agenda-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.agenda-nav { display: flex; align-items: center; gap: 10px; }
.agenda-nav .nav-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--white); color: var(--ink); text-decoration: none; font-size: 18px; line-height: 1;
}
.agenda-nav .nav-btn:hover { border-color: var(--teal); color: var(--teal); }
.agenda-nav strong { font-size: 15px; }
.agenda-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.agenda-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; vertical-align: middle; margin-right: 6px; }
.lg-confirmada { background: var(--teal); } .lg-solicitada { background: var(--sand); } .lg-completada { background: var(--sage); }

.appt-agenda .daypills { display: none; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
@media (max-width: 860px) { .appt-agenda .daypills { display: flex; } }
.appt-agenda .daypill {
  border: 1px solid var(--line); background: var(--white); border-radius: 12px; padding: 8px 14px;
  cursor: pointer; text-align: center; min-width: 56px; transition: .15s;
}
.appt-agenda .daypill small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.appt-agenda .daypill b { font-size: 16px; }
.appt-agenda .daypill:hover { border-color: var(--teal); }
.appt-agenda .daypill.is-active { background: var(--teal); border-color: var(--teal); color: #fff; }
.appt-agenda .daypill.is-active small { color: rgba(255,255,255,.85); }
/* Punto que indica si el día tiene citas (color según estado más relevante). */
.appt-agenda .daypill-dot { display: block; width: 5px; height: 5px; border-radius: 50%; margin: 4px auto 0; background: transparent; }
.appt-agenda .daypill-dot.conf { background: var(--teal); }
.appt-agenda .daypill-dot.solic { background: var(--sand); }
.appt-agenda .daypill-dot.comp { background: var(--sage); }
.appt-agenda .daypill.is-active .daypill-dot { background: #fff !important; }

/* ===== DESKTOP · Rejilla semanal por horas (Propuesta 1) ===== */
.weekgrid { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--white); }
.weekgrid .wg-head { display: grid; grid-template-columns: 52px repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.weekgrid .wg-corner { background: var(--soft); }
.weekgrid .wg-daycol { text-align: center; padding: 9px 0; border-left: 1px solid var(--line); }
.weekgrid .wg-daycol small { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.weekgrid .wg-daycol b { font-size: 16px; font-weight: 600; color: var(--ink); }
.weekgrid .wg-daycol.is-today { background: rgba(47,136,147,.08); }
.weekgrid .wg-daycol.is-today small, .weekgrid .wg-daycol.is-today b { color: var(--teal); }
.weekgrid .wg-body { display: grid; grid-template-columns: 52px repeat(7, 1fr); height: var(--wg-h, 672px); }
.weekgrid .wg-hours { position: relative; }
.weekgrid .wg-hour { height: 56px; position: relative; }
.weekgrid .wg-hour span { position: absolute; top: -7px; right: 8px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.weekgrid .wg-col { position: relative; border-left: 1px solid var(--line); }
.weekgrid .wg-col.is-today { background: rgba(47,136,147,.04); }
.weekgrid .wg-slot { height: 56px; border-bottom: 1px solid var(--line); }
.weekgrid .wg-slot:last-child { border-bottom: none; }
.weekgrid .wg-ev {
  position: absolute; left: 3px; right: 3px; overflow: hidden;
  background: rgba(47,136,147,.12); border-left: 3px solid var(--teal);
  border-radius: 0 7px 7px 0; padding: 5px 8px; box-sizing: border-box; cursor: default;
}
.weekgrid .wg-ev.solic { background: rgba(216,162,113,.16); border-left-color: var(--sand); }
.weekgrid .wg-ev.comp { background: rgba(144,168,155,.16); border-left-color: var(--sage); }
.weekgrid .wg-ev-time { font-size: 11px; font-weight: 600; color: #0f6e56; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weekgrid .wg-ev.solic .wg-ev-time { color: #8a5a24; }
.weekgrid .wg-ev.comp .wg-ev-time { color: #4a6357; }
.weekgrid .wg-ev-meta { font-size: 10px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.weekgrid .wg-ev-actions { display: none; gap: 3px; margin-top: 4px; }
.weekgrid .wg-ev:hover .wg-ev-actions { display: flex; }
.weekgrid .wg-ev:hover { box-shadow: 0 4px 14px rgba(27,45,65,.12); z-index: 5; min-height: fit-content; }

/* Dashboard de farmacia: mini-cards de pendientes por dosis */
.dose-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.dose-card {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 16px 14px; text-decoration: none; color: inherit;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.dose-card:hover { border-color: var(--teal); box-shadow: 0 6px 18px rgba(27,45,65,.08); transform: translateY(-1px); }
.dose-card-dose { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--teal); }
.dose-card-count { font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1.15; }
.dose-card-label { font-size: 12px; color: var(--muted); }
.dose-card-sub { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.dose-card-sub svg { width: 14px; height: 14px; }
.dose-card-doses { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dose-pill { font-size: 11.5px; color: var(--ink); background: rgba(47,136,147,.10); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }
.dose-pill strong { color: #0f6e56; font-weight: 700; }
   la esquina inferior derecha del evento: no añade alto, así el bloque no
   aparenta durar más de lo real. */
.weekgrid .wg-more {
  position: absolute; left: auto; right: 4px; height: 16px; z-index: 6;
  background: rgba(15,110,86,.92); color: #fff; border: 0; border-radius: 8px;
  font-size: 10px; font-weight: 700; line-height: 16px; padding: 0 6px; cursor: pointer;
  white-space: nowrap; overflow: hidden; box-shadow: 0 1px 3px rgba(27,45,65,.25);
}
.weekgrid .wg-more:hover { background: var(--teal); }

/* Popover del chip (se posiciona fijo por JS; fuera de la rejilla) */
.wg-pops { position: relative; }
.wg-more-pop {
  width: 250px; max-width: calc(100vw - 24px); z-index: 120;
  max-height: calc(100vh - 24px); overflow-y: auto;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 20px 50px rgba(27,45,65,.22); padding: 10px;
}
.wg-more-pop[hidden] { display: none; }
.wg-more-pop-h { font-size: 12px; font-weight: 700; color: var(--ink); margin: 2px 4px 8px; }
.wg-pop-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 4px; border-top: 1px solid var(--line); }
.wg-pop-row:first-of-type { border-top: 0; }
.wg-pop-main { min-width: 0; }
.wg-pop-time { display: block; font-size: 12px; font-weight: 600; color: #0f6e56; }
.wg-pop-row.solic .wg-pop-time { color: #8a5a24; }
.wg-pop-row.comp .wg-pop-time { color: #4a6357; }
.wg-pop-who { display: block; font-size: 12.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-pop-mode { display: block; font-size: 11px; color: var(--muted); }
.wg-pop-actions { display: flex; gap: 4px; flex: none; }

/* La rejilla es la vista por defecto; el timeline móvil se oculta en desktop. */
.agenda-days-mobile { display: none; }

@media (max-width: 860px) {
  .weekgrid { display: none; }
  .agenda-days-mobile { display: block; }
}

/* ===== MÓVIL · Timeline vertical del día (Propuesta 3) ===== */
.appt-agenda .agenda-day { display: none; }
.appt-agenda .agenda-day.is-active { display: block; }
.agenda-timeline { display: grid; gap: 10px; }
.agenda-day-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.agenda-day-h .dnum { font-size: 20px; font-weight: 600; color: var(--ink); }
.agenda-day-h .dow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.agenda-day-h .count { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 500; }
.agenda-empty { color: var(--muted); font-size: 13px; font-style: italic; padding: 2px 0 6px 2px; }

.agenda-list { display: grid; gap: 10px; }

/* Agenda del paciente (S4): pestañas y grupos por día. */
.citas-tabs { display: inline-flex; gap: 4px; background: var(--soft); border-radius: 999px; padding: 4px; margin-bottom: 20px; }
.citas-tab { padding: 7px 20px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); }
.citas-tab.is-active { background: var(--navy); color: #fff; }
.citas-group { margin-bottom: 20px; }
.citas-group-h { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--teal); margin-bottom: 10px; }
.appt-agenda .ev {
  display: flex; align-items: center; gap: 14px; position: relative;
  border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 12px;
  padding: 12px 14px; background: var(--white);
  transition: box-shadow .15s ease, transform .15s ease;
}
.appt-agenda .ev:hover { box-shadow: 0 4px 14px rgba(27,45,65,.07); }
.appt-agenda .ev.solic { border-left-color: var(--sand); }
.appt-agenda .ev.comp { border-left-color: var(--sage); }
/* Hora grande y prominente a la izquierda (formato tarjeta). */
.appt-agenda .ev .time {
  display: flex; flex-direction: column; align-items: center;
  min-width: 54px; font-size: 19px; font-weight: 600; color: var(--ink); line-height: 1.05;
}
.appt-agenda .ev .time small { font-size: 10px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.appt-agenda .ev-main { flex: 1; min-width: 0; }
.appt-agenda .ev-main h5 { margin: 0 0 5px; font-size: 14px; font-weight: 600; }
.appt-agenda .ev .meta { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.appt-agenda .ev .meta .chip { font-size: 10.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.appt-agenda .ev .meta .chip.v { background: rgba(158, 203, 221, 0.3); color: #2a6070; }
.appt-agenda .ev .meta .chip.p { background: rgba(216, 162, 113, 0.22); color: #8a5a24; }
.appt-agenda .ev .meta .chip.st-confirmada { background: rgba(47,136,147,.14); color: #0f6e56; }
.appt-agenda .ev .meta .chip.st-solicitada { background: rgba(216,162,113,.18); color: #8a5a24; }
.appt-agenda .ev .meta .chip.st-completada { background: rgba(144,168,155,.2); color: #4a6357; }
.appt-agenda .ev .ev-link { color: var(--teal); font-weight: 600; }
.appt-agenda .ev-actions { display: flex; gap: 4px; align-items: center; }

@media (max-width: 520px) {
  .appt-agenda .ev { flex-wrap: wrap; }
  .appt-agenda .ev-actions { width: 100%; justify-content: flex-end; }
}

/* ===== Datos de encuesta (expediente) ===== */
.survey-empty { color: var(--muted); font-size: 14px; padding: 24px 0; }
.survey-block { display: flex; flex-direction: column; gap: 22px; }
.survey-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.survey-head h3 { margin: 0; }
.survey-date { font-size: 12.5px; color: var(--muted); }
.survey-group h4 { margin: 0 0 10px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--teal); }
.survey-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 18px; }
@media (max-width: 640px) { .survey-grid { grid-template-columns: 1fr; } }
.survey-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; }
.survey-k { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.survey-v { font-size: 14px; color: var(--ink); font-weight: 500; word-break: break-word; }

/* ===== Pestañas del expediente: sin línea inferior, botones sin recarga ===== */
.expedient-tabs { border-bottom: none; }
.expedient-tabs button {
  border: none;
  background: transparent;
  font-family: inherit;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.expedient-tabs button:hover { color: var(--ink); }
.expedient-tabs button.is-active {
  background: rgba(47, 136, 147, 0.12);
  color: var(--teal);
}

/* Autor del registro (médico / nutricionista que lo agregó) */
.item-author { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; font-weight: 400; }
.timeline article span { color: var(--muted); }

/* Aviso: firma electrónica no disponible */
.check-row.is-disabled { opacity: .55; cursor: not-allowed; }
.field-alert {
  margin: 12px 0 16px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
  background: rgba(216, 162, 113, .12);
  border-left: 3px solid var(--sand);
  border-radius: 8px;
  padding: 10px 14px;
}
.field-alert a { color: var(--teal); font-weight: 500; }

/* ===== Acordeón del expediente (numerado + estado) ===== */
.acc { display: flex; flex-direction: column; gap: 14px; }
.acc-item { border: 1px solid var(--line); border-radius: 14px; background: var(--white); overflow: hidden; }
.acc-item > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
}
.acc-item > summary::-webkit-details-marker { display: none; }
.acc-item[open] { border-color: var(--teal); }
.acc-item[open] > summary { background: rgba(47, 136, 147, 0.04); }
.acc-n {
  width: 34px; height: 34px; flex: none; border-radius: 10px;
  background: rgba(47, 136, 147, 0.1); color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
}
.acc-txt { min-width: 0; }
.acc-t { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.acc-s { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.acc-badge {
  margin-left: auto; flex: none; white-space: nowrap;
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  color: var(--muted); background: var(--soft); border: 1px solid var(--line);
}
.acc-badge.is-ok { color: var(--sage); background: rgba(144, 168, 155, 0.15); border-color: transparent; }
.acc-badge.is-warn { color: var(--sand); background: rgba(216, 162, 113, 0.14); border-color: transparent; }
.acc-chev { flex: none; color: var(--muted); transition: transform .2s ease; }
.acc-item[open] .acc-chev { transform: rotate(180deg); }
.acc-body { padding: 24px 20px; border-top: 1px solid var(--line); }

/* Espaciado: los campos ya no salen pegados */
.acc-body .stack-form { display: flex; flex-direction: column; gap: 20px; }
.acc-body .info-grid { margin-bottom: 20px; }
.acc-body .mini-list { margin-top: 18px; }
.acc-body .field-hint { margin: 0 0 12px; }
.acc-body .sub-head { margin: 22px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.field-short { max-width: 220px; }

/* ===== Mi perfil (profesional) ===== */
.profile-hero {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(100deg, rgba(47,136,147,.08), rgba(158,203,221,.12));
  border: 1px solid var(--line); border-radius: 16px;
  padding: 22px; margin-bottom: 20px;
}
.profile-avatar {
  width: 78px; height: 78px; flex: none; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--white);
}
.profile-avatar.is-empty {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--teal), var(--navy));
  color: #fff; font-size: 26px; font-weight: 600; border: none;
}
.profile-id { flex: 1; min-width: 200px; }
.profile-id h2 { margin: 0; font-size: 19px; }
.profile-id p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.profile-chips { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.chip {
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--soft); border: 1px solid var(--line); color: var(--muted);
}
.chip.is-ok { color: var(--sage); background: rgba(144,168,155,.15); border-color: transparent; }
.chip.is-warn { color: var(--sand); background: rgba(216,162,113,.14); border-color: transparent; }

.profile-main, .profile-side { display: flex; flex-direction: column; gap: 20px; }
.profile-main > form { display: flex; flex-direction: column; gap: 20px; }

/* Alineación: reserva 2 líneas para la etiqueta, así los campos de una fila
   quedan alineados aunque una etiqueta salte de línea (pantallas medianas). */
.form-grid.aligned label { display: flex; flex-direction: column; }
.form-grid.aligned label > span {
  min-height: 34px;
  display: flex; align-items: flex-end;
  margin-bottom: 8px;
}
.form-grid.aligned label > input { margin-top: auto; }
@media (max-width: 700px) {
  .form-grid.aligned label > span { min-height: 0; }
}
.stack-field { display: block; margin-top: 20px; }

/* Foto y firma: vista previa de lo ya cargado */
.upload-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  border: 1px dashed var(--line); border-radius: 12px;
  padding: 16px; background: var(--soft); margin-bottom: 14px;
}
.upload-prev {
  width: 104px; height: 60px; flex: none; border-radius: 8px;
  background: var(--white); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.upload-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.upload-prev span { font-size: 11px; color: var(--muted); }
.upload-info { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 4px; }
.upload-info strong { font-size: 13.5px; }
.upload-info small { font-size: 12px; color: var(--muted); line-height: 1.5; }
.upload-info input[type="file"] { margin-top: 6px; font-size: 12.5px; }
.info-grid.one-col { grid-template-columns: 1fr; }

/* ===== Perfil: alineación de columnas y botón de archivo ===== */
/* Las tarjetas arrancan arriba (no se estiran) y ambas columnas comparten el mismo gap */
.profile-hero + .split { align-items: start; }
.profile-hero + .split > .profile-main,
.profile-hero + .split > .profile-side { gap: 18px; }
.profile-main .panel, .profile-side .panel { margin: 0; }

/* Input de archivo con el mismo estilo del botón de la propuesta */
.upload-info input[type="file"] { display: none; }
.upload-btn {
  align-self: flex-start;
  margin-top: 8px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--teal);
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.upload-btn:hover { background: rgba(47,136,147,.06); border-color: var(--teal); }
.upload-name {
  display: block; margin-top: 6px;
  font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ===== Gráfica: barra de progreso + cifras ===== */
.obj-dot-first { fill: var(--white); stroke: var(--teal); stroke-width: 2; }
.obj-progress { margin-top: 16px; }
.obj-progress-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; color: var(--muted); margin-bottom: 7px;
}
.obj-progress-head strong { font-size: 13px; color: var(--teal); }
.obj-progress-track {
  height: 9px; background: var(--white);
  border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
}
.obj-progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--sage));
  transition: width .4s ease;
}
.obj-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.obj-stats > div {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; text-align: center;
}
.obj-stats span {
  display: block; font-size: 10px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.obj-stats strong { display: block; font-size: 16px; font-weight: 600; margin-top: 3px; }
.obj-stats strong.is-good { color: var(--sage); }
.obj-stats strong.is-warn { color: var(--sand); }
@media (max-width: 520px) { .obj-stats { grid-template-columns: 1fr; } }

/* ===== Campos de archivo con estilo propio (reemplazan al input nativo) ===== */
.file-field { display: block; }
.file-label {
  display: block; font-size: 13px; color: var(--muted);
  font-weight: 500; margin-bottom: 8px;
}
.file-drop {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--soft);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.file-drop:hover { border-color: var(--teal); background: rgba(47,136,147,.04); }
.file-drop.has-file { border-style: solid; border-color: var(--teal); background: rgba(47,136,147,.05); }
.file-drop input[type="file"] {
  position: absolute; width: 1px; height: 1px;
  opacity: 0; overflow: hidden; clip: rect(0 0 0 0);
}
.file-ico {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  background: rgba(47,136,147,.1); color: var(--teal);
  display: flex; align-items: center; justify-content: center;
}
.file-txt { flex: 1; min-width: 0; }
.file-txt strong {
  display: block; font-size: 13.5px; font-weight: 500; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-txt small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.file-cta {
  flex: none; font-size: 12.5px; font-weight: 500; color: var(--teal);
  border: 1px solid var(--line); background: var(--white);
  border-radius: 8px; padding: 7px 13px;
}
.file-drop:hover .file-cta { border-color: var(--teal); }

/* Botón compacto (perfil: foto y firma) */
.file-btn {
  align-self: flex-start; margin-top: 8px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--white); color: var(--teal);
  font-size: 13px; font-weight: 500;
  transition: background .18s ease, border-color .18s ease;
}
.file-btn:hover { background: rgba(47,136,147,.06); border-color: var(--teal); }
.file-btn input[type="file"] {
  position: absolute; width: 1px; height: 1px;
  opacity: 0; overflow: hidden; clip: rect(0 0 0 0);
}
.file-chosen {
  display: block; margin-top: 6px; font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* DNI editable dentro de la grilla de datos del paciente */
.info-grid .is-editable { display: flex; flex-direction: column; justify-content: center; }
.info-grid .is-editable input {
  width: 100%;
  margin-top: 4px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}
.info-grid .is-editable input:focus { border-color: var(--teal); }
.patient-data-form .field-hint { margin: 14px 0 0; }
.patient-data-form .actions { margin-top: 14px; display: flex; justify-content: flex-end; }

/* ===== Agenda: navegación estable y sin recarga ===== */
/* La etiqueta de la semana tiene ancho fijo: las flechas ya no se mueven
   aunque el texto sea "20 – 26 Jul 2026" o "27 Jul – 2 Ago 2026". */
.agenda-nav strong {
  min-width: 190px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.agenda-nav .nav-btn {
  flex: none;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  font-family: inherit; font-size: 16px; line-height: 1;
  cursor: pointer;
}
@media (max-width: 480px) {
  .agenda-nav strong { min-width: 0; font-size: 13.5px; }
}

/* Estado de carga al cambiar de semana */
.appt-agenda.is-loading { opacity: .5; pointer-events: none; transition: opacity .15s ease; }

/* ===== Estado vacío (unificado y más amable) ===== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center;
  padding: 34px 20px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--soft);
  color: var(--muted);
}
.empty-state .dashicons, .empty-state .dashicons-before:before {
  font-size: 26px; width: 26px; height: 26px;
  color: var(--teal); opacity: .55; margin-bottom: 2px;
}
.empty-state strong { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.empty-state p { margin: 0; font-size: 13px; line-height: 1.6; max-width: 380px; }

/* Encuesta dentro del acordeón */
.acc-body .survey-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 18px; }
@media (max-width: 640px) { .acc-body .survey-grid { grid-template-columns: 1fr; } }


/* Punto por cada registro de peso (se ven todos los pesajes) */
.obj-dot-rec { fill: var(--white); stroke: var(--teal); stroke-width: 1.6; }

/* Celda editable (DNI): igual a las demás + botón de edición */
.info-grid .has-edit { position: relative; }
.info-grid .has-edit strong { padding-right: 30px; }
.cell-edit {
  position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border: none; background: transparent;
  border-radius: 8px; cursor: pointer;
  color: var(--muted);
  transition: color .18s ease, background .18s ease;
}
.cell-edit:hover { color: var(--teal); background: rgba(47,136,147,.1); }
.cell-edit .dashicons { font-size: 16px; width: 16px; height: 16px; }

/* Modal pequeño */
.modal.modal-sm { max-width: 420px; }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 20px;
}
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.ghost:hover { color: var(--ink); border-color: var(--muted); }

/* ===== Página de revisión (enlace de un solo uso) ===== */
.review-page {
  min-height: 100vh;
  background: linear-gradient(160deg, #eef3f2, #f8f8f5);
  padding: 40px 20px;
  display: flex; justify-content: center; align-items: flex-start;
}
.review-card {
  width: 100%; max-width: 840px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}
.review-head {
  padding: 18px 32px;
  background: #1a2c40;
  border-bottom: 1px solid #1a2c40;
  display: flex;
  align-items: center;
  gap: 14px;
}
.review-logo {
  height: 34px;
  width: auto;
  display: block;
  /* El logo se fuerza a blanco puro para contrastar sobre el azul oscuro. */
  filter: brightness(0) invert(1);
}
.review-eyebrow {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 600; color: var(--teal);
}
.review-title { margin: 28px 32px 6px; font-size: 22px; }
.review-sub { margin: 0 32px 20px; font-size: 14px; color: var(--muted); line-height: 1.65; }
.review-flag {
  margin: 0 32px 22px;
  background: rgba(216,162,113,.12);
  border-left: 3px solid var(--sand);
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 13.5px; color: var(--muted); line-height: 1.6;
}
.review-form { padding: 0 32px 32px; }
.review-sec { margin-bottom: 26px; }
.review-sec h2 {
  font-size: 13px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--teal); margin: 0 0 14px;
}
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .review-grid { grid-template-columns: 1fr; } }
.review-form label { display: block; }
.review-form label > span {
  display: block; font-size: 12.5px; color: var(--muted);
  font-weight: 500; margin-bottom: 7px;
}
.review-form input, .review-form select, .review-form textarea {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink);
  padding: 11px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--white); outline: none; resize: vertical;
}
.review-form input:focus, .review-form select:focus, .review-form textarea:focus { border-color: var(--teal); }
.review-form input:disabled { background: var(--soft); color: var(--muted); }
.review-wide { margin-top: 18px; }
.review-lbl {
  display: block; font-size: 12.5px; color: var(--muted);
  font-weight: 500; margin-bottom: 10px;
}
/* Selección múltiple: casilla y texto en la MISMA fila, alineados. */
.review-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}
/* Estas reglas ganan a `.review-form label` y `.review-form label > span`,
   que rompían la alineación de las casillas. */
.review-form .review-checks .check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  cursor: pointer;
}
.review-form .review-checks .check-row > span {
  display: inline;
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.4;
}
.review-form .review-checks .check-row input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--teal);
  cursor: pointer;
}
.review-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding-top: 22px;
}
.review-actions p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; max-width: 420px; }
.review-error {
  display: flex; align-items: flex-start; gap: 8px; margin: 0 0 4px; max-width: 520px;
  font-size: 13px; line-height: 1.6; color: #791f1f;
  background: rgba(185,74,72,.08); border: 1px solid rgba(185,74,72,.3);
  border-radius: 10px; padding: 12px 14px;
}
.review-error svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.review-notice { padding: 40px 32px; text-align: center; }
.review-notice h1 { font-size: 20px; margin: 0 0 8px; }
.review-notice p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.7; }
.review-notice a { color: var(--teal); font-weight: 500; }

/* Verificación de ubicación en el mapa (formulario de revisión) */
.review-map { margin-top: 14px; }
.review-map .field-hint { margin: 8px 0 0; }
/* Botón sin el sombreado global: en hover solo aumenta el grosor del texto. */
.review-map [data-map-verify] {
  box-shadow: none;
  transition: font-weight .12s ease;
}
.review-map [data-map-verify]:hover,
.review-map [data-map-verify]:focus-visible {
  box-shadow: none;
  transform: none;
  background: var(--surface-2);
  font-weight: 600;
}
.review-map-frame { margin-top: 14px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.review-map-frame iframe { display: block; width: 100%; height: 320px; border: 0; }

/* PWA · Crear acceso directo */
.pwa-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pwa-installed { display: inline-flex; align-items: center; gap: 6px; }
.pwa-ios-hint { margin-top: 10px; }
.pwa-ios-hint .field-hint { margin: 0; }

/* ===== Pedidos de medicamento (Recetas / Farmacia) ===== */
.order-list { display: flex; flex-direction: column; gap: 18px; }
.order-card {
  border: 1px solid var(--line); border-radius: 16px;
  padding: 22px; background: var(--white);
}
.order-card.is-active { border-color: var(--teal); }
.order-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
}
.order-top strong { display: block; font-size: 15px; }
.order-top small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Acordeón de pedidos de farmacia (uno abierto a la vez) */
.order-accordion { gap: 14px; }
.order-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.order-toggle {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 12px;
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.order-chevron { flex: none; display: inline-flex; color: var(--muted); transition: transform .18s ease; }
.order-chevron svg { width: 16px; height: 16px; }
.order-card.is-open .order-chevron { transform: rotate(90deg); }
.order-head-main { min-width: 0; }
.order-head-main strong { display: block; font-size: 15px; }
.order-head-main small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.order-qty {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--teal);
  background: rgba(47,136,147,.1); padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.order-qty svg { width: 14px; height: 14px; }
.order-collapse { display: none; }
.order-card.is-open .order-collapse { display: block; margin-top: 18px; }
/* Contenedor del bloque de estado + acción (siempre visible). Misma separación
   que tenía el bloque cuando estaba dentro del colapso; no cambia estilos. */
.order-action { margin-top: 18px; }

/* Filtro por cantidad de dosis */
.order-filter { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.order-filter-rows { display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto; min-width: 0; }
.order-filter-lbl { font-size: 13px; font-weight: 600; color: var(--ink); min-width: 52px; }
.order-filter-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.order-filter-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.order-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--white);
  font-size: 12px; color: var(--ink); cursor: pointer; user-select: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.order-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.order-chip:hover { border-color: var(--teal); }
.order-chip.is-on { background: rgba(47,136,147,.12); border-color: var(--teal); color: #0f6e56; font-weight: 600; }
.order-filter-empty {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
  background: var(--soft); border: 1px dashed var(--line); border-radius: 10px;
  padding: 12px 14px; margin: 0 0 16px;
}
.order-badge {
  font-size: 11px; font-weight: 600; padding: 5px 12px;
  border-radius: 999px; white-space: nowrap;
  background: var(--soft); color: var(--muted); border: 1px solid var(--line);
}
.order-badge.is-warn { color: var(--sand); background: rgba(216,162,113,.14); border-color: transparent; }
.order-badge.is-info { color: var(--teal); background: rgba(47,136,147,.12); border-color: transparent; }
.order-badge.is-ok { color: var(--sage); background: rgba(144,168,155,.16); border-color: transparent; }

/* Línea de tiempo de estados */
.order-steps {
  list-style: none; margin: 0 0 20px; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
}
.order-steps li { position: relative; text-align: center; padding-top: 20px; }
.order-steps li::before {
  content: ''; position: absolute; top: 6px; left: 0; right: 50%;
  height: 2px; background: var(--line);
}
.order-steps li::after {
  content: ''; position: absolute; top: 6px; left: 50%; right: 0;
  height: 2px; background: var(--line);
}
.order-steps li:first-child::before, .order-steps li:last-child::after { display: none; }
.order-steps li.is-done::before, .order-steps li.is-done::after,
.order-steps li.is-current::before { background: var(--teal); }
.order-steps .dot {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--line);
}
.order-steps li.is-done .dot { background: var(--teal); border-color: var(--teal); }
.order-steps li.is-current .dot { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(47,136,147,.15); }
.order-steps .lbl { font-size: 11.5px; color: var(--muted); }
.order-steps li.is-current .lbl { color: var(--teal); font-weight: 600; }
.order-steps li.is-done .lbl { color: var(--ink); }
@media (max-width: 560px) { .order-steps .lbl { font-size: 10px; } }

.order-info {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 18px;
  margin-bottom: 18px;
}
@media (max-width: 640px) { .order-info { grid-template-columns: 1fr; } }
.order-info > div {
  background: var(--soft); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px;
}
.order-info .span-2 { grid-column: 1 / -1; }
.order-info span {
  display: block; font-size: 10.5px; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 3px;
}
.order-info strong { font-size: 14px; font-weight: 500; word-break: break-word; }

.order-confirm {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  background: rgba(144,168,155,.1); border-radius: 12px; padding: 14px 18px;
}
.order-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.order-form > label { flex: 1 1 220px; min-width: 0; }
@media (max-width: 640px) { .order-form { flex-direction: column; align-items: stretch; } }
.order-form .actions { display: flex; justify-content: flex-end; }
@media (max-width: 640px) { .order-form .actions { width: 100%; } }
.order-log { margin-top: 16px; }
.order-log summary {
  cursor: pointer; font-size: 13px; color: var(--teal); font-weight: 500;
  list-style: none;
}
.order-log summary::-webkit-details-marker { display: none; }
.order-log .timeline { margin-top: 12px; }
.order-new h3 { margin: 0 0 4px; font-size: 16px; }

/* ===== Gráfica de proyección (con y sin Nuuma, 3 meses) ===== */
.proj-chart { width: 100%; }
.proj-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.proj-head strong { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.proj-head small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.proj-badge {
  flex: none; font-size: 10px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--sand);
  background: rgba(216,162,113,.12); border: 1px solid rgba(216,162,113,.3);
  padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}
.proj-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.proj-label { font-family: 'Poppins', sans-serif; font-size: 11px; font-weight: 600; }
.proj-tag { font-family: 'Poppins', sans-serif; font-size: 9px; font-weight: 700; fill: #fff; }
.proj-x { font-family: 'Poppins', sans-serif; font-size: 10px; font-weight: 500; fill: rgba(90,110,127,.6); }
.proj-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 10px; }
.proj-legend span { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; color: var(--muted); }
.proj-legend i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.proj-ms {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin-top: 14px; border-top: 1px solid rgba(27,45,65,.07);
}
.proj-ms > div { text-align: center; padding: 12px 6px; }
.proj-ms > div + div { border-left: 1px solid rgba(27,45,65,.07); }
.proj-ms b { display: block; font-size: 16px; font-weight: 600; color: var(--navy); }
.proj-ms small { font-size: 10px; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }

/* ===== Aviso flotante (guardado sin recargar) ===== */
.nuuma-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translate(-50%, 16px);
  z-index: 9999;
  max-width: min(90vw, 420px);
  padding: 13px 20px;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font-size: 13.5px; font-weight: 500; line-height: 1.5;
  box-shadow: 0 12px 30px -8px rgba(27,45,65,.4);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
}
.nuuma-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.nuuma-toast.is-error { background: #b3453a; }

/* Panel del expediente mientras guarda */
[data-exp-panel].is-loading { opacity: .55; pointer-events: none; transition: opacity .15s ease; }

/* ===== Seguimiento unificado (bloques 1–4 = un solo control) ===== */
.followup-intro { margin: 0 0 14px; }
.followup-save {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-top: 18px; padding: 18px 20px;
  background: rgba(47,136,147,.06);
  border: 1px solid rgba(47,136,147,.2);
  border-radius: 14px;
}
.followup-save p { margin: 0; font-size: 13px; color: var(--muted); }

/* Constructor de ítems */
.ib-add { display: flex; gap: 10px; align-items: center; }
.ib-add input {
  flex: 1; min-width: 0;
  font-family: inherit; font-size: 14px; color: var(--ink);
  padding: 11px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--white); outline: none;
}
.ib-add input:focus { border-color: var(--teal); }
.ib-add .btn { flex: none; }
.ib-empty { margin: 12px 0 0; font-size: 13px; color: var(--muted); font-style: italic; }
.item-builder .numbered-list li .icon-btn { font-size: 18px; line-height: 1; }

/* ===== Historial de seguimiento: línea de tiempo numerada y colapsable ===== */
.fu-rail { position: relative; padding-left: 40px; }
.fu-rail::before {
  content: ''; position: absolute; left: 15px; top: 10px; bottom: 10px;
  width: 2px; background: var(--line);
}
.fu-item {
  position: relative;
  margin-bottom: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.fu-item:last-child { margin-bottom: 0; }
.fu-item[open] { border-color: var(--teal); }
.fu-dot {
  position: absolute; left: -40px; top: 12px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--teal); color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 600;
}
.fu-item[open] .fu-dot { background: var(--teal); color: #fff; }
.fu-item > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
}
.fu-item > summary::-webkit-details-marker { display: none; }
.fu-meta { flex: 1; min-width: 0; }
.fu-meta strong { display: block; font-size: 13.5px; color: var(--ink); }
.fu-meta small { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.fu-chip {
  flex: none; font-size: 10.5px; font-weight: 600; white-space: nowrap;
  color: var(--teal); background: rgba(47,136,147,.1);
  padding: 3px 9px; border-radius: 999px;
}
.fu-chev { flex: none; color: var(--muted); transition: transform .2s ease; }
.fu-item[open] .fu-chev { transform: rotate(180deg); }
.fu-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); margin-top: 0; padding-top: 14px; }
.fu-soap { margin: 0; font-size: 14px; line-height: 1.7; }
.fu-group { margin-top: 12px; }
.fu-group > span {
  display: block; font-size: 11px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--teal); font-weight: 600; margin-bottom: 5px;
}
.fu-group ol { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.7; }

/* ===== Ruta esperada del tratamiento (vista clínica) ===== */
.ruta-chart { width: 100%; }

/* Encabezado: con aire, sin líneas pegadas */
.ruta-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.ruta-head h3 {
  margin: 0 0 8px;
  font-size: 15px; font-weight: 600; color: var(--ink);
  line-height: 1.35;
}
.ruta-head p {
  margin: 0;
  font-size: 14px; font-weight: 500; color: var(--ink);
  line-height: 1.6;
}
.ruta-head .ruta-sub {
  margin-top: 6px;
  font-size: 12.5px; font-weight: 400; color: var(--muted);
}
.ruta-badge {
  flex: none; white-space: nowrap;
  font-size: 11.5px; font-weight: 600;
  color: var(--teal); background: rgba(47,136,147,.1);
  padding: 6px 13px; border-radius: 999px;
}

.ruta-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.ruta-grid { stroke: rgba(27,45,65,.05); stroke-width: 1; }
.ruta-banda { stroke: none; }
.ruta-borde { fill: none; stroke: var(--sky); stroke-width: 1; stroke-dasharray: 4 4; opacity: .7; }
.ruta-linea { fill: none; stroke: var(--teal); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.ruta-hito { fill: var(--white); stroke: var(--teal); stroke-width: 2; }
.ruta-ini { fill: var(--navy); }
.ruta-fin { fill: var(--sage); stroke: var(--white); stroke-width: 2; }
.ruta-val { font-family: 'Poppins', sans-serif; font-size: 11.5px; font-weight: 600; fill: var(--navy); }
.ruta-val.is-goal { fill: var(--sage); }
.ruta-x { font-family: 'Poppins', sans-serif; font-size: 10.5px; font-weight: 500; fill: var(--muted); }

/* Leyenda y nota: el margen queda explicado */
.ruta-legend {
  display: flex; flex-wrap: wrap; gap: 10px 22px;
  justify-content: center;
  margin-top: 16px;
}
.ruta-legend span {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500; color: var(--muted);
}
.ruta-legend i { flex: none; width: 16px; height: 10px; border-radius: 3px; }
.ruta-legend .l-line { height: 3px; background: var(--teal); border-radius: 2px; }
.ruta-legend .l-band {
  background: rgba(158,203,221,.35);
  border: 1px dashed var(--sky);
}
.ruta-note {
  margin: 12px 0 0;
  padding: 12px 16px;
  background: var(--soft);
  border-left: 3px solid var(--sky);
  border-radius: 8px;
  font-size: 12.5px; line-height: 1.65; color: var(--muted);
}

/* Hitos: más aire vertical entre etiqueta y cifra */
.ruta-hitos {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}
@media (max-width: 640px) { .ruta-hitos { grid-template-columns: 1fr 1fr; } }
.ruta-hitos > div {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
}
.ruta-hitos small {
  display: block;
  font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
  margin-bottom: 8px;
}
.ruta-hitos b { display: block; font-size: 17px; font-weight: 600; line-height: 1.2; }
.ruta-hitos b.is-teal { color: var(--teal); }

/* =========================================================
   REFINAMIENTOS VISUALES
   ========================================================= */

/* 1) Valores ya cargados: un punto menos, sin perder jerarquía */
.info-grid strong { font-size: 14px; }
.card .v, .survey-v { font-size: 13.5px; }

/* 2) Botones contiguos: mismo ancho */
.modal-actions .btn,
.followup-save .btn,
.order-confirm .btn { min-width: 150px; justify-content: center; }
.modal-actions { gap: 12px; }

/* 3) Campos de una misma fila: misma altura */
.form-grid select,
.form-grid input:not([type="checkbox"]):not([type="file"]) {
  height: 46px;
}
.form-grid .file-field { display: flex; flex-direction: column; }
.form-grid .file-drop {
  height: 46px;
  min-height: 46px;
  padding: 0 12px;
  gap: 10px;
  overflow: hidden;
}
.form-grid .file-ico { width: 28px; height: 28px; }
.form-grid .file-txt strong { font-size: 13px; line-height: 1.25; }
.form-grid .file-txt small { font-size: 10.5px; line-height: 1.25; margin-top: 2px; }
/* La etiqueta del file-field y la del <label> normal deben ocupar lo mismo
   para que ambos campos arranquen y terminen a la misma altura. */
.form-grid .file-label { margin-bottom: 7px; }

/* 4) Botón de acción: aire respecto a la tarjeta siguiente */
.form-grid .actions,
.compact-form .actions { margin: 6px 0 18px; }
.acc-body .mini-list,
.acc-body .empty-state { margin-top: 18px; }

/* 5) Campo corto con contexto (presión arterial y similares) */
.field-short { max-width: 100%; }
.field-pair {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  align-items: end;
}
@media (max-width: 640px) { .field-pair { grid-template-columns: 1fr; } }
.field-pair .field-note {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  padding-bottom: 12px;
}

/* ===== Fila de mediciones (evaluaciones iniciales) ===== */
.vitals-box {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.vitals-box.is-nut { border-color: rgba(144,168,155,.4); }
.vitals-t {
  display: block;
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--teal); font-weight: 700;
  margin-bottom: 12px;
}
.vitals-box.is-nut .vitals-t { color: var(--sage); }
.vitals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.vitals label > span {
  font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  font-weight: 600; color: var(--muted);
  margin-bottom: 6px;
}
.vitals input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}
.vitals input:focus { border-color: var(--teal); }
.vitals input[readonly] { background: rgba(231,229,221,.35); color: var(--muted); }
.vitals-note { margin: 12px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }

@media (max-width: 900px) { .vitals { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .vitals { grid-template-columns: minmax(0, 1fr); } }

/* =========================================================
   BLINDAJE RESPONSIVE (auditoría completa)
   ========================================================= */

/* 1) Nada desborda horizontalmente.
   Se usa `clip` en vez de `hidden`: `hidden` crea un contenedor de scroll y
   ANULA el position:sticky del sidebar (se rompía al hacer scroll). */
html, body { max-width: 100%; }
body { overflow-x: clip; }
@supports not (overflow: clip) {
  /* Respaldo para navegadores viejos: se limita el ancho sin tocar el scroll. */
  body { overflow-x: visible; }
}
img, svg, video, canvas { max-width: 100%; height: auto; }
input, select, textarea, button { max-width: 100%; }

/* 2) Textos largos (correos, URLs, nombres de archivo) no rompen el layout */
.info-grid strong, .survey-v, .card .v, .mini-item strong,
.order-info strong, .fu-meta strong, .upload-info small {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 3) Todas las grillas: las columnas pueden encogerse (minmax 0) */
.form-grid, .info-grid, .review-grid, .g2, .grid-2, .obj-stats,
.ruta-hitos, .proj-ms, .order-info, .survey-grid, .stats {
  min-width: 0;
}
.form-grid > *, .info-grid > *, .review-grid > *,
.order-info > *, .survey-grid > *, .vitals > * { min-width: 0; }

/* 4) Grids detectados sin protección */
.meal-day { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.plan-timeline .tl-item { grid-template-columns: minmax(0, 74px) minmax(0, 1fr); }
.order-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.proj-ms { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ruta-hitos { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 5) Anchos fijos -> flexibles */
.role-select { width: 100%; max-width: 220px; }
.upload-prev { width: 104px; max-width: 30vw; }
.login-logo { max-width: 60vw; }

/* 6) Tablas: scroll horizontal en vez de romper la página */
.table-wrap, .table, table { max-width: 100%; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; }

/* 7) Ajustes por tamaño de pantalla */
@media (max-width: 900px) {
  .ruta-hitos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-grid, .order-info { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .split, .profile-hero + .split { grid-template-columns: minmax(0, 1fr); }
  .expedient-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .expedient-tabs button { white-space: nowrap; }
  .plan-timeline .tl-item { grid-template-columns: minmax(0, 60px) minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .info-grid, .form-grid, .survey-grid, .order-form,
  .g2, .review-checks, .obj-stats { grid-template-columns: minmax(0, 1fr); }
  .followup-save, .order-confirm, .review-actions, .ruta-head {
    flex-direction: column; align-items: stretch;
  }
  .followup-save .btn, .order-confirm .btn, .review-actions .btn { width: 100%; }
  .ib-add { flex-direction: column; align-items: stretch; }
  .ib-add .btn { width: 100%; justify-content: center; }
  .acc-item > summary, .fu-item > summary { padding: 14px; gap: 10px; }
  .acc-badge { font-size: 10px; padding: 3px 8px; }
  .fu-rail { padding-left: 32px; }
  .fu-dot { left: -32px; width: 26px; height: 26px; font-size: 11px; }
  .order-steps .lbl { font-size: 9.5px; }
  .modal, .modal.modal-sm { width: calc(100vw - 24px); max-width: none; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
}
@media (max-width: 480px) {
  .ruta-hitos, .proj-ms, .stats { grid-template-columns: minmax(0, 1fr); }
  .order-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
  .order-steps li::before, .order-steps li::after { display: none; }
  .upload-row { flex-direction: column; align-items: flex-start; }
  .upload-prev { width: 100%; max-width: 160px; }
  .file-drop { flex-wrap: wrap; }
  .file-cta { width: 100%; text-align: center; }
}

/* =========================================================
   CABECERA DEL EXPEDIENTE (bandas) + RUTA ESPERADA
   ========================================================= */
.exp-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 20px;
}
.exp-band { min-width: 0; }

/* Cabecera a dos columnas: identidad + métricas a la izquierda, gráfica a la derecha */
.exp-split {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  align-items: stretch;
}
.exp-main {
  padding: 22px 24px;
  background: linear-gradient(100deg, rgba(47,136,147,.07), rgba(158,203,221,.10));
  border-right: 1px solid var(--line);
  min-width: 0;
}
.exp-graph { padding: 20px 24px 22px; min-width: 0; }

/* Banda 1: identidad */
.exp-id {
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: nowrap;
}
.exp-id-txt { flex: 1; min-width: 0; }
.exp-id-txt h2 { margin: 3px 0 0; font-size: 21px; line-height: 1.2; }

/* Línea de datos en fila, con aire respecto al título y entre ítems */
.exp-meta-row {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 18px;
  margin-top: 10px;
  font-size: 12.5px; color: var(--muted);
}
.exp-meta-row .is-warn { color: var(--sand); font-weight: 600; }

/* Cifra principal: peso actual + subtítulo */
.exp-hero {
  display: flex; align-items: baseline; gap: 8px;
  margin-top: 18px;
}
.exp-hero-num { font-size: 30px; line-height: 1; font-weight: 600; color: var(--ink); }
.exp-hero-sub { font-size: 13px; color: var(--muted); }

/* Barra de avance inicial → objetivo */
.exp-progress { margin-top: 12px; }
.exp-progress-bar {
  height: 8px; border-radius: 999px;
  background: rgba(47,136,147,.14); overflow: hidden;
}
.exp-progress-bar span {
  display: block; height: 100%;
  background: var(--teal); border-radius: 999px;
  min-width: 8px;
}
.exp-progress-scale {
  display: flex; justify-content: space-between;
  margin-top: 6px; font-size: 11px; color: var(--muted);
}
.exp-id .consideraciones { margin-top: 12px; font-size: 13px; line-height: 1.6; }

/* Banda 2: cifras (obsoleta, se conserva por compatibilidad) */
.exp-kpis {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}
.exp-kpis > div { padding: 16px 20px; border-right: 1px solid var(--line); }
.exp-kpis > div:last-child { border-right: none; }
.exp-kpis small {
  display: block; font-size: 9.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); font-weight: 700;
  margin-bottom: 7px;
}
.exp-kpis b { display: block; font-size: 19px; font-weight: 600; line-height: 1.2; }
.exp-kpis b.is-teal { color: var(--teal); }

/* Banda 3: gráfica */
.exp-chart { padding: 22px 26px 24px; }

/* --- Ruta esperada --- */
.ruta-head { margin-bottom: 10px; }
.ruta-head h3 { margin: 0 0 5px; font-size: 15px; font-weight: 600; }
.ruta-head p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* Nuevo lienzo con ejes (escalado uniforme) */
.ruta-plot2 { display: flex; justify-content: center; margin-top: 6px; }
.ruta-plot2 svg { width: 100%; max-width: 460px; height: auto; display: block; overflow: visible; }
.ruta-grid { stroke: rgba(27,45,65,.06); stroke-width: 1; }
.ruta-axisln { stroke: var(--line); stroke-width: 1; }
.ruta-yl { font-size: 13px; font-weight: 500; fill: var(--muted); }
.ruta-xl { font-size: 13px; font-weight: 500; fill: var(--muted); }
.ruta-linea { fill: none; stroke: var(--teal); stroke-width: 2.5px; stroke-linecap: round; stroke-linejoin: round; }
.ruta-borde { fill: none; stroke: var(--sky); stroke-width: 1px; stroke-dasharray: 4 4; opacity: .75; }
.ruta-hito { fill: var(--white); stroke: var(--teal); stroke-width: 2; }
.ruta-hito.ruta-ini { fill: var(--navy); stroke: var(--navy); }
.ruta-hito.ruta-fin { fill: var(--sage); stroke: var(--white); }

.ruta-legend { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center; margin-top: 12px; }
.ruta-legend span { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.ruta-legend i { flex: none; width: 16px; height: 10px; border-radius: 3px; }
.ruta-legend .l-line { height: 3px; background: var(--teal); border-radius: 2px; }
.ruta-legend .l-band { background: rgba(158,203,221,.35); border: 1px dashed var(--sky); }
.ruta-note {
  margin: 12px 0 0; padding: 12px 16px;
  background: var(--soft); border-left: 3px solid var(--sky);
  border-radius: 8px; font-size: 12.5px; line-height: 1.65; color: var(--muted);
}

/* Responsive */
@media (max-width: 900px) {
  .exp-split { grid-template-columns: minmax(0, 1fr); }
  .exp-main { border-right: none; border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .exp-main, .exp-graph { padding: 18px; }
  .exp-id-txt h2 { font-size: 19px; }
  .exp-id { gap: 12px; }
}

/* Campo autogenerado (Nro HC) */
input[readonly] { background: rgba(231, 229, 221, .35); color: var(--muted); cursor: default; }

/* ===== Consentimiento informado (documento + firma) ===== */
.consent-done {
  display: flex; align-items: center; gap: 12px;
  background: rgba(144,168,155,.12);
  border: 1px solid rgba(144,168,155,.35);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.consent-ok {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  background: var(--sage); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.consent-done strong { display: block; font-size: 14px; }
.consent-done small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.modal.modal-lg { max-width: 720px; width: min(720px, calc(100vw - 32px)); }

/* El documento, con scroll propio */
.consent-doc {
  max-height: 46vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  padding: 20px;
  margin-bottom: 18px;
}
.consent-doc-head {
  text-align: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.consent-doc-head strong { display: block; font-size: 14px; letter-spacing: .06em; }
.consent-doc-head span { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }

.consent-data {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px; margin-bottom: 18px;
}
@media (max-width: 560px) { .consent-data { grid-template-columns: minmax(0, 1fr); } }
.consent-data > div {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 12px;
}
.consent-data span {
  display: block; font-size: 9.5px; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 3px;
}
.consent-data strong { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }

.consent-text p { margin: 0 0 12px; font-size: 13px; line-height: 1.7; color: var(--ink); }
.consent-text p:last-child { margin-bottom: 0; }

.consent-rec {
  margin-top: 16px; padding: 12px 14px;
  background: var(--white); border: 1px solid var(--line);
  border-left: 3px solid var(--sky); border-radius: 8px;
}
.consent-rec-t { display: block; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--teal); font-weight: 700; margin-bottom: 4px; }
.consent-rec p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

.consent-form .check-row { align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.consent-form .check-row input { margin-top: 2px; }
.consent-accept {
  background: rgba(47,136,147,.06);
  border: 1px solid rgba(47,136,147,.25);
  border-radius: 10px;
  padding: 12px 14px;
}
.consent-form .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ── Historia clínica: secciones, cálculos y checklists ── */
.nuuma-story-form .form-section{
  grid-column:1 / -1;
  font-size:14px; font-weight:600; color:var(--ink);
  margin:18px 0 2px; padding-bottom:6px;
  border-bottom:1px solid var(--line);
}
.nuuma-story-form .form-section:first-of-type{margin-top:4px;}
.nuuma-story-form .field-label{
  display:block; font-size:13px; color:var(--muted); margin-bottom:8px;
}
.nuuma-story-form .checklist,
.nuuma-wizard .checklist{
  display:flex; flex-wrap:wrap; gap:8px 18px;
}
.nuuma-story-form .checklist label,
.nuuma-wizard .checklist label{
  display:flex; align-items:center; gap:6px;
  font-size:13px; color:var(--ink); margin:0; font-weight:400;
}
.nuuma-story-form .checklist input,
.nuuma-wizard .checklist input{width:auto; flex:0 0 auto;}
.nuuma-story-form .computed-row,
.nuuma-wizard .computed-row{
  grid-column:1 / -1;
  display:flex; gap:24px; flex-wrap:wrap;
  padding:12px 16px; background:var(--soft);
  border-radius:8px; margin:4px 0;
}
.nuuma-story-form .computed-row .item,
.nuuma-wizard .computed-row .item{font-size:13px; color:var(--muted);}
.nuuma-story-form .computed-row .item b,
.nuuma-wizard .computed-row .item b{
  display:block; font-size:18px; color:var(--ink); font-weight:600; margin-top:2px;
}
.nuuma-wizard .field-label{ display:block; font-size:13px; color:var(--muted); margin-bottom:8px; }
.badge-auto{
  font-size:11px; font-weight:500; padding:2px 9px;
  border-radius:20px; background:var(--soft); color:var(--muted);
  vertical-align:middle;
}

/* ============================================================
   MODO APP MÓVIL · Tab bar inferior (estilo APK)
   Reutiliza .side-nav como barra de navegación inferior fija.
   Se activa en ≤860px y anula el drawer lateral anterior.
   ============================================================ */
@media (max-width: 860px) {
  /* El shell pasa a columna única y deja espacio para la barra inferior. */
  .nuuma-app {
    grid-template-columns: 1fr;
  }

  /* La sidebar deja de ser panel lateral y se ancla al borde inferior. */
  .sidebar {
    position: fixed;
    inset: auto 0 0 0;         /* pegada al borde inferior */
    top: auto;
    height: auto;
    width: 100%;
    flex-direction: row;
    gap: 0;
    padding: 0;
    transform: none !important; /* anula el translateX del drawer viejo */
    background: var(--navy);
    color: #fff;
    border-top: none;
    box-shadow: 0 -6px 24px rgba(27, 45, 65, 0.18);
    z-index: 80;
    /* respeta el notch/gesto inferior en iOS */
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* Ocultamos logo y footer: no caben en una tab bar. */
  .sidebar .brand,
  .sidebar .side-footer {
    display: none;
  }

  /* La nav se vuelve una fila de pestañas repartidas por igual. */
  .side-nav {
    display: flex;
    width: 100%;
    gap: 0;
    /* si hay muchas secciones, permite scroll horizontal suave */
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* aire lateral para que la primera y última tab no queden pegadas al borde */
    padding: 0 calc(12px + env(safe-area-inset-right, 0px)) 0 calc(12px + env(safe-area-inset-left, 0px));
  }
  .side-nav::-webkit-scrollbar { display: none; }

  /* Cada tab: ícono arriba, etiqueta pequeña debajo. */
  .side-nav a {
    flex: 1 1 0;
    min-width: 60px;
    min-height: 58px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 8px 3px;
    border-radius: 0;
    color: rgba(255, 255, 255, 0.58);
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1.1;
    text-align: center;
    transform: none !important;
    position: relative;
  }

  .side-nav a svg,
  .side-nav a img {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
  }

  /* Los íconos del tema son dashicons (webfont en un <span>): se escalan por font-size. */
  .side-nav a .dashicons {
    width: 24px;
    height: 24px;
    font-size: 24px;
    line-height: 24px;
    flex: 0 0 auto;
  }

  /* En la tab bar móvil se muestra la etiqueta corta y se oculta la completa. */
  .side-nav a .nav-label-full {
    display: none;
  }
  .side-nav a .nav-label-short {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 62px;
    word-break: break-word;
    hyphens: auto;
  }

  /* Estado activo estilo C2: teal claro sobre una cápsula tenue. */
  .side-nav a:hover {
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    transform: none !important;
  }
  .side-nav a.is-active {
    color: #5dcaa5;
    background: rgba(47, 136, 147, 0.26);
    border-radius: 12px;
    margin: 6px 2px;
    min-height: 46px;
    transform: none !important;
  }
  .side-nav a.is-active::before {
    content: none;
  }

  /* En móvil, las secciones "extra" desaparecen de la barra (viven en la hoja "Más"). */
  .side-nav a.nav-extra {
    display: none;
  }

  /* El botón "Más" se ve y se comporta como una tab más. */
  .nav-more-btn {
    display: flex;
    flex: 1 1 0;
    min-width: 60px;
    min-height: 58px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 3px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.58);
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1.1;
    cursor: pointer;
  }
  .nav-more-btn .dashicons {
    width: 24px;
    height: 24px;
    font-size: 24px;
    line-height: 24px;
  }
  .nav-more-btn.is-active {
    color: #5dcaa5;
    background: rgba(47, 136, 147, 0.26);
    border-radius: 12px;
    margin: 6px 2px;
    min-height: 46px;
  }

  /* Hoja emergente con las secciones extra. */
  .nav-more-sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 90;
  }
  .nav-more-sheet[hidden] {
    display: none;
  }
  .nav-more-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(27, 45, 65, 0.45);
    animation: nuuma-fade 0.2s ease;
  }
  .nav-more-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    border-radius: 18px 18px 0 0;
    padding: 14px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -10px 30px rgba(27, 45, 65, 0.22);
    animation: nuuma-sheet-up 0.24s ease;
  }
  .nav-more-handle {
    width: 38px;
    height: 4px;
    border-radius: 2px;
    background: var(--line);
    margin: 0 auto 14px;
  }
  .nav-more-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 12px;
  }
  .nav-more-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  /* Se ajusta el número de columnas al total para no dejar huecos vacíos:
     2 items → 2 col, 4 items → 2x2, 1 item → 1 col. 3/5/6 quedan en 3 columnas. */
  .nav-more-grid.nav-more-count-1 {
    grid-template-columns: 1fr;
  }
  .nav-more-grid.nav-more-count-2,
  .nav-more-grid.nav-more-count-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .nav-more-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 6px;
    border: 0.5px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    font-size: 11px;
    text-align: center;
  }
  .nav-more-item .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
    color: var(--teal);
  }
  .nav-more-item.is-active {
    border-color: var(--teal);
    background: rgba(47, 136, 147, 0.08);
  }

  /* Topbar en móvil: header navy de marca con acento teal (estilo "C2").
     Fondo navy SÓLIDO con degradé sutil y línea teal inferior que lo une a la marca. */
  .topbar {
    min-height: 62px;
    padding: 12px 16px;
    background: linear-gradient(120deg, var(--navy), #22405a);
    border-bottom: 2px solid var(--teal);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .topbar span {
    color: rgba(255, 255, 255, 0.6);
    opacity: 1;
  }
  .topbar h1 {
    color: #fff;
  }
  .user-pill div {
    display: none;
  }
  /* El avatar del usuario en teal, redondo, sobre el header oscuro.
     margin-left:auto lo empuja a la derecha, junto al botón de salir,
     en vez de quedar flotando al centro. */
  .topbar .user-pill {
    border: none;
    background: transparent;
    padding: 0;
    margin-left: auto;
  }
  .topbar .user-pill > span {
    background: var(--teal);
    color: #fff;
    border-radius: 50%;
  }

  /* Botón de cerrar sesión accesible desde la topbar en móvil (adaptado al fondo navy). */
  .topbar-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    margin-left: 8px;
  }
  .topbar-logout .dashicons,
  .topbar-logout .dashicons::before {
    color: #fff;
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 20px;
  }

  /* El contenido no debe quedar tapado por la barra inferior. */
  .workspace {
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  }
}

/* En pantallas muy angostas, prioriza el ícono y reduce texto. */
@media (max-width: 380px) {
  .side-nav a {
    font-size: 9.5px;
    min-width: 56px;
  }
  .side-nav a span {
    max-width: 60px;
  }
}

/* ============================================================
   WIZARD de Historia clínica (pasos, como el HTML de referencia)
   ============================================================ */
.nuuma-wizard { display: block; }

/* Layout de dos columnas: pasos a la izquierda, formulario a la derecha. */
.wizard-layout { display: flex; gap: 24px; align-items: flex-start; }
.wizard-panels { flex: 1; min-width: 0; }

/* Navegación de pasos: columna vertical (escritorio). */
.wizard-steps {
  display: flex; flex-direction: column; gap: 4px;
  width: 210px; flex-shrink: 0;
  position: sticky; top: 96px;
}
.wizard-steps button {
  display: flex; align-items: center; gap: 11px; width: 100%;
  background: transparent; border: none; border-radius: 10px;
  padding: 10px 12px; cursor: pointer; font-family: inherit; text-align: left;
  transition: .15s;
}
.wizard-steps button:hover { background: var(--soft); }
.wizard-steps button .num {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--soft); color: var(--muted); font-size: 13px; font-weight: 600;
  transition: .15s;
}
.wizard-steps button .lbl { display: flex; flex-direction: column; font-size: 13px; font-weight: 500; color: var(--ink); line-height: 1.25; }
.wizard-steps button .lbl small { font-size: 11px; font-weight: 400; color: var(--muted); }
.wizard-steps button.is-active { background: rgba(47,136,147,.1); }
.wizard-steps button.is-active .num { background: #fff; border: 2px solid var(--teal); color: var(--teal); }
.wizard-steps button.is-active .lbl { color: var(--teal); font-weight: 600; }
.wizard-steps button.is-done .num { background: var(--teal); color: #fff; }

/* Paneles: solo el activo se ve */
.wizard-panel { display: none; }
.wizard-panel.is-active { display: block; animation: nuuma-soft-in .25s ease; }

.wizard-note {
  background: rgba(158,203,221,.16); border: 1px solid rgba(158,203,221,.4);
  border-radius: 10px; padding: 10px 14px; font-size: 13px; color: #2a6070; margin-bottom: 16px;
}

/* Fieldset que envuelve una sección de otro rol: sin estilo propio de fieldset;
   al estar deshabilitado se atenúa e ignora clics para dejar solo lectura. */
.wizard-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.wizard-fieldset[disabled] { opacity: .7; }
.wizard-fieldset[disabled] .wizard-card { background: var(--soft); }

/* Aviso de sección bloqueada (solo lectura para el rol actual) */
.section-lock-note {
  display: flex; align-items: center; gap: 8px;
  background: rgba(216,162,113,.12); border: 1px solid rgba(216,162,113,.35);
  border-radius: 10px; padding: 10px 14px; margin: 0 0 16px;
  font-size: 13px; color: #8a5a2b;
}
.section-lock-note .dashicons { font-size: 16px; width: 16px; height: 16px; }

.wizard-card {
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 22px; margin-bottom: 16px;
}
.wizard-card h3 {
  font-size: 15px; font-weight: 600; margin: 0 0 16px;
  display: flex; align-items: center; gap: 8px;
}
.wizard-card .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.wizard-card .form-grid.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wizard-card .form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .wizard-card .form-grid,
  .wizard-card .form-grid.form-grid-3 { grid-template-columns: 1fr; }
}

.wizard-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 4px;
}
.wizard-nav form { margin: 0; }

/* ── En móvil/tablet: los pasos vuelven a una tira horizontal arriba ── */
@media (max-width: 860px) {
  .wizard-layout { flex-direction: column; gap: 0; }
  .wizard-steps {
    flex-direction: row; width: 100%; position: static;
    overflow-x: auto; scrollbar-width: none;
    gap: 8px; margin-bottom: 20px; padding-bottom: 4px;
  }
  .wizard-steps::-webkit-scrollbar { display: none; }
  .wizard-steps button {
    flex: 0 0 auto; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
  }
  .wizard-steps button.is-active { border-color: var(--teal); }
  .wizard-panels { width: 100%; }
}

/* Banner de señal de alarma en el seguimiento médico (rojo). */
.alarm-banner {
  display: flex; align-items: center; gap: 8px;
  background: #fcebeb; color: #791f1f; border: 1px solid #e24b4a;
  border-radius: 8px; padding: 11px 14px; font-size: 13px; font-weight: 500;
  margin-top: 12px;
}
.alarm-banner[hidden] { display: none; }
.alarm-banner .dashicons { color: #b94a48; }

/* ── Plan nutricional (HTML 5): barra de macros y filas de comida ── */
.nuuma-plan-wizard .macro-bar {
  display: flex; height: 10px; border-radius: 6px; overflow: hidden;
  margin: 10px 0 12px; background: var(--soft);
}
.nuuma-plan-wizard .macro-bar span { height: 100%; }
.nuuma-plan-wizard .macro-legend {
  display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted);
}
.nuuma-plan-wizard .macro-legend .dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px;
}
.nuuma-plan-wizard .macro-legend b { color: var(--ink); font-weight: 600; }

.nuuma-plan-wizard .meal-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.nuuma-plan-wizard .meal-row:first-of-type { border-top: none; }
.nuuma-plan-wizard .meal-row .name { width: 110px; flex-shrink: 0; font-size: 13.5px; font-weight: 500; }
.nuuma-plan-wizard .meal-row input { flex: 1; }
.nuuma-plan-wizard .meal-row .kcal { width: 90px; flex-shrink: 0; }
@media (max-width: 560px) {
  .nuuma-plan-wizard .meal-row { flex-wrap: wrap; }
  .nuuma-plan-wizard .meal-row .name { width: 100%; }
  .nuuma-plan-wizard .meal-row .kcal { width: 90px; }
}

/* ── Prescripción farmacológica (HTML 4): filas de titulación con rango ── */
.rx-titration { display: flex; flex-direction: column; gap: 10px; }
.rx-tit-row {
  display: grid; grid-template-columns: 1fr 168px 1fr 36px; gap: 10px; align-items: center;
}
.rx-tit-row .daterange { margin: 0; }
.rx-tit-row .daterange .field-lbl { display: none; }
.rx-tit-row .rx-tit-dose { align-self: center; padding-right: 30px; text-overflow: ellipsis; }
.rx-tit-row .rx-tit-note { align-self: center; }

/* Fases ya emitidas a farmacia: bloque de solo lectura. */
.rx-tit-locked {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  margin-bottom: 14px; background: rgba(144,168,155,.06);
}
.rx-tit-locked-title {
  display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  color: var(--muted); margin-bottom: 10px;
}
.rx-tit-locked-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 7px 0; border-top: 1px solid var(--line);
}
.rx-tit-locked-row:first-of-type { border-top: 0; }
.rx-tit-locked-dose { font-weight: 600; }
.rx-tit-locked-range { font-size: 13px; color: var(--muted); }
.rx-tit-locked-note { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.rx-tit-locked-note .dashicons { font-size: 16px; width: 16px; height: 16px; }

/* Nota de ajuste de dosis en el esquema que ve farmacia. */
.titration-nota {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--muted);
}
.titration-nota .dashicons { font-size: 15px; width: 15px; height: 15px; }
/* Fila con fechas solapadas: se resalta el campo de rango en rojo. */
.rx-tit-row.is-overlap .daterange-field {
  border-color: #e24b4a; background: #fcebeb;
}
.rx-tit-row.is-overlap .daterange-field .daterange-text { color: #791f1f; }
.rx-tit-row.is-overlap .daterange-field .dashicons { color: #b94a48; }
.rx-tit-del {
  width: 34px; height: 38px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--white); color: var(--muted); cursor: pointer;
}
.rx-tit-del:hover { border-color: var(--danger); color: var(--danger); }
@media (max-width: 560px) {
  .rx-tit-row { grid-template-columns: 1fr 1fr 34px; gap: 8px; }
  .rx-tit-row .rx-tit-note { grid-column: 1 / -1; }
}

/* ── Selector de rango de fechas (calendario tipo aeropuerto) ── */
.daterange { position: relative; }
.daterange .field-lbl { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.daterange-field {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); background: var(--white); border-radius: 10px;
  padding: 11px 14px; cursor: pointer; transition: border-color .15s;
}
.daterange-field:hover, .daterange-field:focus { border-color: var(--teal); outline: none; }
.daterange-field .dashicons { color: var(--teal); font-size: 19px; width: 19px; height: 19px; }
.daterange-text { flex: 1; font-size: 14px; color: var(--muted); }
.daterange-text.has-value { color: var(--ink); }
.daterange-days {
  display: none; font-size: 12px; font-weight: 500; color: #0f6e56;
  background: rgba(47,136,147,.12); padding: 3px 10px; border-radius: 20px;
}
.daterange-cal {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  border: 1px solid var(--line); background: var(--white);
  border-radius: 12px; padding: 16px; box-shadow: 0 8px 24px rgba(27,45,65,.14);
  z-index: 40; max-width: 340px;
}
.daterange-cal[hidden] { display: none; }
.daterange-cal.is-flip-up { top: auto; bottom: calc(100% + 6px); }
.daterange-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.daterange-nav strong { font-size: 14px; }
.daterange-nav button { border: none; background: transparent; font-size: 20px; cursor: pointer; color: var(--muted); padding: 0 6px; }
.daterange-dow { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; font-size: 10px; color: var(--muted); text-align: center; margin-bottom: 6px; }
.daterange-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.dr-day {
  border: none; background: transparent; color: var(--ink); font: inherit; font-size: 13px;
  padding: 8px 0; border-radius: 6px; cursor: pointer;
}
.dr-day:hover { background: var(--soft); }
.dr-day.in-range { background: rgba(47,136,147,.14); border-radius: 0; }
.dr-day.is-end { background: var(--teal); color: #fff; border-radius: 8px; }
.daterange-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.daterange-foot button:first-child { border: none; background: transparent; font-size: 13px; color: var(--muted); cursor: pointer; }
.daterange-foot .btn.primary { font-size: 13px; padding: 7px 18px; }

/* ── Laboratorio · Tomas a domicilio ── */
.lab-orders { display: grid; gap: 12px; }
.lab-order-card {
  border: 1px solid var(--line); border-left: 4px solid var(--sand); border-radius: 12px;
  background: var(--white); padding: 16px 18px;
}
.lab-order-card.estado-muestra_tomada { border-left-color: var(--sky); }
.lab-order-card.estado-resultados_subidos { border-left-color: var(--sage); }
.lab-order-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.lab-order-head strong { font-size: 15px; }

/* Acción de estado dentro de la cabecera, junto a fecha y WhatsApp (A1) */
.lab-order-action { display: inline-flex; align-items: center; }
.lab-order-action .lab-order-foot { margin: 0; padding: 0; border: 0; }
.lab-order-action form { margin: 0; }

.lab-filter-empty {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
  background: var(--soft); border: 1px dashed var(--line); border-radius: 10px;
  padding: 12px 14px; margin: 0 0 16px;
}

/* Acordeón: cabecera clicable + panel colapsable (uno abierto a la vez) */
.lab-order-toggle {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.lab-order-chevron { flex: none; display: inline-flex; color: var(--muted); transition: transform .18s ease; }
.lab-order-chevron svg { width: 16px; height: 16px; }
.lab-order-card.is-open .lab-order-chevron { transform: rotate(90deg); }
.lab-order-name { display: inline-flex; align-items: center; min-width: 0; flex-wrap: wrap; }
.lab-order-when {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--muted); white-space: nowrap; padding-left: 10px;
}
.lab-order-when svg { width: 13px; height: 13px; }
.lab-order-collapse { display: none; }
.lab-order-card.is-open .lab-order-collapse { display: block; margin-top: 14px; }
.lab-order-state { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; margin-left: 8px; }
.lab-order-state.st-pendiente { background: rgba(216,162,113,.2); color: #8a5a24; }
.lab-order-state.st-muestra_tomada { background: rgba(158,203,221,.3); color: #2a6070; }
.lab-order-state.st-resultados_subidos { background: rgba(144,168,155,.24); color: #4a6357; }
.lab-order-tel { font-size: 13px; color: var(--teal); display: inline-flex; align-items: center; gap: 5px; }
.lab-order-wa {
  font-size: 13px; font-weight: 500; color: #fff; background: #25d366;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px; text-decoration: none;
  white-space: nowrap; transition: background .12s;
}
.lab-order-wa:hover { background: #1eb855; }
.lab-order-wa .nuuma-wa-ico { flex: 0 0 auto; }
.lab-order-body { display: flex; flex-direction: column; gap: 16px; }
.lab-order-dni {
  display: flex; gap: 10px; align-items: center;
  font-size: 13.5px; color: var(--ink);
}
.lab-order-dni .dashicons { color: var(--muted); }
.lab-order-addr { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink); }
.lab-order-cita { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink); }
.lab-order-cita > div { display: flex; flex-direction: column; }
.lab-order-cita small { color: var(--muted); }

/* Flujo "no realizada" y reprogramación */
.lab-order-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.btn.danger-outline {
  background: transparent; color: #b94a48; border: 1px solid rgba(185,74,72,.4);
  box-shadow: none;
}
.btn.danger-outline:hover { background: rgba(185,74,72,.06); transform: none; box-shadow: none; }
.lab-reject { display: inline-flex; flex-direction: column; gap: 8px; }
.lab-reject-body { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.lab-reject-body select { min-width: 180px; }
.lab-order-note.reject { color: #b94a48; }

/* Tarjeta de onboarding del asistente en estado rechazado */
.onb-card.is-reject { border-color: rgba(185,74,72,.35); background: rgba(185,74,72,.03); }
.onb-reject { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: #b94a48; }
.onb-reject-note {
  display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted);
  background: rgba(185,74,72,.06); border-radius: 8px; padding: 10px 12px; margin: 10px 0;
}
.onb-reschedule-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; margin-bottom: 10px;
}
.onb-reschedule label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
@media (max-width: 560px) { .onb-reschedule-grid { grid-template-columns: 1fr; } }
.lab-order-addr .dashicons { color: var(--teal); flex-shrink: 0; margin-top: 1px; }
.lab-order-addr small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.lab-order-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.lab-order-foot form { margin: 0; }
.lab-order-note { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.lab-order-note.ok { color: #4a6357; font-weight: 500; }

/* Dropzone para subir resultados desde la tarjeta */
.lab-drop-form { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.lab-dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px dashed var(--line); border-radius: 10px; padding: 18px 16px;
  cursor: pointer; text-align: center; transition: .15s; background: var(--soft);
}
.lab-dropzone:hover, .lab-dropzone:focus { border-color: var(--teal); background: rgba(47,136,147,.05); outline: none; }
.lab-dropzone.is-drag { border-color: var(--teal); background: rgba(47,136,147,.1); }
.lab-dropzone.has-file { border-style: solid; border-color: var(--teal); background: rgba(47,136,147,.06); }
.lab-dropzone .dashicons { font-size: 24px; width: 24px; height: 24px; color: var(--teal); }
.lab-dropzone-text { font-size: 13px; color: var(--muted); word-break: break-word; }
.lab-dropzone.has-file .lab-dropzone-text { color: var(--ink); font-weight: 500; }
.lab-drop-submit { align-self: flex-start; }

/* ── Aire general en textos (legibilidad) ────────────────────
   Ajustes conservadores: más interlineado en cuerpo y separación
   entre párrafos, sin tocar controles de una sola línea. */
.panel p,
.wizard-card p,
.review-section p,
.card p {
  line-height: 1.6;
}
.panel p + p,
.card p + p { margin-top: 10px; }

/* Pares "título + subtítulo" apilados: un respiro entre ellos. */
.lab-order-addr small,
.fu-meta small,
.professional-card p,
.info-grid small { margin-top: 3px; }

/* Listas con ítems muy juntos. */
.fu-body ol li,
.fu-group ol li { margin-bottom: 5px; line-height: 1.5; }

/* Hints/ayudas debajo de campos: algo de separación arriba. */
.field-hint { line-height: 1.5; }

/* ── Asistente · Onboarding (stepper de estado de laboratorio) ── */
.onb-list { display: grid; gap: 14px; }
.onb-card { border: 1px solid var(--line); border-radius: 12px; background: var(--white); padding: 18px 20px; }
.onb-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  margin-bottom: 0; flex-wrap: wrap;
  width: 100%; background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: inherit; text-align: left;
}
.onb-head-right { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.onb-chevron { display: inline-flex; color: var(--muted); transition: transform .2s ease; }
.onb-chevron svg { width: 18px; height: 18px; }
.onb-card.is-open .onb-chevron { transform: rotate(90deg); }
.onb-collapse { display: none; }
.onb-card.is-open .onb-collapse { display: block; margin-top: 18px; }
.onb-head strong { font-size: 15px; display: block; }
.onb-head small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; display: inline-flex; align-items: center; gap: 5px; }
.onb-ready { font-size: 12px; font-weight: 600; color: #4a6357; background: rgba(144,168,155,.22); padding: 5px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; }
.onb-wait { font-size: 12px; font-weight: 600; color: #8a5a24; background: rgba(216,162,113,.18); padding: 5px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; }

.onb-steps { display: flex; align-items: center; margin-bottom: 14px; }
.onb-step { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; flex-shrink: 0; width: 96px; }
.onb-step .dot {
  width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--soft); color: var(--muted); font-size: 13px; font-weight: 600;
}
.onb-step .dot .dashicons { font-size: 17px; width: 17px; height: 17px; }
.onb-step .lbl { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.onb-step.current .dot { background: #fff; border: 2px solid var(--teal); color: var(--teal); }
.onb-step.current .lbl { color: var(--teal); font-weight: 500; }
.onb-step.done .dot { background: var(--teal); color: #fff; }
.onb-step.done .lbl { color: var(--ink); }
.onb-bar { flex: 1; height: 3px; background: var(--line); margin: 0 -6px; margin-bottom: 22px; border-radius: 2px; }
.onb-bar.done { background: var(--teal); }
.onb-addr { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding-top: 12px; border-top: 1px solid var(--line); }
.onb-addr + .onb-addr { padding-top: 4px; border-top: 0; }
.onb-addr .dashicons { color: var(--teal); }

@media (max-width: 560px) {
  .onb-step { width: auto; flex: 1; }
  .onb-step .lbl { font-size: 10.5px; }
}

/* Acciones agrupadas en el encabezado de sección (buscador + botón) */
.section-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
/* El buscador cede espacio; el botón mantiene su tamaño y no baja a otra fila. */
.section-head-actions .search-box { flex: 1 1 auto; min-width: 0; }
.section-head-actions .btn { flex: 0 0 auto; }
@media (max-width: 560px) {
  .section-head-actions { width: 100%; }
  .section-head-actions .search-box { flex: 1; }
}

/* Aviso de cuenta en configuración (paciente antes de la confirmación del asistente). */
.setup-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}
.setup-notice-card {
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 12px;
}
.setup-notice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: rgba(47, 136, 147, .1);
  color: var(--teal);
}
.setup-notice-icon .dashicons {
  width: 30px;
  height: 30px;
  font-size: 30px;
  line-height: 1;
}
.setup-notice-card h2 {
  font-size: 22px;
  color: var(--ink);
  margin: 0 0 12px;
}
.setup-notice-card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 12px;
}
.setup-notice-sub { font-size: 13.5px; }

/* Panel de formulario inline (reemplaza el modal en el expediente). */
.inline-form-panel {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  animation: nuuma-soft-in .22s ease;
}
.inline-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.inline-form-head h3 { margin: 0; font-size: 17px; color: var(--ink); }

/* Historial de cambios (auditoría) — panel desplegable dentro de cada form. */
.audit-log {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  overflow: hidden;
}
.audit-log > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  user-select: none;
}
.audit-log > summary::-webkit-details-marker { display: none; }
.audit-log-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: none;
  border-radius: 7px; background: rgba(47,136,147,.1); color: var(--teal);
}
.audit-log-ico .dashicons { width: 16px; height: 16px; font-size: 16px; }
.audit-log-title { flex: 1; }
.audit-log-count {
  flex: none; min-width: 22px; text-align: center;
  padding: 2px 8px; border-radius: 20px;
  background: var(--white); border: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.audit-log-chev { flex: none; color: var(--muted); transition: transform .2s ease; }
.audit-log[open] > summary .audit-log-chev { transform: rotate(180deg); }
.audit-log-body {
  padding: 4px 16px 14px;
  border-top: 1px solid var(--line);
  background: var(--white);
}
.audit-log-empty { color: var(--muted); font-size: 13px; margin: 12px 0 4px; }
.audit-log-list { list-style: none; margin: 0; padding: 0; }
.audit-log-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.audit-log-item:last-child { border-bottom: none; }
.audit-log-field { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.audit-log-change {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; margin-bottom: 5px;
}
.audit-old {
  padding: 2px 8px; border-radius: 6px;
  background: rgba(200,60,60,.08); color: #a23; text-decoration: line-through;
}
.audit-arrow { color: var(--muted); }
.audit-new {
  padding: 2px 8px; border-radius: 6px;
  background: rgba(47,136,147,.1); color: var(--teal); font-weight: 500;
}
.audit-log-meta { font-size: 11.5px; color: var(--muted); }

/* Datos de solo lectura con apariencia de etiqueta (no de input). */
.data-readout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}
.data-readout > div {
  display: grid;
  gap: 7px;
  position: relative;
}
.data-readout > div > span {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.data-readout > div > strong {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
}
.data-readout > div > strong.is-empty { color: var(--muted); }
.data-readout .has-edit { position: relative; }
.data-readout .has-edit strong { padding-right: 42px; }
.data-readout .has-edit .cell-edit {
  position: absolute;
  right: 8px;
  top: auto;            /* anula el top:50% de la regla base */
  bottom: 0;            /* se ancla al recuadro, que ocupa la parte baja */
  height: 42px;         /* igual al min-height del recuadro */
  width: 32px;
  transform: none;      /* anula el translateY heredado */
  display: inline-flex;
  align-items: center;  /* centra el lápiz sobre el texto del recuadro */
  justify-content: center;
  padding: 0;
  min-height: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
}
.data-readout .has-edit .cell-edit:hover { color: var(--teal); }
@media (max-width: 640px) {
  .data-readout { grid-template-columns: 1fr; }
}

/* Contador del historial de seguimiento (badge en la cabecera). */
.fu-count {
  flex: none;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

/* Esquema de titulación / dosis (visible para farmacia y paciente). */
.titration-box {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}
.titration-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.titration-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.titration-title .dashicons { color: var(--teal); font-size: 17px; width: 17px; height: 17px; }
.titration-start {
  font-size: 12px;
  font-weight: 500;
  color: var(--teal);
  background: rgba(47,136,147,.1);
  border-radius: 999px;
  padding: 3px 10px;
}
.titration-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.titration-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 9px 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.titration-fase {
  flex: none;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  min-width: 54px;
}
.titration-dosis {
  font-size: 14px;
  font-weight: 600;
  color: var(--teal);
  min-width: 64px;
}
.titration-rango {
  font-size: 12.5px;
  color: var(--ink);
}

/* Ocultar los spinners nativos de los inputs numéricos (se veían feos). */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Historial de mediciones: mini-gráficas de progreso. */
.mini-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.mini-chart {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  padding: 12px 14px;
}
.mini-chart-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.mini-chart-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
}
.mini-chart-last {
  font-size: 14px;
  font-weight: 600;
  color: var(--teal);
}
.mini-chart-delta {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--soft);
}
.mini-chart-delta.is-down { color: #0F6E56; background: rgba(15,110,86,.1); }
.mini-chart-delta.is-up { color: #a23; background: rgba(200,60,60,.08); }
.mini-chart-svg {
  width: 100%;
  height: 90px;
  display: block;
  overflow: visible;
}
/* Eje Y: columna de valores a la izquierda del trazo (no se deforma) */
.mini-chart-plot {
  position: relative;
  padding-left: 34px;
}
.mini-chart-y {
  position: absolute;
  left: 0;
  width: 28px;
  text-align: right;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1;
  pointer-events: none;
}
.mini-chart-y.mc-y-top { top: 11.11%; transform: translateY(-50%); }
.mini-chart-y.mc-y-mid { top: 50%;    transform: translateY(-50%); }
.mini-chart-y.mc-y-bot { top: 88.89%; transform: translateY(-50%); }
.mini-chart-grid { stroke: rgba(27,45,65,.06); stroke-width: 1; }
.mini-chart-empty {
  font-size: 12.5px;
  color: var(--muted);
  margin: 18px 0;
  text-align: center;
}
.mini-chart-hint {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  min-height: 90px;
  margin: 0;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed color-mix(in srgb, var(--muted) 40%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--muted) 6%, transparent);
}
@media (max-width: 640px) {
  .mini-chart-grid { grid-template-columns: 1fr; }
}

/* Disponibilidad semanal (patrón Calendly) */
.week-avail-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 6px;
}
.week-avail-dur { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.week-avail-dur select { min-width: 120px; }
.week-avail-days { display: flex; flex-direction: column; }
.wa-day {
  display: grid; grid-template-columns: 150px 1fr; gap: 16px;
  align-items: start; padding: 14px 0; border-top: 1px solid var(--line);
}
.wa-day:first-child { border-top: none; }
.wa-day-toggle { display: flex; align-items: center; gap: 10px; padding-top: 4px; }
.wa-toggle {
  width: 36px; height: 21px; border-radius: 21px; border: none; padding: 0;
  background: var(--teal); position: relative; cursor: pointer; flex-shrink: 0;
  transition: background .15s;
}
.wa-toggle::after {
  content: ""; position: absolute; top: 2px; right: 2px;
  width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: all .15s;
}
.wa-toggle.off { background: var(--border-strong, #c9cdd2); }
.wa-toggle.off::after { right: auto; left: 2px; }
.wa-dayname { font-size: 14px; font-weight: 500; }
.wa-day:not(.is-on) .wa-dayname { color: var(--muted); }
.wa-range { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.wa-time { min-width: 92px; }
.wa-dash { color: var(--muted); }
.wa-del { color: var(--muted); }
.wa-add {
  font-size: 12.5px; color: var(--teal); cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.wa-add .dashicons { font-size: 16px; width: 16px; height: 16px; }
.wa-off { font-size: 13px; color: var(--muted); display: none; }
/* Día inactivo: se ocultan los rangos y el "agregar", se muestra "No disponible". */
.wa-day:not(.is-on) .wa-ranges,
.wa-day:not(.is-on) .wa-add { display: none; }
.wa-day:not(.is-on) .wa-off { display: block; padding-top: 4px; }
.week-avail-actions { margin-top: 18px; }
.modal-wide { max-width: 640px; width: 92vw; }
@media (max-width: 560px) {
  .wa-day { grid-template-columns: 1fr; gap: 8px; }
}

/* Gráfico de circunferencia (cintura, cuello): óvalos anidados */
.circ-prog {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.circ-prog-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.circ-prog-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.circ-prog-head small {
  font-size: 11.5px;
  color: var(--muted);
}
.circ-prog-empty {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  margin: 6px 0 2px;
  padding: 12px 14px;
  border: 1px dashed color-mix(in srgb, var(--muted) 35%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--muted) 5%, transparent);
}
.circ-prog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}
.circ-prog-grid .mini-chart {
  background: var(--soft);
  padding: 10px 12px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
}
.circ-prog-grid .mini-chart-plot {
  margin-top: auto;
}
.circ-prog-grid .mini-chart-hint,
.circ-prog-grid .mini-chart-empty {
  margin-top: auto;
  margin-bottom: 0;
}
@media (max-width: 760px) {
  .circ-prog-grid { grid-template-columns: 1fr; }
}

/* Aviso cuando aún no puede agendar cita */
.cita-lock-note {
  display: flex; align-items: flex-start; gap: 9px; margin: 4px 0 14px;
  background: var(--cream); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 13.5px; color: var(--ink); line-height: 1.5;
}
.cita-lock-note svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--warning); margin-top: 1px; }

/* ═══════════════════════════════════════════════════════════════════════
   PACIENTE · Vista de bienvenida (carrusel inmersivo, previa al dashboard)
   ═══════════════════════════════════════════════════════════════════════ */
/* Modal a pantalla completa: cubre TODO el viewport (ancho y alto, incluida la
   barra lateral) y se monta sobre el dashboard, que queda pintado detrás. */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(135deg, rgba(158, 203, 221, 0.24), rgba(216, 162, 113, 0.12) 42%, rgba(144, 168, 155, 0.18)),
    var(--cream);
  animation: welcomeOverlayIn .35s ease both;
}
@keyframes welcomeOverlayIn { from { opacity: 0; } to { opacity: 1; } }
/* Estado al cerrar (se desvanece y se retira). */
.welcome-overlay.is-dismissed {
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
/* El contenido llena todo el modal: sin caja centrada de 1080px, se estira a
   lo ancho y alto disponibles. */
.welcome-scroll {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
}
/* Evita el scroll del fondo mientras el modal está abierto. */
body.nuuma-welcome-open { overflow: hidden; }

.welcome { max-width: none; width: 100%; margin: 0; flex: 1; display: flex; flex-direction: column; }

/* Card de bienvenida inicial (se muestra antes del paso 1 y se desvanece).
   Ahora ocupa todo el alto/ancho del modal, a sangre completa. */
.welcome-hero {
  position: relative; border-radius: 0; padding: 76px 40px 64px; text-align: center;
  background: linear-gradient(150deg, var(--navy), var(--teal)); color: #fff;
  flex: 1; min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity .5s ease, transform .5s ease;
}
.welcome-hero.is-gone { opacity: 0; transform: scale(.98); pointer-events: none; }
.welcome-mark { font-weight: 700; letter-spacing: .3em; font-size: 15px; color: rgba(255,255,255,.85); margin-bottom: 30px; }
.welcome-hero-eyebrow { font-size: 12.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--sky); }
.welcome-hero h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 12px 0 16px; max-width: 16ch; color: #fff; }
.welcome-hero p { margin: 0 0 32px; font-size: 16.5px; line-height: 1.7; color: rgba(255,255,255,.88); max-width: 46ch; }
.welcome-start {
  border: none; background: #fff; color: var(--navy); font-weight: 600; font-size: 15.5px;
  padding: 14px 40px; border-radius: 12px; cursor: pointer; transition: transform .2s ease;
}
.welcome-start:hover { transform: translateY(-2px); }
.welcome-hero .welcome-skip-top { margin-top: 22px; color: rgba(255,255,255,.92); text-decoration: none; }
.welcome-hero .welcome-skip-top:hover { color: #fff; }

/* El carrusel de pasos empieza oculto y aparece al pulsar "Comenzar". */
.welcome-main { display: none; }
.welcome-main.is-in { display: flex; flex-direction: column; flex: 1; animation: welcomeFadeIn .55s ease both; }
@keyframes welcomeFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.welcome-stage {
  background: var(--tint); transition: background .8s cubic-bezier(.65,0,.35,1);
  border-radius: 0; overflow: hidden;
  flex: 1; display: flex; flex-direction: column;
}
.welcome-inner {
  position: relative; max-width: 720px; margin: 0 auto; width: 100%;
  flex: 1; min-height: 440px; padding: 72px 32px 60px;
}
.welcome-card {
  position: absolute; inset: 0; padding: 72px 32px 60px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity .55s cubic-bezier(.65,0,.35,1), transform .6s cubic-bezier(.65,0,.35,1);
}
.welcome-card.on { opacity: 1; transform: none; pointer-events: auto; }
.welcome-ico {
  width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center;
  color: var(--accent); border: 1.6px solid var(--accent); margin-bottom: 24px;
}
.welcome-ico svg { width: 36px; height: 36px; }
.welcome-kicker {
  font-size: 12.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent);
}
.welcome-card h2 {
  font-size: clamp(24px, 3.6vw, 33px); font-weight: 600; margin: 12px 0 16px;
  line-height: 1.18; letter-spacing: -.01em; color: var(--navy);
}
.welcome-card p {
  margin: 0; color: #4d5a67; font-size: 16.5px; line-height: 1.7; max-width: 42ch;
}
.welcome-ticker {
  border-top: 1px solid rgba(27,45,65,.08); background: rgba(255,255,255,.4);
  padding: 16px 20px; display: flex; justify-content: center; align-items: center;
  gap: 6px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.welcome-tk {
  font-size: 12.5px; color: var(--muted); padding: 6px 12px; border-radius: 999px;
  transition: .3s; white-space: nowrap; cursor: pointer; flex: 0 0 auto;
}
.welcome-tk.on { background: var(--navy); color: #fff; }
/* En móvil el ticker de nombres ocupa demasiado y se envuelve en varias filas;
   se oculta. Los puntos y el contador "PASO X DE 06" ya indican el progreso. */
@media (max-width: 680px) {
  .welcome-ticker { display: none; }
}

.welcome-nav { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 28px; }
.welcome-arrow {
  width: 50px; height: 50px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--white); display: grid; place-items: center; color: var(--navy);
  cursor: pointer; transition: .2s cubic-bezier(.65,0,.35,1);
}
.welcome-arrow:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }
.welcome-arrow:disabled { opacity: .3; cursor: default; }
.welcome-arrow svg { width: 22px; height: 22px; }
.welcome-dots { display: flex; gap: 10px; align-items: center; }
.welcome-dot {
  width: 11px; height: 11px; border-radius: 50%; background: rgba(27,45,65,.28); border: none;
  padding: 0; cursor: pointer; transition: .35s cubic-bezier(.65,0,.35,1);
}
.welcome-dot:hover { background: rgba(27,45,65,.5); }
.welcome-dot.on { background: var(--teal); width: 30px; border-radius: 6px; }

.welcome-foot { text-align: center; margin: 22px auto 40px; }
/* Sin borde inferior en el enlace (por pedido): solo cambia de color al pasar. */
.welcome-skip {
  color: var(--muted); font-size: 13.5px; text-decoration: none; transition: color .2s;
}
.welcome-skip:hover { color: var(--teal); }

@media (max-width: 640px) {
  .welcome-inner, .welcome-card { padding: 52px 24px 44px; min-height: 420px; }
  .welcome-ico { width: 68px; height: 68px; }
}
@media (prefers-reduced-motion: reduce) {
  .welcome-stage, .welcome-card, .welcome-hero { transition-duration: .001ms !important; }
  .welcome-main.is-in { animation-duration: .001ms !important; }
}
