/* JUDExIA PWA — navegación exclusivamente móvil.
 * Regla: escritorio (>768px) permanece sin cambios de diseño.
 */
.jx-mobile-bar, .jx-mobile-backdrop { display: none; }
@media (max-width: 768px) {
  :root { --jx-mobile-bar-height: 58px; }
  .jx-mobile-bar {
    display: flex;
    position: fixed;
    inset: 0 0 auto 0;
    min-height: calc(var(--jx-mobile-bar-height) + env(safe-area-inset-top, 0px));
    padding: calc(7px + env(safe-area-inset-top, 0px)) 14px 7px;
    align-items: center;
    gap: 12px;
    z-index: 1041;
    color: var(--jx-text, #172033);
    background: var(--jx-surface, #ffffff);
    border-bottom: 1px solid var(--jx-border, #d1d5db);
    box-shadow: 0 3px 14px rgba(10, 20, 40, .07);
  }
  .jx-mobile-menu-toggle {
    display: inline-flex;
    flex: 0 0 43px;
    width: 43px;
    height: 43px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--jx-border, #d1d5db);
    border-radius: 11px;
    color: inherit;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
  }
  .jx-mobile-menu-toggle:focus-visible {
    outline: 3px solid var(--jx-accent, #e11d2e);
    outline-offset: 2px;
  }
  .jx-mobile-title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.02em;
    white-space: nowrap;
  }
  .jx-mobile-title .jx-mobile-x { color: #e11d2e; }
  .jx-mobile-bar .jx-mobile-home {
    margin-left: auto;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--jx-text, #172033);
    font-size: 18px;
    text-decoration: none;
  }
  .jx-mobile-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    background: rgba(11, 21, 39, .55);
    z-index: 1042;
    cursor: pointer;
  }
  body.jx-theme-active .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1043;
    width: min(290px, 87vw);
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(-110%);
    visibility: hidden;
    transition: transform .2s ease, visibility .2s ease;
    box-shadow: 6px 0 28px rgba(0, 0, 0, .1);
  }
  body.jx-theme-active .sidebar.jx-mobile-open {
    transform: translateX(0) !important;
    visibility: visible;
  }
  body.jx-mobile-nav-open { overflow: hidden; }
  body.jx-theme-active .content-wrapper {
    min-width: 0;
    width: 100%;
    max-width: 100vw;
    padding: calc(var(--jx-mobile-bar-height) + env(safe-area-inset-top, 0px) + 12px) 12px 20px !important;
  }
}
@media (prefers-reduced-motion: reduce) and (max-width: 768px) {
  body.jx-theme-active .sidebar { transition: none; }
}

/* PWA: adaptación de fichas y listados sin intervenir en escritorio. */
@media (max-width: 768px) {
  .jx-causes-list .jx-causes-search > .position-relative {
    flex: 1 1 100% !important;
    min-width: 0;
  }
  .jx-causes-list .jx-causes-search > .btn {
    flex: 1 1 calc(50% - 8px);
    min-height: 42px;
  }
  .jx-causes-list .table-responsive,
  .jx-clients .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .jx-causes-list .table-responsive table,
  .jx-clients .table-responsive table {
    min-width: 640px;
  }
  .jx-causes-list .table-responsive td,
  .jx-clients .table-responsive td {
    overflow-wrap: anywhere;
    vertical-align: middle;
  }
  .jx-causes-list .table-responsive td:last-child {
    min-width: 190px;
  }
  .jx-causes-list .table-responsive td:last-child .btn {
    margin: 2px 1px;
  }
  .jx-cause-detail .jx-value,
  .jx-cause-detail .jx-section-text,
  .jx-clients .jx-client-name {
    overflow-wrap: anywhere;
  }
}

/* JUDEXIA PWA — Clientes como fichas verticales, SOLO en teléfonos.
   No modifica estructura DOM, botones, datos, rutas ni permisos. */
@media (max-width: 768px) {
  .jx-clients .jx-card > .table-responsive {
    overflow-x: visible;
  }
  .jx-clients .table-responsive > table {
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
  }
  .jx-clients .table-responsive thead {
    display: none;
  }
  .jx-clients .table-responsive tbody,
  .jx-clients .table-responsive tr.jx-row {
    display: block;
    width: 100%;
  }
  .jx-clients .table-responsive tr.jx-row {
    padding: 14px;
    margin-bottom: 12px;
    background: var(--jx-surface, #fff);
    border: 1px solid var(--jx-border, #d1d5db);
    border-radius: 14px;
    box-shadow: 0 3px 14px rgba(20, 33, 61, .06);
  }
  .jx-clients .table-responsive tr.jx-row > td {
    display: block;
    width: 100%;
    border: 0;
    padding: 6px 0;
    text-align: left !important;
    overflow-wrap: anywhere;
  }
  .jx-clients .table-responsive tr.jx-row > td:first-child {
    padding-top: 0;
    font-size: 1.02rem;
  }
  .jx-clients .table-responsive tr.jx-row > td:nth-child(2)::before {
    content: "RUT: ";
    color: var(--jx-muted, #7b8798);
    font-weight: 600;
  }
  .jx-clients .table-responsive tr.jx-row > td:nth-child(3)::before {
    content: "Contacto";
    display: block;
    color: var(--jx-muted, #7b8798);
    font-size: .73rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 3px;
  }
  .jx-clients .table-responsive tr.jx-row > td:nth-child(4)::before {
    content: "Causas: ";
    color: var(--jx-muted, #7b8798);
    font-weight: 600;
  }
  .jx-clients .table-responsive tr.jx-row > td:last-child {
    padding-top: 11px;
  }
  .jx-clients .table-responsive tr.jx-row > td:last-child .btn {
    display: block;
    width: 100%;
    min-height: 42px;
  }
}

/* JUDEXIA PWA — fichas de Causas SOLO en móvil.
   Se conservan enlaces, formularios, confirmación y permisos del servidor. */
@media (max-width: 768px) {
  .jx-causes-list > .table-responsive {
    width: 100%;
    overflow-x: visible;
  }
  .jx-causes-list > .table-responsive > table {
    display: block;
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
  }
  .jx-causes-list > .table-responsive > table > thead {
    display: none;
  }
  .jx-causes-list > .table-responsive > table > tbody {
    display: block;
    width: 100%;
  }
  .jx-causes-list > .table-responsive > table > tbody > tr {
    display: block;
    width: 100%;
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid var(--jx-border, #d1d5db);
    border-radius: 14px;
    background: var(--jx-surface, #fff);
    box-shadow: 0 3px 14px rgba(20, 33, 61, .06);
  }
  .jx-causes-list > .table-responsive > table > tbody > tr:nth-of-type(odd) > *,
  .jx-causes-list > .table-responsive > table > tbody > tr:nth-of-type(even) > * {
    --bs-table-bg-type: transparent;
    --bs-table-accent-bg: transparent;
    box-shadow: none;
  }
  .jx-causes-list > .table-responsive > table > tbody > tr > td {
    display: block;
    width: 100%;
    padding: 6px 0;
    border: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
    text-align: left !important;
    background: transparent;
  }
  .jx-causes-list > .table-responsive > table > tbody > tr > td:first-child {
    color: var(--jx-muted, #7b8798);
    font-size: .75rem;
  }
  .jx-causes-list > .table-responsive > table > tbody > tr > td:first-child::before {
    content: "ID: ";
    font-weight: 700;
  }
  .jx-causes-list > .table-responsive > table > tbody > tr > td:nth-child(2) {
    font-size: 1.08rem;
    font-weight: 750;
    line-height: 1.35;
  }
  .jx-causes-list > .table-responsive > table > tbody > tr > td:nth-child(3)::before {
    content: "ROL: ";
    color: var(--jx-muted, #7b8798);
    font-weight: 700;
  }
  .jx-causes-list > .table-responsive > table > tbody > tr > td:nth-child(4)::before {
    content: "Cliente: ";
    color: var(--jx-muted, #7b8798);
    font-weight: 700;
  }
  .jx-causes-list > .table-responsive > table > tbody > tr > td:nth-child(5)::before {
    content: "Tribunal: ";
    color: var(--jx-muted, #7b8798);
    font-weight: 700;
  }
  .jx-causes-list > .table-responsive > table > tbody > tr > td:nth-child(6)::before {
    content: "Estado: ";
    color: var(--jx-muted, #7b8798);
    font-weight: 700;
  }
  .jx-causes-list > .table-responsive > table > tbody > tr > td:nth-child(7)::before {
    content: "Inicio: ";
    color: var(--jx-muted, #7b8798);
    font-weight: 700;
  }
  .jx-causes-list > .table-responsive > table > tbody > tr > td:last-child {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid var(--jx-border, #d1d5db);
  }
  .jx-causes-list > .table-responsive > table > tbody > tr > td:last-child > a,
  .jx-causes-list > .table-responsive > table > tbody > tr > td:last-child > form {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    margin: 0;
  }
  .jx-causes-list > .table-responsive > table > tbody > tr > td:last-child > form > button {
    width: 100%;
  }
  .jx-causes-list > .table-responsive > table > tbody > tr > td:last-child .btn {
    min-height: 42px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
  }
}

/* JUDEXIA PWA — contraste del aviso profesional PJUD en móviles.
   El tema oscuro aplica color claro a todos los párrafos; el aviso tiene fondo crema.
   Se restaura el contraste solo dentro del aviso, sin alterar su texto legal. */
@media (max-width: 768px) {
  body.jx-theme-active .jx-pjud-page .jx-pjud-disclaimer {
    color: #293244;
    background: #fffaf1;
  }
  body.jx-theme-active .jx-pjud-page .jx-pjud-disclaimer p,
  body.jx-theme-active .jx-pjud-page .jx-pjud-disclaimer p strong {
    color: #293244;
  }
  body.jx-theme-active .jx-pjud-page .jx-pjud-disclaimer .fw-bold {
    color: #1c2940;
  }
}

/* JUDEXIA PWA — contraste de tarjetas judiciales en móvil.
   El tema oscuro hereda texto claro sobre tarjetas blancas PJUD.
   Ajuste exclusivamente visual: no afecta lógica, filtros ni adjuntos. */
@media (max-width: 768px) {
  body.jx-theme-active .jx-pjud-page .jx-pjud-card {
    background-color: #ffffff;
    color: #263449;
  }
  body.jx-theme-active .jx-pjud-page .jx-pjud-card .jx-pjud-preview,
  body.jx-theme-active .jx-pjud-page .jx-pjud-card p.jx-pjud-preview {
    color: #59677c !important;
  }
  body.jx-theme-active .jx-pjud-page .jx-pjud-card .jx-pjud-from {
    color: #59677c;
  }
  body.jx-theme-active .jx-pjud-page .jx-pjud-card .jx-pjud-subject {
    color: #263449;
  }
  body.jx-theme-active .jx-pjud-page .jx-pjud-card .jx-pjud-subject:hover {
    color: #ba1232;
  }
  body.jx-theme-active .jx-pjud-page .jx-pjud-card .jx-pjud-meta-label {
    color: #65738a;
  }
  body.jx-theme-active .jx-pjud-page .jx-pjud-card .jx-pjud-meta-value {
    color: #263449;
  }
}

/* JUDEXIA PWA — documentos de Causas y Extrajudiciales en fichas móviles.
   SOLO presentación; respeta R2/históricos, CSRF, formularios y rutas. */
@media (max-width: 768px) {
  .jx-causa-docs [style*="min-width:220px"] {
    min-width: 0 !important;
    text-align: left !important;
  }
  .jx-causa-docs select.form-select[style*="max-width"],
  .jx-exj-detail .jx-exj-docs-list select.form-select[style*="max-width"] {
    max-width: 100% !important;
  }
  .jx-causa-docs > .table,
  .jx-exj-detail .jx-exj-docs-list > .table {
    display: block;
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }
  .jx-causa-docs > .table thead,
  .jx-exj-detail .jx-exj-docs-list > .table thead {
    display: none;
  }
  .jx-causa-docs > .table tbody,
  .jx-exj-detail .jx-exj-docs-list > .table tbody {
    display: block;
    width: 100%;
  }
  .jx-causa-docs > .table tbody > tr,
  .jx-exj-detail .jx-exj-docs-list > .table tbody > tr {
    display: block;
    width: 100%;
    padding: 14px;
    margin-bottom: 12px;
    border: 1px solid var(--jx-border, #d1d5db);
    border-radius: 14px;
    background: var(--jx-surface, #fff);
  }
  .jx-causa-docs > .table tbody > tr > td,
  .jx-exj-detail .jx-exj-docs-list > .table tbody > tr > td {
    display: block;
    padding: 6px 0;
    width: 100%;
    border: 0;
    box-shadow: none !important;
    background: transparent !important;
    text-align: left !important;
    white-space: normal !important;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .jx-causa-docs > .table tbody > tr > td:first-child .fw-semibold,
  .jx-exj-detail .jx-exj-docs-list > .table tbody > tr > td:first-child .fw-semibold {
    font-size: 1rem;
    overflow-wrap: anywhere;
  }
  .jx-causa-docs > .table tbody > tr > td:last-child > .d-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 8px !important;
  }
  .jx-exj-detail .jx-exj-docs-list > .table tbody > tr > td:last-child {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
  }
  .jx-causa-docs > .table tbody > tr > td:last-child .btn,
  .jx-exj-detail .jx-exj-docs-list > .table tbody > tr > td:last-child .btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .jx-exj-detail .jx-exj-docs-list > .table tbody > tr > td:last-child > a,
  .jx-exj-detail .jx-exj-docs-list > .table tbody > tr > td:last-child > form {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    margin: 0;
  }
  .jx-exj-detail .jx-exj-docs-list > .table tbody > tr > td:last-child > form > button {
    width: 100%;
  }
}

/* JUDEXIA PWA — selector PDF compacto y legible en teléfono.
   Solo apariencia del input nativo; mantiene selección múltiple y POST existentes. */
@media (max-width: 768px) {
  .jx-causa-docs input[type="file"][name="documentos"] {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    font-size: 11px;
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .jx-causa-docs input[type="file"][name="documentos"]::file-selector-button {
    font-size: 12px;
    padding: 8px 9px;
    margin-right: 7px;
    max-width: 48%;
    white-space: nowrap;
  }
}

/* JUDEXIA PWA — selector y advertencia extrajudicial legibles en teléfono.
   No altera carga múltiple, R2, eliminación ni formularios existentes. */
@media (max-width: 768px) {
  .jx-exj-detail input[type="file"][name="archivo"] {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
    line-height: 1.45;
  }
  .jx-exj-detail input[type="file"][name="archivo"]::file-selector-button {
    font-size: 12px;
    padding: 8px 9px;
    margin-right: 7px;
    max-width: 48%;
    white-space: nowrap;
  }
  body.jx-theme-active .jx-exj-detail .jx-danger-zone {
    color: #293244;
    background: #fffafa;
  }
  body.jx-theme-active .jx-exj-detail .jx-danger-zone .text-muted,
  body.jx-theme-active .jx-exj-detail .jx-danger-zone .small {
    color: #485265 !important;
  }
  body.jx-theme-active .jx-exj-detail .jx-danger-zone .text-danger {
    color: #ba1232 !important;
  }
}

/* JX_FIN_MOBILE_CARDS_V1
   Presentación móvil de las dos tablas principales.
   Mantiene intactos TR, TD, eventos JS y datos Jinja.
*/
@media (max-width: 767.98px) {

  .jx-fin-mobile-cards,
  .jx-fin-mobile-cards tbody {
    display: block;
    width: 100%;
  }

  .jx-fin-mobile-cards thead {
    display: none;
  }

  .jx-fin-mobile-cards tbody tr {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #d6dce5;
    border-radius: 14px;
    overflow: hidden;
  }

  .jx-fin-mobile-cards tbody td {
    display: grid;
    grid-template-columns: minmax(0, 44%) minmax(0, 56%);
    gap: 10px;
    align-items: start;
    width: 100%;
    padding: 10px 0 !important;
    border-bottom: 1px solid #edf0f4;
    text-align: right !important;
    overflow-wrap: anywhere;
    min-width: 0;
    box-shadow: none !important;
    background: transparent !important;
  }

  .jx-fin-mobile-cards tbody td:last-child {
    border-bottom: 0;
  }

  .jx-fin-mobile-cards tbody td::before {
    display: block;
    font-weight: 500;
    color: #657084;
    text-align: left;
  }

  /* Tabla de Cobranza */
  .jx-fin-mobile-cards tbody
  tr.jx-cobrar-cliente-row td:nth-child(1)::before {
    content: "Cliente";
  }
  .jx-fin-mobile-cards tbody
  tr.jx-cobrar-cliente-row td:nth-child(2)::before {
    content: "Asuntos";
  }
  .jx-fin-mobile-cards tbody
  tr.jx-cobrar-cliente-row td:nth-child(3)::before {
    content: "Cuotas";
  }
  .jx-fin-mobile-cards tbody
  tr.jx-cobrar-cliente-row td:nth-child(4)::before {
    content: "Vencidas";
  }
  .jx-fin-mobile-cards tbody
  tr.jx-cobrar-cliente-row td:nth-child(5)::before {
    content: "Saldo vencido";
  }
  .jx-fin-mobile-cards tbody
  tr.jx-cobrar-cliente-row td:nth-child(6)::before {
    content: "Saldo pendiente";
  }

  /* Tabla del resumen financiero */
  .jx-fin-mobile-cards tbody
  tr.jx-client-row td:nth-child(1)::before {
    content: "Cliente";
  }
  .jx-fin-mobile-cards tbody
  tr.jx-client-row td:nth-child(2)::before {
    content: "Causas";
  }
  .jx-fin-mobile-cards tbody
  tr.jx-client-row td:nth-child(3)::before {
    content: "Honorarios";
  }
  .jx-fin-mobile-cards tbody
  tr.jx-client-row td:nth-child(4)::before {
    content: "Cobrado";
  }
  .jx-fin-mobile-cards tbody
  tr.jx-client-row td:nth-child(5)::before {
    content: "Honorarios pendientes";
  }
  .jx-fin-mobile-cards tbody
  tr.jx-client-row td:nth-child(6)::before {
    content: "Gastos por reembolsar";
  }

  /* Estado vacío: no generar etiquetas artificiales */
  .jx-fin-mobile-cards tbody tr:has(td.jx-empty) td {
    display: block;
    text-align: center !important;
  }

  .jx-fin-mobile-cards tbody tr:has(td.jx-empty)
  td::before {
    content: none;
  }

  /* Las filas siguen siendo seleccionables */
  .jx-fin-mobile-cards tbody tr[style*="cursor:pointer"] {
    cursor: pointer;
  }
}

/* JX_DOCUMENTOS_MOBILE_CARDS_V1
   Solo presentación. No modifica formularios ni permisos.
*/
@media (max-width: 767.98px) {

  .jx-doc-mobile-cards,
  .jx-doc-mobile-cards tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .jx-doc-mobile-cards thead {
    display: none;
  }

  .jx-doc-mobile-cards tbody tr {
    display: block;
    width: 100%;
    min-width: 0;
    margin-bottom: 12px;
    padding: 14px;
    background: #fff;
    border: 1px solid #d6dce5;
    border-radius: 14px;
    overflow-wrap: anywhere;
  }

  .jx-doc-mobile-cards tbody td {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 10px 0 !important;
    border-bottom: 1px solid #edf0f4;
    background: transparent !important;
    box-shadow: none !important;
    overflow-wrap: anywhere;
  }

  .jx-doc-mobile-cards tbody td:last-child {
    border-bottom: 0;
  }

  .jx-doc-mobile-cards tbody td:nth-child(1)::before,
  .jx-doc-mobile-cards tbody td:nth-child(2)::before,
  .jx-doc-mobile-cards tbody td:nth-child(3)::before {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #657084;
  }

  .jx-doc-mobile-cards tbody td:nth-child(1)::before {
    content: "Documento";
  }

  .jx-doc-mobile-cards tbody td:nth-child(2)::before {
    content: "Fecha";
  }

  .jx-doc-mobile-cards tbody td:nth-child(3)::before {
    content: "Acciones";
  }

  .jx-doc-mobile-cards .form-select {
    width: 100%;
    max-width: 100% !important;
    min-height: 40px;
  }

  .jx-doc-mobile-cards tbody td:last-child > .d-flex {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px !important;
  }

  .jx-doc-mobile-cards tbody td:last-child .btn {
    min-height: 40px;
    min-width: 48px;
  }
}

/* JX_AUDIENCIAS_MOBILE_V1
   Presentación móvil sin modificar acciones ni estados.
*/
@media (max-width: 767.98px) {

  .jx-aud-mobile-cards,
  .jx-causa-aud-mobile-cards,
  .jx-aud-mobile-cards tbody,
  .jx-causa-aud-mobile-cards tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .jx-aud-mobile-cards thead,
  .jx-causa-aud-mobile-cards thead {
    display: none;
  }

  .jx-aud-mobile-cards tbody tr,
  .jx-causa-aud-mobile-cards tbody tr {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid #d6dce5;
    border-radius: 14px;
    background: #fff;
    overflow-wrap: anywhere;
  }

  .jx-aud-mobile-cards tbody td,
  .jx-causa-aud-mobile-cards tbody td {
    display: grid;
    grid-template-columns: minmax(0, 38%) minmax(0, 62%);
    gap: 8px;
    align-items: start;
    width: 100%;
    min-width: 0;
    max-width: none !important;
    padding: 10px 0 !important;
    border-bottom: 1px solid #edf0f4;
    background: transparent !important;
    box-shadow: none !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere;
    text-align: left !important;
  }

  .jx-aud-mobile-cards tbody td:last-child,
  .jx-causa-aud-mobile-cards tbody td:last-child {
    border-bottom: 0;
  }

  .jx-aud-mobile-cards tbody td::before,
  .jx-causa-aud-mobile-cards tbody td::before {
    display: block;
    color: #657084;
    font-size: 13px;
    font-weight: 600;
  }

  /* Agenda general: 7 columnas */
  .jx-aud-mobile-cards td:nth-child(1)::before {
    content: "Fecha";
  }
  .jx-aud-mobile-cards td:nth-child(2)::before {
    content: "Hora";
  }
  .jx-aud-mobile-cards td:nth-child(3)::before {
    content: "Tribunal";
  }
  .jx-aud-mobile-cards td:nth-child(4)::before {
    content: "Tipo";
  }
  .jx-aud-mobile-cards td:nth-child(5)::before {
    content: "Estado";
  }
  .jx-aud-mobile-cards td:nth-child(6)::before {
    content: "Observaciones";
  }
  .jx-aud-mobile-cards td:nth-child(7)::before {
    content: "Acciones";
  }

  /* Audiencias de una causa: 6 columnas */
  .jx-causa-aud-mobile-cards td:nth-child(1)::before {
    content: "Fecha";
  }
  .jx-causa-aud-mobile-cards td:nth-child(2)::before {
    content: "Hora";
  }
  .jx-causa-aud-mobile-cards td:nth-child(3)::before {
    content: "Tipo";
  }
  .jx-causa-aud-mobile-cards td:nth-child(4)::before {
    content: "Estado";
  }
  .jx-causa-aud-mobile-cards td:nth-child(5)::before {
    content: "Título";
  }
  .jx-causa-aud-mobile-cards td:nth-child(6)::before {
    content: "Acciones";
  }

  .jx-aud-mobile-cards .btn,
  .jx-causa-aud-mobile-cards .btn {
    min-height: 40px;
  }

  .jx-causa-aud-mobile-cards .d-inline-flex {
    flex-wrap: wrap;
    gap: 8px !important;
  }
}

/* JX_CAUSAS_REAL_MOBILE_V1
   Listado activo /causas. Solo presentación móvil.
   Respeta la navegación de filas y los estados existentes.
*/
@media (max-width: 767.98px) {

  .jx-causas-real-mobile,
  .jx-causas-real-mobile tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .jx-causas-real-mobile thead {
    display: none;
  }

  .jx-causas-real-mobile tbody tr.jx-row-clickable {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid #d6dce5;
    border-radius: 14px;
    background: #fff;
    overflow-wrap: anywhere;
    cursor: pointer;
  }

  .jx-causas-real-mobile tbody tr.jx-row-clickable td {
    display: grid;
    grid-template-columns: minmax(0, 34%) minmax(0, 66%);
    gap: 8px;
    align-items: start;
    width: 100%;
    min-width: 0 !important;
    max-width: none !important;
    padding: 10px 0 !important;
    border-bottom: 1px solid #edf0f4;
    background: transparent !important;
    box-shadow: none !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  .jx-causas-real-mobile tbody tr.jx-row-clickable td:last-child {
    border-bottom: 0;
  }

  .jx-causas-real-mobile tbody tr.jx-row-clickable td::before {
    display: block;
    color: #657084;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
  }

  .jx-causas-real-mobile tbody tr.jx-row-clickable td:nth-child(1)::before {
    content: "Causa";
  }

  .jx-causas-real-mobile tbody tr.jx-row-clickable td:nth-child(2)::before {
    content: "Cliente";
  }

  .jx-causas-real-mobile tbody tr.jx-row-clickable td:nth-child(3)::before {
    content: "Actividad";
  }

  .jx-causas-real-mobile tbody tr.jx-row-clickable td:nth-child(4)::before {
    content: "Estado";
  }

  .jx-causas-real-mobile tbody tr.jx-row-clickable td:nth-child(5)::before {
    content: "Responsable";
  }

  .jx-causas-real-mobile tbody tr.jx-row-clickable:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
  }
}

/* JX_CAUSAS_REAL_SEARCH_MOBILE_V1 */
@media (max-width: 767.98px) {
  .jx-causas-real-search {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    width: 100%;
    min-width: 0;
  }

  .jx-causas-real-search > .form-select,
  .jx-causas-real-search > .form-control,
  .jx-causas-real-search > .btn {
    display: block;
    box-sizing: border-box;
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .jx-causas-real-search > .form-select,
  .jx-causas-real-search > .form-control {
    min-height: 42px;
  }

  .jx-causas-real-search > .btn {
    min-height: 42px;
    text-align: center;
  }
}
