/* ============================================================
   Panel movil (M2a) — Reservas: listado por dias (agenda), hoja de
   filtros, enlaces de la hoja de una cita, avisos del gestor de
   acciones y detalle de una reserva.
   REGLA DURA: todo dentro del @media (ver 01-carcasa.css).
   Spec: docs/superpowers/specs/2026-10-13-movil-m2a-reservas-listado-detalle-design.md §4 y §7.3
   Prueba: scripts/test/e2e/movil/test_reservas_fixture.js (fixture-reservas.html
   lleva el marcado del contrato; si cambia una clase aqui, cambia alli).
   Diana visual: el mockup aprobado de M2a (m2a-reservas-pantallas.html).

   Las clases las pone Blazor, son estaticas. Reutiliza de 04-calendario.css la hoja
   (.vzt-hoja*), las insignias (.vzt-cal-ins*) y la pastilla de estado (.vzt-cal-estado*).
   Letra y objetivos tactiles en px: la raiz de Metronic en movil no son 16 px.
   ============================================================ */

@media (max-width: 991.98px) {
  /* --- Contenedores ------------------------------------------------------
     A todo el ancho de la pantalla, con el mismo margen negativo que .vzt-cal: compensa el
     relleno lateral de #kt_app_content_container (20 px, y 12 px por debajo de 576). */
  .vzt-res,
  .vzt-det {
    --vzt-cal-sangria: 20px;
    --vzt-res-fondo: var(--bs-gray-100);
    /* Lo que el «+» de la barra inferior sobresale por encima de ella: su margen superior de
       -22 px menos el borde (1) y el relleno (6) de .vzt-barra (01-carcasa.css). Medido en el
       fixture a 360, 390 y 768: barra.top - nueva.top = 15 px. Si cambia la barra, cambia
       aqui (lo vigila noTapaElMas). */
    --vzt-res-protrusion: 15px;
    /* Alto de la barra de acciones del detalle: 1 de borde + 8 + 46 + 8. */
    --vzt-det-barra-alto: 63px;
    margin: 0 calc(-1 * var(--vzt-cal-sangria));
    color: var(--bs-gray-900);
    font-family: var(--vzt-font-cuerpo, inherit);
    font-size: 14px;
    line-height: 20px;
  }

  @media (max-width: 575.98px) {
    .vzt-res,
    .vzt-det {
      --vzt-cal-sangria: 12px;
    }
  }

  .vzt-res {
    background: var(--bs-body-bg);
  }

  /* La cabecera general no repite titulo ni botones: el layout pintaria el <h1> vacio y la
     miga «Inicio» en una fila suelta (D19 de M1). */
  body:has(.vzt-res, .vzt-det) #kt_app_header #kt_app_toolbar {
    display: none;
  }

  /* --- Cabecera del listado: titulo y «Filtros» -------------------------- */
  .vzt-res-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    padding: 0 12px 0 16px;
  }

  .vzt-res-titulo {
    min-width: 0;
    margin: 0;
    color: var(--bs-gray-900);
    font-family: var(--vzt-font-titulo, inherit);
    font-size: 22px;
    font-weight: 800;
    line-height: 26px;
    letter-spacing: -0.01em;
  }

  .vzt-res-filtros {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    box-sizing: border-box;
    height: 44px;
    margin: 0;
    padding: 0 13px;
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    background: var(--bs-body-bg);
    color: var(--bs-primary);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
    white-space: nowrap;
    appearance: none;
  }

  .vzt-res-filtros i {
    color: inherit;
    font-size: 15px;
    line-height: 1;
  }

  .vzt-res-filtros__cuenta {
    box-sizing: border-box;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--bs-primary);
    color: var(--bs-primary-inverse, #fff);
    font-size: 12px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
  }

  /* Sin filtros activos Blazor la deja vacia. */
  .vzt-res-filtros__cuenta:empty {
    display: none;
  }

  /* --- Buscador ----------------------------------------------------------
     Letra de 16 px: con menos, iOS amplia la pagina al tocar el campo. Con la letra a 16 el
     texto de ayuda largo («Buscar por cliente, servicio o profesional», 308 px de Inter) no
     cabe a 360 px; el corto (R7, 279 px) cabe en los 284 que quedan con el campo vacio. Con
     el campo vacio no hay boton de borrar (ReservasMovil solo lo pinta con texto) y el
     relleno derecho baja a 12 px; con texto deja sitio a los 44 px del boton. */
  .vzt-res-buscador {
    position: relative;
    padding: 3px 12px 9px;
    border-bottom: 1px solid var(--bs-border-color);
  }

  .vzt-res-buscador__icono {
    position: absolute;
    top: 3px;
    left: 24px;
    display: grid;
    place-items: center;
    width: 16px;
    height: 44px;
    color: var(--bs-text-muted);
    font-size: 16px;
    line-height: 1;
    pointer-events: none;
  }

  .vzt-res-buscador__campo {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 44px 0 38px;
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    background: var(--bs-gray-100);
    color: var(--bs-gray-900);
    font: inherit;
    font-size: 16px;
    line-height: 20px;
    outline: none;
    appearance: none;
  }

  .vzt-res-buscador__campo:placeholder-shown {
    padding-right: 12px;
  }

  .vzt-res-buscador__campo::placeholder {
    color: var(--bs-text-muted);
    opacity: 1;
  }

  /* El boton nativo de borrar de type=search no: ya hay uno de 44 px. */
  .vzt-res-buscador__campo::-webkit-search-cancel-button,
  .vzt-res-buscador__campo::-webkit-search-decoration {
    appearance: none;
  }

  .vzt-res-buscador__campo:focus {
    border-color: var(--bs-primary);
    background: var(--bs-body-bg);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
  }

  .vzt-res-buscador__campo:focus + .vzt-res-buscador__borrar,
  .vzt-res-buscador:has(.vzt-res-buscador__campo:focus) .vzt-res-buscador__icono {
    color: var(--bs-primary);
  }

  .vzt-res-buscador__borrar {
    position: absolute;
    top: 3px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: none;
    color: var(--bs-text-muted);
    font-size: 16px;
    line-height: 1;
    appearance: none;
  }

  .vzt-res-buscador__campo:placeholder-shown ~ .vzt-res-buscador__borrar {
    display: none;
  }

  /* --- Resultado, avisos -------------------------------------------------- */
  .vzt-res-resultado {
    margin: 0;
    padding: 10px 4px 0;
    color: var(--bs-text-muted);
    font-size: 13px;
    line-height: 18px;
  }

  .vzt-res-aviso {
    box-sizing: border-box;
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(var(--bs-warning-rgb), 0.12);
    color: var(--warning-text, var(--bs-gray-900));
    font-size: 14px;
    line-height: 20px;
    overflow-wrap: anywhere;
  }

  .vzt-res-agenda > .vzt-res-aviso {
    margin-top: 10px;
    margin-bottom: 0;
  }

  .vzt-res-aviso b {
    display: block;
    font-weight: 700;
  }

  .vzt-res-aviso ul {
    margin: 4px 0 0;
    padding-left: 18px;
  }

  .vzt-res-aviso--error {
    background: rgba(var(--bs-danger-rgb), 0.1);
    color: var(--bs-danger);
  }

  /* Error de una accion: arriba, sobre todo (las hojas van a 1056). */
  .vzt-res-aviso--flotante {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    left: 12px;
    right: 12px;
    z-index: 1057;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 4px 4px 4px 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  }

  /* El fondo de --error es translucido: sobre la pagina, se pone encima del blanco. */
  .vzt-res-aviso--flotante.vzt-res-aviso--error {
    background: linear-gradient(rgba(var(--bs-danger-rgb), 0.1), rgba(var(--bs-danger-rgb), 0.1)), var(--bs-body-bg);
  }

  .vzt-res-aviso--flotante > span {
    flex: 1 1 auto;
    min-width: 0;
  }

  .vzt-res-aviso--flotante > .btn {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 10px;
    color: inherit;
    font-size: 14px;
    font-weight: 600;
  }

  /* --- Agenda: un grupo por dia, con su cabecera fija -------------------- */
  .vzt-res-agenda {
    padding: 0 12px 8px;
    background: var(--vzt-res-fondo);
  }

  .vzt-res-grupo {
    display: block;
  }

  /* Se pega dentro de su grupo: al acabar el dia se va con el. Fondo opaco, el de la agenda.
     La cabecera general no es fija en movil (ver 04-calendario.css), asi que va a 0. */
  .vzt-res-dia {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 10px 4px 6px;
    background: var(--vzt-res-fondo);
  }

  .vzt-res-dia__titulo {
    min-width: 0;
    overflow: hidden;
    color: var(--bs-gray-900);
    font-family: var(--vzt-font-titulo, inherit);
    font-size: 14px;
    font-weight: 700;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .vzt-res-dia--hoy .vzt-res-dia__titulo {
    color: var(--bs-primary);
  }

  .vzt-res-dia__cuenta {
    flex: 0 0 auto;
    color: var(--bs-text-muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 18px;
    white-space: nowrap;
  }

  /* --- Fila de una reserva -----------------------------------------------
     Toda la fila es el objetivo tactil. Rejilla de tres columnas: hora y duracion; cliente y
     «servicio, profesional»; estado y precio. La tercera linea, solo si hay insignias. Las
     piezas se colocan por clase, no por orden en el marcado. */
  .vzt-res-fila {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 2px;
    box-sizing: border-box;
    width: 100%;
    min-height: 56px;
    margin: 0 0 6px;
    padding: 8px 11px 8px 12px;
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    background: var(--bs-body-bg);
    color: var(--bs-gray-900);
    font: inherit;
    font-size: 13px;
    line-height: 18px;
    text-align: left;
    appearance: none;
  }

  .vzt-res-fila:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
  }

  .vzt-res-fila__hora {
    grid-row: 1;
    grid-column: 1;
    font-size: 15px;
    font-weight: 700;
    line-height: 19px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  .vzt-res-fila__dur {
    grid-row: 2;
    grid-column: 1;
    color: var(--bs-text-muted);
    font-size: 13px;
    line-height: 18px;
    white-space: nowrap;
  }

  .vzt-res-fila__cliente {
    grid-row: 1;
    grid-column: 2;
    min-width: 0;
    overflow: hidden;
    font-size: 15px;
    font-weight: 600;
    line-height: 19px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .vzt-res-fila__detalle {
    grid-row: 2;
    grid-column: 2;
    min-width: 0;
    overflow: hidden;
    color: var(--bs-text-muted);
    font-size: 13px;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .vzt-res-fila__estado.vzt-cal-estado {
    grid-row: 1;
    grid-column: 3;
    justify-self: end;
  }

  .vzt-res-fila__precio {
    grid-row: 2;
    grid-column: 3;
    justify-self: end;
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  /* Insignias: tercera linea, de la columna del cliente al final. Siete no caben en una linea
     (257 a 287 px en un telefono): la fila se parte (R1) y cada insignia sigue en una linea. */
  .vzt-res-fila__insignias {
    grid-row: 3;
    grid-column: 2 / 4;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    min-width: 0;
    margin-top: 5px;
  }

  /* Atenuada (cancelada, no asistio): todo menos la pastilla, que dice por que. */
  .vzt-res-fila--atenuada :is(.vzt-res-fila__hora, .vzt-res-fila__dur, .vzt-res-fila__cliente, .vzt-res-fila__detalle, .vzt-res-fila__precio) {
    opacity: 0.55;
  }

  .vzt-res-fila--atenuada .vzt-res-fila__cliente {
    font-weight: 500;
    text-decoration: line-through;
  }

  /* --- Insignias ----------------------------------------------------------
     En la fila y en la cabecera del detalle, las del calendario crecen a la medida del mockup
     (18 px, 11 px de letra): alli eran de 16 para caber en la tarjeta. Ninguna regla de
     04-calendario.css pensada para `.vzt-cal-cita > .vzt-cal-ins` aplica aqui (son de hijo
     directo de la tarjeta). (0,3,0) para ganar a `.vzt-cal-ins.vzt-cal-ins`. */
  :is(.vzt-res-fila__insignias, .vzt-det-cab__insignias) > .vzt-cal-ins.vzt-cal-ins,
  .vzt-res-ins.vzt-res-ins {
    display: inline-block;
    flex: 0 0 auto;
    box-sizing: border-box;
    max-width: 100%;
    height: 18px;
    padding: 0 6px;
    overflow: hidden;
    border-radius: 5px;
    font-family: var(--vzt-font-cuerpo, inherit);
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    letter-spacing: 0;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
  }

  .vzt-res-ins.vzt-res-ins--relacionado {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    /* R20: el 9 % del azul marino sobre blanco se leia gris. El azul del hover del primario
       (mas saturado) al 13 % sobre el fondo, con el texto en el primario: contraste de 11:1. */
    background: rgba(var(--bs-primary-rgb), 0.09);
    background: color-mix(in srgb, var(--primary-hover, var(--bs-primary)) 13%, var(--bs-body-bg));
    color: var(--bs-primary);
  }

  .vzt-res-ins.vzt-res-ins--presencia,
  .vzt-res-ins.vzt-res-ins--modalidad {
    background: rgba(var(--bs-info-rgb), 0.12);
    color: var(--bs-info);
  }

  /* --- Final de la agenda, «Ver más días», vacio y esqueleto -------------- */
  .vzt-res-fin {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 36px;
    color: var(--bs-text-muted);
    font-size: 13px;
    line-height: 18px;
  }

  .vzt-res-fin__giro {
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 16px;
    height: 16px;
    border: 2px solid var(--bs-gray-300);
    border-top-color: var(--bs-primary);
    border-radius: 50%;
    animation: vzt-res-giro 0.8s linear infinite;
  }

  .vzt-res-mas {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 44px;
    margin: 4px auto 0;
    padding: 0 22px;
    border: 1px solid rgba(var(--bs-primary-rgb), 0.3);
    border-radius: 11px;
    background: var(--bs-body-bg);
    color: var(--bs-primary);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
    white-space: nowrap;
    appearance: none;
  }

  .vzt-res-vacio {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 72px 28px 24px;
    text-align: center;
  }

  .vzt-res-vacio__icono {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    border-radius: 20px;
    background: rgba(var(--bs-primary-rgb), 0.08);
    color: var(--bs-primary);
    font-size: 26px;
    line-height: 1;
  }

  .vzt-res-vacio__icono i {
    color: inherit;
    font-size: 26px;
  }

  .vzt-res-vacio > :is(h2, h3, b, strong) {
    margin: 0;
    color: var(--bs-gray-900);
    font-family: var(--vzt-font-titulo, inherit);
    font-size: 17px;
    font-weight: 700;
    line-height: 22px;
  }

  .vzt-res-vacio > p {
    margin: 6px 0 18px;
    color: var(--bs-text-muted);
    font-size: 14px;
    line-height: 20px;
  }

  .vzt-res-esqueleto {
    padding-top: 10px;
  }

  .vzt-res-esqueleto__fila {
    height: 56px;
    margin-bottom: 6px;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--bs-gray-200) 0%, var(--bs-gray-300) 50%, var(--bs-gray-200) 100%) 0 0 / 200% 100%;
    animation: vzt-res-brillo 1.4s ease-in-out infinite;
  }

  /* --- Hoja de filtros (sobre las piezas de la hoja de 04-calendario.css) -- */
  .vzt-res-fechas {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: -4px 0 12px;
  }

  .vzt-res-fechas > label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    margin: 0;
    color: var(--bs-text-muted);
    font-size: 13px;
    line-height: 18px;
  }

  .vzt-res-fechas__campo {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 44px;
    margin: 0;
    padding: 0 10px;
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    background: var(--bs-body-bg);
    color: var(--bs-gray-900);
    font: inherit;
    font-size: 16px;
    line-height: 20px;
    font-variant-numeric: tabular-nums;
    appearance: none;
  }

  .vzt-res-fechas__campo:focus {
    border-color: var(--bs-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
  }

  .vzt-res-interruptor {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    margin: 0 0 12px;
    padding: 0 2px;
    border-top: 1px solid var(--bs-border-color);
    border-bottom: 1px solid var(--bs-border-color);
    color: var(--bs-gray-900);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    cursor: pointer;
  }

  .vzt-res-interruptor > input[type="checkbox"] {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 28px;
    margin: 0;
    border: 0;
    border-radius: 14px;
    background: var(--bs-gray-300);
    cursor: pointer;
    transition: background-color 0.15s ease-out;
    appearance: none;
  }

  .vzt-res-interruptor > input[type="checkbox"]::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bs-body-bg);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3);
    transition: transform 0.15s ease-out;
  }

  .vzt-res-interruptor > input[type="checkbox"]:checked {
    background: var(--bs-primary);
  }

  .vzt-res-interruptor > input[type="checkbox"]:checked::before {
    transform: translateX(18px);
  }

  .vzt-res-interruptor > input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
  }

  .vzt-res-pie {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 8px;
    margin: 0 0 4px;
  }

  /* En 04 el principal que va primero ocupa toda la fila; aqui no. */
  .vzt-res-pie > .vzt-hoja__boton.vzt-hoja__boton {
    grid-column: auto;
    min-height: 46px;
    font-size: 14px;
  }

  /* --- Enlaces al pie de la hoja de una cita: «Ver reservas del grupo» y «Ver todo» -- */
  .vzt-hoja__enlace {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 0 12px;
    border: 0;
    background: none;
    color: var(--bs-primary);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    text-decoration: none;
    appearance: none;
  }

  .vzt-hoja__enlace i {
    color: inherit;
    font-size: 12px;
    line-height: 1;
  }

  .vzt-hoja__enlace + .vzt-hoja__enlace {
    margin-top: -6px;
  }

  .vzt-hoja__enlace:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: -2px;
    border-radius: 10px;
  }

  /* --- Detalle ------------------------------------------------------------
     El contenido deja sitio a la barra de acciones y al «+» que sobresale: la barra inferior
     ya la descuenta #kt_app_main (01-carcasa.css, su alto mas 28 px). */
  .vzt-det {
    padding: 0 12px calc(var(--vzt-det-barra-alto) + var(--vzt-res-protrusion));
    background: var(--vzt-res-fondo);
  }

  /* Cabecera: «‹ Reservas» y el numero en la primera fila; el cliente; estado e insignias. */
  .vzt-det-cab {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 8px;
    padding: 0 0 14px;
  }

  .vzt-det-cab__volver {
    grid-row: 1;
    grid-column: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin-left: -4px;
    padding: 0 10px 0 4px;
    color: var(--bs-primary);
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
    text-decoration: none;
  }

  .vzt-det-cab__volver i {
    color: inherit;
    font-size: 15px;
    line-height: 1;
  }

  .vzt-det-cab__numero {
    grid-row: 1;
    grid-column: 2;
    justify-self: end;
    min-width: 0;
    overflow: hidden;
    color: var(--bs-text-muted);
    font-size: 13px;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .vzt-det-cab__cliente {
    grid-column: 1 / -1;
    display: -webkit-box;
    margin: 2px 4px 8px;
    overflow: hidden;
    color: var(--bs-gray-900);
    font-family: var(--vzt-font-titulo, inherit);
    font-size: 22px;
    font-weight: 800;
    line-height: 27px;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .vzt-det-cab__insignias {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin: 0 4px;
  }

  /* Secciones como tarjetas. */
  .vzt-det-sec {
    box-sizing: border-box;
    min-width: 0;
    margin: 0 0 10px;
    padding: 14px 16px;
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    background: var(--bs-body-bg);
    font-size: 14px;
    line-height: 20px;
    overflow-wrap: anywhere;
  }

  .vzt-det-sec p {
    margin: 0 0 6px;
  }

  .vzt-det-sec p:last-child {
    margin-bottom: 0;
  }

  .vzt-det-sec__titulo {
    margin: 0 0 8px;
    color: var(--bs-gray-900);
    font-family: var(--vzt-font-titulo, inherit);
    font-size: 13px;
    font-weight: 700;
    line-height: 18px;
  }

  /* «Cuándo» con su icono de calendario a la izquierda (mockup, marco 5): fecha a 16 px. */
  .vzt-det-sec.vzt-det-cuando {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .vzt-det-cuando__icono {
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(var(--bs-primary-rgb), 0.08);
    color: var(--bs-primary);
    font-size: 20px;
    line-height: 1;
  }

  .vzt-det-cuando__icono i {
    color: inherit;
    font-size: 20px;
  }

  .vzt-det-cuando__texto {
    flex: 1 1 auto;
    min-width: 0;
  }

  .vzt-det-cuando .vzt-det-sec__titulo {
    margin: 0 0 2px;
    font-size: 16px;
    line-height: 21px;
  }

  .vzt-det-sec > .vzt-hoja__contactar {
    margin: 0;
  }

  .vzt-det-dl {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 14px;
    margin: 0;
    font-size: 14px;
    line-height: 20px;
  }

  .vzt-det-dl > dt {
    color: var(--bs-text-muted);
    font-weight: 400;
  }

  .vzt-det-dl > dd {
    min-width: 0;
    margin: 0;
    color: var(--bs-gray-900);
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
  }

  .vzt-det-dl > dd .vzt-cal-ins {
    margin-left: 4px;
  }

  .vzt-det-dl > dd.vzt-det-importe__pendiente {
    font-weight: 700;
  }

  /* (0,2,1) y su rotulo: `.vzt-det-dl > dd` (0,1,1) le ganaba el color y el peso. */
  .vzt-det-dl > dd.vzt-det-importe__pendiente--resaltado,
  .vzt-det-dl > dt:has(+ dd.vzt-det-importe__pendiente--resaltado) {
    color: var(--bs-danger);
    font-weight: 700;
  }

  /* Las demas citas de la visita: como la fila del listado, sin la tercera linea. Las piezas
     son las de la fila (.vzt-res-fila__*), que se colocan por clase. */
  /* Primera columna de al menos 46 px pero elastica: la hora de otro dia lleva fecha
     («14/10, 9:30») y en 46 px pisaba al servicio. */
  .vzt-det-hermana {
    display: grid;
    grid-template-columns: minmax(46px, auto) minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 2px;
    min-height: 44px;
    padding: 6px 0;
    color: var(--bs-gray-900);
    text-decoration: none;
  }

  .vzt-det-hermana + .vzt-det-hermana {
    border-top: 1px solid var(--bs-border-color);
  }

  .vzt-det-hermana:hover {
    color: var(--bs-gray-900);
  }

  .vzt-det-hermana .vzt-res-fila__hora {
    font-size: 14px;
  }

  .vzt-det-enlaces {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0 4px;
    margin: 4px -8px -8px 0;
  }

  .vzt-det-enlaces > :is(a, button) {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin: 0;
    padding: 0 8px;
    border: 0;
    background: none;
    color: var(--bs-primary);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
    text-decoration: none;
    white-space: nowrap;
    appearance: none;
  }

  .vzt-det :is(a, button):focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
  }

  /* Cabecera compacta: aparece cuando la grande sale por arriba (data-compacta, lo pone el
     script). Por debajo de la barra inferior (1039) y de las hojas (1056). */
  .vzt-det-compacta {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    display: none;
    align-items: center;
    gap: 2px;
    box-sizing: border-box;
    height: 52px;
    padding: env(safe-area-inset-top, 0px) 14px 0 4px;
    border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  }

  .vzt-det[data-compacta="true"] .vzt-det-compacta {
    display: flex;
  }

  .vzt-det-compacta__volver {
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--bs-primary);
    font-size: 17px;
    line-height: 1;
    appearance: none;
  }

  .vzt-det-compacta__cliente {
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 8px;
    overflow: hidden;
    color: var(--bs-gray-900);
    font-family: var(--vzt-font-titulo, inherit);
    font-size: 15px;
    font-weight: 700;
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Barra de acciones: fija encima de la barra inferior y del «+», que sobresale. 1035: por
     encima del contenido y la cabecera compacta, por debajo de la barra (1039) y las hojas. */
  .vzt-det-barra {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--vzt-barra-alto) + var(--vzt-res-protrusion) + env(safe-area-inset-bottom, 0px));
    z-index: 1035;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    box-sizing: border-box;
    padding: 8px 12px;
    border-top: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    /* La primera sombra, opaca, rellena la franja de la protrusion hasta la barra inferior:
       sin ella se veria el contenido pasar por un hueco de 15 px. No cuenta en la caja, y el
       «+» (1039) se pinta encima. */
    box-shadow: 0 var(--vzt-res-protrusion) 0 var(--bs-body-bg), 0 -4px 14px rgba(15, 23, 42, 0.05);
  }

  /* Los botones son .vzt-hoja__boton: en 04 el principal que va primero ocupa toda la fila. */
  .vzt-det-barra > .vzt-hoja__boton.vzt-hoja__boton {
    grid-column: auto;
    min-height: 46px;
    font-size: 14px;
    white-space: nowrap;
  }

  .vzt-det-barra > .vzt-det-barra__mas.vzt-hoja__boton {
    gap: 6px;
    padding: 0 14px 0 18px;
  }

  .vzt-det-barra__mas i {
    color: inherit;
    font-size: 12px;
    line-height: 1;
  }

  /* Con «Más» abierto (el menu lateral como drawer a pantalla completa, z 110: KTDrawer le
     pone `drawer-on`, como mira dispositivo.js) la barra de acciones (1035) y la cabecera
     compacta (1030) quedarian encima del menu (R19). Se quitan mientras esta abierto. */
  body:has(#kt_app_sidebar.drawer-on) .vzt-det .vzt-det-barra,
  body:has(#kt_app_sidebar.drawer-on) .vzt-det .vzt-det-compacta {
    display: none;
  }

  @keyframes vzt-res-giro {
    to { transform: rotate(360deg); }
  }

  @keyframes vzt-res-brillo {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
  }

  @media (prefers-reduced-motion: reduce) {
    .vzt-res *,
    .vzt-det *,
    .vzt-res-interruptor *,
    .vzt-res-interruptor > input::before,
    .vzt-hoja__enlace {
      animation: none !important;
      transition: none !important;
      scroll-behavior: auto !important;
    }
  }
}
