/* ============================================================
   LEXTER · Dashboard CSS
   Paleta (modo claro): sidebar marino #14253D · acento #1F5FAF · fondo #F2F5F9
   ============================================================ */

/* ── Escala tipográfica ──────────────────────────────────────
   Todo el sitio va 1px más chico que el tema Techmin de fábrica: los tamaños
   propios en px ya están bajados a mano; lo que el tema define en rem (cuerpo,
   formularios, botones, modales, dropdowns) se baja moviendo la base del html
   de 16 a 15px, y lo que fija en px (menú, título de página) se pisa acá. */
html { font-size: 15px; }
:root, [data-bs-theme="light"], [data-bs-theme="dark"] { --tz-menu-item-font-size: 14px; }
.navbar-custom .page-title { font-size: 17px; }

/* ── Paleta del modo claro: azul marino institucional ────────
   Fondo de la app. Pisa el #faf4f0 (crema) que trae Techmin, sin tocar el
   vendorizado. Va scopeado a [data-bs-theme="light"] a propósito: el tema
   oscuro tiene su propio --tz-body-bg (#171717) y no hay que pisarlo.
   --lx-surface deriva de esta variable, así que inputs y hovers acompañan.
   El acento (primary) pasa del #007aff de Techmin a un azul más sobrio; botones,
   links, pestañas y badges lo toman de acá. */
[data-bs-theme="light"] {
  --tz-body-bg: #F2F5F9;
  --tz-primary: #1F5FAF;
  --tz-primary-rgb: 31, 95, 175;
  --tz-primary-text-emphasis: #174A8A;
  --tz-primary-bg-subtle: #E4ECF7;
  --tz-primary-border-subtle: #BCD0EA;
  --tz-link-color: #1F5FAF;
  --tz-link-color-rgb: 31, 95, 175;
  --tz-link-hover-color: #174A8A;
  --tz-link-hover-color-rgb: 23, 74, 138;
  --tz-border-color: #E1E6EE;
}

/* ── Sidebar marino y navbar blanca ──────────────────────────
   Scopeado al modo claro: el toggle de la luna (#light-dark-mode) pasa a oscuro,
   que se queda con los colores del tema.

   OJO CON LA ESPECIFICIDAD: el tema define estas variables en
   `html[data-menu-color=light]` y `html[data-topbar-color=light]` (0,1,1), así
   que un `[data-bs-theme=light]` a secas (0,1,0) PIERDE y no se aplica nada.
   Los selectores llevan `[data-menu-color]` sin valor a propósito: Techmin guarda
   la config en sessionStorage y puede reescribir el atributo; el sidebar tiene que
   salir marino sea cual sea.

   Contrastes sobre #14253D: ítems 9.6:1, rótulos 4.6:1, activo (blanco) 15:1. */
html[data-bs-theme="light"][data-menu-color] {
  --tz-menu-bg:                   #14253D;
  --tz-menu-item-color:           #C3CEDD;
  --tz-menu-item-hover-color:     #FFFFFF;
  --tz-menu-item-active-color:    #FFFFFF;
  --tz-menu-item-active-bg:       rgba(255, 255, 255, 0.10);
  --tz-menu-condensed-link-bg:    #1C3150;
}
html[data-bs-theme="light"][data-topbar-color="light"] {
  --tz-topbar-bg:               #FFFFFF;
  --tz-topbar-item-color:       #14253D;
  --tz-topbar-item-hover-color: #1F5FAF;
}
html[data-bs-theme="light"] .leftside-menu {
  border-right: 0;
  box-shadow: none;
}
html[data-bs-theme="dark"] .leftside-menu {
  border-right: 1px solid rgba(255, 255, 255, .7);
  box-shadow: none;
}
/* Sidebar oscuro → logo en blanco. Techmin solo lo cambia con data-menu-color=dark. */
html[data-bs-theme="light"] .leftside-menu .logo.logo-light { display: block; }
html[data-bs-theme="light"] .leftside-menu .logo.logo-dark  { display: none; }
html[data-bs-theme="light"] .navbar-custom { border-bottom: 1px solid #E1E6EE; }
/* Rótulos de sección, un escalón más apagados que los ítems. */
html[data-bs-theme="light"] .side-nav .side-nav-title { color: #7F93AE; }
/* Barra izquierda del ítem activo. */
html[data-bs-theme="light"] .side-nav .menuitem-active > .side-nav-link {
  box-shadow: inset 3px 0 0 #6FA3E6;
}
html[data-bs-theme="light"] .side-nav .side-nav-item:not(.menuitem-active) > .side-nav-link:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

/* ── Variables ───────────────────────────────────────────────
   Los componentes propios (lx-*) toman color, fondo y radio del tema Techmin
   (variables --tz-*), así siguen el modo claro/oscuro sin reglas propias. */
:root, [data-bs-theme="light"], [data-bs-theme="dark"] {
  --lx-dark:          var(--tz-emphasis-color);
  --lx-darker:        var(--tz-emphasis-color);
  --lx-accent:        var(--tz-primary);
  --lx-accent-dim:    rgba(var(--tz-primary-rgb), 0.10);
  --lx-accent-border: rgba(var(--tz-primary-rgb), 0.30);
  --lx-surface:       var(--tz-body-bg);
  --lx-white:         var(--tz-secondary-bg);
  --lx-border:        var(--tz-border-color);
  --lx-text:          var(--tz-body-color);
  --lx-text-muted:    var(--tz-secondary-color);
  --lx-danger:        var(--tz-danger);
  --lx-danger-bg:     var(--tz-danger-bg-subtle);
  --lx-success-bg:    var(--tz-success-bg-subtle);
  --lx-success-text:  var(--tz-success-text-emphasis);
  --lx-warn-bg:       var(--tz-warning-bg-subtle);
  --lx-warn-text:     var(--tz-warning-text-emphasis);

  /* el "teal de marca" pasa a ser el primario del tema */
  --lx-teal-800:      var(--tz-primary);
  --lx-teal-700:      var(--tz-primary-text-emphasis);
  --lx-teal-400:      rgba(var(--tz-primary-rgb), 0.65);
  --lx-teal-200:      rgba(var(--tz-primary-rgb), 0.30);
  --lx-teal-100:      var(--tz-primary-bg-subtle);
  --lx-teal-dim:      rgba(var(--tz-primary-rgb), 0.12);
  --lx-teal-border:   rgba(var(--tz-primary-rgb), 0.25);

  --lx-radius:        var(--tz-border-radius);
  --lx-radius-lg:     var(--tz-border-radius-lg);
  --lx-transition:    220ms ease;
}

button { cursor: pointer; }

/* Topbar y menú: retoques sobre el tema */
.lx-logo-text { font-weight: 700; letter-spacing: 0.12em; font-size: 21px; color: var(--tz-primary); line-height: 70px; }
.logo-sm .lx-logo-text, .logo-sm.lx-logo-text { font-size: 14px; }
/* logo en imagen (static/img): horizontal en el menú ancho, ícono en el condensado, vertical en el login */
/* Techmin alterna .logo-light/.logo-dark y .logo-lg/.logo-sm con display: acá no se toca display */
.leftside-menu .logo { line-height: var(--tz-topbar-height); }
/* Techmin fija .logo-lg img / .logo-sm img en 30px: se pisa con la misma especificidad */
.logo-lg img.lx-logo-img { height: 30px; width: auto; vertical-align: middle; margin-left: -6px; }   /* solo la palabra; el SVG trae margen propio */
.logo-sm img.lx-logo-img { height: 34px; width: auto; vertical-align: middle; }
.lx-auth-logo { height: 170px; width: auto; }
/* login: la tarjeta centrada en la ventana sin scroll; el logo grande hace de título */
/* Fondo de login, 2FA, recupero de contraseña y demás pantallas de auth_base.html:
   color liso en vez de la imagen de Techmin (auth-bg.jpg). */
body.authentication-bg,
html[data-bs-theme] body.authentication-bg { background: #0095ff1f; }
.lx-auth-pages { min-height: 100vh; display: flex; align-items: center; padding: 16px 0; }
.lx-auth-pages .container { width: 100%; }
.lx-auth-brand { padding: 28px 16px 24px; }
/* logo alineado a la izquierda, al ras del ícono de los ítems del menú (12px de .side-nav + 12px del link) */
.leftside-menu .logo { text-align: left; padding: 0 24px; }
html[data-sidenav-size=condensed] .wrapper .leftside-menu .logo,
html[data-sidenav-size=compact] .wrapper .leftside-menu .logo { text-align: center; }
.lx-topbar-titulo { display: flex; flex-direction: column; justify-content: center; min-height: 70px; }
.lx-topbar-titulo .page-title { line-height: 1.2; }
.lx-topbar-tenant { font-size: 10px; color: var(--tz-secondary-color); letter-spacing: .03em; margin-top: 2px; }
.lx-avatar-iniciales {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%; font-size: 11px; font-weight: 600;
  background: var(--tz-primary-bg-subtle); color: var(--tz-primary);
}
.profile-dropdown form button.dropdown-item { width: 100%; text-align: left; background: none; border: 0; }

/* ── Messages / alerts ───────────────────────────────────── */
.lx-messages { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }

.lx-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--lx-radius);
  font-size: 12px;
  border: 0.5px solid transparent;
}
.lx-alert--success { background: var(--lx-success-bg); color: var(--lx-success-text); border-color: #C0DD97; }
.lx-alert--error,
.lx-alert--danger  { background: var(--lx-danger-bg); color: var(--lx-danger); border-color: #F7C1C1; }
.lx-alert--warning { background: var(--lx-warn-bg); color: var(--lx-warn-text); border-color: #FAC775; }
.lx-alert--info    { background: #E6F1FB; color: #185FA5; border-color: #B5D4F4; }

.lx-alert__close {
  background: none;
  border: none;
  font-size: 15px;
  line-height: 1;
  color: inherit;
  opacity: 0.6;
  padding: 0 2px;
  flex-shrink: 0;
}
.lx-alert__close:hover { opacity: 1; }

/* ── Page header (para vistas hijas) ─────────────────────── */
.lx-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
}
.lx-page-title {
  font-size: 19px;
  font-weight: 500;
  color: var(--lx-dark);
  margin: 0;
}
.lx-page-subtitle {
  font-size: 11px;
  color: var(--lx-text-muted);
  margin: 2px 0 0;
}

/* ── Metric cards ────────────────────────────────────────── */
.lx-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.lx-metric-card {
  background: var(--lx-white);
  border: 0.5px solid var(--lx-border);
  border-radius: var(--lx-radius-lg);
  padding: 14px 16px;
}
.lx-metric-card--accent {
  background: var(--tz-emphasis-color);
  border-color: var(--lx-accent-border);
}
.lx-metric-card__label {
  font-size: 10px;
  color: var(--lx-text-muted);
  margin: 0 0 4px;
}
.lx-metric-card--accent .lx-metric-card__label { color: rgba(255, 255, 255, 0.45); }
.lx-metric-card__value {
  font-size: 21px;
  font-weight: 500;
  color: var(--lx-dark);
  margin: 0;
}
.lx-metric-card--accent .lx-metric-card__value { color: var(--lx-teal-100); }
.lx-metric-card__sub {
  font-size: 10px;
  color: var(--lx-text-muted);
  margin: 2px 0 0;
}
.lx-metric-card--accent .lx-metric-card__sub { color: rgba(255, 255, 255, 0.3); }

/* ── Tabla / data cards ──────────────────────────────────── */
.lx-card {
  background: var(--lx-white);
  border: 0.5px solid var(--lx-border);
  border-radius: var(--lx-radius-lg);
  overflow: hidden;
}
.lx-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 0.5px solid var(--lx-border);
}
.lx-card__title {
  font-size: 12px;
  font-weight: 500;
  color: var(--lx-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}

/* Badge de estado */
.lx-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 500;
}
.lx-badge--active  { background: var(--lx-success-bg); color: var(--lx-success-text); }
.lx-badge--pending { background: var(--lx-warn-bg);    color: var(--lx-warn-text); }
.lx-badge--closed  { background: var(--lx-surface);    color: var(--lx-text-muted); }

/* Botón primario */
.lx-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--lx-radius);
  font-size: 12px;
  font-weight: 500;
  border: 0.5px solid transparent;
  transition: background var(--lx-transition), border-color var(--lx-transition);
}
.lx-btn--primary {
  background: var(--lx-accent);
  color: #FFFFFF;
  border-color: transparent;
}
.lx-btn--primary:hover { background: var(--tz-primary-text-emphasis); }
.lx-btn--ghost {
  background: none;
  color: var(--lx-text-muted);
  border-color: var(--lx-border);
}
.lx-btn--ghost:hover { background: var(--lx-surface); color: var(--lx-text); }

/* ── Botones — sistema completo ──────────────────────────── */
.lx-btn--sm  { height: 28px; padding: 0 10px; font-size: 11px; border-radius: 6px; }
.lx-btn--lg  { height: 42px; padding: 0 20px; font-size: 13px; }
.lx-btn--icon { padding: 0; width: 36px; justify-content: center; }
.lx-btn--icon.lx-btn--sm { width: 28px; }

.lx-btn--outline {
  background: none;
  color: var(--lx-text);
  border-color: rgba(0, 0, 0, 0.25);
}
.lx-btn--outline:hover { background: var(--lx-surface); border-color: rgba(0, 0, 0, 0.45); }

.lx-btn--accent {
  background: var(--lx-accent);
  color: #FFFFFF;
  border-color: transparent;
}
.lx-btn--accent:hover { background: var(--tz-primary-text-emphasis); }

.lx-btn--danger {
  background: var(--lx-danger-bg);
  color: var(--lx-danger);
  border-color: #F7C1C1;
}
.lx-btn--danger:hover { background: #F7C1C1; }

.lx-btn--danger-solid {
  background: var(--lx-danger);
  color: #fff;
  border-color: transparent;
}
.lx-btn--danger-solid:hover { background: #8a2525; }

.lx-btn--success {
  background: var(--lx-success-bg);
  color: var(--lx-success-text);
  border-color: #C0DD97;
}
.lx-btn--success:hover { background: #C0DD97; }

.lx-btn--warn {
  background: var(--lx-warn-bg);
  color: var(--lx-warn-text);
  border-color: #FAC775;
}
.lx-btn--warn:hover { background: #FAC775; }

.lx-btn--link {
  background: none;
  border-color: transparent;
  color: var(--lx-accent);
  padding-left: 0;
  padding-right: 0;
}
.lx-btn--link:hover { color: var(--tz-primary-text-emphasis); text-decoration: underline; }

.lx-btn[disabled],
.lx-btn:disabled { opacity: 0.38; cursor: not-allowed; pointer-events: none; }

.lx-btn--loading { position: relative; color: transparent !important; pointer-events: none; }
.lx-btn--loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--lx-accent);
  border-right-color: transparent;
  animation: lx-spin 0.65s linear infinite;
}
.lx-btn--danger-solid.lx-btn--loading::after { border-color: #fff; border-right-color: transparent; }
@keyframes lx-spin { to { transform: rotate(360deg); } }

/* ── SweetAlert2 overrides ───────────────────────────────── */
.swal2-popup {
  font-size: 12px !important;
  border-radius: var(--lx-radius-lg) !important;
  padding: 24px 28px !important;
}
.swal2-title {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--lx-text) !important;
  padding: 0 0 6px !important;
}
.swal2-html-container {
  font-size: 12px !important;
  color: var(--lx-text-muted) !important;
  margin: 4px 0 0 !important;
}
.swal2-actions {
  gap: 8px !important;
  margin-top: 20px !important;
}
.swal2-confirm,
.swal2-cancel,
.swal2-deny {
  font-size: 12px !important;
  font-weight: 500 !important;
  padding: 7px 16px !important;
  border-radius: var(--lx-radius) !important;
}
.swal2-icon {
  width: 48px !important;
  height: 48px !important;
  margin: 0 auto 12px !important;
}
.swal2-icon .swal2-icon-content {
  font-size: 25px !important;
}
.swal2-icon.swal2-warning { border-color: #FAC775 !important; color: var(--lx-warn-text) !important; }
.swal2-icon.swal2-error   { border-color: #F7C1C1 !important; color: var(--lx-danger)   !important; }
.swal2-icon.swal2-success { border-color: #C0DD97 !important; }
.swal2-icon.swal2-success [class^="swal2-success-line"] { background: var(--lx-success-text) !important; }
.swal2-icon.swal2-success .swal2-success-ring { border-color: #C0DD97 !important; }

/* Dark mode */
[data-bs-theme="dark"] .swal2-popup {
  background: #1B2426 !important;
  border: 0.5px solid rgba(255,255,255,0.12) !important;
}
[data-bs-theme="dark"] .swal2-title        { color: #fff !important; }
[data-bs-theme="dark"] .swal2-html-container { color: #93999A !important; }
/* Toast compacto */
.lx-swal-toast {
  padding: 10px 16px !important;
  min-height: unset !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10) !important;
  border: 0.5px solid var(--lx-border) !important;
  background: var(--lx-white) !important;
}
.lx-swal-toast .swal2-title {
  padding: 0 !important;
  margin: 0 !important;
  font-size: 11px !important;
}
.swal2-timer-progress-bar {
  background: var(--lx-accent) !important;
  height: 2px !important;
}
[data-bs-theme="dark"] .lx-swal-toast {
  background: #1B2426 !important;
  border-color: rgba(255,255,255,0.12) !important;
}

/* ── Modales ─────────────────────────────────────────────── */
.modal-content {
  background: var(--lx-white);
  border: none !important;
  border-radius: var(--lx-radius-lg) !important;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45) !important;
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
}
/* El <form> envuelve body+footer: debe propagar el flex para que el body scrollee */
.modal-content > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.modal-backdrop,
.modal-backdrop.show {
  background-color: #000 !important;
  opacity: 0.7 !important;
}

/* Cabecera: primario del tema en ambos modos */
.modal-header {
  background: var(--tz-primary);
  border-bottom: none;
  padding: 14px 28px;
  align-items: center;
}
.modal-title {
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}
.modal-header .btn-close {
  filter: brightness(0) invert(1);
  opacity: 0.65;
  transition: opacity var(--lx-transition);
}
.modal-header .btn-close:hover { opacity: 1; }
/* acciones secundarias del encabezado del modal (p. ej. editar desde el detalle) */
.lx-modal-tool {
  margin-left: auto;
  margin-right: 6px;
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px; background: transparent;
  color: #fff; opacity: 0.75; font-size: 16px;
  transition: opacity var(--lx-transition), background var(--lx-transition);
}
.lx-modal-tool:hover { opacity: 1; background: rgba(255,255,255,.14); }
.modal-header .lx-modal-tool + .btn-close { margin-left: 0; }

/* Cuerpo y pie: superficie del tema + padding armónico */
.modal-body {
  padding: 24px 28px;
  background: var(--lx-white);
  color: var(--lx-text);
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.modal-footer {
  padding: 14px 24px;
  border-top: 0.5px solid var(--lx-border);
  background: var(--lx-white);
  gap: 8px;
}

/* Campos del formulario dentro del modal (theme-aware) */
.modal-body input:not([type="checkbox"]):not([type="radio"]),
.modal-body select,
.modal-body textarea {
  width: 100%;
  font-size: 12px;
  padding: 6px 10px;
  line-height: 1.3;
  border-radius: var(--lx-radius);
  border: 0.5px solid var(--lx-border);
  background: var(--lx-surface);
  color: var(--lx-text);
  outline: none;
  transition: border-color var(--lx-transition), box-shadow var(--lx-transition);
}
.modal-body input:not([type="checkbox"]):not([type="radio"]):focus,
.modal-body select:focus,
.modal-body textarea:focus {
  border-color: var(--lx-accent);
  box-shadow: 0 0 0 2px var(--lx-accent-dim);
}
.modal-body .form-label {
  color: var(--lx-text-muted);
  font-size: 10.5px;
  margin-bottom: 3px;
}
.modal-body .text-muted.mb-3 { margin-bottom: 10px !important; }
.modal-body .row.mb-3 { margin-bottom: 14px !important; }

/* ── Toast SWAL: ícono compacto ──
   SweetAlert dibuja el tilde con posiciones en em pensadas para un ícono de
   2em; achicar el ancho/alto a mano lo deforma. Se reduce el font-size del
   ícono y todo (anillo, líneas, contenido) escala en proporción. */
.lx-swal-toast .swal2-icon {
  font-size: 10px !important;
  width: 2em !important;
  height: 2em !important;
  min-width: 2em !important;
  margin: 0 0.8em 0 0 !important;
  flex-shrink: 0 !important;
}

/* ==========================================================================
   Componentes de listado (barra de filtros, tabla, paginación, estado vacío).
   Vivían embebidos en clientes_lista.html; se movieron acá al crear la
   pantalla de convenios, que usa los mismos componentes.
   ========================================================================== */

/* ── Filtros ── */
.lx-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.lx-filter-bar .lx-input-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}
.lx-filter-bar .lx-input-wrap .lx-input-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--lx-text-muted);
  pointer-events: none;
  font-size: 15px;
}
.lx-filter-bar input[type="text"],
.lx-filter-bar select {
  height: 34px;
  border: 0.5px solid var(--lx-border);
  border-radius: var(--lx-radius);
  background: var(--lx-white);
  font-size: 12px;
  color: var(--lx-text);
  padding: 0 10px;
  width: 100%;
  outline: none;
  transition: border-color var(--lx-transition);
}
.lx-filter-bar input[type="text"] {
  padding-left: 32px;
}
.lx-filter-bar input[type="text"]:focus,
.lx-filter-bar select:focus {
  border-color: var(--lx-accent);
}
.lx-filter-bar select {
  width: 180px;
  flex-shrink: 0;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888780' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.lx-filter-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.lx-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--lx-radius);
  border: 0.5px solid var(--lx-border);
  background: var(--lx-white);
  color: var(--lx-text-muted);
  transition: all var(--lx-transition);
  text-decoration: none;
}
.lx-btn-icon:hover {
  background: var(--lx-surface);
  color: var(--lx-text);
  border-color: var(--lx-accent-border);
}
.lx-filter-bar .lx-btn--primary {
  height: 34px;
  padding: 0 14px;
}
.lx-filter-bar .lx-btn--ghost {
  height: 34px;
  padding: 0 12px;
}


.lx-table__name {
  font-weight: 500;
  color: var(--lx-dark);
  text-decoration: none;
  transition: color var(--lx-transition);
}
.lx-table__name:hover { color: var(--lx-accent); }

/* Acción en fila — botón discreto, siempre visible */
.lx-row-action {
  font-size: 11px;
  font-weight: 500;
  color: var(--lx-text-muted);
  border: 0.5px solid var(--lx-border);
  background: var(--lx-white);
  border-radius: var(--lx-radius);
  padding: 4px 12px;
  cursor: pointer;
  transition: all var(--lx-transition);
  white-space: nowrap;
}
.lx-row-action:hover {
  border-color: var(--lx-accent-border);
  color: var(--lx-accent);
  background: var(--lx-surface);
}


/* ── Empty state ── */
.lx-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
  color: var(--lx-text-muted);
  gap: 8px;
}
.lx-empty__icon {
  font-size: 31px;
  opacity: 0.2;
}
.lx-empty__msg {
  font-size: 12px;
  margin: 0;
}
.lx-empty__sub {
  font-size: 11px;
  margin: 0;
}

/* ── Paginación ── */
.lx-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-top: 0.5px solid var(--lx-border);
  font-size: 11px;
  color: var(--lx-text-muted);
}
.lx-pagination__pages {
  display: flex;
  gap: 4px;
}
.lx-page-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--lx-radius);
  border: 0.5px solid var(--lx-border);
  font-size: 11px;
  background: var(--lx-white);
  color: var(--lx-text-muted);
  text-decoration: none;
  transition: all var(--lx-transition);
}
.lx-page-btn:hover {
  border-color: var(--lx-accent-border);
  color: var(--lx-accent);
}
.lx-page-btn--active {
  background: var(--tz-primary);
  color: #fff;
  border-color: var(--lx-accent-border);
}
.lx-page-btn[disabled] {
  opacity: 0.35;
  pointer-events: none;
}

/* ── Card result info ── */
.lx-card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 0.5px solid var(--lx-border);
}
.lx-card-topbar__count {
  font-size: 11px;
  color: var(--lx-text-muted);
}
.lx-active-filters {
  display: flex;
  align-items: center;
  gap: 6px;
}
.lx-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--lx-accent-dim);
  border: 0.5px solid var(--lx-accent-border);
  color: var(--lx-warn-text);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
}

.lx-flag {
  font-size: 10.5px;
  padding: 2px 9px;
  border-radius: 20px;
  border: 0.5px solid var(--lx-border);
  background: var(--lx-surface);
  color: var(--lx-text-muted);
}
.lx-flag--on {
  background: var(--lx-success-bg);
  border-color: var(--lx-accent-border);
  color: var(--lx-success-text);
}

/* Utilidad: columnas numéricas de cualquier tabla. */
.lx-num { text-align: right; white-space: nowrap; }

/* Formularios de alta/edición: encabezado de grupo de campos y error por campo. */
.lx-form-section {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--lx-accent);
  margin: 0 0 10px;
  padding-bottom: 5px;
  border-bottom: 0.5px solid var(--lx-border);
}
.lx-field-error {
  font-size: 10.5px;
  color: var(--lx-danger);
  margin-top: 3px;
}

/* ==========================================================================
   Patrón de listado: cards de 3 por fila con menú de acciones.
   Se usa en todo contenido listado, no solo en una pantalla.
   ========================================================================== */

.lx-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1100px) { .lx-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .lx-card-grid { grid-template-columns: 1fr; } }

.lx-content-card {
  display: flex;
  flex-direction: column;
  border: 0.5px solid var(--lx-border);
  border-radius: var(--lx-radius);
  background: var(--lx-white);
  transition: border-color var(--lx-transition), box-shadow var(--lx-transition);
}
/* Sin overflow:hidden: recortaría el menú de acciones, que se despliega fuera
   de la card. Tampoco se le pone position/z-index, porque crearía un contexto
   de apilado y el menú quedaría por debajo de las cards siguientes. */
.lx-content-card:hover {
  border-color: var(--lx-accent-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}
.lx-content-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 10px;
}
.lx-content-card__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--lx-dark);
  line-height: 1.3;
  word-break: break-word;
}
.lx-content-card__meta {
  font-size: 10px;
  color: var(--lx-text-muted);
  margin-top: 2px;
}
.lx-content-card__body {
  padding: 0 14px 14px;
  font-size: 11.5px;
  color: var(--lx-text-muted);
  line-height: 1.5;
  flex: 1;
}

/* ── Menú de acciones: discreto, se marca al pasar por encima ── */
.lx-actions { position: relative; flex-shrink: 0; }
.lx-actions__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: var(--lx-radius);
  border: 0.5px solid transparent;
  background: transparent;
  color: var(--lx-text-muted);
  cursor: pointer;
  opacity: .55;
  transition: all var(--lx-transition);
}
.lx-content-card:hover .lx-actions__toggle,
.lx-actions__toggle:focus-visible,
.lx-actions__toggle[aria-expanded="true"] { opacity: 1; }
.lx-actions__toggle:hover,
.lx-actions__toggle[aria-expanded="true"] {
  background: var(--lx-surface);
  border-color: var(--lx-border);
  color: var(--lx-text);
}
.lx-actions__toggle .material-icons { font-size: 16px; }

.lx-actions__menu {
  /* fixed y ubicado por JS: dentro del flujo lo recortarían .lx-card
     (overflow:hidden) y .table-responsive (overflow-x:auto). */
  position: fixed;
  min-width: 168px;
  padding: 4px;
  border: 0.5px solid var(--lx-border);
  border-radius: var(--lx-radius);
  background: var(--lx-white);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .10);
  z-index: 1080;
}
.lx-actions__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border: 0; background: transparent;
  border-radius: var(--lx-radius);
  font-size: 11.5px;
  color: var(--lx-text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--lx-transition);
}
.lx-actions__item:hover { background: var(--lx-surface); color: var(--lx-dark); }
.lx-actions__item .material-icons { font-size: 14px; color: var(--lx-text-muted); }
.lx-actions__item--danger { color: var(--lx-danger); }
.lx-actions__item--danger:hover { background: var(--lx-danger-bg); color: var(--lx-danger); }
.lx-actions__item--danger .material-icons { color: var(--lx-danger); }
.lx-actions__sep { height: 0.5px; background: var(--lx-border); margin: 4px 2px; }

/* ── Previsualizador de documentos: modal maximizado, sin cromo ── */
.lx-viewer .modal-content {
  border: 0;
  border-radius: 0;
  background: #3a3a3a;
}
.lx-viewer .modal-header {
  border: 0;
  padding: 8px 14px;
  background: transparent;
  align-items: center;
}
.lx-viewer .modal-title {
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
}
.lx-viewer .modal-body {
  padding: 0;
  display: flex;
  overflow: hidden;
}
.lx-viewer__doc {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  display: block;
  background: #3a3a3a;
}
.lx-viewer__acciones { display: flex; align-items: center; gap: 8px; }
.lx-viewer__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--lx-radius);
  border: 0.5px solid rgba(255, 255, 255, .22);
  background: transparent;
  color: rgba(255, 255, 255, .82);
  font-size: 11.5px;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--lx-transition);
}
.lx-viewer__btn:hover {
  background: rgba(255, 255, 255, .10);
  color: #fff;
  border-color: rgba(255, 255, 255, .4);
}
.lx-viewer__btn .material-icons { font-size: 15px; }

/* ── Edición de cláusulas ── */
.lx-clausula { margin-bottom: 14px; }
.lx-clausula__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.lx-clausula__nombre {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--lx-accent);
  margin: 0;
}
.lx-clausula__acciones { display: flex; gap: 2px; opacity: 0; transition: opacity var(--lx-transition); }
.lx-clausula:hover .lx-clausula__acciones { opacity: 1; }
.lx-clausula__acciones .lx-mini-btn:disabled { opacity: .3; pointer-events: none; }

.lx-clausula-nueva {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 0.5px solid var(--lx-border);
}
.lx-clausula-nueva input {
  height: 32px;
  width: 190px;
  font-size: 11.5px;
  border: 0.5px solid var(--lx-border);
  border-radius: var(--lx-radius);
  padding: 0 9px;
  background: var(--lx-white);
  color: var(--lx-text);
  outline: none;
}
.lx-clausula-nueva input:focus { border-color: var(--lx-accent); }

/* Barra de acción dentro de un tab (el botón viaja con el fragmento AJAX). */
.lx-tab-toolbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }

/* Dentro de una card angosta, el alta de valores se apila en vez de estirarse. */
.lx-content-card .lx-valor-new { flex-wrap: wrap; }
.lx-content-card .lx-valor-new input[name="codigo"] { width: 88px; }
.lx-content-card .lx-valor-new input[name="observacion"] { flex: 1; min-width: 110px; }
.lx-content-card .lx-valor-new .lx-btn { height: 30px; padding: 0 12px; }
.lx-content-card .lx-valor-row__actions { opacity: 0; }
.lx-content-card .lx-valor-row:hover .lx-valor-row__actions { opacity: 1; }

/* ── Reglas de elegibilidad de los juicios ── */
.lx-regla { margin-bottom: 4px; }
.lx-regla__tipo {
  font-size: 10px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--lx-accent); margin-right: 6px;
}
.lx-regla__todos { font-size: 11.5px; color: var(--lx-text-muted); font-style: italic; }
.lx-clasif-chip {
  display: inline-block; font-size: 9.5px; font-weight: 500;
  padding: 1px 7px; border-radius: 4px; margin: 1px 2px 1px 0;
  background: var(--lx-accent-dim); border: 0.5px solid var(--lx-accent-border);
  color: var(--lx-warn-text);
}
.lx-regla-edit { padding: 10px 0; border-bottom: 0.5px dashed var(--lx-border); }
.lx-regla-edit:last-child { border-bottom: none; }
.lx-regla-edit__head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.lx-regla-edit__estado { font-size: 9.5px; color: var(--lx-text-muted); }
.lx-regla-edit__valores { display: flex; flex-wrap: wrap; gap: 10px; }
.lx-check { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; cursor: pointer; }
.lx-check input { margin: 0; }


/* ==========================================================================
   Tabla de listado. Estaba embebida en clientes_lista.html, por eso el resto
   de las pantallas la usaban sin estilos.
   ========================================================================== */

/* ── Tabla ── */
.lx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.lx-table thead th {
  padding: 10px 12px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lx-text-muted);
  background: var(--lx-surface);
  border-bottom: 0.5px solid var(--lx-border);
  white-space: nowrap;
}
.lx-table thead th:first-child { padding-left: 20px; border-radius: var(--lx-radius) 0 0 0; }
.lx-table thead th:last-child  { padding-right: 16px; border-radius: 0 var(--lx-radius) 0 0; }

.lx-table tbody tr {
  border-bottom: 0.5px solid var(--lx-border);
  transition: background var(--lx-transition);
}
.lx-table tbody tr:last-child { border-bottom: none; }
.lx-table tbody tr:hover { background: rgba(168, 133, 78, 0.04); }

.lx-table tbody td {
  padding: 11px 12px;
  color: var(--lx-text-muted);
  vertical-align: middle;
}
.lx-table tbody td:first-child { padding-left: 20px; }
.lx-table tbody td:last-child  { padding-right: 16px; }

/* Celda de acciones: pegada a la derecha y sin cortar los botones. */
.lx-table__acciones {
  text-align: right;
  white-space: nowrap;
}
.lx-table__acciones .lx-row-action { margin-left: 4px; }

/* El buscador no se estira a todo el ancho: al lado de un par de selects
   quedaba desproporcionado. */
.lx-filter-bar .lx-input-wrap { flex: 0 1 50%; max-width: 50%; }
@media (max-width: 720px) {
  .lx-filter-bar .lx-input-wrap { flex: 1 1 100%; max-width: 100%; }
}

/* Alta rápida de convenio desde la ficha del cliente. */
/* Una sola línea: [juicio] [n] cuotas de $[valor] ☐ Efectivo [Iniciar].
   Los selectores llevan .modal-body para ganarle a la regla genérica del modal
   (width:100%), que es lo que la apilaba a todo el ancho. */
.lx-iniciar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lx-iniciar select,
.lx-iniciar input[type="number"],
.lx-iniciar input[type="text"],
.modal-body .lx-iniciar select,
.modal-body .lx-iniciar input:not([type="checkbox"]):not([type="radio"]) {
  width: auto; height: 28px; font-size: 11.5px; line-height: 1;
  border: 0.5px solid var(--lx-border); border-radius: 6px;
  padding: 0 8px; background: var(--lx-white); color: var(--lx-text); outline: none;
  box-shadow: none;
}
.modal-body .lx-iniciar select:focus,
.modal-body .lx-iniciar input:not([type="checkbox"]):focus { border-color: var(--lx-accent); box-shadow: none; }
.modal-body .lx-iniciar select { flex: 0 1 240px; min-width: 150px; }
.modal-body .lx-iniciar input[type="number"] { width: 56px; text-align: center; }
.modal-body .lx-iniciar input[type="text"] { width: 96px; text-align: right; }
.lx-iniciar__txt { font-size: 11.5px; color: var(--lx-text-muted); }
.lx-iniciar__monto { display: inline-flex; align-items: center; gap: 3px; }
.lx-iniciar .lx-switch { margin-left: 4px; }
.lx-iniciar .lx-btn { margin-left: auto; }

/* ── Buscador con chips (elegir varios clientes) ── */
.lx-sugerencias {
  border: 0.5px solid var(--lx-border);
  border-radius: var(--lx-radius);
  background: var(--lx-white);
  margin-top: 4px;
  max-height: 190px;
  overflow-y: auto;
}
.lx-sugerencia {
  display: block; width: 100%; text-align: left;
  padding: 7px 10px; border: 0; background: transparent;
  font-size: 11.5px; color: var(--lx-text); cursor: pointer;
}
.lx-sugerencia:hover { background: var(--lx-surface); }
.lx-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.lx-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 3px 6px 3px 9px; border-radius: 20px;
  background: var(--lx-accent-dim); border: 0.5px solid var(--lx-accent-border);
  color: var(--lx-warn-text);
}
.lx-chip__quitar {
  border: 0; background: transparent; color: inherit;
  font-size: 14px; line-height: 1; padding: 0 2px; cursor: pointer; opacity: .7;
}
.lx-chip__quitar:hover { opacity: 1; }
.lx-hint { font-size: 10.5px; color: var(--lx-text-muted); margin-top: 3px; }

/* Propuesta de la IA: una fila por persona detectada. */
.lx-propuesta {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 0; border-bottom: 0.5px dashed var(--lx-border);
  font-size: 12px; cursor: pointer;
}
.lx-propuesta:last-child { border-bottom: none; }
.lx-propuesta input:disabled { opacity: .45; }
.lx-propuesta__nombre { flex: 1; color: var(--lx-text); }

/* ── Dropzone (documentos del cliente, escaneo del poder) ── */
.lx-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 12px;
  padding: 22px 16px;
  text-align: center;
  background: var(--lx-surface);
  border: 1.5px dashed var(--lx-border);
  border-radius: var(--lx-radius-lg);
  cursor: pointer;
  transition: border-color var(--lx-transition), background var(--lx-transition);
}
.lx-dropzone:hover,
.lx-dropzone:focus-visible { border-color: var(--lx-accent); outline: none; }
.lx-dropzone.is-over {
  border-color: var(--lx-accent);
  border-style: solid;
  background: var(--lx-accent-dim);
}
.lx-dropzone * { pointer-events: none; }
.lx-dropzone__icon { font-size: 29px; color: var(--lx-teal-400); }
.lx-dropzone__title { margin: 4px 0 0; font-size: 12px; font-weight: 600; color: var(--lx-dark); }
.lx-dropzone__hint  { margin: 0; font-size: 11px; color: var(--lx-text-muted); }
.lx-dropzone__meta  { margin: 6px 0 0; font-size: 9.5px; letter-spacing: 0.03em; color: var(--lx-teal-400); }

/* ── Poderes: modal de alta ── */
.lx-input-wrap--full { position: relative; }
.lx-input-wrap--full .lx-input-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--lx-text-muted);
  pointer-events: none;
  font-size: 15px;
}
/* la regla genérica .modal-body input:not(...) tiene más especificidad */
.lx-input-wrap--full input,
.modal-body .lx-input-wrap--full input:not([type="checkbox"]):not([type="radio"]) { padding-left: 34px; }
.lx-poder-clasif { display: flex; gap: 8px; }
.lx-poder-clasif select { flex: 1; min-width: 0; }
.lx-poder-clasif select:disabled { opacity: .55; }
.lx-dropzone--compacta { margin-top: 0; padding: 14px 16px; }
.lx-dropzone--compacta .lx-dropzone__icon { font-size: 23px; }
.lx-dropzone.is-cargado { border-style: solid; border-color: var(--lx-accent); }
.lx-dropzone.is-cargado .lx-dropzone__title { color: var(--lx-accent); }
.lx-dropzone.is-leyendo { border-style: solid; }
.lx-dropzone.is-leyendo .lx-dropzone__icon { animation: lx-pulso 1.1s ease-in-out infinite; }
@keyframes lx-pulso { 50% { opacity: .35; } }
.lx-propuesta-box {
  margin-top: 8px;
  padding: 4px 12px 10px;
  border: 0.5px solid var(--lx-border);
  border-radius: var(--lx-radius);
  background: var(--lx-white);
}
.lx-propuesta-box__pie { display: flex; gap: 6px; margin-top: 8px; }
.lx-propuesta__doc { color: var(--lx-text-muted); font-size: 11px; }
.lx-propuesta--todos { font-weight: 600; border-bottom: 0.5px solid var(--lx-border); }
.lx-flag--new  { background: var(--lx-accent-dim); border-color: var(--lx-accent-border); color: var(--lx-accent); }
.lx-flag--warn { background: var(--lx-warn-bg); border-color: #FAC775; color: var(--lx-warn-text); }
.lx-table .lx-flag { white-space: nowrap; }
.lx-chip--nuevo { border-style: dashed; }
.lx-chip--nuevo small { margin-left: 5px; font-size: 9px; opacity: .7; text-transform: uppercase; letter-spacing: .04em; }

/* ── Switch (booleanos de toda la app) ──────────────────────────────────────
   <label class="lx-switch"><input type="checkbox"><span class="lx-switch__track"></span><span class="lx-switch__text">Texto</span></label>
   El input queda oculto pero accesible; el track dibuja el estado. Para listas
   de selección múltiple (tildar filas) se sigue usando el checkbox común. */
.lx-switch {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--lx-text); cursor: pointer; user-select: none;
  margin: 0; line-height: 1;
}
.lx-switch input,
.lx-switch input.form-check-input {
  position: absolute; opacity: 0; width: 0; height: 0; margin: 0; pointer-events: none;
}
.lx-switch__track {
  position: relative; flex-shrink: 0;
  width: 30px; height: 16px; border-radius: 16px;
  background: var(--lx-border);
  transition: background var(--lx-transition);
}
.lx-switch__track::before {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: transform var(--lx-transition);
}
.lx-switch input:checked + .lx-switch__track { background: var(--lx-accent); }
.lx-switch input:checked + .lx-switch__track::before { transform: translateX(14px); }
.lx-switch input:focus-visible + .lx-switch__track { box-shadow: 0 0 0 3px var(--lx-accent-dim); }
.lx-switch input:disabled + .lx-switch__track { opacity: .45; }
.lx-switch:has(input:disabled) { cursor: not-allowed; }
.lx-switch__text { color: var(--lx-text-muted); }
.lx-switch input:checked ~ .lx-switch__text { color: var(--lx-text); }

/* ── Demandas ── */
.lx-dem-grid { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 10px 12px; align-items: end; margin-bottom: 14px; }
.lx-dem-grid--cabecera { grid-template-columns: 2fr 1fr 1fr; }
.lx-dem-grid--alta { grid-template-columns: 1fr 1fr 2fr auto; }
.lx-dem-grid__domicilio { grid-column: 1 / 2; }
.lx-dem-grid__comentarios { grid-column: 1 / -1; }
.lx-dem-grid__cautelar { padding-bottom: 6px; }
@media (max-width: 700px) {
  .lx-dem-grid, .lx-dem-grid--cabecera, .lx-dem-grid--alta { grid-template-columns: 1fr; }
  .lx-dem-grid__domicilio { grid-column: auto; }
}
.lx-dem-nuevo-dom { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lx-dem-nuevo-dom input:first-child { flex: 1 1 220px; }
.lx-dem-nuevo-dom select { flex: 0 1 160px; }
.lx-dem-nuevo-dom input:nth-of-type(2) { flex: 0 1 130px; }
.lx-dem-actores__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lx-dem-actores__head .form-label, .lx-dem-actores__head .lx-detail-heading { margin-bottom: 0; }
#demPoolFiltro { margin: 6px 0; }
.lx-pool {
  max-height: 260px; overflow-y: auto;
  padding: 2px 12px; border: 0.5px solid var(--lx-border); border-radius: var(--lx-radius);
  background: var(--lx-white);
}
.lx-pool .lx-propuesta--todos { position: sticky; top: 0; background: var(--lx-white); z-index: 1; }
.lx-dem-caratula { margin: 8px 0 0; font-size: 11.5px; font-weight: 600; color: var(--lx-accent); letter-spacing: .02em; }
.lx-dem-resumen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.lx-dem-resumen .lx-switch { margin-left: auto; }
.lx-dem-detalle__pie { display: flex; justify-content: flex-end; margin-top: 8px; }
.lx-dem-detalle .js-det-pool { margin-top: 8px; }
.lx-table__name--btn { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font: inherit; }
/* Línea secundaria bajo el nombre de la fila (p. ej. la clasificación de una demanda). */
.lx-table__sub { margin-top: 3px; line-height: 1; }
.lx-table__sub .lx-clasif-chip { margin-left: 0; }

/* Rótulo de sección. Estaba definido SOLO en el {% block extra_css %} de
   clientes_lista.html, así que en Configuración y en el detalle de demanda la
   clase no pintaba nada y los títulos salían como texto plano. Vive acá. */
.lx-detail-heading {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lx-accent);
  margin: 0 0 6px;
  padding-bottom: 4px;
  border-bottom: 0.5px solid var(--lx-border);
}

/* ── Configuración → Demandas ── */
/* Cada bloque es una tarjeta, igual que el resto de la app: sin esto las
   secciones flotaban sueltas sobre el fondo y el botón de acción quedaba
   colgado en el borde derecho de la pantalla. */
.lx-cfg-seccion {
  background: var(--lx-white);
  border: 0.5px solid var(--lx-border);
  border-radius: var(--lx-radius-lg);
  margin-bottom: 14px;
  overflow: hidden;
}
.lx-cfg-seccion__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 0.5px solid var(--lx-border);
  background: var(--lx-surface);
}
/* El borde ya lo pone la cabecera de la tarjeta. */
.lx-cfg-seccion__head .lx-detail-heading { margin: 0; padding-bottom: 0; border-bottom: 0; }
/* El cuerpo no tiene wrapper propio (el partial se reemplaza entero por AJAX):
   se le da el margen a los tres tipos de hijo que puede haber. */
.lx-cfg-seccion > .lx-card-grid,
.lx-cfg-seccion > .lx-cfg-vacio,
.lx-cfg-seccion > .lx-claves,
.lx-cfg-seccion > .lx-hint,
.lx-cfg-seccion > .lx-table-wrap { margin: 14px 16px; }
/* La tabla de envíos llega al ancho completo de la tarjeta. */
.lx-cfg-seccion > .lx-table-wrap { margin-left: 0; margin-right: 0; }
/* Estado vacío: en vez de una línea en itálica flotando, un marcador que ocupa
   el lugar donde van a aparecer las tarjetas. */
.lx-cfg-vacio {
  margin: 0;
  padding: 18px 12px;
  text-align: center;
  font-size: 11.5px;
  color: var(--lx-text-muted);
  border: 1px dashed var(--lx-border);
  border-radius: var(--lx-radius);
}
.lx-cfg-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.lx-clasif-chip--principal { font-weight: 600; box-shadow: 0 0 0 1.5px var(--lx-accent) inset; }
.lx-dem-descargas { display: flex; gap: 6px; margin: -6px 0 14px; }
.lx-cfg-seccion__acciones { display: flex; align-items: center; gap: 6px; }
.lx-cfg-filtro { height: 28px; font-size: 11px; border: 0.5px solid var(--lx-border); border-radius: 6px; background: var(--lx-white); color: var(--lx-text); padding: 0 8px; }
.lx-claves { margin-bottom: 12px; padding: 4px 12px; border: 0.5px solid var(--lx-border); border-radius: var(--lx-radius); background: var(--lx-white); max-height: 280px; overflow-y: auto; }
.lx-claves code { font-size: 11px; color: var(--lx-accent); }
.lx-docx-preview { max-width: 820px; margin: 0 auto; padding: 32px 40px; background: #fff; color: #111; font-family: Arial, sans-serif; font-size: 12px; line-height: 1.6; }
.lx-docx-preview p { margin: 0 0 8px; text-align: justify; }
.lx-docx-preview table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.lx-docx-preview td, .lx-docx-preview th { border: 1px solid #333; padding: 4px 6px; vertical-align: top; }
.lx-viewer .modal-body { overflow: auto; }

/* ── Recordatorios / WhatsApp (configuración) ── */
.lx-rec-switches { display: flex; gap: 18px; margin: 4px 0 14px; }
.lx-rec-canal { border: 0.5px solid var(--lx-border); border-radius: var(--lx-radius); padding: 10px 12px 12px; margin-bottom: 12px; background: var(--lx-white); }
.lx-rec-canal__head { margin-bottom: 8px; font-weight: 600; }
.lx-rec-canal.is-off > :not(.lx-rec-canal__head) { opacity: .45; }
.lx-claves-det summary { font-size: 11px; color: var(--lx-accent); cursor: pointer; margin-bottom: 6px; }
.lx-claves-det code { font-size: 11px; color: var(--lx-accent); }
.lx-wa-estado { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.lx-wa-estado code { font-size: 11px; }

/* ── Bandeja de WhatsApp ── */
.lx-wa { display: grid; grid-template-columns: 300px 1fr; gap: 0; border: 0.5px solid var(--lx-border); border-radius: var(--lx-radius-lg); background: var(--lx-white); min-height: 560px; overflow: hidden; }
.lx-wa__lista { border-right: 0.5px solid var(--lx-border); overflow-y: auto; max-height: 72vh; }
.lx-wa__conv { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-bottom: 0.5px solid var(--lx-border); background: none; cursor: pointer; font: inherit; color: var(--lx-text); }
.lx-wa__conv:hover { background: var(--lx-surface); }
.lx-wa__conv.is-active { background: var(--lx-accent-dim); }
.lx-wa__conv-nombre { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.lx-wa__conv-ultimo { font-size: 11px; color: var(--lx-text-muted); }
.lx-wa__conv-fecha { font-size: 9.5px; color: var(--lx-text-muted); }
.lx-wa__badge { font-size: 9px; background: var(--lx-accent); color: #fff; border-radius: 10px; padding: 1px 6px; }
.lx-wa__hilo { display: flex; flex-direction: column; max-height: 72vh; }
.lx-wa__hilo-head { padding: 10px 16px; font-size: 12px; font-weight: 600; border-bottom: 0.5px solid var(--lx-border); color: var(--lx-dark); }
.lx-wa__mensajes { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; background: var(--lx-surface); }
.lx-wa__msg { max-width: 72%; }
.lx-wa__msg--out { align-self: flex-end; text-align: right; }
.lx-wa__burbuja { display: inline-block; text-align: left; padding: 7px 11px; border-radius: 12px; font-size: 12px; line-height: 1.4; background: var(--lx-white); border: 0.5px solid var(--lx-border); }
.lx-wa__msg--out .lx-wa__burbuja { background: var(--lx-accent-dim); border-color: var(--lx-accent-border); }
.lx-wa__meta { font-size: 9.5px; color: var(--lx-text-muted); margin-top: 2px; }
.lx-wa__responder { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 0.5px solid var(--lx-border); }
.lx-wa__responder textarea { flex: 1; resize: none; font-size: 12px; padding: 7px 10px; border: 0.5px solid var(--lx-border); border-radius: var(--lx-radius); background: var(--lx-white); color: var(--lx-text); outline: none; }
.lx-wa__responder textarea:focus { border-color: var(--lx-accent); }
.lx-wa__ventana { margin: 0; padding: 10px 14px; font-size: 11px; color: var(--lx-warn-text); background: var(--lx-warn-bg); border-top: 0.5px solid var(--lx-border); }
@media (max-width: 800px) { .lx-wa { grid-template-columns: 1fr; } .lx-wa__lista { max-height: 200px; border-right: 0; border-bottom: 0.5px solid var(--lx-border); } }
.lx-wa__panel { display: flex; flex-direction: column; border-right: 0.5px solid var(--lx-border); max-height: 72vh; }
.lx-wa__filtros { display: flex; gap: 6px; padding: 8px; border-bottom: 0.5px solid var(--lx-border); }
.lx-wa__filtros input { flex: 1; min-width: 0; }
.lx-wa__filtros input, .lx-wa__filtros select { height: 28px; font-size: 11px; border: 0.5px solid var(--lx-border); border-radius: 6px; background: var(--lx-white); color: var(--lx-text); padding: 0 8px; }
.lx-wa__lista { flex: 1; overflow-y: auto; border-right: 0; }
.lx-wa__conv-tel { font-size: 10px; color: var(--lx-text-muted); }
.lx-wa__hilo-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ── Autenticación: solo la card centrada ── */
.account-pages .card { box-shadow: var(--tz-box-shadow-lg); }

/* ══════════════════════════════════════════════════════════════════════════
   Alineación con el tema Techmin. Va al final para pisar las reglas de arriba:
   bordes de 1px (el tema no usa medios píxeles), sombra suave de card,
   cabecera de página como el tema, botones con la métrica de .btn.
   ══════════════════════════════════════════════════════════════════════════ */
.lx-card, .lx-content-card, .lx-tipo-card, .lx-propuesta-box, .lx-pool, .lx-claves, .lx-rec-canal, .lx-wa {
  border-width: 1px;
  box-shadow: var(--tz-box-shadow);
}
.lx-card { padding: 0; }
.lx-page-header { margin-bottom: 20px; }
.lx-page-title { font-size: 15px; font-weight: 600; color: var(--tz-emphasis-color); }
.lx-page-subtitle { font-size: 11px; }
.lx-btn { padding: 0 .9rem; height: 36px; font-size: .875rem; border-width: 1px; }
.lx-btn--sm { height: 30px; padding: 0 .75rem; font-size: .8rem; }
.lx-btn--primary { box-shadow: 0 2px 6px rgba(var(--tz-primary-rgb), .25); }
.lx-btn--ghost { background: var(--tz-secondary-bg); color: var(--tz-body-color); border-color: var(--tz-border-color); }
.lx-btn--ghost:hover { background: var(--tz-tertiary-bg); }
.lx-table thead th { background: var(--tz-tertiary-bg); font-size: 10px; letter-spacing: .04em; color: var(--tz-secondary-color); border-bottom-width: 1px; }
.lx-table tbody td { border-bottom: 1px solid var(--tz-border-color); }
.lx-table tbody tr:hover { background: rgba(var(--tz-primary-rgb), .04); }
.lx-filter-bar input[type="text"], .lx-filter-bar select, .lx-filter-bar input[type="text"]:focus { border-width: 1px; height: 36px; font-size: .875rem; }
.lx-filter-bar select { width: 200px; }
.modal-header { background: var(--tz-primary); padding: 12px 24px; }
.modal-title { font-size: 12px; letter-spacing: .06em; }
.modal-content { box-shadow: var(--tz-box-shadow-lg) !important; }
.modal-body { padding: 20px 24px; }
.modal-body input:not([type="checkbox"]):not([type="radio"]), .modal-body select, .modal-body textarea { border-width: 1px; padding: .45rem .9rem; font-size: .875rem; }
.modal-body .form-label { font-size: 11px; color: var(--tz-secondary-color); }
.lx-actions__menu, .lx-user-dropdown, .lx-sugerencias { border-width: 1px; box-shadow: var(--tz-box-shadow-lg); }
.lx-mini-table th { background: var(--tz-tertiary-bg); }
.lx-flag, .lx-clasif-chip, .lx-clasif-badge, .lx-badge { border-radius: var(--tz-border-radius-sm); }
.lx-pagination { font-size: 11px; }
.lx-page-btn { border-width: 1px; }
.lx-doc-tabs { gap: 4px; }
.lx-tab { padding: 8px 14px; font-size: 12px; }
.lx-tab--active { color: var(--tz-primary); border-bottom-color: var(--tz-primary); }

/* El título de cada pantalla ya está en la topbar (como en el tema): dentro
   del contenido queda solo el subtítulo (conteo) y las acciones. */
.lx-page-title { display: none; }
.lx-page-subtitle { margin: 0; font-size: 12px; color: var(--tz-secondary-color); }
.lx-page-header { margin-bottom: 16px; min-height: 36px; }
.lx-breadcrumb__sep { display: none; }
.lx-breadcrumb__item { color: inherit; }

/* Selects nativos de toda la app con la flecha del tema (equivale a .form-select). */
.modal-body select, .lx-filter-bar select, .lx-iniciar select, .lx-wa__filtros select, .lx-cfg-filtro, .lx-dem-nuevo-dom select, .lx-select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-color: var(--tz-secondary-bg);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 12px 9px;
  padding-right: 2rem !important;
}
[data-bs-theme="dark"] .modal-body select, [data-bs-theme="dark"] .lx-filter-bar select, [data-bs-theme="dark"] .lx-cfg-filtro {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23a3a3a3' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}


/* Sin conteos ni subtítulos dentro de la página: el título va en la topbar. */
.lx-page-subtitle { display: none; }
.lx-page-header { justify-content: flex-end; margin-bottom: 14px; }
.lx-page-header > div:first-child:empty { display: none; }
.navbar-custom .lx-topbar-titulo { gap: 1px; }
.navbar-custom .lx-topbar-titulo .page-title { line-height: 1.15; height: auto; }
.navbar-custom .lx-topbar-tenant { line-height: 1.2; margin: 0; }
/* Barra de filtros: entran buscador + tres selects en una línea a 1440px. */
.lx-filter-bar .lx-input-wrap { flex: 0 1 38%; max-width: 38%; }
.lx-filter-bar select { width: 180px; }

/* ── Botón "Nuevo" discreto, en la esquina del encabezado de la tabla ── */
.lx-th-nuevo { width: 60px; text-align: right !important; padding-right: 12px !important; }
.lx-th-add {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: var(--tz-border-radius);
  border: 1px solid rgba(var(--tz-primary-rgb), .45); background: var(--tz-secondary-bg);
  color: var(--tz-primary); font-size: 16px; line-height: 1; text-decoration: none;
  transition: background var(--lx-transition), color var(--lx-transition);
}
.lx-th-add:hover { background: var(--tz-primary); color: #fff; border-color: var(--tz-primary); }
.lx-th-add[disabled] { opacity: .4; pointer-events: none; }
.lx-empty__nuevo { margin-top: 4px; }
.lx-empty__nuevo .lx-th-add { width: 32px; height: 32px; font-size: 19px; }
.lx-wa__filtros .lx-th-add { height: 28px; width: 28px; flex-shrink: 0; }
.lx-empty__nuevo { order: 10; margin-top: 8px; }

/* Nombre del estudio bajo el título: chip sobrio (fondo suave del primario, ícono, mayúsculas chicas). */
.navbar-custom .lx-topbar-tenant {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  margin-top: 3px; padding: 2px 9px 2px 7px;
  font-size: 9.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--tz-primary); background: rgba(var(--tz-primary-rgb), .10);
  border: 1px solid rgba(var(--tz-primary-rgb), .18); border-radius: 2px; line-height: 1.5;
}
.navbar-custom .lx-topbar-tenant i { font-size: 11px; line-height: 1; }
[data-bs-theme="dark"] .navbar-custom .lx-topbar-tenant { color: #8ec1ff; background: rgba(var(--tz-primary-rgb), .18); }
/* Flags del cliente (Poder / Recibo) debajo del nombre, como etiquetas chicas. */
.lx-table__flags { display: flex; gap: 4px; margin-top: 3px; }
.lx-table__flags .lx-badge-mini { font-size: 8.5px; letter-spacing: .05em; text-transform: uppercase; padding: 1px 6px; }

/* Footer fijo, como la topbar: sigue el ancho del sidebar en cada tamaño. */
.footer { position: fixed; left: var(--tz-leftbar-width); background: var(--tz-body-bg); z-index: 50; }
html[data-sidenav-size="condensed"] .footer { left: var(--tz-leftbar-width-sm); }
html[data-sidenav-size="compact"] .footer { left: var(--tz-leftbar-width-md); }
html[data-sidenav-size="full"] .footer, html[data-sidenav-size="fullscreen"] .footer { left: 0; }
@media (max-width: 767.98px) { .footer { left: 0; } }
.content-page { padding-bottom: calc(var(--tz-footer-height) + 1rem); }
.footer { font-size: 10px; color: var(--tz-secondary-color); letter-spacing: .02em; }

/* Honeypot antibots: fuera de la vista y del tab, pero presente en el DOM. */
.lx-hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── Finanzas ── */
.lx-fin-resumen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 720px) { .lx-fin-resumen { grid-template-columns: 1fr; } }
.lx-fin-kpi { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; background: var(--tz-secondary-bg); border: 1px solid var(--tz-border-color); box-shadow: var(--tz-box-shadow); }
.lx-fin-kpi__v { font-size: 19px; font-weight: 600; color: var(--tz-emphasis-color); }
.lx-fin-kpi__l { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--tz-secondary-color); }
.lx-fin-kpi--alerta { border-color: rgba(var(--tz-warning-rgb), .6); }
.lx-fin-kpi--alerta .lx-fin-kpi__v { color: var(--tz-warning-text-emphasis); }
.lx-fin-sospechosos { margin-bottom: 16px; padding: 0 16px 8px; }
.lx-fin-sospechosos .lx-card__header { padding-left: 0; padding-right: 0; }
.lx-viewer__img { display: block; max-width: 100%; max-height: calc(100vh - 80px); margin: 0 auto; }
.lx-rec-canal--solo { padding-bottom: 8px; }
.lx-rec-canal--solo .lx-rec-canal__head { margin-bottom: 0; }

/* ==========================================================================
   Repositorio de documentos (apps/documentos)
   ========================================================================== */
/* .lx-doc-tabs y no .lx-tabs: ese nombre lo usa el modal de cliente como
   contenedor (barra + panel) y hacerlo flex lo rompía. */
.lx-doc-tabs { display: flex; gap: 4px; border-bottom: 0.5px solid var(--lx-border); margin-bottom: 20px; }
.lx-doc-tabs .lx-tab { padding: 8px 14px; font-size: 12px; color: var(--lx-text-muted); text-decoration: none; border-bottom: 2px solid transparent; transition: all var(--lx-transition); }
.lx-doc-tabs .lx-tab:hover { color: var(--lx-text); }
.lx-doc-tabs .lx-tab--active { color: var(--tz-primary); border-bottom-color: var(--tz-primary); font-weight: 500; }

.lx-repo { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 991px) { .lx-repo { grid-template-columns: 1fr; } }
.lx-repo__panel { padding: 12px 10px; margin-bottom: 14px; }
.lx-repo__panel-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--lx-text-muted); padding: 0 6px 8px;
}
.lx-repo__panel-head .lx-th-add { width: 24px; height: 24px; font-size: 14px; }

.lx-tree { list-style: none; margin: 0; padding: 0; }
.lx-tree .lx-tree { padding-left: 14px; }
.lx-tree__link {
  display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 6px;
  font-size: 12px; color: var(--lx-text); text-decoration: none; white-space: nowrap; overflow: hidden;
}
.lx-tree__link i { font-size: 15px; color: var(--lx-text-muted); flex-shrink: 0; }
.lx-tree__link span { overflow: hidden; text-overflow: ellipsis; }
.lx-tree__link small { margin-left: auto; font-size: 10px; color: var(--lx-text-muted); }
.lx-tree__link:hover { background: var(--lx-surface); color: var(--lx-text); }
.lx-tree__item.is-activa > .lx-tree__link { background: var(--lx-accent-dim); color: var(--tz-primary); font-weight: 500; }
.lx-tree__item.is-activa > .lx-tree__link i { color: var(--tz-primary); }

.lx-repo__tags { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 6px; }
.lx-tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; padding: 2px 8px; border-radius: 20px;
  border: 0.5px solid var(--lx-border); background: var(--lx-surface); color: var(--lx-text-muted); text-decoration: none; white-space: nowrap;
}
.lx-tag__n { font-size: 9px; opacity: .7; }
a.lx-tag:hover, .lx-tag.is-activa { border-color: var(--tz-primary); color: var(--tz-primary); }
.lx-tag--azul     { background: var(--lx-accent-dim); border-color: var(--lx-accent-border); color: var(--lx-accent); }
.lx-tag--verde    { background: var(--lx-success-bg); border-color: #C0DD97; color: var(--lx-success-text); }
.lx-tag--amarillo { background: var(--lx-warn-bg); border-color: #FAC775; color: var(--lx-warn-text); }
.lx-tag--rojo     { background: var(--lx-danger-bg); border-color: #F7C1C1; color: var(--lx-danger); }
.lx-tag--violeta  { background: #F1ECFB; border-color: #D5C6F2; color: #6B47B8; }
[data-bs-theme="dark"] .lx-tag--violeta { background: rgba(107,71,184,.18); border-color: rgba(107,71,184,.45); color: #B9A3EA; }

.lx-repo__ruta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 12px 16px; border-bottom: 0.5px solid var(--lx-border); font-size: 11.5px; }
.lx-repo__ruta-item { color: var(--lx-text-muted); text-decoration: none; }
a.lx-repo__ruta-item:hover { color: var(--tz-primary); }
.lx-repo__ruta-item--actual { color: var(--lx-text); font-weight: 500; }
.lx-repo__ruta-sep { color: var(--lx-border); }
.lx-repo__ruta-acciones { margin-left: auto; display: flex; gap: 2px; }
.lx-repo__ruta-acciones .lx-btn-icon i { font-size: 14px; }

.lx-repo__nombre { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--lx-text); text-decoration: none; text-align: left; }
.lx-repo__nombre:hover { color: var(--tz-primary); }
.lx-repo__icono { font-size: 17px; color: var(--lx-text-muted); flex-shrink: 0; }
.lx-repo__icono--carpeta { color: #E9B949; }
.lx-repo__fila-carpeta td { background: color-mix(in srgb, var(--lx-surface) 55%, transparent); }
.lx-th-nuevo .lx-th-add + .lx-th-add { margin-left: 4px; }

/* zona de arrastre sobre el listado: la capa aparece solo mientras se arrastra un archivo */
.lx-repo__drop { position: relative; }
.lx-repo__drop-capa {
  position: absolute; inset: 0; z-index: 5; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 2px dashed var(--tz-primary); border-radius: inherit; background: var(--lx-accent-dim);
  color: var(--tz-primary); font-size: 13px; pointer-events: none;
}
.lx-repo__drop-capa .material-icons { font-size: 39px; }
.lx-repo__drop-capa p { margin: 0; }
.lx-repo__drop.is-over .lx-repo__drop-capa { display: flex; }
.lx-repo__drop.is-over > #repoContenido { visibility: hidden; }

.lx-ia-nota {
  display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 12px; border-radius: var(--lx-radius);
  background: var(--lx-accent-dim); border: 0.5px solid var(--lx-accent-border); color: var(--lx-accent); font-size: 11.5px;
}
.lx-ia-nota i { font-size: 15px; }
.lx-propuesta { margin-top: 10px; }
.lx-propuesta__titulo { display: block; font-size: 9.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--lx-accent); margin: 0 0 4px; }
.lx-persona { display: flex; align-items: center; gap: 8px; font-size: 11.5px; padding: 4px 0; cursor: pointer; }
.lx-persona--ajena { color: var(--lx-text-muted); cursor: default; }
.lx-buscador { position: relative; }
.lx-buscador .lx-input-icon { top: 50%; }
.lx-buscador .lx-sugerencias { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; }
.lx-hint.d-inline { display: inline; margin: 0 0 0 4px; font-weight: 400; }

/* ── Configuración → Recordatorios: un canal por card, con su switch ── */
.lx-rec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lx-rec-card .lx-content-card__head { align-items: center; padding-bottom: 12px; }
.lx-rec-card .lx-content-card__title { display: flex; align-items: center; gap: 6px; }
.lx-rec-card__icon { font-size: 16px; color: var(--lx-accent); }
.lx-rec-card.is-off .lx-content-card__title, .lx-rec-card.is-off .lx-rec-card__icon { color: var(--lx-text-muted); }
.lx-rec-card .lx-switch input:disabled + .lx-switch__track { opacity: .4; cursor: not-allowed; }

/* ── Aviso de instalación del PWA ────────────────────────────
   Tarjeta flotante abajo a la derecha; en pantallas chicas ocupa el ancho. */
.lx-pwa-install {
  position: fixed;
  z-index: 1035;              /* por debajo de los modales de Bootstrap (1055) */
  right: 1rem;
  bottom: 1rem;
  left: auto;
  max-width: 22rem;
  display: flex;
  gap: .75rem;
  padding: .875rem 1rem;
  background: var(--tz-secondary-bg);
  border: 1px solid var(--tz-border-color);
  border-radius: var(--tz-border-radius-lg, .5rem);
  box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .18);
}
.lx-pwa-install__icono { width: 40px; height: 40px; flex: 0 0 auto; }
@media (max-width: 575.98px) {
  .lx-pwa-install { left: 1rem; right: 1rem; max-width: none; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Teléfonos
   El síntoma era scroll horizontal de la PÁGINA: algo adentro se pasaba de
   ancho y estiraba el documento entero. Las causas encontradas:

   1. `.lx-table-wrap` se usaba en 6 templates y NO tenía ninguna definición,
      así que esas tablas desbordaban sueltas. Otras tres directamente no
      tenían contenedor (ahora sí, en sus templates).
   2. Los hijos de flex/grid traen `min-width:auto`: una tabla ancha adentro
      no se encoge, empuja al contenedor y de ahí al documento.
   3. Varias grillas de 2 y 3 columnas no tenían corte para teléfono.
   ══════════════════════════════════════════════════════════════════════════ */

/* El scroll de una tabla ancha es de la tabla, nunca de la página. */
.lx-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.lx-claves { overflow-x: auto; }

/* Barras de pestañas: filas flex sin wrap. En un teléfono no entran (Configuración
   tiene seis) y estiraban el documento entero. Se deslizan solas.
   El overflow-y:hidden no es decorativo: con overflow-x en auto el eje Y queda en
   'visible', que por CSS computa a 'auto', y el navegador dibuja una barra
   vertical al costado de las pestañas. */
.lx-tabs, .lx-doc-tabs, .lx-tabs-nav {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.lx-tabs::-webkit-scrollbar,
.lx-doc-tabs::-webkit-scrollbar,
.lx-tabs-nav::-webkit-scrollbar { display: none; }
/* Que no se compriman: se desliza, no se aplastan las etiquetas. */
.lx-tabs > *, .lx-doc-tabs > *, .lx-tabs-nav > * { flex: 0 0 auto; }

/* Cortar la cadena de `min-width:auto` que propaga el ancho hacia afuera. */
.content-page, .content, .lx-card, .lx-cfg-seccion, .lx-content-card { min-width: 0; }
.lx-card-grid > *, .lx-filter-bar > * { min-width: 0; }

@media (max-width: 575.98px) {
  /* Tablas: menos aire por celda para que entren más columnas antes de
     tener que deslizar. */
  .lx-table thead th, .lx-table tbody td,
  .lx-mini-table th, .lx-mini-table td { padding-left: 8px; padding-right: 8px; }
  .lx-table, .lx-mini-table { font-size: 11px; }

  /* Filtros: uno por línea. Antes los selects de 200px fijos wrapeaban
     dejando medio renglón vacío al lado. */
  .lx-filter-bar > * { flex: 1 1 100%; }
  .lx-filter-bar select,
  .lx-filter-bar .lx-input-wrap { width: 100%; max-width: none; }

  /* Cabeceras: el botón de acción baja de línea en vez de aplastar el título. */
  .lx-page-header,
  .lx-cfg-seccion__head { flex-wrap: wrap; }
  .lx-cfg-seccion__acciones { flex-wrap: wrap; }

  /* Grillas que no tenían corte para teléfono. */
  .lx-rec-grid, .lx-cfg-checks { grid-template-columns: 1fr; }

  /* Modales: el margen lateral del tema se come media pantalla. */
  .modal-dialog { margin: 8px; }
  .modal-body { padding: 16px 14px; }
  .modal-header { padding: 10px 14px; }
  .lx-cfg-seccion > .lx-card-grid,
  .lx-cfg-seccion > .lx-cfg-vacio,
  .lx-cfg-seccion > .lx-claves { margin: 12px; }
  .lx-docx-preview { padding: 16px 14px; }
}

/* ── Panel del estudio ─────────────────────────────────────────────────── */
.lx-panel__bloque { margin-bottom: 26px; }
.lx-panel__titulo {
  font-size: 13px; font-weight: 600; color: var(--lx-text-muted);
  letter-spacing: 0.04em; text-transform: uppercase; margin: 0 0 12px;
}
.lx-tile { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; }
.lx-tile__label {
  font-size: 11px; font-weight: 500; color: var(--lx-text-muted);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.lx-tile__valor {
  font-size: 26px; font-weight: 600; color: var(--lx-text); line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.lx-tile__valor small { font-size: 15px; font-weight: 500; color: var(--lx-text-muted); }
.lx-tile__pie { font-size: 12px; color: var(--lx-text-muted); }
.lx-tile--alerta .lx-tile__valor { color: var(--lx-danger); }

.lx-panel__grafico { margin-top: 14px; }
.lx-chart { padding: 16px 18px; position: relative; min-height: 200px; }
.lx-vacio { color: var(--lx-text-muted); font-size: 13px; margin: 24px 0; text-align: center; }
.lx-panel__error { padding: 18px; font-size: 13px; color: var(--lx-text-muted); }

.lx-tabla-alt { border-top: 0.5px solid var(--lx-border); }
.lx-tabla-alt > summary {
  cursor: pointer; padding: 10px 18px; font-size: 12px; color: var(--lx-text-muted);
}
.lx-tabla-alt .lx-tabla { width: 100%; font-size: 13px; }
.lx-tabla-alt .lx-tabla th, .lx-tabla-alt .lx-tabla td {
  padding: 7px 18px; border-top: 0.5px solid var(--lx-border); text-align: left;
}
.lx-tabla-alt .lx-tabla td + td, .lx-tabla-alt .lx-tabla th + th {
  text-align: right; font-variant-numeric: tabular-nums;
}

.lx-skel { background: var(--lx-border); border-radius: var(--lx-radius); opacity: .45;
           animation: lx-pulso 1.4s ease-in-out infinite; }
.lx-skel--titulo { height: 13px; width: 160px; margin-bottom: 14px; }
.lx-skel--card { height: 104px; }
@keyframes lx-pulso { 0%, 100% { opacity: .45; } 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .lx-skel { animation: none; } }

/* ── Pestaña Pagos del cliente: alta de pago y fecha de inicio ──────────── */
.lx-detail-heading-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.lx-btn-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--lx-accent); font-size: inherit; font-weight: 500;
  text-decoration: underline; text-underline-offset: 2px;
}
.lx-btn-link:hover { opacity: .8; }

.lx-pago-form {
  border: 0.5px solid var(--lx-border); border-radius: var(--lx-radius);
  padding: 12px 14px; margin-bottom: 12px; background: var(--lx-surface);
}
.lx-pago-form__campos {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
}
.lx-pago-form label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; color: var(--lx-text-muted);
  letter-spacing: .03em; text-transform: uppercase;
}
.lx-pago-form input, .lx-pago-form select {
  border: 0.5px solid var(--lx-border); border-radius: var(--lx-radius);
  padding: 7px 9px; font-size: 13px; text-transform: none; letter-spacing: 0;
  background: var(--lx-white); color: var(--lx-text);
}
.lx-pago-form__acciones {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px;
}
@media (max-width: 720px) {
  .lx-pago-form__campos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Notificaciones (campanita de la topbar) ─────────────────────────────── */
.lx-notif__boton { position: relative; }
/* Íconos de la topbar (tema y campanita): un poco más chicos que el fs-22 de Techmin. */
.lx-topbar-icono { font-size: 19px; line-height: 1; vertical-align: middle; }
.lx-notif__badge {
  position: absolute; top: 14px; right: -6px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--lx-danger); color: #fff;
  font-size: 10px; font-weight: 600; line-height: 16px; text-align: center;
}
.lx-notif__menu { width: 340px; max-width: calc(100vw - 32px); }
.lx-notif__cabecera {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--lx-border);
}
.lx-notif__lista { max-height: 380px; overflow-y: auto; }
.lx-notif__push { padding: 10px 14px; border-top: 0.5px solid var(--lx-border); }
.lx-notif__push-nota { display: block; margin-top: 6px; font-size: 10.5px; color: var(--lx-text-muted); line-height: 1.4; }
.lx-notif__item {
  display: flex; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid var(--lx-border);
  color: var(--lx-text); text-decoration: none;
}
.lx-notif__item:last-child { border-bottom: 0; }
a.lx-notif__item:hover { background: var(--lx-accent-dim); color: var(--lx-text); }
.lx-notif__item.is-nueva { background: var(--lx-accent-dim); }
.lx-notif__item.is-nueva .lx-notif__titulo { font-weight: 600; }
.lx-notif__icono { font-size: 20px; line-height: 1.2; flex: none; }
.lx-notif__item--exito  .lx-notif__icono { color: var(--tz-success); }
.lx-notif__item--alerta .lx-notif__icono { color: var(--tz-warning); }
.lx-notif__item--info   .lx-notif__icono { color: var(--lx-accent); }
.lx-notif__cuerpo { min-width: 0; }
.lx-notif__titulo { font-size: 14px; }
.lx-notif__detalle { font-size: 13px; color: var(--lx-text-muted); overflow-wrap: anywhere; }
.lx-notif__cuando { color: var(--lx-text-muted); }
.lx-notif__vacio { margin: 0; padding: 24px 16px; text-align: center; color: var(--lx-text-muted); }

/* ── Bordes redondeados ──────────────────────────────────────────────────────
   Techmin trae --tz-border-radius: 0 y de ahí cuelgan botones, inputs, cards,
   modales, tablas y los --lx-radius. Se redondea sutil: 6px lo chico (botones,
   inputs, chips), 10px lo grande (cards, modales, paneles), 8px los menús. */
:root, [data-bs-theme="light"], [data-bs-theme="dark"] {
  --tz-border-radius:    6px;
  --tz-border-radius-sm: 4px;
  --tz-border-radius-lg: 10px;
}
.card  { --tz-card-border-radius: var(--tz-border-radius-lg);
         --tz-card-inner-border-radius: calc(var(--tz-border-radius-lg) - 1px); }
.modal { --tz-modal-border-radius: var(--tz-border-radius-lg);
         --tz-modal-inner-border-radius: calc(var(--tz-border-radius-lg) - 1px); }
.dropdown-menu { --tz-dropdown-border-radius: 8px;
                 --tz-dropdown-inner-border-radius: 7px; }
.badge { --tz-badge-border-radius: var(--tz-border-radius-sm); }
.lx-actions__menu, .lx-user-dropdown, .lx-sugerencias { border-radius: 8px; }
.lx-actions__item { border-radius: var(--tz-border-radius-sm); }
.swal2-popup { border-radius: var(--tz-border-radius-lg); }
/* Tablas: el contenedor recorta las esquinas del encabezado y de la última fila. */
.lx-table-wrap, .table-responsive { border-radius: var(--tz-border-radius-lg); }

/* Título y estudio también en el teléfono: el bloque cede ancho y los textos
   largos se cortan con "…" antes de empujar los íconos de la derecha. */
.topbar > .d-flex:first-child { min-width: 0; flex: 1 1 auto; }
.navbar-custom .lx-topbar-titulo { min-width: 0; }
.navbar-custom .lx-topbar-titulo .page-title,
.navbar-custom .lx-topbar-tenant { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navbar-custom .lx-topbar-tenant { display: inline-block; }
.navbar-custom .lx-topbar-tenant i { vertical-align: -1px; margin-right: 4px; }
@media (max-width: 575.98px) {
  .navbar-custom .lx-topbar-titulo .page-title { font-size: 15px; }
  .navbar-custom .topbar-menu { gap: .5rem !important; flex-shrink: 0; }
}

/* Switch con ayuda debajo, al final de la barra de filtros y pegado a la derecha
   (Clientes: "Mostrar todos"; Poderes: "Mostrar no cargados"). */
.lx-filter-bar .lx-filtro-todos {
  margin-left: auto;
  display: flex; flex-direction: column; gap: 3px;
  max-width: 240px;
}
.lx-filtro-todos .lx-switch { white-space: nowrap; }
.lx-filtro-todos__ayuda { font-size: 10px; line-height: 1.3; color: var(--lx-text-muted); }
