.body-wrapper {
  padding-top: calc(70px + 20px);
}

.topbar .page-title-bar {
  gap: 8px;
  font-weight: 600;
  line-height: 1.2;
}

.topbar .page-title-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.35em 0.65em;
  line-height: 1.1;
  flex-shrink: 0;
}

.master-data-table {
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
}

.master-data-table th,
.master-data-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.master-data-table th.col-actions,
.master-data-table td.col-actions {
  width: 65px;
  min-width: 65px;
  max-width: 65px;
  padding: 0.25rem 0.2rem;
  overflow: visible;
}

.master-system-table th.col-actions,
.master-system-table td.col-actions {
  width: 92px;
  min-width: 92px;
  max-width: 92px;
}

.master-data-table th.col-id,
.master-data-table td.col-id,
.master-data-table th.col-type,
.master-data-table td.col-type {
  width: 70px;
  min-width: 70px;
  max-width: 70px;
  text-align: center;
}

.master-data-table th.col-unit,
.master-data-table td.col-unit {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

.master-data-table col.col-description {
  width: 210px;
}

.master-data-table th.col-description,
.master-data-table td.col-description {
  width: 210px;
  min-width: 210px;
  max-width: 210px;
}

.master-data-table th.col-data,
.master-data-table td.col-data {
  width: 130px;
  min-width: 130px;
  max-width: 130px;
}

/*
 * Selector directo (> en vez de descendiente): el modal de "Editar" se
 * incluye dentro de este mismo contenedor (_master_row_actions.html.twig),
 * así que un selector descendiente también encogía los botones Cerrar/
 * Guardar del modal — este estilo es solo para los íconos de editar/eliminar
 * de la fila, que sí son hijos directos.
 */
.master-row-actions > .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  padding: 0.1rem 0.25rem;
  line-height: 1.1;
  font-size: 0.8rem;
}

.master-row-actions > .btn i {
  font-size: 0.95rem;
}

.composite-group-row {
  background-color: var(--bs-warning-bg-subtle, #fff3cd);
}

.composite-group-row td {
  border-bottom-width: 0;
}

.composite-component-row .composite-component-code {
  padding-left: 1.25rem;
}

.composite-component-marker {
  font-size: 0.85rem;
}

.composite-group-row.table-danger > td {
  --bs-table-bg-state: var(--bs-danger-bg-subtle);
}

.composite-group-row .composite-toggle-btn {
  line-height: 1;
}

.composite-group-row .composite-toggle-icon {
  transition: transform 0.15s ease-in-out;
}

.composite-expected-missing td {
  opacity: 0.95;
}

.composite-component-row.table-danger > td {
  --bs-table-bg-state: var(--bs-danger-bg-subtle);
}

/* Los modales de edición se incluyen dentro del <td> de acciones de la fila
   (ver _master_row_actions.html.twig), así que heredan el white-space:nowrap
   de .master-data-table td pensado para celdas de tabla densas — sin esto,
   cualquier texto largo dentro del modal (ej. .form-text) se corta en vez de
   hacer salto de línea. */
.modal-content {
  white-space: normal;
}

.modal-body .form-select {
  background-color: transparent;
  border-color: var(--bs-border-color, #dfe5ef);
  color: var(--bs-body-color, #5a6a85);
  font-size: 0.875rem;
  line-height: 1.5;
  padding: 0.5rem 2.25rem 0.5rem 0.875rem;
}

.order-format {
  --order-gap: 12px;
  --order-pad: 12px;
  border: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.08));
  border-radius: var(--bs-border-radius, 0.375rem);
}

.order-format .order-section {
  border: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.06));
  border-radius: var(--bs-border-radius-sm, 0.25rem);
}

.order-format .order-section-head {
  border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.06));
}

.order-format-banner {
  padding: 8px var(--order-pad);
  border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.06));
}

.order-format-banner h6 {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.order-format-body {
  padding: var(--order-pad);
}

.order-section-head {
  padding: 6px var(--order-pad);
}

.order-section-head h6 {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--bs-secondary-color);
}

.order-section-body {
  padding: var(--order-pad);
}

.order-format .form-label {
  font-size: 0.75rem;
  font-weight: 400;
  margin-bottom: 2px;
  color: var(--bs-secondary-color);
}

.order-format .form-label.label-required {
  font-weight: 600;
  color: var(--bs-body-color);
}

.order-format .form-control,
.order-format .form-select {
  min-height: 34px;
  font-size: 0.8125rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.order-format .form-control-sm,
.order-format .form-select-sm {
  min-height: 32px;
}

.order-grid {
  display: grid;
  gap: var(--order-gap);
  align-items: end;
}

.order-grid--order {
  grid-template-columns:
    minmax(72px, max-content)
    minmax(180px, 2.5fr)
    minmax(170px, 1.5fr)
    minmax(140px, 1fr)
    minmax(108px, max-content);
}

.order-grid--order-extended {
  grid-template-columns:
    minmax(72px, max-content)
    minmax(180px, 2.2fr)
    minmax(170px, 1.4fr)
    minmax(140px, 1fr)
    minmax(108px, max-content)
    minmax(100px, max-content);
}

.order-customer-nit .form-label {
  font-size: 0.6875rem;
}

.order-section--items .order-section-body,
.order-items-section-body {
  padding: 0;
}

.order-items-section-body .table {
  margin-bottom: 0;
}

.order-items-thead-row th {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.5rem 0.75rem;
  border-bottom-width: 1px;
}

.order-items-action-col {
  width: 28px;
  padding-left: 0.75rem !important;
  padding-right: 0 !important;
}

.order-items-qty-col {
  text-align: right;
  padding-right: 0.75rem !important;
}

.request-creation-items th.order-items-qty-col {
  width: 140px;
  min-width: 140px;
  white-space: nowrap;
}

.request-creation-items {
  table-layout: fixed;
  width: 100%;
}

.request-creation-items .order-items-desc-col {
  width: auto;
}

.request-creation-items td,
.request-creation-items th {
  padding: 0.35rem 0.5rem;
  vertical-align: middle;
}

.request-creation-items td:last-child {
  text-align: right;
  padding-right: 0.75rem !important;
}

.request-creation-items .form-control,
.request-creation-items .form-select {
  min-height: 32px;
  padding: 0.2rem 0.4rem;
  font-size: 0.8125rem;
}

.request-creation-items td:last-child .form-control {
  width: 88px;
  max-width: 88px;
  margin-left: auto;
  text-align: right;
}

.order-items-footer {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.06));
  color: var(--bs-secondary-color);
}

.order-form-actions {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

.transfer-request-form .order-format {
  margin-top: 0;
}

.order-section--surgery {
  margin-bottom: 0.5rem !important;
}

.order-section--items {
  margin-bottom: 0 !important;
}

.order-grid--order-meta {
  grid-template-columns: minmax(120px, 1fr) minmax(160px, 1.4fr) minmax(180px, 1.6fr);
}

.order-grid--surgery {
  grid-template-columns:
    minmax(160px, 2fr)
    minmax(110px, 1fr)
    minmax(160px, 2fr)
    minmax(170px, 1.5fr)
    minmax(120px, 0.75fr);
}

@media (max-width: 1199.98px) {
  .order-grid--order,
  .order-grid--order-extended {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .order-grid--order .order-field--customer {
    grid-column: span 2;
  }

  .order-grid--order .order-field--datetime {
    grid-column: span 2;
  }

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

  .order-grid--surgery .order-field--patient,
  .order-grid--surgery .order-field--specialist {
    grid-column: span 1;
  }

  .order-grid--surgery .order-field--surgery-date {
    grid-column: span 2;
  }
}

@media (max-width: 767.98px) {
  .order-grid--order,
  .order-grid--order-extended,
  .order-grid--order-meta,
  .order-grid--surgery {
    grid-template-columns: 1fr;
  }

  .order-grid--order .order-field--customer,
  .order-grid--order .order-field--datetime,
  .order-grid--surgery .order-field--surgery-date {
    grid-column: auto;
  }
}

/* Vista detalle — orden de pedido (solo lectura) */
.transfer-request-show-page .order-request-show {
  margin-top: 0;
}

.order-request-show .order-show-label {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--bs-secondary-color);
  margin-bottom: 1px;
  line-height: 1.2;
}

.order-request-show .order-show-value {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
}

.order-grid--show {
  display: grid;
  gap: 10px 14px;
  align-items: start;
}

.order-grid--show-order {
  grid-template-columns:
    minmax(100px, 1fr)
    minmax(150px, 1.4fr)
    minmax(120px, 1fr)
    minmax(100px, 0.9fr)
    minmax(120px, 1fr)
    minmax(120px, 1fr);
}

.order-grid--show-client {
  grid-template-columns:
    minmax(180px, 2.2fr)
    minmax(100px, 0.8fr)
    minmax(180px, 2fr)
    minmax(100px, 0.8fr);
}

.order-grid--show-surgery {
  grid-template-columns:
    minmax(140px, 1.5fr)
    minmax(110px, 1fr)
    minmax(140px, 1.5fr)
    minmax(120px, 1fr)
    minmax(150px, 1.2fr)
    minmax(100px, 0.8fr)
    minmax(70px, 0.5fr);
}

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

.order-show-field--wide {
  grid-column: span 2;
}

.order-show-empty-meta {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--bs-border-color-translucent, rgba(0, 0, 0, 0.08));
  line-height: 1.4;
}

.order-show-items-table th,
.order-show-items-table td {
  padding: 0.35rem 0.75rem;
  vertical-align: middle;
  font-size: 0.8125rem;
}

.order-show-items-table .order-show-lot-col {
  width: 100px;
  max-width: 100px;
}

.order-show-items-table .order-show-qty-col {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  white-space: nowrap;
  text-align: right;
}

.order-show-items-table td:last-child {
  text-align: right;
}

.order-show-items-table--no-lot .order-show-qty-col {
  width: 100px;
  min-width: 100px;
}

.order-show-footer {
  padding-top: 0.75rem;
  margin-top: 0.25rem;
  border-top: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.08));
}

.order-show-actions-divider {
  display: inline-block;
  width: 1px;
  height: 1.5rem;
  background-color: var(--bs-border-color-translucent, rgba(0, 0, 0, 0.15));
  flex-shrink: 0;
}

.composite-components-panel {
  min-height: 120px;
}

.composite-components-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.88);
  border-radius: var(--bs-border-radius-sm, 0.25rem);
}

.composite-components-loading__content {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.08));
  border-radius: var(--bs-border-radius, 0.375rem);
  background-color: var(--bs-body-bg, #fff);
  color: var(--bs-secondary-color);
  font-size: 0.8125rem;
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.06);
}

@media (max-width: 991.98px) {
  .order-grid--show-order,
  .order-grid--show-client,
  .order-grid--show-surgery,
  .order-grid--show-remision {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-show-field--wide {
    grid-column: span 2;
  }
}

@media (max-width: 575.98px) {
  .order-grid--show-order,
  .order-grid--show-client,
  .order-grid--show-surgery,
  .order-grid--show-remision {
    grid-template-columns: 1fr;
  }

  .order-show-field--wide {
    grid-column: auto;
  }

  .order-show-footer {
    flex-direction: column;
    align-items: stretch !important;
  }

  .order-show-footer-actions {
    justify-content: flex-end;
  }
}

.logistics-page .logistics-card {
  margin-bottom: 0.5rem;
}

.logistics-alert-compact {
  padding: 0.625rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.logistics-alert-compact .ti {
  font-size: 1rem;
  margin-top: 0.1rem;
}

.logistics-location-grid .form-label {
  margin-bottom: 0.25rem;
}

.logistics-location-group {
  display: flex;
  flex-direction: column;
}

.logistics-location-group-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
  margin-bottom: 0.5rem;
}

.logistics-location-group-field:last-of-type {
  margin-bottom: 0;
}

.logistics-location-grid .form-select {
  min-height: 34px;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  font-size: 0.875rem;
}

.destination-field-hint {
  font-size: 0.75rem;
  line-height: 1.3;
}

.logistics-stock-help {
  font-size: 0.75rem;
  line-height: 1.35;
}

.logistics-items-table th,
.logistics-items-table td {
  padding: 0.3rem 0.5rem;
  vertical-align: middle;
  font-size: 0.8125rem;
}

.logistics-items-thead-row th {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.logistics-items-action-col {
  width: 52px;
  padding-left: 0.5rem !important;
  padding-right: 0 !important;
}

.logistics-items-unit-col {
  width: 70px;
  white-space: nowrap;
}

.logistics-items-stock-col {
  width: 96px;
  min-width: 96px;
  white-space: nowrap;
}

.logistics-items-qty-col {
  width: 120px;
  min-width: 120px;
  white-space: nowrap;
  text-align: right;
}

.logistics-items-table .current-qty-cell {
  white-space: nowrap;
}

.logistics-items-table td:last-child {
  text-align: right;
}

.logistics-items-table td:last-child .form-control {
  width: 88px;
  max-width: 88px;
  margin-left: auto;
  text-align: right;
  min-height: 30px;
  padding: 0.2rem 0.4rem;
  font-size: 0.8125rem;
}

.logistics-items-footer {
  color: var(--bs-secondary-color);
}

.logistics-form-footer {
  padding-bottom: 0.25rem;
}

@media (max-width: 767.98px) {
  .logistics-location-grid .col-md-6 + .col-md-6 {
    margin-top: 0.25rem;
  }
}

/* El menú lateral (nav-item/sidebar-nav) no calza con el selector .sidebar-item
   del tema, así que el ícono y la etiqueta no quedaban en flex real — con texto
   largo, la etiqueta caía debajo del ícono en vez de solo hacer wrap en su columna. */
.sidebar-nav #sidebarnav .sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: normal;
}

.sidebar-nav #sidebarnav .sidebar-link > span:first-child {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.sidebar-nav #sidebarnav .sidebar-link .hide-menu {
  white-space: normal;
  line-height: 1.3;
}

/* Cuando el sidebar está colapsado (mini-sidebar) y no se está pasando el mouse
   por encima, un submenú que haya quedado abierto (Bootstrap .collapse.show)
   no debe desbordar íconos sueltos en el riel angosto — se oculta hasta que
   el sidebar se expanda de nuevo (clic o hover). */
[data-layout=vertical] body[data-sidebartype=mini-sidebar] .left-sidebar:not(:hover) .first-level {
  display: none !important;
}

/* Con el sidebar colapsado (sin hover), el ícono debe quedar centrado en el
   riel angosto en vez de pegado a la izquierda — al expandir (hover), vuelve
   a alinearse a la izquierda junto con la etiqueta, como corresponde. */
[data-layout=vertical] body[data-sidebartype=mini-sidebar] .left-sidebar:not(:hover) .sidebar-nav #sidebarnav .sidebar-link {
  justify-content: center;
}

/* Íconos del menú lateral con fondo cuadrado, tamaño de ícono/texto más grande,
   y más espaciado entre ítems — mismos colores del tema, solo estructura. */
.sidebar-nav #sidebarnav .sidebar-link {
  padding: 10px 14px;
  gap: 12px;
}

.sidebar-nav #sidebarnav .nav-item {
  margin-bottom: 4px;
}

.sidebar-nav #sidebarnav .sidebar-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bs-primary-bg-subtle, #ecf2ff);
  flex-shrink: 0;
}

.sidebar-nav #sidebarnav .sidebar-link-icon i {
  font-size: 20px;
  line-height: 1;
}

.sidebar-nav #sidebarnav .sidebar-link .hide-menu {
  font-size: 15px;
}

.sidebar-nav #sidebarnav .first-level .sidebar-link-icon {
  width: 30px;
  height: 30px;
}

.sidebar-nav #sidebarnav .first-level .sidebar-link-icon i {
  font-size: 17px;
}

.sidebar-nav #sidebarnav .first-level .nav-item {
  margin-bottom: 2px;
}

/* La flecha del tema usa un "top" fijo pensado para una fila más baja — con
   íconos/padding más grandes, se recentra verticalmente en la fila. */
.sidebar-nav #sidebarnav .has-arrow::after,
.sidebar-nav #sidebarnav .has-arrow[aria-expanded="true"]::after {
  top: 50%;
}

/* Submenú de Maestros agrupado por sección (Bodegas/Productos/Clientes):
   el título de cada grupo va apagado y un poco más indentado que el ítem
   padre, y sus propios ítems quedan un nivel más adentro todavía — así la
   jerarquía (Maestros > Bodegas > Sedes) se lee de un vistazo al abrir el
   menú, en vez de 15 ítems sueltos en una sola lista plana. */
.sidebar-nav #sidebarnav .sidebar-subgroup-toggle {
  padding: 6px 14px 6px 22px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-secondary-color, #7c8fac);
}

.sidebar-nav #sidebarnav .sidebar-subgroup-toggle .hide-menu {
  font-size: 11px;
}

.sidebar-nav #sidebarnav .sidebar-subgroup-toggle:hover {
  color: var(--bs-primary);
}

.sidebar-nav #sidebarnav .sidebar-subgroup-items .sidebar-link {
  padding-left: 38px;
}

.sidebar-nav #sidebarnav .sidebar-subgroup-items .sidebar-link .hide-menu {
  font-size: 14px;
}

.sidebar-nav #sidebarnav .sidebar-subgroup-items .sidebar-link-icon {
  width: 28px;
  height: 28px;
}

.sidebar-nav #sidebarnav .sidebar-subgroup-items .sidebar-link-icon i {
  font-size: 16px;
}

/* Hotwire Native — layout app instalable */
body.osteotech-native {
  background: #fff;
}

/* Ocultar shell de escritorio en app nativa; no afectar login (usa #main-wrapper.auth-customizer-none) */
body.osteotech-native #main-wrapper:not(.auth-customizer-none) {
  display: none;
}

body.osteotech-native .offcanvas.customizer {
  display: none !important;
}

#native-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.native-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 52px;
  padding: calc(0.5rem + env(safe-area-inset-top, 0px)) 1rem 0.5rem;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.native-topbar__title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.native-body-wrapper {
  flex: 1 1 auto;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

/* App Android: barra inferior nativa (HotwireBottomNavigationController) */
body.osteotech-android-native .native-body-wrapper {
  padding-bottom: 1rem;
}

.native-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  padding: 0.35rem 0 calc(0.35rem + env(safe-area-inset-bottom, 0px));
  background-color: #fff;
  border-top: 1px solid #e8e8e8;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
  isolation: isolate;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Relleno opaco bajo los íconos (zona de gestos del sistema en Android) */
.native-bottom-nav::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: env(safe-area-inset-bottom, 0px);
  background-color: #fff;
  pointer-events: none;
}

.native-bottom-nav__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 52px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--bs-secondary);
  text-decoration: none;
}

.native-bottom-nav__link i {
  font-size: 1.25rem;
  line-height: 1;
}

.native-bottom-nav__link.is-active {
  color: var(--bs-primary);
}

/* ---- "Más" (menú de acceso a inventario/maestros/admin en la app nativa) ---- */
.more-menu__label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bs-secondary-color);
  margin: 18px 2px 8px;
}
.more-menu__label:first-child { margin-top: 2px; }
.more-menu__card {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.08));
  border-radius: 12px;
  overflow: hidden;
}
.more-menu__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.06));
}
.more-menu__row:last-child { border-bottom: none; }
.more-menu__row-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bs-primary-bg-subtle, rgba(93,135,255,0.1));
  color: var(--bs-primary);
  flex-shrink: 0;
  font-size: 1rem;
}
.more-menu__row-body { flex: 1 1 auto; min-width: 0; }
.more-menu__row-title { display: block; font-size: 0.85rem; font-weight: 700; }
.more-menu__row-sub { display: block; font-size: 0.72rem; color: var(--bs-secondary-color); margin-top: 1px; }
.more-menu__chev { color: var(--bs-secondary-color); font-size: 0.85rem; flex-shrink: 0; }
.more-menu__row--danger .more-menu__row-icon { background: var(--bs-danger-bg-subtle, rgba(250,137,107,0.15)); color: var(--bs-danger); }
.more-menu__row--danger .more-menu__row-title { color: var(--bs-danger); }

/* ---- listas tipo card reusadas en Órdenes/Reposición/Remisiones móvil ---- */
.mrow-list {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.08));
  border-radius: 12px;
  overflow: hidden;
}
.mrow-list + .mrow-list,
.mrow-list + .m-section-label { margin-top: 10px; }
.mrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.06));
}
.mrow:last-child { border-bottom: none; }
.mrow__icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
  background: var(--bs-light-primary, rgba(93,135,255,0.1));
  color: var(--bs-primary);
}
.mrow__body { flex: 1 1 auto; min-width: 0; display: block; }
.mrow__title {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mrow__sub {
  display: block;
  font-size: 0.72rem;
  color: var(--bs-secondary-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.mrow__end { text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.mrow__end strong { display: block; font-size: 0.85rem; }
.mrow__end span { font-size: 0.66rem; color: var(--bs-secondary-color); }
.mrow__chev { color: var(--bs-secondary-color); font-size: 0.85rem; flex-shrink: 0; transition: transform 0.15s ease-in-out; }

.mrow--btn {
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.06));
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.mrow--btn:last-child { border-bottom: none; }
.mrow--btn[aria-expanded="true"] .mrow__chev { transform: rotate(180deg); }
.mrow--btn[aria-expanded="true"] { border-bottom-color: transparent; }

.mrow-detail {
  padding: 2px 14px 14px calc(14px + 36px + 10px);
  border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.06));
  background: var(--bs-tertiary-bg, rgba(0,0,0,0.015));
}
.mrow-detail:last-child { border-bottom: none; }
.mrow-detail dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  margin: 0;
}
.mrow-detail dt {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--bs-secondary-color);
  white-space: nowrap;
}
.mrow-detail dd {
  font-size: 0.76rem;
  margin: 0;
}

.m-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bs-secondary-color);
  margin: 18px 2px 8px;
}
.m-section-label:first-child { margin-top: 2px; }

.m-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--bs-secondary-color);
}
.m-empty i { font-size: 2rem; opacity: 0.5; margin-bottom: 8px; display: block; }
.m-empty p { font-size: 0.82rem; margin: 0; }

/* ---- Tarjetas de métricas (pantalla de Inicio) ---- */
.m-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.m-stat-tile {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.08));
  border-radius: 12px;
  padding: 12px 14px;
}
.m-stat-tile__label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
}
.m-stat-tile__value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.25;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.m-stat-tile__delta {
  font-size: 0.68rem;
  color: var(--bs-secondary-color);
  margin-top: 2px;
}
.m-stat-tile__delta--warn { color: #c97e00; }
.m-stat-tile__delta--up { color: var(--bs-primary); }
.m-stat-tile__value--danger { color: var(--bs-danger); }

.m-fab {
  position: fixed;
  right: 18px;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 14px);
  width: 52px; height: 52px;
  border-radius: 999px;
  background: var(--bs-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 10px 20px -6px rgba(93,135,255,0.55);
  z-index: 25;
  text-decoration: none;
}

/* App Android: la barra inferior es nativa (HotwireBottomNavigationController).
   El WebView ya está constreñido en el layout nativo (activity_main.xml,
   layout_constraintBottom_toTopOf="@id/bottom_nav") a terminar justo encima de
   esa barra, sin espacio oculto debajo — así que ni los 72px de una barra HTML
   ni el safe-area-inset-bottom (esa zona de gestos ya la absorbe la barra
   nativa por su cuenta) aplican aquí. */
body.osteotech-android-native .m-fab {
  bottom: 14px;
}

.m-fab--left {
  left: 18px;
  right: auto;
  width: 46px; height: 46px;
  font-size: 1.1rem;
  background: var(--bs-body-bg);
  color: var(--bs-primary);
  border: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.1));
  box-shadow: 0 8px 16px -6px rgba(0,0,0,0.18);
  display: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.15s ease-in-out, transform 0.15s ease-in-out;
}
.m-fab--left.is-visible {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* ---- Barra de paginación (contenido generado por Paginator::getLinkGenerated(), pensado para escritorio) ---- */
.m-pagination-bar {
  overflow-x: auto;
  white-space: nowrap;
  font-size: 0.76rem;
  color: var(--bs-secondary-color);
  margin-bottom: 10px;
  padding-bottom: 2px;
}
.m-pagination-bar .text-success {
  /* Ícono de exportar a Excel del Paginator compartido — exportExcel() no
     está definido en esta pantalla (solo existe en 2 vistas de admin de
     escritorio), así que acá no hace nada. Se oculta solo en este contexto,
     sin tocar Paginator.php (lo usan muchas otras listas). */
  display: none;
}
.m-pagination-bar select {
  font-size: 0.76rem;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.15));
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
}

.m-pagination-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--bs-secondary-color);
}

/* ---- Panel de filtro (reutiliza filter.js del escritorio, apilado en móvil) ---- */
.m-filter-panel {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.08));
  border-radius: 12px;
  padding: 4px 14px;
  margin-bottom: 12px;
}
.m-filter-panel[open] { padding-bottom: 14px; }
.m-filter-panel__toggle {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--bs-primary);
  cursor: pointer;
}
.m-filter-panel__toggle::-webkit-details-marker { display: none; }

.osteotech-native #tbl_filters,
.osteotech-native #tbl_filters tbody,
.osteotech-native #tbl_filters tr {
  display: block;
  width: 100%;
}
.osteotech-native #tbl_filters tr {
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.06));
}
.osteotech-native #tbl_filters tr:last-child { border-bottom: none; }
.osteotech-native #tbl_filters td {
  display: block;
  width: 100%;
  padding: 4px 0;
}
.osteotech-native #tbl_filters td[id^="add_filter_td"],
.osteotech-native #tbl_filters td[id^="del_filter_td"] {
  display: inline-block;
  width: auto;
  margin-right: 14px;
  font-size: 1.4rem;
}

.m-card {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.08));
  border-radius: 12px;
  padding: 12px 14px;
}
.m-card + .m-card { margin-top: 10px; }
.m-field { margin-bottom: 12px; }
.m-field:last-child { margin-bottom: 0; }
.m-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--bs-secondary-color);
  margin-bottom: 5px;
}
.m-field-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.m-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.64rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.m-badge--primary { background: var(--bs-light-primary, rgba(93,135,255,0.1)); color: var(--bs-primary); }
.m-badge--success { background: var(--bs-success-bg-subtle, rgba(19,222,185,0.15)); color: #0ea892; }
.m-badge--warning { background: var(--bs-warning-bg-subtle, rgba(255,174,31,0.15)); color: #c97e00; }
.m-badge--danger  { background: var(--bs-danger-bg-subtle, rgba(250,137,107,0.15)); color: var(--bs-danger); }
.m-badge--info    { background: var(--bs-info-bg-subtle, rgba(83,155,255,0.15)); color: var(--bs-info); }
.m-badge--muted   { background: var(--bs-secondary-bg-subtle, rgba(0,0,0,0.06)); color: var(--bs-secondary-color); }

/* Círculo de color en las tablas de listado (_master_crud_table.html.twig,
   _master_cards.html.twig) para BootstrapColorType. Sin esto el usuario solo
   ve el nombre bootstrap o, para un color heredado, el código hex crudo. */
.select2-color-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  min-width: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.rem-evidence {
  margin-top: 1.25rem;
}

.rem-evidence__title {
  margin-bottom: 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}

.rem-evidence__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.rem-evidence__item,
.rem-evidence__add {
  width: 112px;
  height: 112px;
  border-radius: 12px;
}

.rem-evidence__item {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.08));
  background: var(--bs-tertiary-bg, #f8f9fa);
  color: inherit;
  text-decoration: none;
}

.rem-evidence__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rem-evidence__file {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  text-align: center;
  font-size: 0.68rem;
  line-height: 1.2;
  word-break: break-word;
}

.rem-evidence__file .ti {
  font-size: 1.4rem;
}

.rem-evidence__add {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  border: 1px dashed var(--bs-border-color, #ced4da);
  background: transparent;
  color: var(--bs-secondary-color);
  cursor: pointer;
  font-size: 0.75rem;
}

.rem-evidence__add:hover {
  border-color: var(--bs-primary);
  color: var(--bs-primary);
}

.rem-evidence__add .ti {
  font-size: 1.35rem;
  pointer-events: none;
}

.rem-evidence__add-label {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.rem-evidence__add input[type="file"] {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.rem-evidence__help,
.rem-evidence__errors {
  margin-top: 8px;
  text-align: center;
}

html.gs1-live,
html.gs1-live body,
html.gs1-live #native-app,
html.gs1-live .native-topbar,
html.gs1-live .native-body-wrapper,
html.gs1-live .container-fluid {
  background: transparent !important;
}

html.gs1-live .native-topbar,
html.gs1-live .gs1-scanner-page > :not(.gs1-live-hud) {
  visibility: hidden;
}

html.gs1-live .gs1-live-hud {
  visibility: visible;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 24px;
  z-index: 2;
  margin: 0;
  padding: 0 16px;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

html.gs1-scanner-open,
body.gs1-scanner-open {
  height: 100%;
  overflow: hidden;
}

body.gs1-scanner-open {
  position: relative;
}

.gs1-scanner-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #000;
  color: #fff;
}

.gs1-scanner-screen__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
}

.gs1-scanner-screen__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.2rem;
}

.gs1-scanner-screen__title {
  font-size: 1.05rem;
  font-weight: 700;
}

.gs1-scanner-screen__hint {
  margin: 0;
  padding: 14px 16px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.95rem;
}

.gs1-scanner {
  position: relative;
  flex: 1 1 auto;
  min-height: 240px;
  width: 100%;
  background: #111;
}

.gs1-scanner video {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
}

.gs1-scanner canvas.imgBuffer {
  display: none;
}

.gs1-scanner canvas.drawingBuffer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: transparent;
}

/* Escáner @zxing/library — modal flotante con visor estilizado y láser animado. */
.zxing-scanner-modal__content {
  background: #000;
  border: none;
  overflow: hidden;
}

.zxing-scanner-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #000;
  overflow: hidden;
}

.zxing-scanner-viewport video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.zxing-scanner-viewport__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.zxing-scanner-frame {
  position: absolute;
  inset: 12%;
  pointer-events: none;
  z-index: 2;
}

.zxing-scanner-frame__corner {
  position: absolute;
  width: 32px;
  height: 32px;
  border: 3px solid #ff3b30;
}

.zxing-scanner-frame__corner--tl {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 6px;
}

.zxing-scanner-frame__corner--tr {
  top: 0;
  right: 0;
  border-left: none;
  border-bottom: none;
  border-top-right-radius: 6px;
}

.zxing-scanner-frame__corner--bl {
  bottom: 0;
  left: 0;
  border-right: none;
  border-top: none;
  border-bottom-left-radius: 6px;
}

.zxing-scanner-frame__corner--br {
  bottom: 0;
  right: 0;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 6px;
}

.zxing-scanner-frame__laser {
  position: absolute;
  left: 2%;
  right: 2%;
  height: 2px;
  background: #ff3b30;
  box-shadow: 0 0 8px 2px rgba(255, 59, 48, 0.8);
  animation: zxing-laser-sweep 1.8s ease-in-out infinite;
}

@keyframes zxing-laser-sweep {
  0% {
    top: 4%;
  }
  50% {
    top: 96%;
  }
  100% {
    top: 4%;
  }
}
