/* ============ RENTA BLANCARTE — estilo minimalista ============ */
:root {
  --fondo: #f6f6f3;
  --panel: #ffffff;
  --tinta: #16181d;
  --gris: #6b7280;
  --linea: #e7e7e2;
  --acento: #0f766e;
  --acento-suave: #ccfbf1;
  --rojo: #b91c1c;
  --verde: #0f766e;
  --sombra: 0 1px 2px rgba(20, 20, 20, .05), 0 8px 24px -12px rgba(20, 20, 20, .18);
  --radio: 14px;
  --blanco: #ffffff;
  --hover-fila: #fafaf7;
  --linea-suave: #f0f0ec;
  --texto-2: #374151;
  --barra-gas: #d1d5db;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

body {
  font-family: ui-sans-serif, system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--fondo);
  color: var(--tinta);
  font-size: 15px;
  line-height: 1.45
}

.mono {
  font-variant-numeric: tabular-nums
}

.der {
  text-align: right
}

.rojo {
  color: var(--rojo)
}

.verde {
  color: var(--verde)
}

.inline {
  display: inline
}

.fila {
  display: flex;
  gap: 10px;
  align-items: center
}

.fila.fin {
  justify-content: flex-end;
  margin-top: 14px
}

/* ---- estructura ---- */
.app {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh
}

.contenido {
  padding: 28px 34px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  min-width: 0
}

/* ---- barra lateral ---- */
.sidebar {
  background: #101418;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh
}

.marca {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 20px 18px 16px;
  border-bottom: 1px solid #1d242b
}

.marca div {
  display: flex;
  flex-direction: column;
  line-height: 1.05
}

.marca strong {
  color: #fff;
  font-size: 16px;
  letter-spacing: .3px
}

.marca span {
  font-size: 11.5px;
  color: #7c8894;
  letter-spacing: 2.5px;
  text-transform: uppercase
}

.sidebar nav {
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #aeb8c2;
  text-decoration: none;
  font-size: 14px;
  transition: background .18s, color .18s, transform .18s
}

.sidebar nav a svg {
  width: 18px;
  height: 18px;
  flex: none
}

.sidebar nav a:hover {
  background: #1a2027;
  color: #fff;
  transform: translateX(2px)
}

.sidebar nav a.activo {
  background: var(--acento);
  color: #fff
}

.sesion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid #1d242b
}

.chip {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--acento);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700
}

.quien {
  flex: 1;
  line-height: 1.15
}

.quien strong {
  color: #e5e7eb;
  font-size: 13px;
  display: block
}

.quien span {
  font-size: 11px;
  color: #7c8894
}

.salir {
  color: #7c8894;
  transition: color .18s
}

.salir:hover {
  color: #f87171
}

.salir svg {
  width: 18px;
  height: 18px
}

/* ---- cabecera ---- */
.cabecera {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap
}

h1 {
  font-size: 23px;
  letter-spacing: -.02em
}

h2 {
  font-size: 15px;
  margin-bottom: 14px;
  color: var(--texto-2)
}

.sub {
  color: var(--gris);
  font-size: 13.5px;
  margin-top: 3px
}

/* ---- tarjetas ---- */
.tarjetas {
  display: grid;
  /* el mínimo crece con el tamaño de letra: al agrandar, caben menos tarjetas
     por fila (más anchas) y los montos nunca se cortan */
  grid-template-columns: repeat(auto-fit, minmax(calc(190px + (var(--fs) - 1) * 900px), 1fr));
  gap: 14px;
  margin-bottom: 22px
}

.tarjeta {
  background: var(--panel);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: 16px 18px;
  box-shadow: var(--sombra);
  transition: transform .2s, box-shadow .2s
}

.tarjeta:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px -12px rgba(20, 20, 20, .22)
}

.tarjeta span {
  font-size: 12.5px;
  color: var(--gris)
}

.tarjeta strong {
  display: block;
  font-size: 23px;
  margin-top: 6px;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums
}

.tarjeta.acento {
  background: linear-gradient(135deg, #0f766e, #115e59);
  border: none;
  color: #fff
}

.tarjeta.acento span {
  color: #99f6e4
}

/* ---- paneles y tablas ---- */
.panel {
  background: var(--panel);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: 20px 22px;
  box-shadow: var(--sombra);
  margin-bottom: 20px
}

.tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px
}

.tabla th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--gris);
  padding: 8px 10px;
  border-bottom: 1px solid var(--linea)
}

.tabla th.der {
  text-align: right
}

.tabla td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--linea-suave);
  vertical-align: top
}

.tabla tbody tr {
  transition: background .15s
}

.tabla tbody tr:hover {
  background: var(--hover-fila)
}

.tabla tfoot td {
  font-weight: 600;
  border-bottom: none;
  padding-top: 12px
}

.notita {
  font-size: 12px;
  color: var(--gris);
  margin-top: 2px
}

.etiqueta {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap
}

.etiqueta.ingreso {
  background: #dcfce7;
  color: #166534
}

.etiqueta.otro_ingreso {
  background: #e0f2fe;
  color: #075985
}

.etiqueta.gasto {
  background: #fee2e2;
  color: #991b1b
}

.etiqueta.reparto {
  background: #fef9c3;
  color: #854d0e
}

/* ---- botones y formularios ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--blanco);
  border: 1px solid var(--linea);
  color: var(--tinta);
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
  transition: all .18s
}

.btn svg {
  width: 15px;
  height: 15px
}

.btn:hover {
  border-color: #c9c9c2;
  transform: translateY(-1px);
  box-shadow: var(--sombra)
}

.btn.primario {
  background: var(--acento);
  border-color: var(--acento);
  color: #fff
}

.btn.primario:hover {
  background: #0d635c
}

.btn.peligro {
  color: var(--rojo)
}

.btn.peligro:hover {
  background: #fef2f2;
  border-color: #fecaca
}

.btn.verde-btn {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff
}

.btn.rojo-btn {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff
}

.btn.chico {
  padding: 5px 10px;
  font-size: 12.5px;
  border-radius: 8px
}

.btn.ancho {
  width: 100%;
  justify-content: center
}

.acciones {
  white-space: nowrap
}

.acciones form {
  margin-left: 4px
}

label {
  display: block;
  font-size: 13px;
  color: var(--texto-2);
  margin-bottom: 12px
}

input,
select,
textarea {
  width: 100%;
  margin-top: 5px;
  padding: 9px 11px;
  border: 1px solid var(--linea);
  border-radius: 10px;
  font-size: 14px;
  background: var(--blanco);
  font-family: inherit;
  transition: border .15s, box-shadow .15s
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--acento);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .14)
}

.filtros {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 14px 16px
}

.filtros select,
.filtros input {
  width: auto;
  margin: 0
}

.aviso {
  padding: 11px 15px;
  border-radius: 10px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  margin-bottom: 16px;
  animation: entrar .35s ease
}

.aviso.error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca
}

/* ---- grafica de barras ---- */
.grafica {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  height: 190px;
  padding-top: 10px
}

.mes {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%
}

.mes span {
  font-size: 11px;
  color: var(--gris)
}

.barras {
  flex: 1;
  display: flex;
  gap: 3px;
  align-items: flex-end;
  width: 100%;
  justify-content: center
}

.barra {
  width: 38%;
  max-width: 22px;
  border-radius: 5px 5px 2px 2px;
  height: 0;
  animation: crecer .9s cubic-bezier(.2, .7, .3, 1) forwards
}

.barra.ing {
  background: var(--acento)
}

.barra.gas {
  background: var(--barra-gas)
}

@keyframes crecer {
  to {
    height: var(--h)
  }
}

.leyenda {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--gris);
  margin-top: 12px;
  font-style: normal
}

.pt {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px
}

.pt.ing {
  background: var(--acento)
}

.pt.gas {
  background: var(--barra-gas)
}

/* ---- modales ---- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 21, .45);
  backdrop-filter: blur(3px);
  display: none;
  place-items: center;
  z-index: 50;
  padding: 20px
}

.modal.abierto {
  display: grid
}

.modal-caja {
  background: var(--panel);
  border-radius: 16px;
  padding: 26px 26px 20px;
  width: 100%;
  max-width: 430px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .35)
}

.modal-caja h2 {
  margin-bottom: 16px
}

/* ---- login ---- */
.pantalla-login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: radial-gradient(1100px 500px at 20% -10%, #d9f2ef 0%, var(--fondo) 55%)
}

.caja-login {
  background: var(--panel);
  border: 1px solid var(--linea);
  border-radius: 20px;
  box-shadow: var(--sombra);
  padding: 38px 36px;
  width: 100%;
  max-width: 380px;
  text-align: center
}

.caja-login h1 {
  font-size: 24px;
  margin: 14px 0 2px
}

.caja-login h1 span {
  color: var(--acento)
}

.caja-login .sub {
  margin-bottom: 22px
}

.caja-login form {
  text-align: left
}

.caja-login button {
  margin-top: 6px
}

/* ---- notas ---- */
.nota-mes textarea {
  resize: vertical
}

.texto-nota {
  font-size: 14px;
  color: var(--texto-2);
  white-space: pre-wrap
}

/* ---- animaciones ---- */
@keyframes entrar {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes subir {
  from {
    opacity: 0;
    transform: translateY(14px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

.anima-entrar {
  animation: entrar .4s ease both
}

.anima-subir {
  animation: subir .5s cubic-bezier(.2, .7, .3, 1) both;
  animation-delay: var(--d, 0s)
}

.latido {
  animation: latido 2.6s ease-in-out infinite
}

@keyframes latido {

  0%,
  100% {
    transform: scale(1)
  }

  50% {
    transform: scale(1.06)
  }
}

/* ---- libreta mensual (estilo Excel) ---- */
.car-cab {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px
}

.car-cab h2 {
  margin-bottom: 0
}

.car-controles {
  display: flex;
  align-items: center;
  gap: 8px
}

.car-ind {
  font-size: 12px;
  color: var(--gris)
}

.carrusel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch
}

.carrusel::-webkit-scrollbar {
  display: none
}

.mes-bloque {
  flex: 0 0 100%;
  scroll-snap-align: start;
  min-width: 0
}

.mes-titulo {
  background: #2563eb;
  color: #fff;
  text-align: center;
  font-weight: 700;
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px
}

.mes-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 14px;
  align-items: start
}

.ms {
  margin-bottom: 12px;
  border: 1px solid var(--linea);
  border-radius: 8px;
  overflow: hidden
}

.ms-cab {
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 10px
}

.ms-ing .ms-cab {
  background: #16a34a
}

.ms-otro .ms-cab {
  background: #2563eb
}

.ms-gas .ms-cab {
  background: #dc2626
}

.ms-rep .ms-cab {
  background: #7c3aed
}

.mini-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  table-layout: fixed
}

.mini-tabla td {
  overflow-wrap: break-word
}

.mini-tabla .mt-f {
  width: 50px
}

.mini-tabla td:last-child {
  width: 96px
}

.mini-tabla td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--linea-suave)
}

.mini-tabla .mt-f {
  color: var(--gris);
  font-family: ui-monospace, monospace;
  font-size: 11px;
  white-space: nowrap
}

.mini-tabla .mt-suma td {
  border-bottom: none;
  background: var(--acento-suave);
  font-weight: 700
}

.mes-resumen {
  border: 1px solid var(--linea);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px
}

.mr-fila {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px
}

.mr-fila span {
  color: var(--gris)
}

.mr-neto {
  border-top: 1px dashed var(--linea);
  margin-top: 4px;
  padding-top: 8px
}

.mr-sep {
  height: 1px;
  background: var(--linea);
  margin: 8px 0
}

.mr-caja {
  background: var(--acento-suave);
  border-radius: 6px;
  padding: 8px 10px;
  font-weight: 700
}

.mr-caja span {
  color: var(--tinta)
}

.mes-nota {
  border: 1px solid #eab308;
  border-radius: 8px;
  overflow: hidden;
  background: #fefce8
}

.mes-nota .ms-cab {
  background: #eab308;
  color: #3f3000
}

.mes-nota p {
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #5b4a00;
  white-space: pre-wrap
}

html[data-tema="oscuro"] .mes-nota {
  background: #2a2410;
  border-color: #a1861a
}

html[data-tema="oscuro"] .mes-nota p {
  color: #e6d68a
}

.quien {
  font-size: 12px;
  color: var(--gris);
  white-space: nowrap
}

/* ---- boton modo noche ---- */
.tema-btn {
  background: none;
  border: none;
  color: #7c8894;
  cursor: pointer;
  padding: 4px;
  display: grid;
  place-items: center;
  transition: color .18s
}

.tema-btn:hover {
  color: #fff
}

.tema-btn svg {
  width: 18px;
  height: 18px
}

#icono-sol {
  display: none
}

html[data-tema="oscuro"] #icono-sol {
  display: block
}

html[data-tema="oscuro"] #icono-luna {
  display: none
}

/* ---- modo noche ---- */
html[data-tema="oscuro"] {
  --fondo: #0e1116;
  --panel: #161b22;
  --tinta: #e6e8ec;
  --gris: #98a1ad;
  --linea: #242b34;
  --linea-suave: #1e252d;
  --blanco: #1b222b;
  --hover-fila: #1b222b;
  --texto-2: #c3c9d2;
  --acento: #14b8a6;
  --acento-suave: #0b3a35;
  --barra-gas: #39424d;
  --sombra: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px -12px rgba(0, 0, 0, .65);
}

html[data-tema="oscuro"] .btn:hover {
  border-color: #3a434e
}

html[data-tema="oscuro"] .btn.peligro:hover {
  background: #2a1416;
  border-color: #7f1d1d
}

html[data-tema="oscuro"] .etiqueta.ingreso {
  background: #0c2f22;
  color: #6ee7b7
}

html[data-tema="oscuro"] .etiqueta.otro_ingreso {
  background: #0c2740;
  color: #7dd3fc
}

html[data-tema="oscuro"] .etiqueta.gasto {
  background: #3a1214;
  color: #fca5a5
}

html[data-tema="oscuro"] .etiqueta.reparto {
  background: #332810;
  color: #fde047
}

html[data-tema="oscuro"] .aviso {
  background: #0c2f22;
  color: #6ee7b7;
  border-color: #134e3a
}

html[data-tema="oscuro"] .aviso.error {
  background: #3a1214;
  color: #fca5a5;
  border-color: #7f1d1d
}

html[data-tema="oscuro"] .pantalla-login {
  background: radial-gradient(1100px 500px at 20% -10%, #0b3a35 0%, var(--fondo) 55%)
}

html[data-tema="oscuro"] .tarjeta.acento {
  background: linear-gradient(135deg, #0f766e, #134e4a)
}

html[data-tema="oscuro"] input:focus,
html[data-tema="oscuro"] select:focus,
html[data-tema="oscuro"] textarea:focus {
  box-shadow: 0 0 0 3px rgba(20, 184, 166, .22)
}

/* ---- movil ---- */
@media (max-width:840px) {

  html,
  body {
    overflow-x: hidden;
    max-width: 100vw
  }

  .app {
    grid-template-columns: minmax(0, 1fr);
    max-width: 100vw
  }

  .sidebar {
    position: fixed;
    bottom: 0;
    top: auto;
    height: auto;
    width: 100%;
    flex-direction: row;
    z-index: 40;
    align-items: center;
    border-top: 1px solid #232b33;
    box-shadow: 0 -6px 18px rgba(0, 0, 0, .35);
    padding-bottom: env(safe-area-inset-bottom)
  }

  .marca,
  .sesion .quien {
    display: none
  }

  .sidebar nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 8px 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    min-width: 0
  }

  .sidebar nav::-webkit-scrollbar {
    display: none
  }

  .sidebar nav a {
    flex: none;
    flex-direction: column;
    gap: 3px;
    padding: 7px 12px;
    font-size: 11px
  }

  .sidebar nav a svg {
    width: 20px;
    height: 20px
  }

  .sesion {
    border-top: none;
    border-left: 1px solid #232b33;
    padding: 8px 10px;
    gap: 8px
  }

  .sesion .chip {
    width: 28px;
    height: 28px;
    font-size: 12px
  }

  .contenido {
    padding: 16px 12px calc(104px + env(safe-area-inset-bottom))
  }

  h1 {
    font-size: 20px
  }

  .tarjetas {
    grid-template-columns: 1fr 1fr;
    gap: 10px
  }

  .tarjeta {
    padding: 13px 14px
  }

  .tarjeta strong {
    font-size: 19px
  }

  .panel {
    padding: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch
  }

  .tabla {
    min-width: 640px
  }

  .filtros {
    padding: 10px 2px
  }

  .filtros select,
  .filtros input {
    flex: 1;
    min-width: 110px
  }

  .grafica {
    min-width: 520px;
    height: 150px
  }

  .modal-caja {
    padding: 20px 18px 16px
  }

  .panel[data-carrusel] {
    overflow-x: hidden
  }

  .mes-grid {
    grid-template-columns: 1fr
  }

  .car-cab {
    flex-wrap: wrap;
    gap: 8px
  }
}

/* ---- pantallas muy angostas (o zoom de accesibilidad alto) ---- */
@media (max-width:430px) {
  .tarjetas {
    grid-template-columns: 1fr
  }

  .tarjeta strong {
    font-size: 18px
  }

  h1 {
    font-size: 18px
  }

  .contenido {
    padding: 14px 10px calc(104px + env(safe-area-inset-bottom))
  }

  .mini-tabla {
    font-size: 12px
  }

  .mini-tabla .mt-f {
    width: 42px
  }

  .mini-tabla td:last-child {
    width: 86px
  }

  .mes-titulo {
    font-size: 13px
  }

  .mr-fila {
    font-size: 12.5px
  }

  .grafica {
    min-width: 430px
  }

  .car-cab h2 {
    font-size: 14px
  }
}

/* ---- pastillas de tipo (colores del Excel) ---- */
.tipo-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 4px 0 14px
}

.tp {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .15s;
  text-align: center
}

.tp input {
  display: none
}

.tp-ingreso {
  background: #dcfce7;
  color: #166534
}

.tp-otro_ingreso {
  background: #e0f2fe;
  color: #075985
}

.tp-gasto {
  background: #fee2e2;
  color: #991b1b
}

.tp-reparto {
  background: #ede9fe;
  color: #5b21b6
}

.tp:hover {
  border-color: currentColor
}

.tp-ingreso:has(input:checked) {
  background: #16a34a;
  color: #fff;
  border-color: #15803d
}

.tp-otro_ingreso:has(input:checked) {
  background: #0ea5e9;
  color: #fff;
  border-color: #0369a1
}

.tp-gasto:has(input:checked) {
  background: #dc2626;
  color: #fff;
  border-color: #991b1b
}

.tp-reparto:has(input:checked) {
  background: #7c3aed;
  color: #fff;
  border-color: #5b21b6
}

html[data-tema="oscuro"] .tp-ingreso {
  background: #0c2f22;
  color: #6ee7b7
}

html[data-tema="oscuro"] .tp-otro_ingreso {
  background: #0c2740;
  color: #7dd3fc
}

html[data-tema="oscuro"] .tp-gasto {
  background: #3a1214;
  color: #fca5a5
}

html[data-tema="oscuro"] .tp-reparto {
  background: #2a1d47;
  color: #c4b5fd
}

html[data-tema="oscuro"] .tp-ingreso:has(input:checked) {
  background: #16a34a;
  color: #fff
}

html[data-tema="oscuro"] .tp-otro_ingreso:has(input:checked) {
  background: #0ea5e9;
  color: #fff
}

html[data-tema="oscuro"] .tp-gasto:has(input:checked) {
  background: #dc2626;
  color: #fff
}

html[data-tema="oscuro"] .tp-reparto:has(input:checked) {
  background: #7c3aed;
  color: #fff
}

.tp-deuda {
  background: #fef9c3;
  color: #854d0e
}

.tp-deuda:has(input:checked) {
  background: #eab308;
  color: #3f3000;
  border-color: #a16207
}

html[data-tema="oscuro"] .tp-deuda {
  background: #332810;
  color: #fde047
}

html[data-tema="oscuro"] .tp-deuda:has(input:checked) {
  background: #eab308;
  color: #3f3000
}

/* ---- caja de deuda en la libreta ---- */
.mes-deuda {
  border: 1px solid #eab308;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #fefce8
}

.mes-deuda .ms-cab {
  background: #eab308;
  color: #3f3000
}

.md-cuerpo {
  padding: 8px 12px
}

.md-debe {
  background: rgba(234, 179, 8, .18);
  border-radius: 6px;
  padding: 7px 10px;
  font-weight: 700;
  margin-top: 4px
}

.md-debe span {
  color: inherit
}

html[data-tema="oscuro"] .mes-deuda {
  background: #2a2410;
  border-color: #a1861a
}

html[data-tema="oscuro"] .md-cuerpo .mr-fila span {
  color: #cbb968
}

/* ---- guia de uso ---- */
.paso {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--linea-suave)
}

.paso:last-child {
  border-bottom: none
}

.paso-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--acento-suave);
  color: var(--acento);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0
}

.paso h3 {
  font-size: 13.5px;
  margin-bottom: 3px
}

.paso p {
  font-size: 13px;
  color: var(--gris);
  line-height: 1.65
}

.guia-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px
}

.tarj-guia {
  border: 1px solid var(--linea);
  border-radius: 10px;
  padding: 12px 14px
}

.tarj-guia b {
  font-size: 13px;
  display: block;
  margin-bottom: 5px
}

.tarj-guia p {
  font-size: 12.5px;
  color: var(--gris);
  line-height: 1.6
}

.nota-guia {
  font-size: 12.5px;
  color: var(--gris);
  line-height: 1.6;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--acento-suave);
  border-radius: 8px
}

.codigo-inv {
  background: var(--acento);
  color: #fff;
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: .5px
}

.pie-login {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--gris);
  text-align: center;
  line-height: 1.7
}

.pie-login a {
  color: var(--acento);
  font-weight: 600;
  text-decoration: none
}

.pie-login a:hover {
  text-decoration: underline
}
/* ═══════════════════════════════════════════════════════════
   CAPA GLASS v16 — refresco visual 2026
   Se añade al final: sobrescribe por cascada sin tocar lo de arriba.
   Para revertir, basta con borrar este bloque.
   ═══════════════════════════════════════════════════════════ */

:root {
  --radio: 16px;
  --glass-borde: rgba(255,255,255,.55);
  --glass-brillo: rgba(255,255,255,.65);
  --aura-1: rgba(15,118,110,.10);
  --aura-2: rgba(59,130,246,.07);
  --sombra: 0 1px 2px rgba(20,20,30,.04), 0 12px 32px -14px rgba(20,20,40,.16);
  --sombra-flote: 0 18px 44px -18px rgba(20,20,40,.28);
}
html[data-tema="oscuro"] {
  --glass-borde: rgba(255,255,255,.08);
  --glass-brillo: rgba(255,255,255,.04);
  --aura-1: rgba(20,184,166,.14);
  --aura-2: rgba(99,102,241,.10);
  --sombra: 0 1px 2px rgba(0,0,0,.4), 0 14px 36px -16px rgba(0,0,0,.7);
  --sombra-flote: 0 22px 50px -18px rgba(0,0,0,.85);
}

/* fondo con auras de color suaves, fijas */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 60rem at 8% -5%, var(--aura-1), transparent 55%),
    radial-gradient(50rem 50rem at 108% 110%, var(--aura-2), transparent 55%);
}

/* superficie glass compartida */
.tarjeta, .panel, .lateral, .modal-caja, .mes-bloque,
.tarj-guia, .paso, .sc-card {
  background: color-mix(in srgb, var(--panel) 72%, transparent) !important;
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--glass-borde) !important;
}

/* tarjetas KPI: más aire, brillo superior, número protagonista */
.tarjetas { gap: 16px; margin-bottom: 26px; }
.tarjeta {
  padding: 18px 20px;
  border-radius: var(--radio);
  position: relative;
  overflow: hidden;
}
.tarjeta::after {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-brillo), transparent);
}
.tarjeta:hover { transform: translateY(-4px); box-shadow: var(--sombra-flote); }
.tarjeta strong { font-size: 25px; margin-top: 8px; }
.tarjeta.acento {
  background: linear-gradient(135deg, #0f766e, #0d9488 60%, #14b8a6) !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  box-shadow: 0 10px 30px -10px rgba(15,118,110,.5);
}

/* paneles con más respiro */
.panel { padding: 22px 24px; border-radius: var(--radio); margin-bottom: 22px; }

/* barra lateral translúcida */
.lateral { border-right: 1px solid var(--glass-borde) !important; }

/* filas de tabla con hover más suave y bordes sutiles */
.tabla th { border-bottom: 1px solid var(--glass-borde); }
.tabla tbody tr:hover { background: color-mix(in srgb, var(--acento) 7%, transparent); }

/* botones glass */
.btn {
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: transform .12s, box-shadow .2s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn.primario { box-shadow: 0 6px 18px -8px rgba(15,118,110,.6); }


/* ── Movimientos: chips de resumen ── */
.chips-resumen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.chip-res {
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--glass-borde);
  border-radius: 13px;
  padding: 12px 15px;
  position: relative;
  overflow: hidden;
}
.chip-res::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.chip-res span { display: block; font-size: 11.5px; color: var(--gris); margin-bottom: 4px; }
.chip-res b { font-size: 18px; letter-spacing: -.02em; }
.chip-ingreso::before { background: #16a34a; }
.chip-gasto::before { background: #dc2626; }
.chip-reparto::before { background: #7c3aed; }
.chip-neto::before { background: var(--acento); }
.chip-ingreso b { color: #16a34a; }
.chip-gasto b { color: #dc2626; }
.chip-reparto b { color: #7c3aed; }
.chip-neto b { color: var(--acento); }

/* ── montos coloreados en la tabla ── */
.monto-ingreso, .monto-otro_ingreso { color: #16a34a; }
.monto-gasto { color: #dc2626; }
.monto-reparto { color: #7c3aed; }
html[data-tema="oscuro"] .monto-ingreso,
html[data-tema="oscuro"] .monto-otro_ingreso { color: #4ade80; }
html[data-tema="oscuro"] .monto-gasto { color: #f87171; }
html[data-tema="oscuro"] .monto-reparto { color: #c4b5fd; }
.col-fecha { color: var(--gris); font-size: 13px; white-space: nowrap; }

/* ── estado vacío elegante ── */
.fila-vacia td { padding: 0 !important; }
.fila-vacia:hover { background: transparent !important; }
.vacio { text-align: center; padding: 48px 20px; color: var(--gris); }
.vacio p { font-size: 15px; color: var(--texto-2); margin: 10px 0 4px; }
.vacio span { font-size: 13px; }
.icono-vacio, .icono-mas {
  display: inline-block; vertical-align: middle;
}
.icono-vacio::before {
  content: ''; display: block; width: 44px; height: 44px; margin: 0 auto;
  border: 2px dashed var(--linea); border-radius: 12px;
  opacity: .6;
}
.icono-mas { width: 15px; height: 15px; margin-right: 6px; position: relative; }
.icono-mas::before, .icono-mas::after {
  content: ''; position: absolute; background: currentColor; border-radius: 2px;
}
.icono-mas::before { left: 6px; top: 1px; width: 3px; height: 13px; }
.icono-mas::after { left: 1px; top: 6px; width: 13px; height: 3px; }

/* ── filtros más limpios ── */
.filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filtros select, .filtros input {
  border-radius: 10px;
}


/* ── fix: el monto de la libreta no debe partirse en dos renglones ── */
.mini-tabla td:last-child {
  white-space: nowrap;
  text-align: right;
  width: 112px;
}
.mini-tabla .mt-suma td:last-child { width: 112px; }
@media (max-width: 640px) {
  .mini-tabla td:last-child { width: 96px; }
}

/* ═══════════════════════════════════════════════════════════
   CAPA GLASS v13 — fondo animado, gráfica, notas, reportes
   ═══════════════════════════════════════════════════════════ */

/* ── fondo animado (canvas constelación) ── */
#fondo-anim {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
  opacity: .9;
}
.pantalla-login { position: relative; overflow: hidden; }
.pantalla-login .caja-login { position: relative; z-index: 1; }
/* en el panel el canvas vive detrás del contenido translúcido */
.app { position: relative; z-index: 1; }

/* ── gráfica de evolución del saldo ── */
.panel-grafica .graf-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.panel-grafica .graf-head h2 { margin: 0; }
.graf-sub { font-size: 12.5px; color: var(--gris); }
.g-saldo { width: 100%; height: auto; display: block; margin-top: 8px; }
.g-guia { stroke: var(--linea); stroke-width: 1; stroke-dasharray: 3 4; }
.g-ytxt { fill: var(--gris); font-size: 11px; text-anchor: end; font-family: ui-monospace, monospace; }
.g-xtxt { fill: var(--gris); font-size: 11px; text-anchor: middle; }
.g-pt { fill: var(--panel); stroke: var(--acento); stroke-width: 2; transition: r .15s; }
.g-pt:hover { r: 5; }

/* ── notas: grid de tarjetas ── */
.notas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.nota-card {
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--glass-borde);
  border-top: 3px solid var(--c, var(--acento));
  border-radius: 14px;
  padding: 14px 16px;
}
.nota-card.vacia { opacity: .6; }
.nota-card.vacia:focus-within { opacity: 1; }
.nota-mes-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; margin-bottom: 10px;
}
.nota-mes-pt { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--acento)); flex-shrink: 0; }
.nota-anio { margin-left: auto; font-size: 12px; color: var(--gris); font-weight: 400; }
.nota-card textarea {
  width: 100%; border: 1px solid var(--linea); border-radius: 10px;
  padding: 10px; font: inherit; font-size: 13px; resize: vertical;
  background: var(--fondo); color: var(--tinta); line-height: 1.5;
}
.nota-card textarea:focus { outline: 2px solid var(--acento); border-color: transparent; }
.nota-card .texto-nota { font-size: 13px; line-height: 1.6; color: var(--texto-2); white-space: pre-wrap; }
.vacio-panel { text-align: center; padding: 40px; color: var(--gris); }

/* ── reportes: mini-barra en el neto ── */
.neto-barra {
  display: block; height: 3px; border-radius: 2px;
  background: var(--linea-suave); margin-bottom: 4px; overflow: hidden;
}
.neto-barra i { display: block; height: 100%; border-radius: 2px; }
.neto-barra i.pos { background: #16a34a; }
.neto-barra i.neg { background: #dc2626; margin-left: auto; }
.mes-celda { font-weight: 500; }

/* ── botón "mostrar más" ── */
.mas-fila { text-align: center; margin-top: 16px; }
.mostrar-mas {
  padding: 9px 20px; border-radius: 11px;
  border: 1px solid var(--glass-borde);
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--texto-2); font: inherit; font-size: 13px; cursor: pointer;
  transition: transform .12s, border-color .2s, color .2s;
}
.mostrar-mas:hover { border-color: var(--acento); color: var(--acento); }
.mostrar-mas:active { transform: scale(.97); }
.mostrar-mas .restantes { color: var(--gris); font-weight: 400; }

/* ── responsive: el fondo más sutil en móvil, gráfica legible ── */
@media (max-width: 640px) {
  #fondo-anim { opacity: .5; }
  .g-ytxt, .g-xtxt { font-size: 13px; }
  .notas-grid { grid-template-columns: 1fr; }
}

/* ── gráficas lado a lado (barras + dona) ── */
.graf-fila {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}
.graf-fila .panel { margin-bottom: 0; }
.panel-dona { display: flex; flex-direction: column; }
.dona-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: auto; margin-bottom: auto; }
.dona { width: 170px; height: 170px; }
.dona circle { transition: stroke-width .2s; }
.dona-centro-t { fill: var(--gris); font-size: 13px; text-anchor: middle; }
.dona-centro-v { fill: var(--tinta); font-size: 22px; font-weight: 700; text-anchor: middle; font-family: ui-monospace, monospace; }
.dona-leyenda { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.dona-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dona-item i { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.dona-item span { color: var(--texto-2); }
.dona-item b { margin-left: auto; font-family: ui-monospace, monospace; }
.graf-vacio { color: var(--gris); text-align: center; margin: auto; }

@media (max-width: 860px) {
  .graf-fila { grid-template-columns: 1fr; }
}

/* ── zona de perfil (sidebar) en 2 filas · colores sobre barra oscura ── */
.sesion {
  margin: 10px;
  padding: 14px;
  border-top: none !important;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  background: rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.sesion-top { display: flex; align-items: center; gap: 11px; min-width: 0; }
.sesion-acciones { display: flex; gap: 10px; }
.sesion-acciones .tema-btn, .sesion-acciones .salir { flex: 1; }
.sesion .chip {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--acento), #14b8a6);
  box-shadow: 0 4px 12px -4px rgba(15,118,110,.7);
  font-size: 18px;
  flex-shrink: 0;
}
.sesion-top .quien {
  flex: 1; min-width: 0;
  white-space: normal;
}
.sesion .quien strong {
  font-size: 15px;
  color: #f1f5f9;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.sesion .quien span { font-size: 12.5px; color: #9aa7b4; }
/* botones tema y salir: alto contraste, texto grande */
.sesion .tema-btn, .sesion .salir {
  height: 42px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  color: #e2e8f0;
  flex-shrink: 0;
  transition: transform .12s, background .2s, color .2s, border-color .2s;
}
.sesion .tema-btn svg, .sesion .salir svg { width: 20px; height: 20px; }
.sesion .tema-btn:hover { color: #fff; border-color: var(--acento); background: rgba(20,184,166,.28); }
.sesion .salir:hover { color: #fff; border-color: #f87171; background: rgba(248,113,113,.3); }
.sesion .tema-btn:active, .sesion .salir:active { transform: scale(.94); }

/* en móvil el perfil va en la barra inferior: compacto, una fila */
@media (max-width: 980px) {
  .sesion {
    margin: 0; border: none; border-radius: 0; background: transparent;
    -webkit-backdrop-filter: none; backdrop-filter: none; padding: 6px 10px;
    flex-direction: row; align-items: center; gap: 8px;
  }
  .sesion-top .quien { display: none; }
  .sesion-acciones { gap: 6px; }
}

/* ── gráfica comparativa anual (barras) ── */
.grafica-anual {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 12px;
  height: 230px;
  padding: 10px 4px 0;
}
.anio-col {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  height: 100%; justify-content: flex-end; gap: 8px;
  animation: subir .5s var(--d, 0s) both;
}
.anio-val { font-size: 14px; font-weight: 700; color: var(--acento); font-variant-numeric: tabular-nums; }
.anio-barra-wrap { width: 100%; max-width: 64px; flex: 1; display: flex; align-items: flex-end; }
.anio-barra {
  width: 100%; height: var(--h); min-height: 4px;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, #2dd4a6, var(--acento));
  box-shadow: 0 6px 16px -6px rgba(15,118,110,.6);
  transition: height .6s cubic-bezier(.2,.8,.2,1);
}
.anio-lbl { font-size: 14px; font-weight: 600; color: var(--texto-2); }
@media (max-width: 640px) {
  .grafica-anual { height: 190px; gap: 6px; }
  .anio-val { font-size: 12px; }
  .anio-lbl { font-size: 12px; }
}

/* ── tipografía escalable por el usuario (--fs) + importante más grande ── */
:root { --fs: 1; }
body { font-size: calc(15px * var(--fs)); }
h2 { font-size: calc(17px * var(--fs)); }
.panel-grafica .graf-head h2 { font-size: calc(18px * var(--fs)); }
.graf-sub, .sub { font-size: calc(13.5px * var(--fs)); }

.tarjeta span { font-size: calc(13px * var(--fs)); letter-spacing: .01em; }
.tarjeta strong { font-size: calc(29px * var(--fs)); }

.tabla { font-size: calc(15px * var(--fs)); }
.tabla th { font-size: calc(12px * var(--fs)); }
.tabla td { padding: 11px 10px; }

.chip-res b { font-size: calc(21px * var(--fs)); }
.chip-res span { font-size: calc(12.5px * var(--fs)); }

.sidebar nav a { font-size: calc(14.5px * var(--fs)); }

@media (max-width: 640px) {
  h2 { font-size: calc(16px * var(--fs)); }
  .panel-grafica .graf-head h2 { font-size: calc(16px * var(--fs)); }
  .tarjeta strong { font-size: calc(24px * var(--fs)); }
  .tabla { font-size: calc(14px * var(--fs)); }
  .chip-res b { font-size: calc(18px * var(--fs)); }
}

/* ── contraste alto (opcional, lo activa el usuario) ── */
html[data-contraste="alto"] {
  --gris: #475569;
  --texto-2: #0f172a;
}
html[data-contraste="alto"][data-tema="oscuro"] {
  --gris: #cbd5e1;
  --texto-2: #f8fafc;
}
html[data-contraste="alto"] .tarjeta,
html[data-contraste="alto"] .panel,
html[data-contraste="alto"] .lateral,
html[data-contraste="alto"] .mes-bloque,
html[data-contraste="alto"] .nota-card,
html[data-contraste="alto"] .chip-res {
  border-color: rgba(15,23,42,.35);
}
html[data-contraste="alto"][data-tema="oscuro"] .tarjeta,
html[data-contraste="alto"][data-tema="oscuro"] .panel,
html[data-contraste="alto"][data-tema="oscuro"] .lateral,
html[data-contraste="alto"][data-tema="oscuro"] .mes-bloque,
html[data-contraste="alto"][data-tema="oscuro"] .nota-card,
html[data-contraste="alto"][data-tema="oscuro"] .chip-res {
  border-color: rgba(255,255,255,.4);
}
html[data-contraste="alto"] .tabla td { border-bottom-color: rgba(15,23,42,.18); }
html[data-contraste="alto"] a:focus-visible,
html[data-contraste="alto"] button:focus-visible,
html[data-contraste="alto"] input:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; }

/* ── botón flotante + panel de accesibilidad ── */
.a11y-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  width: 50px; height: 50px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22);
  background: linear-gradient(135deg, #14b8a6, #0f766e);
  color: #fff; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 10px 26px -8px rgba(15,118,110,.7);
  transition: transform .2s, box-shadow .2s;
}
.a11y-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 30px -8px rgba(15,118,110,.85); }
.a11y-fab svg { width: 26px; height: 26px; }

.a11y-panel {
  position: fixed; right: 18px; bottom: 78px; z-index: 50;
  width: 270px; max-width: calc(100vw - 36px);
  padding: 16px; border-radius: 16px;
  background: var(--glass-fondo, rgba(20,22,30,.92));
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--glass-borde, rgba(255,255,255,.14));
  box-shadow: 0 20px 50px -12px rgba(0,0,0,.55);
  animation: subir .25s both;
}
html:not([data-tema="oscuro"]) .a11y-panel { background: rgba(255,255,255,.96); border-color: rgba(15,23,42,.12); }
.a11y-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.a11y-head strong { font-size: calc(15px * var(--fs)); }
.a11y-x { background: none; border: none; color: var(--gris); font-size: 16px; cursor: pointer; padding: 4px; border-radius: 6px; line-height: 1; }
.a11y-x:hover { background: rgba(127,127,127,.15); }
.a11y-grupo { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(127,127,127,.14); }
.a11y-grupo:first-of-type { border-top: none; }
.a11y-lbl { font-size: calc(13.5px * var(--fs)); font-weight: 600; display: block; }
.a11y-grupo small { font-size: 11.5px; color: var(--gris); }
.a11y-fs { display: flex; gap: 6px; }
.a11y-fs button {
  min-width: 40px; height: 38px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(127,127,127,.3); background: transparent; color: var(--tinta);
  font-weight: 700; transition: all .15s;
}
.a11y-fs button:nth-child(1) { font-size: 13px; }
.a11y-fs button:nth-child(2) { font-size: 16px; }
.a11y-fs button:nth-child(3) { font-size: 19px; }
.a11y-fs button:hover { border-color: var(--acento); }
.a11y-fs button.activo { background: var(--acento); color: #fff; border-color: var(--acento); }
.a11y-switch {
  flex-shrink: 0; width: 48px; height: 28px; border-radius: 20px; cursor: pointer;
  border: 1px solid rgba(127,127,127,.3); background: rgba(127,127,127,.25); position: relative; transition: background .2s;
}
.a11y-switch i { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.a11y-switch.on { background: var(--acento); border-color: var(--acento); }
.a11y-switch.on i { left: 22px; }
.a11y-reset { width: 100%; margin-top: 14px; height: 40px; border-radius: 10px; cursor: pointer; border: 1px solid rgba(127,127,127,.3); background: transparent; color: var(--texto-2); font-weight: 600; font-size: calc(13px * var(--fs)); transition: all .15s; }
.a11y-reset:hover { border-color: var(--acento); color: var(--acento); }

@media (max-width: 640px) {
  .a11y-fab { right: 14px; bottom: 76px; } /* arriba de la barra de nav inferior */
  .a11y-panel { bottom: 136px; right: 14px; }
}


/* ── bitácora de auditoría ── */
.aud-banner {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px; border-radius: 14px; margin-bottom: 16px;
  border: 1px solid var(--glass-borde);
}
.aud-banner.ok { background: color-mix(in srgb, #16a34a 12%, var(--panel)); border-color: color-mix(in srgb, #16a34a 40%, transparent); }
.aud-banner.rota { background: color-mix(in srgb, #dc2626 12%, var(--panel)); border-color: color-mix(in srgb, #dc2626 45%, transparent); }
.aud-banner-ic { flex-shrink: 0; width: 40px; height: 40px; }
.aud-banner.ok .aud-banner-ic { color: #16a34a; }
.aud-banner.rota .aud-banner-ic { color: #dc2626; }
.aud-banner-ic svg { width: 40px; height: 40px; }
.aud-banner strong { font-size: calc(16px * var(--fs)); display: block; margin-bottom: 3px; }
.aud-banner p { font-size: calc(13px * var(--fs)); color: var(--texto-2); line-height: 1.5; }

.aud-filtros { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.aud-chip {
  font-size: calc(12.5px * var(--fs)); padding: 6px 13px; border-radius: 20px; text-decoration: none;
  border: 1px solid var(--glass-borde); color: var(--texto-2); background: color-mix(in srgb, var(--panel) 60%, transparent);
  transition: all .15s;
}
.aud-chip:hover { border-color: var(--acento); color: var(--acento); }
.aud-chip.activo { background: var(--acento); color: #fff; border-color: var(--acento); }

.aud-lista { display: flex; flex-direction: column; }
.aud-fila {
  display: grid; grid-template-columns: 150px 170px 130px 1fr; gap: 12px; align-items: center;
  padding: 11px 6px; border-bottom: 1px solid var(--linea-suave); font-size: calc(13px * var(--fs));
}
.aud-fila:last-child { border-bottom: none; }
.aud-col-ts { display: flex; flex-direction: column; gap: 2px; }
.aud-ts { font-family: var(--mono, monospace); font-size: calc(12px * var(--fs)); color: var(--texto-2); font-variant-numeric: tabular-nums; }
.aud-ip { font-size: 10.5px; color: var(--gris); font-family: var(--mono, monospace); }
.aud-accion { display: inline-block; font-size: calc(11.5px * var(--fs)); font-weight: 600; padding: 3px 9px; border-radius: 6px; white-space: nowrap; }
.ac-ok   { background: rgba(34,197,94,.14);  color: #16a34a; }
.ac-add  { background: rgba(59,130,246,.14); color: #2563eb; }
.ac-edit { background: rgba(234,179,8,.16);  color: #a16207; }
.ac-del  { background: rgba(239,68,68,.14);  color: #dc2626; }
.aud-col-act { font-weight: 500; color: var(--tinta); }
.aud-col-det { color: var(--texto-2); overflow: hidden; text-overflow: ellipsis; }
html[data-tema="oscuro"] .ac-edit { color: #fde047; }
html[data-tema="oscuro"] .ac-add { color: #93c5fd; }

@media (max-width: 760px) {
  .aud-fila { grid-template-columns: 1fr; gap: 4px; padding: 12px 4px; }
  .aud-col-ts { flex-direction: row; gap: 8px; align-items: baseline; }
  .aud-col-det { white-space: normal; }
}

/* ── passkeys / biometría ── */
.btn.ghost { background: transparent; border: 1px solid var(--glass-borde); color: var(--tinta); }
.btn.ghost:hover { border-color: var(--acento); color: var(--acento); }

/* login: separador "o" + botón huella */
.pk-login { margin-top: 4px; }
.pk-o { display: flex; align-items: center; gap: 10px; color: var(--gris); font-size: 12px; margin: 14px 0; }
.pk-o::before, .pk-o::after { content: ''; flex: 1; height: 1px; background: var(--glass-borde); }
.pk-msg { font-size: 12.5px; margin-top: 8px; color: var(--texto-2); text-align: center; }
.pk-msg.err { color: #dc2626; }
.pk-msg.ok { color: #16a34a; }

/* seguridad */
.pk-intro { font-size: calc(13.5px * var(--fs)); color: var(--texto-2); line-height: 1.6; margin-bottom: 16px; }
.pk-alta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pk-alta input { flex: 1; min-width: 180px; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--glass-borde); background: color-mix(in srgb, var(--panel) 60%, transparent); color: var(--tinta); font-size: 14px; }
.pk-alta input:focus { outline: 2px solid var(--acento); border-color: transparent; }

.pk-lista { display: flex; flex-direction: column; gap: 10px; }
.pk-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; border: 1px solid var(--glass-borde); background: color-mix(in srgb, var(--panel) 55%, transparent); flex-wrap: wrap; }
.pk-ic { width: 40px; height: 40px; flex-shrink: 0; color: var(--acento); background: color-mix(in srgb, var(--acento) 14%, transparent); border-radius: 10px; display: grid; place-items: center; }
.pk-ic svg { width: 22px; height: 22px; }
.pk-info { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 2px; }
.pk-info strong { font-size: calc(14.5px * var(--fs)); }
.pk-info span { font-size: calc(12px * var(--fs)); color: var(--gris); }
.pk-acc { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pk-ren { display: flex; gap: 6px; }
.pk-ren input { width: 150px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--glass-borde); background: color-mix(in srgb, var(--panel) 60%, transparent); color: var(--tinta); font-size: 13px; }
.pk-ren input:focus { outline: 2px solid var(--acento); border-color: transparent; }

@media (max-width: 640px) {
  .pk-card { align-items: flex-start; }
  .pk-ren input { width: 120px; }
  .pk-acc { width: 100%; }
}
