/* ============================================================
   Señor Rentas — Capa móvil "aplicación"
   ------------------------------------------------------------
   Convierte la interfaz de escritorio en algo que se siente app:
   modales que suben desde abajo, barra de navegación inferior,
   botón flotante para agregar y buscador que no ocupa espacio.

   Todo vive dentro de @media (max-width: 767.98px). Arriba de ese
   ancho no cambia absolutamente nada.

   Se apoya en los tokens pr-* de softmor-modules/properties.css.
   ============================================================ */

:root {
    --sm-header-h: 76px;        /* lo mide softmor-mobile-app.js al cargar */
    --sm-tab-h: 78px;
    --sm-content-bottom-space: 24px;
    --sm-safe-b: env(safe-area-inset-bottom, 0px);
    --sm-sheet-radius: 20px;
}

/* Piezas que solo existen en móvil: ocultas por defecto para que el
   escritorio no las vea nunca, aunque el HTML siempre se renderice. */
.sm-tabbar,
.sm-install-tab,
.sm-fab,
.sm-search-toggle,
.sm-filter-toggle,
.sm-scrim,
.sm-sheet,
.sm-appbar-title {
    display: none;
}

@media (max-width: 767.98px) {

/* ============================================================
   1. Modales como hoja desde abajo
   ------------------------------------------------------------
   Se aplica a los modales de formulario (todos usan
   .modal-dialog-scrollable). Los avisos de SoftmorAlert quedan
   centrados a propósito: son diálogos de confirmación cortos y
   centrados es lo correcto también en móvil.
   ============================================================ */
.modal-dialog.modal-dialog-scrollable {
    align-items: flex-end;
    display: flex;
    height: 100%;
    margin: 0;
    max-height: 100%;
    max-width: none;
    min-height: 100%;
    width: 100%;
}

@supports (height: 100dvh) {
    .modal-dialog.modal-dialog-scrollable {
        height: 100dvh;
        min-height: 100dvh;
    }
}

.modal-dialog.modal-dialog-scrollable .modal-content {
    border-radius: var(--sm-sheet-radius) var(--sm-sheet-radius) 0 0;
    height: auto;
    max-height: 92vh;
    width: 100%;
}

@supports (height: 100dvh) {
    .modal-dialog.modal-dialog-scrollable .modal-content {
        max-height: 92dvh;
    }
}

/* El asa de arrastre. Es una señal visual de "esto sube y baja". */
.modal-dialog.modal-dialog-scrollable .modal-content::before {
    background: #d6dae0;
    border-radius: 999px;
    content: "";
    height: 4px;
    left: 50%;
    position: absolute;
    top: 8px;
    transform: translateX(-50%);
    width: 38px;
    z-index: 6;
}

.modal-dialog.modal-dialog-scrollable .modal-header {
    padding-top: 22px;
}

/* Sube desde abajo en vez de bajar desde arriba. */
.modal.fade .modal-dialog.modal-dialog-scrollable {
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.32, .72, 0, 1);
}

.modal.show .modal-dialog.modal-dialog-scrollable {
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .modal.fade .modal-dialog.modal-dialog-scrollable {
        transition: none;
    }
}

/* Acciones al pie: pegadas abajo y respetando el área segura del iPhone. */
.modal-dialog.modal-dialog-scrollable .modal-footer {
    padding-bottom: calc(14px + var(--sm-safe-b));
}

.modal-dialog.modal-dialog-scrollable .modal-footer .btn {
    min-height: 48px;
}

/* ============================================================
   1b. Barra superior compacta
   ------------------------------------------------------------
   El encabezado del tema trae un logo horizontal grande, un
   separador y un menú "···". En móvil se convierte en una barra
   de app: menú, título de la página y nada más.
   ============================================================ */
.page-wrapper .page-main-header {
    height: 56px !important;
    min-height: 56px !important;
}

.page-wrapper .page-main-header .main-header-right {
    align-items: center;
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    height: 56px !important;
    min-height: 56px;
    padding: 0 8px;
}

/* El tema fija estos anchos y visibilidades con cadenas de 5 clases
   (.page-wrapper.compact-wrapper .page-main-header …), así que aquí
   toca !important: es eso o replicar sus selectores enteros. */
.sm-has-appbar-title .page-main-header .main-header-left {
    border-right: none !important;
    flex: 0 0 auto;
    height: 56px !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
}

/* El logo se va solo cuando hay un título que ponga en su lugar. */
.sm-has-appbar-title .page-main-header .logo-wrapper,
.sm-has-appbar-title .page-main-header .dark-logo-wrapper {
    display: none !important;
}

.page-main-header .toggle-sidebar {
    align-items: center;
    border-radius: 12px;
    display: flex;
    height: 40px;
    justify-content: center;
    margin: 0;
    width: 40px;
}

.sm-appbar-title {
    color: var(--pr-text-main, #111827);
    display: block;
    flex: 1 1 auto;
    font-family: var(--pr-font, 'Montserrat', sans-serif);
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -.01em;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-main-header .softmor-header-context {
    flex: 0 0 auto;
    padding: 0;
    width: auto;
}

/* Salir y el menú "···" sobran cuando existe la hoja "Más",
   que ya los incluye. Sin barra inferior se quedan. */
.sm-has-tabbar .page-main-header .nav-right,
.sm-has-tabbar .page-main-header .mobile-toggle {
    display: none !important;
}

/* El título ya vive arriba: el bloque del contenido sobra. */
.sm-has-appbar-title .pr-page-header {
    display: none;
}

/* ---- Dashboard ----
   Su encabezado no se puede esconder entero porque lleva dentro el
   filtro de periodo. Se le quita el título (ya está arriba) y el
   "Resumen de <empresa>", que en su propia cuenta no dice nada, y
   queda una barra compacta: filtro arriba, periodo vigente abajo. */
.sm-has-appbar-title .db-page-title,
.sm-has-appbar-title .db-subtitle-lead {
    display: none;
}

/* Botón de periodo en la barra superior. */
.sm-filter-toggle {
    align-items: center;
    background: var(--pr-neutral-lt, #f3f4f6);
    border: none;
    border-radius: 12px;
    color: var(--pr-text-main, #111827);
    cursor: pointer;
    display: flex;
    flex: 0 0 auto;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.sm-filters-open .sm-filter-toggle {
    background: var(--pr-primary-lt, #e8f5f3);
    color: var(--pr-primary, #24695c);
}

/* Plegado por defecto: la vista arranca con los números. */
.db-page-header.db-header-row {
    align-items: stretch;
    background: #fff;
    box-shadow: 0 2px 10px rgba(16, 24, 40, .07);
    flex-direction: column;
    gap: 8px;
    margin: 0 -15px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 15px;
    position: sticky;
    top: var(--sm-header-h);
    transition: max-height .26s ease, opacity .2s ease, padding .26s ease, margin-bottom .26s ease;
    z-index: 8;
}

.sm-filters-open .db-page-header.db-header-row {
    margin-bottom: 16px;
    max-height: 280px;
    opacity: 1;
    padding: 10px 15px 12px;
}

@media (prefers-reduced-motion: reduce) {
    .db-page-header.db-header-row {
        transition: none;
    }
}

.db-header-row .db-filter {
    flex-wrap: wrap;
    gap: 8px;
    order: 1;
    width: 100%;
}

.db-header-row .db-header-copy {
    order: 2;
}

/* El periodo vigente suelto debajo del filtro se veía como un texto
   perdido. Como chip se lee como lo que es: una etiqueta de qué
   estás viendo. */
.db-page-subtitle {
    align-items: center;
    background: var(--pr-neutral-lt, #f3f4f6);
    border-radius: 999px;
    color: var(--pr-text-sub, #6b7280);
    display: inline-flex;
    font-size: .72rem;
    font-weight: 600;
    gap: 6px;
    line-height: 1.3;
    margin: 0;
    padding: 5px 11px 5px 9px;
}

.db-page-subtitle::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    content: "";
    flex: 0 0 auto;
    height: 13px;
    width: 13px;
}

.db-page-subtitle strong {
    color: var(--pr-text-main, #111827);
    font-weight: 700;
}

/* Los anchos base hacen que el acomodo salga solo en los dos casos:
   sin rango, el select y "Aplicar" caben en una fila; con rango, las
   fechas no alcanzan a subir y bajan juntas a su propio renglón.

     sin rango            con rango
     [select] [Aplicar]   [select ..........]
                          [desde]    [hasta]
                          [Aplicar] */
.db-header-row .db-filter-field {
    flex: 1 1 60%;
    min-width: 0;
}

.db-header-row .db-filter-range {
    flex: 1 1 calc(50% - 4px);
}

.db-header-row .db-filter-range .pr-input {
    padding-left: 10px;
    padding-right: 6px;
}

/* La etiqueta "Periodo" sobra: el propio select ya dice cuál es.
   Se oculta a la vista pero sigue ahí para lectores de pantalla. */
.db-header-row .db-filter-field:first-child .db-filter-label {
    clip: rect(0 0 0 0);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.db-header-row .db-filter-btn {
    flex: 0 0 auto;
    padding: 0 16px;
    width: auto;
}

/* ============================================================
   1c. Menú lateral a pantalla completa
   ------------------------------------------------------------
   El tema lo arranca a 65px del tope y con z-index 12, así que
   quedaba por debajo del encabezado y de la barra inferior. Aquí
   se le da todo el alto y se sube por encima de ambos (y de las
   hojas), pero por debajo de los modales de Bootstrap (1055).
   ============================================================ */
.page-wrapper.compact-wrapper .page-body-wrapper.sidebar-icon header.main-nav,
.page-wrapper.compact-wrapper .page-body-wrapper header.main-nav {
    top: 0 !important;
    z-index: 1045 !important;
}

.sidebar-backdrop {
    top: 0 !important;
    z-index: 1044 !important;
}

/* Que el último módulo de la lista no quede debajo del gesto de
   inicio del teléfono. */
.page-wrapper.compact-wrapper .page-body-wrapper header.main-nav .nav-menu {
    padding-bottom: calc(16px + var(--sm-safe-b));
}

/* ---- Dashboard: el resto de las secciones ----
   Mismo lenguaje de card que las listas: esquina de 16px, sombra
   suave y sin borde duro. */
.db-card,
.db-kpi-card,
.db-op-card,
.db-result {
    border: none;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 16px rgba(16, 24, 40, .045);
}

.db-section-label {
    font-size: .7rem;
    margin-bottom: 8px;
}

.db-result-head {
    padding: 12px 16px;
}

.db-result-side,
.db-result-main {
    padding: 16px;
}

/* Los indicadores van de dos en dos: a todo lo ancho eran cuatro
   pantallazos de scroll para ver cuatro números. */
.db-kpi-grid > [class*="col-"],
.db-op-grid > [class*="col-"] {
    flex: 0 0 50%;
    max-width: 50%;
    width: 50%;
}

.db-kpi-card {
    min-height: 0;
    padding: 14px;
}

.db-kpi-icon {
    height: 32px;
    margin-bottom: 10px;
    width: 32px;
}

.db-kpi-value {
    font-size: 1.15rem;
}

.db-kpi-label {
    font-size: .74rem;
    line-height: 1.35;
    margin-bottom: 8px;
}

.db-kpi-trend {
    font-size: .67rem;
    line-height: 1.35;
}

/* En media columna el ícono no cabe al lado del texto: se apila. */
.db-op-card {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    padding: 14px;
}

.db-op-value {
    font-size: 1.15rem;
}

.db-op-label {
    font-size: .74rem;
    line-height: 1.35;
}

.db-card-header {
    padding: 14px 16px;
}

.db-card-body {
    padding: 14px 16px;
}

/* La fila de gastos pedía tres columnas con mínimos de 140 y 90px:
   en 375px no cabían. Ahora concepto e importe comparten renglón y
   la barra cruza debajo. */
.db-expense-row {
    gap: 6px 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px 16px;
}

/* Las filas van explícitas: el orden en el HTML es concepto, barra e
   importe, y sin fijarlas el importe se iba debajo de la barra. */
.db-expense-copy {
    grid-column: 1;
    grid-row: 1;
}

.db-expense-amount {
    grid-column: 2;
    grid-row: 1;
}

.db-expense-bar {
    grid-column: 1 / -1;
    grid-row: 2;
}

.db-expenses-side {
    gap: 2px;
    padding: 10px 16px 14px;
}

/* Cada dato en su renglón, concepto a la izquierda e importe a la
   derecha, en vez de dos columnas que se parten a media palabra. */
.db-expenses-stat {
    align-items: baseline;
    display: flex;
    flex: 1 1 100%;
    gap: 12px;
    justify-content: space-between;
    padding: 6px 0;
}

.db-expenses-stat + .db-expenses-stat {
    border-top: 1px solid var(--pr-border-light, #f0f2f5);
}

/* ============================================================
   2. Barra de navegación inferior
   ============================================================ */
.sm-tabbar {
    background: #fff;
    border-top: 1px solid var(--pr-border-light, #f0f2f5);
    bottom: 0;
    box-shadow: 0 -2px 12px rgba(16, 24, 40, .06);
    display: flex;
    height: calc(var(--sm-tab-h) + var(--sm-safe-b));
    left: 0;
    padding-bottom: var(--sm-safe-b);
    position: fixed;
    right: 0;
    z-index: 1035;
}

.sm-tab {
    align-items: center;
    background: none;
    border: none;
    color: #9aa3ae;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    font-family: var(--pr-font, 'Montserrat', sans-serif);
    font-size: .66rem;
    font-weight: 600;
    flex: 1 1 0;
    gap: 5px;
    justify-content: center;
    line-height: 1.2;
    min-width: 0;
    padding: 4px 2px 2px;
    text-decoration: none;
    transition: color .16s ease, flex-grow .18s ease, max-width .18s ease;
}

.pwa-browser-mode .sm-install-tab {
    display: flex;
    max-width: 100vw;
}

.pwa-is-installed .sm-install-tab {
    display: flex !important;
    flex-grow: 0;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    padding-left: 0;
    padding-right: 0;
    pointer-events: none;
    visibility: hidden;
}

.sm-tab.active {
    color: var(--pr-primary, #24695c);
}

.sm-tab-ic {
    align-items: center;
    display: flex;
    height: 26px;
    justify-content: center;
}

.sm-tab-ic svg {
    height: 23px;
    width: 23px;
}

.sm-tab-label {
    display: -webkit-box;
    line-height: 1.15;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* El contenido arranca justo debajo de la barra superior (que ahora
   mide menos) y extiende el scroll del documento más allá de la barra
   inferior. Ambos paddings llevan !important porque responsive.css
   los reinicia con el shorthand `padding` hasta los 575px. */
.page-wrapper.compact-wrapper .page-body-wrapper .page-body,
.page-wrapper .page-body-wrapper .page-body {
    margin-top: var(--sm-header-h);
    padding-bottom: calc(var(--sm-tab-h) + var(--sm-safe-b) + var(--sm-content-bottom-space)) !important;
    padding-top: 0 !important;
}

/* Separa la primera tarjeta del dashboard de la barra superior compacta. */
.dashboard-exec > .db-result {
    margin-top: 20px;
}

/* El pie de escritorio no aporta nada debajo de una barra de pestañas. */
.page-body-wrapper > footer {
    display: none;
}

/* ============================================================
   3. Botón flotante para agregar
   ------------------------------------------------------------
   Lo inyecta el JS espejeando el botón "Nuevo …" que cada página
   ya tiene en su encabezado, así que hereda permisos y handler.
   ============================================================ */
.sm-fab {
    align-items: center;
    background: var(--pr-primary, #24695c);
    border: none;
    border-radius: 50%;
    bottom: calc(var(--sm-tab-h) + var(--sm-safe-b) + 16px);
    box-shadow: 0 8px 22px rgba(36, 105, 92, .42), 0 2px 6px rgba(36, 105, 92, .3);
    color: #fff;
    cursor: pointer;
    display: flex;
    height: 56px;
    justify-content: center;
    position: fixed;
    right: 16px;
    transition: transform .14s ease;
    width: 56px;
    z-index: 1030;
}

.sm-fab:active {
    transform: scale(.92);
}

.sm-fab svg {
    height: 26px;
    width: 26px;
}

/* El botón del encabezado se va: su lugar lo toma el flotante. */
.pr-page-header .pr-btn-primary {
    display: none;
}

.pr-page-header {
    margin-bottom: 14px;
}

.pr-page-title {
    font-size: 1.25rem;
}

.pr-page-subtitle {
    font-size: .82rem;
}

/* ============================================================
   4. Barra de filtros pegajosa + buscador discreto
   ============================================================ */
/* `position: sticky` no engancha si algún ancestro es contenedor de
   scroll. El tema pone overflow-x: hidden en html y body, y eso crea
   uno. `clip` recorta igual de bien pero sin crear scroll, así la
   barra de filtros sí se queda pegada. Los navegadores que no
   entienden `clip` ignoran la línea y conservan `hidden`. */
html,
body {
    overflow-x: clip;
}

.pr-card-header {
    align-items: center;
    background: #fff;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    position: sticky;
    top: var(--sm-header-h);
    z-index: 8;
}

.pr-card-header .pr-status-tabs {
    flex: 1 1 auto;
    min-width: 0;
    order: 1;
    overflow-x: auto;
    scrollbar-width: none;
}

.pr-card-header .pr-status-tabs::-webkit-scrollbar {
    display: none;
}

.sm-search-toggle {
    align-items: center;
    background: var(--pr-neutral-lt, #f3f4f6);
    border: none;
    border-radius: 12px;
    color: var(--pr-text-main, #111827);
    cursor: pointer;
    display: flex;
    flex: 0 0 auto;
    height: 38px;
    justify-content: center;
    order: 2;
    width: 38px;
}

.pr-card-header.sm-search-open .sm-search-toggle {
    background: var(--pr-primary-lt, #e8f5f3);
    color: var(--pr-primary, #24695c);
}

/* El formulario ya existe en la vista; aquí solo se colapsa. */
.pr-card-header .pr-search-form {
    flex: 1 1 100%;
    max-height: 0;
    opacity: 0;
    order: 3;
    overflow: hidden;
    transition: max-height .24s ease, opacity .18s ease, margin-top .24s ease;
    width: 100%;
}

.pr-card-header.sm-search-open .pr-search-form {
    margin-top: 2px;
    max-height: 200px;
    opacity: 1;
}

/* Campo y botón en una sola fila: apilados se comían media pantalla. */
.pr-card-header .pr-search-form {
    align-items: center;
    flex-direction: row;
    gap: 8px;
}

.pr-card-header .pr-search-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.pr-card-header .pr-btn-search {
    flex: 0 0 auto;
}

/* ============================================================
   5. Listas como cards
   ------------------------------------------------------------
   Cada módulo ya renderiza .pr-mobile-list / .pr-mobile-card en
   móvil; aquí se les da elevación y separación.
   ============================================================ */
.pr-card {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

/* De borde a borde: .page-body trae 15px de padding lateral, así que
   se compensa con margen negativo. Se lee como barra, no como card. */
.pr-card > .pr-card-header {
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(16, 24, 40, .07);
    margin: 0 -15px;
    padding-left: 15px;
    padding-right: 15px;
}

.pr-mobile-list {
    gap: 10px;
    padding: 10px 0 4px;
}

.pr-mobile-card {
    background: #fff;
    border-bottom: none;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 16px rgba(16, 24, 40, .045);
    padding: 14px;
}

.pr-mobile-card:last-child {
    border-bottom: none;
}

.pr-mobile-card-meta {
    padding-left: 0;
}

/* ---- Card tocable (patrón nuevo) ---- */
.sm-card {
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    transition: transform .12s ease;
}

.sm-card:active {
    transform: scale(.985);
}

/* Variante en la que la card entera es un enlace (actas de inventario). */
.sm-card-link,
.sm-card-link:hover,
.sm-card-link:focus {
    color: inherit;
    display: block;
    text-decoration: none;
}

/* Los botones siguen en el DOM porque son los que llevan los data-*
   que espera el JS del módulo; solo dejan de verse. La hoja de
   acciones les reenvía el click. */
.sm-card .pr-actions {
    display: none;
}

.sm-card-top {
    align-items: center;
    display: flex;
    gap: 12px;
}

.sm-card .pr-avatar {
    border-radius: 14px;
    flex: 0 0 auto;
    font-size: .85rem;
    height: 44px;
    width: 44px;
}

.sm-card-id {
    flex: 1 1 auto;
    min-width: 0;
}

.sm-card-name {
    color: var(--pr-text-main, #111827);
    display: block;
    font-family: var(--pr-font, 'Montserrat', sans-serif);
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: -.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sm-card-sub {
    color: var(--pr-text-sub, #6b7280);
    display: block;
    font-size: .78rem;
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sm-card-chevron {
    align-items: center;
    color: #c3cad2;
    display: flex;
    flex: 0 0 auto;
}

.sm-card-chevron svg {
    height: 18px;
    width: 18px;
}

.sm-card-body {
    border-top: 1px dashed var(--pr-border, #e8eaed);
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 12px;
    padding-top: 11px;
}

.sm-card-line {
    align-items: center;
    color: var(--pr-text-sub, #6b7280);
    display: flex;
    font-size: .82rem;
    gap: 8px;
    min-width: 0;
}

.sm-card-line svg {
    color: #9ca3af;
    flex: 0 0 auto;
    height: 15px;
    width: 15px;
}

.sm-card-line span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sm-card-line.is-empty {
    color: #a9b0b9;
}

.sm-card-foot {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    margin-top: 12px;
}

/* ---- Filas de la hoja de acciones ---- */
.sm-actions-body {
    padding: 6px 8px calc(10px + var(--sm-safe-b));
}

.sm-action-row {
    align-items: center;
    background: none;
    border: none;
    border-radius: 14px;
    color: var(--pr-text-main, #111827);
    cursor: pointer;
    display: flex;
    font-family: var(--pr-font, 'Montserrat', sans-serif);
    font-size: .95rem;
    font-weight: 600;
    gap: 13px;
    padding: 14px 12px;
    text-align: left;
    width: 100%;
}

.sm-action-row:active {
    background: var(--pr-neutral-lt, #f3f4f6);
}

.sm-action-row.is-danger {
    color: var(--pr-danger, #e05c5c);
}

.sm-action-row[disabled] {
    color: #9ca3af;
    cursor: not-allowed;
}

.sm-action-ic {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
}

.sm-action-ic svg {
    height: 19px;
    width: 19px;
}

.sm-action-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sm-action-hint {
    color: var(--pr-text-sub, #6b7280);
    font-size: .74rem;
    font-weight: 500;
    line-height: 1.35;
}

.sm-action-row[disabled] .sm-action-hint {
    color: #a9b0b9;
}

/* Con nombres largos, los botones de acción se apilaban uno debajo
   del otro y reventaban el alto de la card. */
.pr-mobile-card-top .pr-property-cell {
    min-width: 0;
}

.pr-mobile-card-top .pr-property-info {
    min-width: 0;
}

.pr-mobile-card-top .pr-property-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pr-mobile-card-top .pr-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
}

.pr-empty {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 16px rgba(16, 24, 40, .045);
    margin-top: 10px;
}

.pr-pagination {
    padding-top: 6px;
}

/* ============================================================
   6. Hojas propias (Más, acciones)
   ============================================================ */
.sm-scrim {
    background: rgba(9, 16, 24, .45);
    display: block;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity .26s ease;
    z-index: 1040;
}

.sm-scrim.is-open {
    opacity: 1;
    pointer-events: auto;
}

.sm-sheet {
    background: #fff;
    border-radius: var(--sm-sheet-radius) var(--sm-sheet-radius) 0 0;
    bottom: 0;
    box-shadow: 0 -8px 30px rgba(9, 16, 24, .18);
    display: flex;
    flex-direction: column;
    left: 0;
    max-height: 88vh;
    position: fixed;
    right: 0;
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.32, .72, 0, 1);
    z-index: 1041;
}

.sm-sheet.is-open {
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .sm-sheet {
        transition: none;
    }
}

.sm-grabber {
    background: #d6dae0;
    border-radius: 999px;
    flex: 0 0 auto;
    height: 4px;
    margin: 9px auto 0;
    width: 38px;
}

.sm-sheet-head {
    align-items: center;
    border-bottom: 1px solid var(--pr-border-light, #f0f2f5);
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
    padding: 12px 16px;
}

.sm-sheet-title {
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: var(--pr-text-main, #111827);
    display: -webkit-box;
    flex: 1 1 auto;
    font-family: var(--pr-font, 'Montserrat', sans-serif);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.35;
    min-width: 0;
    overflow: hidden;
}

.sm-icon-btn {
    align-items: center;
    background: none;
    border: none;
    border-radius: 12px;
    color: var(--pr-text-sub, #6b7280);
    cursor: pointer;
    display: flex;
    flex: 0 0 auto;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.sm-icon-btn:active {
    background: var(--pr-neutral-lt, #f3f4f6);
}

.sm-sheet-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: 14px 12px calc(14px + var(--sm-safe-b));
}

.sm-more-grid {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sm-more-item {
    align-items: center;
    border-radius: 14px;
    color: var(--pr-text-sub, #6b7280);
    display: flex;
    flex-direction: column;
    font-family: var(--pr-font, 'Montserrat', sans-serif);
    font-size: .68rem;
    font-weight: 600;
    gap: 7px;
    line-height: 1.25;
    padding: 13px 4px;
    text-align: center;
    text-decoration: none;
}

.sm-more-item:active {
    background: var(--pr-neutral-lt, #f3f4f6);
}

.sm-more-item.active {
    background: var(--pr-primary-lt, #e8f5f3);
    color: var(--pr-primary, #24695c);
}

.sm-more-ic svg {
    height: 22px;
    width: 22px;
}

.sm-more-logout {
    border-top: 1px solid var(--pr-border-light, #f0f2f5);
    margin-top: 12px;
    padding-top: 8px;
}

.sm-more-logout button {
    align-items: center;
    background: none;
    border: none;
    border-radius: 14px;
    color: var(--pr-danger, #e05c5c);
    cursor: pointer;
    display: flex;
    font-family: var(--pr-font, 'Montserrat', sans-serif);
    font-size: .92rem;
    font-weight: 600;
    gap: 12px;
    padding: 14px 12px;
    width: 100%;
}

.sm-more-logout button:active {
    background: var(--pr-danger-lt, #fdf0f0);
}

.sm-more-logout svg {
    height: 19px;
    width: 19px;
}

/* Bloquea el scroll del fondo mientras una hoja está abierta. */
body.sm-sheet-lock {
    overflow: hidden;
}

}
