:root {
  --bg: #f6f0e6;
  --surface: #fffdf9;
  --surface-2: #f3ebe1;
  --ink: #2c2622;
  --muted: #6f645c;
  --wine: #d06a45;
  --wine-deep: #b55232;
  --gold: #1f6f66;
  --gold-bright: #164e48;
  --line: rgba(44, 38, 34, 0.12);
  --danger: #9d2c2c;
  --ok: #1c7a46;
  --radius: 22px;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI", "Helvetica Neue", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(980px 460px at 0% -8%, rgba(224, 164, 122, 0.55), transparent 58%),
    radial-gradient(760px 420px at 100% 0%, rgba(31, 111, 102, 0.16), transparent 48%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}
body.bloqueado { overflow: hidden; }
::selection { background: #f3c7b4; color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

.solo-lectura {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.barra-superior {
  position: relative;
  z-index: 40;
  background: rgba(246, 240, 230, 0.96);
  border-bottom: 1px solid var(--line);
}
.encabezado, .pagina { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.encabezado {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 0;
}
.encabezado-acciones {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 14px;
  margin-left: auto;
}
.encabezado-nota {
  font-style: normal;
  color: var(--gold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.68rem;
}
.enlace-nav {
  color: var(--gold-bright);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}
.enlace-nav:hover { text-decoration: underline; }
.acciones-consulta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.tabla-envuelve { overflow-x: auto; margin-top: 22px; }
.tabla-consulta { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tabla-consulta th,
.tabla-consulta td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.tabla-consulta th {
  color: var(--gold-bright);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tabla-consulta tbody tr { cursor: pointer; }
.tabla-consulta tbody tr:hover,
.tabla-consulta tbody tr[aria-selected="true"] { background: rgba(31, 111, 102, 0.08); }
.tabla-consulta tbody tr.fila-seleccionada,
.tabla-consulta tbody tr.fila-seleccionada:hover { background: rgba(31, 111, 102, 0.16); }
.columna-seleccion, .tabla-consulta td.seleccion {
  width: 44px;
  padding-inline: 8px;
  text-align: center;
  vertical-align: middle;
}
.tabla-consulta input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold-bright);
  cursor: pointer;
}
.barra-seleccion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #e7f3f1;
}
.barra-seleccion p { margin: 0; color: var(--gold-bright); font-weight: 700; }
.tabla-consulta td.folio { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla-consulta td.accion { white-space: nowrap; width: 1%; }
.detalle-consulta { margin-top: 22px; }
.detalle-consulta dl {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: 8px 16px;
  margin: 0;
}
.detalle-consulta dt { color: var(--gold-bright); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.detalle-consulta dd { margin: 0; overflow-wrap: anywhere; }
.pagina { padding: 28px 0 48px; }
.kicker {
  margin: 0 0 8px;
  color: var(--gold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.72rem;
}
h1, h2, .resumen-antiguedad { font-family: var(--serif); font-weight: 500; }
h1 { margin: 0 0 10px; font-size: clamp(2rem, 4vw, 3.1rem); letter-spacing: 0.01em; }
h2 { margin: 0 0 16px; font-size: 1.35rem; }
.lead, .ayuda, .nota { color: var(--muted); }
.lead { max-width: 62ch; margin: 0 0 28px; }

.distribucion { display: grid; gap: 22px; align-items: start; }
main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 36px);
  box-shadow: 0 18px 44px rgba(92, 58, 32, 0.08);
}

.banner-slot {
  display: grid;
  place-items: center;
  min-height: 110px;
  border: 1px dashed rgba(31, 111, 102, 0.28);
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.72);
  color: rgba(31, 111, 102, 0.72);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.68rem;
}
.banner-slot:empty::before { content: "Espacio para banner"; }
.banner-slot:not(:empty) { padding: 0; overflow: hidden; border-style: solid; }
.banner-slot img { width: 100%; height: 100%; object-fit: cover; }
.banner-superior, .banner-inferior { margin: 0 0 22px; }
.banner-lateral { min-height: 280px; position: sticky; top: 18px; }

.bloque + .bloque { margin-top: 8px; padding-top: 8px; }
.curp-primero {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(31, 111, 102, 0.07);
}
.curp-primero input {
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#nombreEmpleado,
#nombreEmpresa,
#direccionEmpresa { text-transform: uppercase; }
#entidadFederativa:disabled {
  opacity: 1;
  cursor: default;
  color: #14574f;
  background-color: #eef6f3;
  background-image: none;
  padding-right: 14px;
}
.con-palomita { position: relative; }
.con-palomita > input { padding-right: 46px; }
.palomita {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  border-radius: 50%;
  background: #1f8a4c;
  box-shadow: 0 0 0 2px rgba(31, 138, 76, 0.28);
}
.palomita::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  width: 5px;
  height: 9px;
  border: solid #f4fff8;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.palomita[hidden] { display: none; }
.bloque h2 {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
.rejilla { display: grid; gap: 16px 18px; }
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
label, .etiqueta-grupo {
  color: var(--gold-bright);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.casilla {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink);
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
}
.casilla input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
  padding: 0;
  accent-color: var(--gold);
}
.requerido::after { content: " *"; color: var(--gold); }
.ayuda, .error-campo, .nota { margin: 0; font-size: 0.86rem; }
.error-campo { color: var(--danger); }
input, textarea, select {
  width: 100%;
  border: 1px solid #e6d9cc;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 12px 14px;
}
textarea { resize: vertical; min-height: 74px; }
input[readonly] {
  background: #eef6f3;
  color: #14574f;
  font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
}
select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
input:focus, textarea:focus, select:focus { border-color: var(--gold); }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] {
  border-color: #d27a7a;
  background: #fff6f4;
}
.antiguedad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.moneda { position: relative; display: flex; align-items: center; }
.moneda span { position: absolute; color: var(--gold); font-size: 0.86rem; }
.moneda span:first-child { left: 14px; }
.moneda span:last-child { right: 14px; }
.moneda input { padding-left: 30px; padding-right: 58px; }

.fecha-manual { position: relative; display: flex; align-items: center; gap: 8px; }
.fecha-manual input[type="text"] { flex: 1; }
.fecha-nativa {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  border: 0;
  padding: 0;
}
.calendario {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  padding: 0;
  border-radius: 12px;
  letter-spacing: 0;
}
.calendario svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.total-fila { display: flex; align-items: center; gap: 10px; }
.total-fila .moneda { flex: 1; min-width: 0; }
#botonPdf {
  height: 48px;
  padding: 0 16px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.documento-pdf { display: none; }
body.imprimiendo {
  margin: 0 !important;
  min-height: 0 !important;
  background: #fff !important;
  color: #1c1917 !important;
}
body.imprimiendo .barra-superior,
body.imprimiendo #aviso,
body.imprimiendo #portal,
body.imprimiendo #modal-acceso,
body.imprimiendo .noscript { display: none !important; }
body.imprimiendo .documento-pdf {
  display: block !important;
  max-width: 190mm;
  margin: 0 auto;
  color: #1c1917;
  background: #fff;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 9pt;
  line-height: 1.28;
}
.doc-encabezado {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 4px 12px;
  margin: 0 0 8px;
  padding-bottom: 7px;
  border-bottom: 2.5px solid #6b2a3e;
}
.doc-kicker {
  flex: 0 0 100%;
  margin: 6px 0 0;
  color: #6b2a3e;
  font-size: 16pt;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
}
.doc-meta { text-align: right; }
.doc-meta strong {
  display: block;
  color: #6b2a3e;
  font-size: 12pt;
  line-height: 1.1;
}
.doc-meta p { margin: 2px 0 0; color: #6f645c; font-size: 8pt; }
.doc-partes {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 8px;
}
.doc-parte {
  border: 1px solid #e6ddd3;
  border-top: 3px solid #6b2a3e;
  padding: 5px 8px 6px;
}
.doc-parte h2 {
  margin: 0 0 3px;
  padding: 0;
  border: 0;
  color: #6b2a3e;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 7.5pt;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.doc-parte dl {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 1px 8px;
  margin: 0;
}
.doc-parte dt { color: #6f645c; font-weight: 650; }
.doc-parte dd { margin: 0; overflow-wrap: anywhere; }
.doc-hechos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px 10px;
  margin: 8px 0;
  padding: 6px 0;
  border-top: 1px solid #e6ddd3;
  border-bottom: 1px solid #e6ddd3;
}
.doc-hecho span {
  display: block;
  color: #6f645c;
  font-size: 7pt;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.doc-hecho strong { display: block; margin-top: 1px; font-weight: 650; }
.doc-tabla { width: 100%; border-collapse: collapse; margin: 0; }
.doc-tabla th,
.doc-tabla td { padding: 3px 4px; text-align: left; vertical-align: baseline; }
.doc-tabla thead th {
  padding-bottom: 4px;
  border-bottom: 1px solid #6b2a3e;
  color: #6f645c;
  font-size: 7.5pt;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.doc-tabla tbody th { font-weight: 500; }
.doc-tabla tbody td,
.doc-tabla thead th:last-child,
.doc-tabla tfoot td { text-align: right; font-variant-numeric: tabular-nums; }
.doc-tabla tbody tr + tr th,
.doc-tabla tbody tr + tr td { border-top: 1px solid #f0e8df; }
.doc-tabla tfoot th,
.doc-tabla tfoot td {
  padding-top: 6px;
  border-top: 2px solid #6b2a3e;
  color: #6b2a3e;
  font-size: 12pt;
  font-weight: 700;
}
.doc-nota { margin: 7px 0 0; color: #6f645c; font-size: 8pt; }
.doc-pie {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 7px;
  padding-top: 4px;
  border-top: 1px solid #e6ddd3;
  color: #6f645c;
  font-size: 7.5pt;
}
.doc-pie p { margin: 0; }
.acciones { margin-top: 22px; }
button, .modal button, #botonCalcular {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 28px;
  background: linear-gradient(180deg, #e48968, #c45b3c);
  color: #fffdf9;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(196, 91, 60, 0.22);
}
button:disabled { opacity: 0.45; cursor: not-allowed; }
button:not(:disabled):hover { filter: brightness(1.05); }
.boton-acceso,
.boton-compacto { width: auto; padding: 10px 16px; }
.boton-secundario {
  width: auto;
  background: transparent;
  color: var(--gold-bright);
  border: 1px solid rgba(31, 111, 102, 0.35);
  box-shadow: none;
}
.boton-peligro {
  background: linear-gradient(180deg, #c45b3c, #9d2c2c);
  box-shadow: none;
}
.modal-tarjeta .acciones-acceso {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.modal-tarjeta .acciones-acceso button { width: auto; flex: 1; }
.sesion-nombre {
  color: var(--gold-bright);
  font-size: 0.82rem;
  font-weight: 700;
}
.pestanas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
}
.pestanas button {
  width: auto;
  background: transparent;
  color: var(--gold-bright);
  border: 1px solid rgba(31, 111, 102, 0.28);
  box-shadow: none;
}
.pestanas button[aria-selected="true"] {
  background: var(--gold);
  color: #fffdf9;
  border-color: var(--gold);
}
.permisos {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}
.permisos label,
#campo-activo label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.resultado {
  margin-top: 26px;
  padding: 22px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f4faf7, #fffdf9);
  border: 1px solid rgba(31, 111, 102, 0.18);
}
.resultado h2 { margin-bottom: 8px; }
.resumen-antiguedad { margin: 0 0 16px; font-size: 1.7rem; color: var(--gold-bright); }
.resultado dl { display: grid; gap: 10px; margin: 0 0 16px; }
.resultado dl div {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 8px 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(31, 111, 102, 0.12);
}
.resultado dt { color: var(--gold); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.resultado dd { margin: 0; overflow-wrap: anywhere; }
.estado-ok, .estado-aviso { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; }
.estado-ok { background: #e7f6ec; color: var(--ok); }
.estado-aviso { background: #f8efe4; color: #8a4b32; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(62, 44, 32, 0.28);
  backdrop-filter: blur(8px);
}
.modal-tarjeta {
  width: min(560px, 100%);
  max-height: min(680px, calc(100vh - 40px));
  overflow: auto;
  padding: 28px 26px;
  border-radius: 24px;
  background: #fffdf9;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(92, 58, 32, 0.16);
}
.modal-tarjeta h2 { font-size: 1.8rem; }
.modal-tarjeta p { margin: 0 0 14px; }
.modal-regla { color: var(--gold-bright); }
.modal-tarjeta button { width: 100%; }

.trampa {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.noscript {
  margin: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff1e8;
  color: var(--ink);
}

@media (min-width: 760px) {
  .rejilla-2 { grid-template-columns: 1fr 1fr; }
  .campo-completo { grid-column: 1 / -1; }
}
@media (min-width: 1040px) {
  .distribucion { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 640px) {
  .encabezado { align-items: flex-start; flex-direction: column; }
  .encabezado-acciones { align-self: flex-end; }
  .resultado dl div,
  .detalle-consulta dl { grid-template-columns: 1fr; gap: 2px; }
  .total-fila { flex-direction: column; align-items: stretch; }
  #botonPdf { width: 100%; }
}
@media print {
  @page {
    size: letter;
    margin: 14mm 13mm 12mm;
  }
  html, body.imprimiendo, body.tema-despacho {
    height: auto !important;
    min-height: 0 !important;
    background: #fff !important;
    color: #1c1917 !important;
  }
  body:has(#documento-pdf:not(:empty)) .barra-superior,
  body:has(#documento-pdf:not(:empty)) #aviso,
  body:has(#documento-pdf:not(:empty)) #portal,
  body:has(#documento-pdf:not(:empty)) #modal-acceso,
  body:has(#documento-pdf:not(:empty)) .noscript,
  .btn-wa,
  .wa { display: none !important; }
  body:has(#documento-pdf:not(:empty)) #documento-pdf {
    display: block !important;
    max-width: none;
    margin: 0;
    color: #1c1917 !important;
    background: #fff !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

html:has(body.tema-despacho) { color-scheme: dark; }
body.tema-despacho {
  --bg: #080606;
  --surface: #120e0f;
  --surface-2: #1a1416;
  --ink: #f3ede8;
  --muted: #a89890;
  --wine: #6b2a3e;
  --wine-deep: #481828;
  --gold: #c4a574;
  --gold-bright: #c4a574;
  --line: #2a1c20;
  --danger: #e7a0a0;
  --ok: #b7e4c7;
  --serif: "Cinzel", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Manrope", "Segoe UI", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
}
body.tema-despacho ::selection { background: #6b2a3e; color: #f3ede8; }
body.tema-despacho.imprimiendo {
  color: #1c1917;
  background: #fff !important;
}
body.tema-despacho .barra-superior {
  background: rgba(8, 6, 6, 0.94);
  border-bottom: 1px solid var(--line);
}
body.tema-despacho .marca {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}
body.tema-despacho .marca img { height: 52px; width: auto; }
body.tema-despacho .marca span { display: flex; flex-direction: column; line-height: 1.15; }
body.tema-despacho .marca strong {
  font-family: var(--serif);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
body.tema-despacho .marca em {
  font-style: normal;
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
body.tema-despacho main {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
}
body.tema-despacho .banner-slot {
  border-color: rgba(196, 165, 116, 0.28);
  background: rgba(18, 14, 15, 0.72);
  color: rgba(196, 165, 116, 0.72);
}
body.tema-despacho .curp-primero {
  border-color: var(--line);
  background: rgba(107, 42, 62, 0.28);
}
body.tema-despacho #entidadFederativa:disabled,
body.tema-despacho input[readonly] {
  color: var(--gold);
  background-color: #24181c;
}
body.tema-despacho .casilla input {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--gold);
}
body.tema-despacho input,
body.tema-despacho textarea,
body.tema-despacho select {
  border-color: #3a2a30;
  background-color: #1a1416;
  color: var(--ink);
}
body.tema-despacho select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-color: #1a1416;
}
body.tema-despacho input:focus,
body.tema-despacho textarea:focus,
body.tema-despacho select:focus { border-color: var(--gold); }
body.tema-despacho input[aria-invalid="true"],
body.tema-despacho textarea[aria-invalid="true"],
body.tema-despacho select[aria-invalid="true"] {
  border-color: #e07a7a;
  background-color: #2a1618;
}
body.tema-despacho button,
body.tema-despacho .modal button,
body.tema-despacho #botonCalcular,
body.tema-despacho #botonPdf {
  background: var(--wine-deep);
  color: #fff;
  border: 1px solid rgba(196, 165, 116, 0.35);
  box-shadow: none;
}
body.tema-despacho #botonPdf:not(:disabled) {
  background: var(--gold);
  color: #1a1014;
  border-color: var(--gold);
  opacity: 1;
  cursor: pointer;
}
body.tema-despacho #botonPdf:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
body.tema-despacho button:not(:disabled):hover,
body.tema-despacho #botonCalcular:not(:disabled):hover {
  background: var(--wine);
  filter: none;
}
body.tema-despacho #botonPdf:not(:disabled):hover {
  background: #d4b896;
  filter: none;
}
body.tema-despacho .boton-secundario {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}
body.tema-despacho .resultado {
  background: #1a1416;
  border-color: var(--line);
}
body.tema-despacho .resultado dl div { border-bottom-color: var(--line); }
body.tema-despacho .estado-ok { background: #163028; color: var(--ok); }
body.tema-despacho .estado-aviso { background: #2a2018; color: #e7c7a4; }
body.tema-despacho .modal { background: rgba(8, 6, 6, 0.72); }
body.tema-despacho .modal-tarjeta {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
body.tema-despacho .noscript { background: #2a2018; color: var(--ink); }
body.tema-despacho .pie-despacho {
  margin-top: 28px;
  padding: 64px 0 36px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}
body.tema-despacho .pie-contenido { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
body.tema-despacho .pie-rejilla {
  display: grid;
  grid-template-columns: minmax(16rem, 1.35fr) minmax(11rem, 0.8fr) minmax(12.5rem, 0.95fr) minmax(16rem, 1.15fr);
  column-gap: 36px;
  row-gap: 28px;
  align-items: start;
}
body.tema-despacho .pie-logo { height: 48px; width: auto; margin-bottom: 16px; }
body.tema-despacho .pie-despacho p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.45;
}
body.tema-despacho .pie-datos p { margin: 0 0 6px; }
body.tema-despacho .pie-servicios { margin-top: 12px; }
body.tema-despacho .pie-correo a { white-space: nowrap; }
body.tema-despacho .pie-despacho h2 {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
body.tema-despacho .pie-despacho a { color: inherit; text-decoration: none; }
body.tema-despacho .pie-despacho a:hover { color: var(--gold); }
body.tema-despacho .pie-mapa { margin-top: 8px; }
body.tema-despacho .pie-mapa iframe {
  display: block;
  width: 100%;
  height: 280px;
  border: 0;
  border-radius: 22px;
  background: #120e0f;
}
@media (max-width: 1040px) {
  body.tema-despacho .pie-rejilla { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  body.tema-despacho .pie-rejilla { grid-template-columns: 1fr; }
  body.tema-despacho .marca strong { font-size: 0.68rem; }
}
@media (max-width: 460px) {
  body.tema-despacho .marca img { height: 44px; }
  body.tema-despacho .marca strong { font-size: 0.62rem; letter-spacing: 0.06em; }
  body.tema-despacho .marca em { letter-spacing: 0.12em; }
}
body.tema-despacho .enlace-nav { color: var(--gold); }
body.tema-despacho .enlace-nav:hover { color: #d4b896; }
body.tema-despacho .pestanas button {
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(196, 165, 116, 0.4);
  box-shadow: none;
}
body.tema-despacho .pestanas button[aria-selected="true"] {
  background: var(--wine-deep);
  color: #fff;
  border-color: var(--gold);
}
body.tema-despacho .pestanas button:not(:disabled):hover,
body.tema-despacho .pestanas button[aria-selected="true"]:hover {
  background: var(--wine);
  color: #fff;
  filter: none;
}
body.tema-despacho .boton-peligro {
  background: #6e2430;
  color: #fff;
  border-color: rgba(231, 160, 160, 0.45);
}
body.tema-despacho .boton-peligro:not(:disabled):hover { background: #8a3040; }
body.tema-despacho .tabla-consulta th { color: var(--gold); }
body.tema-despacho .tabla-consulta tbody tr:hover,
body.tema-despacho .tabla-consulta tbody tr[aria-selected="true"] { background: rgba(107, 42, 62, 0.35); }
body.tema-despacho .tabla-consulta tbody tr.fila-seleccionada,
body.tema-despacho .tabla-consulta tbody tr.fila-seleccionada:hover { background: rgba(196, 165, 116, 0.16); }
body.tema-despacho .barra-seleccion {
  background: #1a1416;
  border: 1px solid var(--line);
}
body.tema-despacho .detalle-consulta {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #1a1416;
}
body.tema-despacho .detalle-consulta dl div {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
body.tema-despacho .btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px 0 14px;
  border-radius: 999px;
  background: var(--wine-deep);
  color: #fff;
  border: 1px solid rgba(196, 165, 116, 0.35);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.68rem;
  text-decoration: none;
  white-space: nowrap;
  transition: 0.2s ease;
}
body.tema-despacho .btn-wa svg { width: 18px; height: 18px; color: #25d366; flex-shrink: 0; }
body.tema-despacho .btn-wa:hover {
  background: var(--wine);
  border-color: var(--gold);
  color: #fff;
}
body.tema-despacho .wa {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  isolation: isolate;
  border: 1px solid rgba(196, 165, 116, 0.45);
  display: grid;
  place-items: center;
  background: #128c7e;
  color: #fff;
  z-index: 35;
  box-shadow: 0 10px 24px rgba(18, 140, 126, 0.35);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
body.tema-despacho .wa svg { width: 28px; height: 28px; }
body.tema-despacho .wa:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(18, 140, 126, 0.45);
  color: #fff;
}
body.tema-despacho .wa::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid rgba(37, 211, 102, 0.35);
  animation: wa-pulse 2.4s ease-out infinite;
}
@keyframes wa-pulse {
  0% { transform: scale(0.92); opacity: 0.7; }
  100% { transform: scale(1.18); opacity: 0; }
}
@media (max-width: 960px) {
  body.tema-despacho .btn-wa span { display: none; }
  body.tema-despacho .btn-wa { min-height: 42px; width: 42px; padding: 0; justify-content: center; }
  body.tema-despacho .btn-wa svg { width: 20px; height: 20px; }
  body.tema-despacho .wa {
    right: calc(16px + env(safe-area-inset-right));
    bottom: calc(16px + env(safe-area-inset-bottom));
  }
  body.tema-despacho .pie-despacho { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  body.tema-despacho .wa::after { animation: none; }
}
body.tema-despacho .permisos input,
body.tema-despacho #campo-activo input,
body.tema-despacho .tabla-consulta input[type="checkbox"] {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--gold);
}
