/* MendoProp — estilos.
   Una sola familia tipográfica (Archivo, variable en ancho y peso): angosta y pesada para
   títulos e importes, normal para el texto. Paleta: tinta y uva sobre piedra clara, con
   cuatro colores de estado (acequia = pagado, sol = vence pronto, mora = vencido, cielo = parcial). */

@import url('/css/inicio.css');

@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo-latin-wdth-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --tinta: #241733;
  --tinta-2: #35244c;
  --uva: #6e2a57;
  --uva-oscura: #561f44;
  --uva-fondo: #f3e7ef;
  --piedra: #f2f1f5;
  --nieve: #ffffff;
  --borde: #dedce4;
  --borde-fuerte: #c4c0cf;
  --texto: #1f1830;
  --texto-2: #5e5873;
  --acequia: #0f7b6c;
  --acequia-fondo: #ddf1ec;
  --sol: #8a6100;
  --sol-fondo: #fbefc9;
  --mora: #b3261e;
  --mora-fondo: #fbe1de;
  --cielo: #2456a6;
  --cielo-fondo: #dfe9f8;

  --t-xs: 0.8125rem;
  --t-s: 0.875rem;
  --t-m: 0.9375rem;
  --t-l: 1.125rem;
  --t-xl: 1.5rem;
  --t-2xl: 2rem;
  --t-3xl: 2.75rem;

  --radio: 5px;
  --lateral: 244px;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--piedra);
  color: var(--texto);
  font-family: 'Archivo', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: var(--t-m);
  line-height: 1.5;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }
a { color: var(--uva); text-underline-offset: 2px; }
a:hover { color: var(--uva-oscura); }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--uva); outline-offset: 2px; border-radius: 2px; }

.cargando-inicial { padding: 3rem; color: var(--texto-2); }

/* ---------- Texto ---------- */

.titulo {
  font-size: var(--t-2xl);
  font-weight: 750;
  font-stretch: 76%;
  line-height: 1.1;
  letter-spacing: -0.005em;
}
.subtitulo {
  font-size: var(--t-l);
  font-weight: 700;
  font-stretch: 84%;
  line-height: 1.25;
}
.bajada { color: var(--texto-2); max-width: 68ch; margin-top: 0.35rem; }
.apagado { color: var(--texto-2); }
.chico { font-size: var(--t-s); }
.muy-chico { font-size: var(--t-xs); }
.num { font-variant-numeric: tabular-nums; font-stretch: 90%; white-space: nowrap; }
.fuerte { font-weight: 650; }
.nowrap { white-space: nowrap; }
.derecha { text-align: right; }

/* ---------- Marco general ---------- */

.marco { display: grid; grid-template-columns: var(--lateral) minmax(0, 1fr); min-height: 100vh; }

.lateral {
  background: var(--tinta);
  color: #e9e3ee;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.marca {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 1.25rem 1.25rem 1rem;
  color: #fff; text-decoration: none;
  font-size: 1.375rem; font-weight: 800; font-stretch: 74%; letter-spacing: 0.01em;
}
.marca svg { width: 30px; height: 26px; flex: none; }
.marca:hover { color: #fff; }

.nav { padding: 0.25rem 0.75rem 1rem; flex: 1; }
.nav-grupo { margin-top: 0.95rem; }
.nav-grupo:first-child { margin-top: 0.25rem; }
.nav-rotulo { padding: 0 0.6rem 0.3rem; font-size: var(--t-xs); color: #a99fba; }
.nav a {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.42rem 0.6rem;
  border-radius: var(--radio);
  color: #d9d1e3; text-decoration: none; font-size: var(--t-s);
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.nav a:hover { background: var(--tinta-2); color: #fff; }
.nav a[aria-current='page'] { background: #fff; color: var(--tinta); font-weight: 650; }
.nav a[aria-current='page'] svg { opacity: 1; }

.cuenta { border-top: 1px solid #3c2b54; padding: 0.9rem 1.25rem 1.1rem; font-size: var(--t-s); }
.cuenta-nombre { color: #fff; font-weight: 650; }
.cuenta-rol { color: #a99fba; font-size: var(--t-xs); }
.cuenta-acciones { display: flex; gap: 1rem; margin-top: 0.5rem; }
.cuenta-acciones button { background: none; border: 0; padding: 0; color: #d9d1e3; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-size: var(--t-xs); }
.cuenta-acciones button:hover { color: #fff; }

.contenido { padding: 2rem 2.25rem 4rem; max-width: 1280px; width: 100%; }

.barra-movil { display: none; }

.encabezado { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.encabezado-acciones { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.volver { display: inline-flex; align-items: center; gap: 0.3rem; font-size: var(--t-s); margin-bottom: 0.6rem; text-decoration: none; }
.volver svg { width: 16px; height: 16px; }

/* ---------- Botones ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--borde-fuerte);
  border-radius: var(--radio);
  background: var(--nieve);
  color: var(--texto);
  font-weight: 600; font-size: var(--t-s); line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { border-color: var(--texto-2); color: var(--texto); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; }
.btn-primario { background: var(--uva); border-color: var(--uva); color: #fff; }
.btn-primario:hover { background: var(--uva-oscura); border-color: var(--uva-oscura); color: #fff; }
.btn-peligro { color: var(--mora); border-color: #e4b3ae; }
.btn-peligro:hover { border-color: var(--mora); color: var(--mora); }
.btn-chico { padding: 0.3rem 0.6rem; font-size: var(--t-xs); }
.btn-texto { background: none; border: 0; padding: 0; color: var(--uva); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-size: inherit; }
.btn-texto:hover { color: var(--uva-oscura); }

/* ---------- Formularios ---------- */

.campo { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
/* La etiqueta "se disuelve" en el campo para que la marca de origen pueda ir debajo del control
   y todos los controles de una fila queden alineados. */
.campo > label { display: contents; font-size: var(--t-s); font-weight: 600; }
.campo > label > * { font-size: var(--t-s); font-weight: 600; }
.campo > label > .origen { order: 2; align-self: flex-start; font-size: 0.6875rem; font-weight: 650; }
.campo .ayuda { order: 3; font-size: var(--t-xs); color: var(--texto-2); }

input[type='text'], input[type='email'], input[type='password'], input[type='date'], input[type='number'], input[type='month'], select, textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--borde-fuerte);
  border-radius: var(--radio);
  background: var(--nieve);
  min-height: 2.4rem;
}
textarea { min-height: 6.5rem; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--uva); outline-offset: 0; border-color: var(--uva); }
input::placeholder, textarea::placeholder { color: #9a94aa; }

.grilla-form { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0.9rem 1rem; }
.grilla-form > * { grid-column: span 12; }
.c-3 { grid-column: span 3; } .c-4 { grid-column: span 4; } .c-5 { grid-column: span 5; }
.c-6 { grid-column: span 6; } .c-7 { grid-column: span 7; } .c-8 { grid-column: span 8; }

.casilla { display: flex; align-items: flex-start; gap: 0.55rem; font-size: var(--t-s); cursor: pointer; }
.casilla input { width: 1.05rem; height: 1.05rem; margin-top: 0.15rem; accent-color: var(--uva); flex: none; }

.form-pie { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.4rem; flex-wrap: wrap; }
.form-error { color: var(--mora); font-size: var(--t-s); font-weight: 600; margin-top: 0.9rem; }

.origen { font-size: 0.6875rem; font-weight: 650; padding: 0.05rem 0.4rem; border-radius: 3px; white-space: nowrap; }
.origen[data-origen='pdf'] { background: var(--acequia-fondo); color: var(--acequia); }
.origen[data-origen='calculado'] { background: var(--cielo-fondo); color: var(--cielo); }
.origen[data-origen='simulado'] { background: var(--sol-fondo); color: var(--sol); }

fieldset.seccion { border: 0; padding: 0; margin: 0 0 1.75rem; min-width: 0; }
fieldset.seccion > legend { padding: 0; margin-bottom: 0.8rem; font-size: var(--t-l); font-weight: 700; font-stretch: 84%; }

.selector { display: inline-flex; border: 1px solid var(--borde-fuerte); border-radius: var(--radio); overflow: hidden; background: var(--nieve); }
.selector button { border: 0; background: none; padding: 0.42rem 0.85rem; font-size: var(--t-s); font-weight: 600; cursor: pointer; color: var(--texto-2); }
.selector button + button { border-left: 1px solid var(--borde-fuerte); }
.selector button[aria-pressed='true'] { background: var(--tinta); color: #fff; }

/* ---------- Superficies ---------- */

.caja { background: var(--nieve); border: 1px solid var(--borde); border-radius: var(--radio); }
.caja-cuerpo { padding: 1.25rem 1.4rem; }
.bloque { margin-top: 2rem; }
.bloque-cabeza { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.columnas-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2rem; }
.columnas-lado { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2rem; align-items: start; }

.nota { border-left: 3px solid var(--borde-fuerte); background: var(--nieve); padding: 0.7rem 0.95rem; font-size: var(--t-s); border-radius: 0 var(--radio) var(--radio) 0; }
.nota[data-tono='sol'] { border-left-color: #d9a400; background: #fdf7e3; }
.nota[data-tono='mora'] { border-left-color: var(--mora); background: #fdf0ee; }
.nota[data-tono='acequia'] { border-left-color: var(--acequia); background: #eef8f5; }
.nota[data-tono='uva'] { border-left-color: var(--uva); background: var(--uva-fondo); }

.vacio { padding: 2.25rem 1.5rem; text-align: center; color: var(--texto-2); }
.vacio .subtitulo { color: var(--texto); margin-bottom: 0.3rem; }
.vacio .btn { margin-top: 1rem; }

.definiciones { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem 1.5rem; margin: 0; }
.definiciones div { min-width: 0; }
.definiciones dt { font-size: var(--t-xs); color: var(--texto-2); }
.definiciones dd { margin: 0.1rem 0 0; font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Tablas ---------- */

.tabla-marco { background: var(--nieve); border: 1px solid var(--borde); border-radius: var(--radio); overflow-x: auto; }
.tabla th {
  text-align: left; font-size: var(--t-xs); font-weight: 600; color: var(--texto-2);
  padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--borde); white-space: nowrap; background: #faf9fc;
}
.tabla td { padding: 0.65rem 0.9rem; border-bottom: 1px solid #ebe9f0; vertical-align: middle; font-size: var(--t-s); }
.tabla tr:last-child td { border-bottom: 0; }
.tabla th.derecha, .tabla td.derecha { text-align: right; }
.tabla tbody tr[data-accion] { cursor: pointer; }
.tabla tbody tr[data-accion]:hover td { background: #faf8fc; }
.tabla tfoot td { border-top: 1px solid var(--borde); border-bottom: 0; font-weight: 700; background: #faf9fc; }
.tabla .principal { font-weight: 600; font-size: var(--t-m); }
.tabla .secundario { display: block; font-size: var(--t-xs); color: var(--texto-2); font-weight: 400; }
.tabla td.acciones { text-align: right; white-space: nowrap; }
.tabla td.acciones .btn + .btn { margin-left: 0.3rem; }
.tabla tr.ajuste td { box-shadow: inset 0 2px 0 var(--cielo-fondo); }

.etiqueta { display: inline-block; font-size: 0.6875rem; font-weight: 650; padding: 0.05rem 0.4rem; border-radius: 3px; background: #ecebf1; color: var(--texto-2); white-space: nowrap; vertical-align: 0.08em; }
.etiqueta[data-tono='cielo'] { background: var(--cielo-fondo); color: var(--cielo); }
.etiqueta[data-tono='sol'] { background: var(--sol-fondo); color: var(--sol); }
.etiqueta[data-tono='uva'] { background: var(--uva-fondo); color: var(--uva); }
.etiqueta[data-tono='acequia'] { background: var(--acequia-fondo); color: var(--acequia); }
.etiqueta[data-tono='mora'] { background: var(--mora-fondo); color: var(--mora); }

/* Estado de una cuota: pastilla en listados, sello en fichas. */
.estado { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.12rem 0.6rem 0.12rem 0.5rem; border-radius: 99px; font-size: var(--t-xs); font-weight: 650; white-space: nowrap; background: #ecebf1; color: var(--texto-2); }
.estado::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.estado[data-estado='pagada'], .estado[data-estado='vigente'], .estado[data-estado='enviado'], .estado[data-estado='activo'], .estado[data-estado='alquilada'] { background: var(--acequia-fondo); color: var(--acequia); }
.estado[data-estado='proxima'], .estado[data-estado='simulado'], .estado[data-estado='disponible'] { background: var(--sol-fondo); color: var(--sol); }
.estado[data-estado='vencida'], .estado[data-estado='error'], .estado[data-estado='rescindido'] { background: var(--mora-fondo); color: var(--mora); }
.estado[data-estado='parcial'] { background: var(--cielo-fondo); color: var(--cielo); }

.sello {
  display: inline-block;
  padding: 0.3rem 0.8rem 0.25rem;
  border: 2px solid currentColor;
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px var(--nieve), inset 0 0 0 3px currentColor;
  font-weight: 800; font-stretch: 70%; font-size: 1.05rem; letter-spacing: 0.09em; text-transform: uppercase; line-height: 1.2;
  transform: rotate(-3deg);
  color: var(--texto-2);
  white-space: nowrap;
}
.sello small { display: block; font-size: 0.6875rem; letter-spacing: 0.06em; font-weight: 600; font-stretch: 86%; }
.sello[data-estado='pagada'], .sello[data-estado='vigente'] { color: var(--acequia); }
.sello[data-estado='proxima'] { color: var(--sol); }
.sello[data-estado='vencida'], .sello[data-estado='rescindido'] { color: var(--mora); }
.sello[data-estado='parcial'] { color: var(--cielo); }

/* ---------- Panel de inicio ---------- */

.titular { font-size: var(--t-3xl); font-weight: 780; font-stretch: 72%; line-height: 1.05; letter-spacing: -0.01em; max-width: 22ch; }
.titular .num { font-stretch: 72%; }

.franja { margin-top: 1.4rem; }
.franja-barra { display: flex; height: 22px; border-radius: 3px; overflow: hidden; background: #e3e1ea; }
.franja-barra span { display: block; min-width: 3px; }
.franja-barra .cobrado { background: var(--acequia); }
.franja-barra .pendiente { background: #c9c5d6; }
.franja-barra .mora { background: var(--mora); }
.franja-leyenda { display: flex; gap: 2.25rem; flex-wrap: wrap; margin-top: 0.8rem; }
.franja-leyenda div { display: grid; grid-template-columns: 10px auto; column-gap: 0.5rem; align-items: baseline; }
.franja-leyenda i { width: 10px; height: 10px; border-radius: 2px; align-self: center; }
.franja-leyenda b { font-size: var(--t-l); font-weight: 700; }
.franja-leyenda span { grid-column: 2; font-size: var(--t-xs); color: var(--texto-2); }

.hechos { display: flex; flex-wrap: wrap; gap: 0.75rem 2.5rem; margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--borde); }
.hechos div { min-width: 0; }
.hechos b { display: block; font-size: var(--t-xl); font-weight: 750; font-stretch: 78%; line-height: 1.15; }
.hechos span { font-size: var(--t-s); color: var(--texto-2); }

.lista { list-style: none; margin: 0; padding: 0; background: var(--nieve); border: 1px solid var(--borde); border-radius: var(--radio); }
.lista li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.2rem 1rem; align-items: center; padding: 0.7rem 0.95rem; border-bottom: 1px solid #ebe9f0; }
.lista li:last-child { border-bottom: 0; }
.lista li[data-accion] { cursor: pointer; }
.lista li[data-accion]:hover { background: #faf8fc; }
.lista .quien { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista .detalle { font-size: var(--t-xs); color: var(--texto-2); }
.lista .importe { text-align: right; font-weight: 700; }
.lista .importe small { display: block; font-weight: 400; font-size: var(--t-xs); color: var(--texto-2); }
.lista .importe small.alerta { color: var(--mora); font-weight: 600; }

.barras { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.9rem; align-items: end; height: 150px; padding: 0.25rem 0; }
.barras .mes { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 0.35rem; min-width: 0; }
.barras .pila { position: relative; flex: 1; display: flex; align-items: flex-end; }
.barras .vencia { width: 100%; background: #dcd9e6; border-radius: 3px 3px 0 0; position: relative; min-height: 2px; }
.barras .cobrado { position: absolute; left: 0; right: 0; bottom: 0; background: var(--acequia); border-radius: 3px 3px 0 0; }
.barras .mes span { font-size: var(--t-xs); color: var(--texto-2); text-align: center; white-space: nowrap; }
.leyenda-chica { display: flex; gap: 1.2rem; font-size: var(--t-xs); color: var(--texto-2); margin-top: 0.6rem; }
.leyenda-chica i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 0.35rem; }

.actividad { list-style: none; margin: 0; padding: 0; }
.actividad li { padding: 0.5rem 0; border-bottom: 1px solid var(--borde); font-size: var(--t-s); display: flex; justify-content: space-between; gap: 1rem; }
.actividad li:last-child { border-bottom: 0; }
.actividad time { color: var(--texto-2); font-size: var(--t-xs); white-space: nowrap; }

/* ---------- Ventanas y avisos ---------- */

dialog.modal { border: 0; border-radius: 8px; padding: 0; width: min(92vw, var(--ancho, 620px)); max-height: 90vh; background: var(--nieve); color: var(--texto); box-shadow: 0 24px 60px rgba(36, 23, 51, 0.32); overflow: hidden; }
dialog.modal[open] { display: flex; flex-direction: column; }
dialog.modal::backdrop { background: rgba(36, 23, 51, 0.55); }
.modal-cabeza { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.4rem 0.9rem; border-bottom: 1px solid var(--borde); }
.modal-cabeza h2 { font-size: var(--t-xl); font-weight: 750; font-stretch: 80%; line-height: 1.15; }
.modal-cerrar { border: 0; background: none; cursor: pointer; padding: 0.25rem; margin: -0.25rem -0.4rem 0 0; color: var(--texto-2); border-radius: 4px; }
.modal-cerrar:hover { color: var(--texto); background: var(--piedra); }
.modal-cerrar svg { width: 20px; height: 20px; display: block; }
.modal-cuerpo { padding: 1.25rem 1.4rem 1.4rem; overflow-y: auto; }

.avisos { position: fixed; right: 1.25rem; bottom: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 1000; max-width: min(420px, calc(100vw - 2.5rem)); }
.aviso { background: var(--tinta); color: #fff; padding: 0.75rem 1rem; border-radius: 6px; font-size: var(--t-s); box-shadow: 0 8px 24px rgba(36, 23, 51, 0.3); border-left: 4px solid var(--acequia); }
.aviso[data-tipo='error'] { border-left-color: #ff8a80; }

/* ---------- Ficha de cuota ---------- */

.cuota-cabeza { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.cuenta-cuota { width: 100%; }
.cuenta-cuota td { padding: 0.4rem 0; border-bottom: 1px solid #ebe9f0; font-size: var(--t-s); }
.cuenta-cuota td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 0.75rem; }
.cuenta-cuota tr.total td { border-bottom: 0; border-top: 2px solid var(--texto); font-weight: 750; font-size: var(--t-l); padding-top: 0.6rem; }
.cuenta-cuota tr.sub td { color: var(--texto-2); padding-left: 0.9rem; font-size: var(--t-xs); }
.cuenta-cuota tr.suma td { font-weight: 650; }

/* ---------- Calendario ---------- */

.cal-barra { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cal-barra .mes-nombre { font-size: var(--t-xl); font-weight: 750; font-stretch: 80%; min-width: 11ch; text-transform: capitalize; }
.cal-resumen { display: flex; gap: 2rem; flex-wrap: wrap; margin-left: auto; font-size: var(--t-s); }
.cal-resumen b { display: block; font-size: var(--t-l); }

.mes-grilla { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--borde); gap: 1px; border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; }
.mes-grilla .dia-nombre { background: #faf9fc; padding: 0.4rem 0.6rem; font-size: var(--t-xs); color: var(--texto-2); font-weight: 600; }
.mes-grilla .dia { background: var(--nieve); min-height: 104px; padding: 0.35rem 0.4rem 0.45rem; display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.mes-grilla .dia.fuera { background: #f8f7fa; }
.mes-grilla .dia-num { font-size: var(--t-xs); color: var(--texto-2); font-weight: 600; align-self: flex-start; padding: 0 0.3rem; border-radius: 99px; }
.mes-grilla .dia.hoy .dia-num { background: var(--tinta); color: #fff; }
.ficha { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--borde-fuerte); background: #f2f1f5; border-radius: 0 3px 3px 0; padding: 0.2rem 0.4rem; font-size: 0.75rem; line-height: 1.25; cursor: pointer; overflow: hidden; }
.ficha b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ficha span { color: var(--texto-2); }
.ficha:hover { filter: brightness(0.97); }
.ficha[data-estado='pagada'] { background: var(--acequia-fondo); border-left-color: var(--acequia); }
.ficha[data-estado='proxima'] { background: var(--sol-fondo); border-left-color: #d9a400; }
.ficha[data-estado='vencida'] { background: var(--mora-fondo); border-left-color: var(--mora); }
.ficha[data-estado='parcial'] { background: var(--cielo-fondo); border-left-color: var(--cielo); }

/* ---------- Carga de contrato ---------- */

.pasos { display: flex; gap: 0; list-style: none; padding: 0; margin: 0 0 1.75rem; counter-reset: paso; }
.pasos li { counter-increment: paso; display: flex; align-items: center; gap: 0.55rem; padding-right: 1.5rem; margin-right: 1.5rem; font-size: var(--t-s); color: var(--texto-2); font-weight: 600; position: relative; }
.pasos li::before { content: counter(paso); width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--borde-fuerte); font-size: var(--t-xs); background: var(--nieve); }
.pasos li:not(:last-child)::after { content: ''; position: absolute; right: -0.9rem; width: 1.2rem; height: 1.5px; background: var(--borde-fuerte); }
.pasos li[data-estado='actual'] { color: var(--texto); }
.pasos li[data-estado='actual']::before { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.pasos li[data-estado='hecho']::before { content: '✓'; background: var(--acequia); border-color: var(--acequia); color: #fff; }

.zona-pdf { border: 2px dashed var(--borde-fuerte); border-radius: 8px; background: var(--nieve); padding: 3rem 1.5rem; text-align: center; cursor: pointer; display: block; }
.zona-pdf:hover, .zona-pdf.encima { border-color: var(--uva); background: var(--uva-fondo); }
.zona-pdf svg { width: 40px; height: 40px; color: var(--uva); }
.zona-pdf .subtitulo { margin-top: 0.6rem; }
.zona-pdf input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.analisis { list-style: none; margin: 1.5rem auto 0; padding: 0; max-width: 420px; text-align: left; }
.analisis li { display: flex; align-items: center; gap: 0.7rem; padding: 0.45rem 0; color: var(--texto-2); }
.analisis li::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--borde-fuerte); flex: none; }
.analisis li[data-estado='en-curso'] { color: var(--texto); font-weight: 600; }
.analisis li[data-estado='en-curso']::before { border-color: var(--uva); border-top-color: transparent; animation: girar 0.8s linear infinite; }
.analisis li[data-estado='listo']::before { background: var(--acequia); border-color: var(--acequia); }
@keyframes girar { to { transform: rotate(360deg); } }

.clausulas { list-style: none; margin: 0; padding: 0; }
.clausulas li { padding: 0.7rem 0; border-bottom: 1px solid var(--borde); }
.clausulas li:last-child { border-bottom: 0; }
.clausulas h4 { font-size: var(--t-s); font-weight: 700; display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; }
.clausulas p { font-size: var(--t-xs); color: var(--texto-2); margin-top: 0.2rem; }

.archivo-pdf { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.9rem; }
.archivo-pdf svg { width: 26px; height: 26px; color: var(--mora); flex: none; }
.archivo-pdf b { display: block; overflow-wrap: anywhere; }

.pegado { position: sticky; top: 1.25rem; }

/* ---------- Calculadora ---------- */

.resultado { background: var(--tinta); color: #fff; border-radius: var(--radio); padding: 1.25rem 1.4rem; }
.resultado .total { font-size: var(--t-3xl); font-weight: 780; font-stretch: 72%; line-height: 1.05; }
.resultado dl { display: grid; grid-template-columns: 1fr auto; gap: 0.35rem 1rem; margin: 1rem 0 0; font-size: var(--t-s); }
.resultado dt { color: #c9bfd8; }
.resultado dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.resultado .formula { margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px solid #47365f; font-size: var(--t-xs); color: #c9bfd8; }

/* ---------- Vista previa de email ---------- */

.email-meta { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.9rem; font-size: var(--t-s); margin-bottom: 0.9rem; }
.email-meta dt { color: var(--texto-2); }
.email-meta dd { margin: 0; overflow-wrap: anywhere; }
.email-marco { width: 100%; height: 440px; border: 1px solid var(--borde); border-radius: var(--radio); background: var(--piedra); }

/* ---------- Ingreso ---------- */

.ingreso { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr); min-height: 100vh; }
.ingreso-portada { background: var(--tinta); color: #fff; padding: 3rem 3.5rem 40vh; display: flex; flex-direction: column; gap: 14vh; position: relative; overflow: hidden; }
.ingreso-portada .marca { padding: 0; }
.ingreso-lema { font-size: clamp(2.5rem, 5.2vw, 4.5rem); font-weight: 800; font-stretch: 68%; line-height: 0.98; letter-spacing: -0.01em; max-width: 12ch; position: relative; z-index: 1; }
.ingreso-portada p { color: #cfc5dc; max-width: 46ch; margin-top: 1.25rem; position: relative; z-index: 1; }
.cordillera { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 38%; }
.ingreso-form { padding: 3rem clamp(1.5rem, 5vw, 4rem); display: flex; flex-direction: column; justify-content: center; background: var(--nieve); }
.ingreso-form form { display: grid; gap: 0.9rem; margin-top: 1.5rem; max-width: 380px; }
.ingreso-demo { margin-top: 2.25rem; padding-top: 1.5rem; border-top: 1px solid var(--borde); max-width: 380px; }
.ingreso-demo .botones { display: grid; gap: 0.5rem; margin-top: 0.8rem; }
.ingreso-demo .btn { justify-content: space-between; padding: 0.7rem 0.9rem; }
.ingreso-demo .btn small { font-weight: 400; color: var(--texto-2); }

/* ---------- Módulos maquetados ---------- */

.maqueta-aviso { display: flex; gap: 0.9rem; align-items: flex-start; background: repeating-linear-gradient(135deg, #fdf7e3 0 14px, #fbf1cf 14px 28px); border: 1px solid #ecd990; border-radius: var(--radio); padding: 0.85rem 1.1rem; margin-bottom: 1.75rem; font-size: var(--t-s); }
.maqueta-aviso svg { width: 20px; height: 20px; flex: none; color: var(--sol); margin-top: 0.1rem; }
.maqueta-aviso b { display: block; }
.maqueta [disabled], .maqueta .btn[aria-disabled='true'] { cursor: not-allowed; }

.flujo { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; list-style: none; margin: 0; padding: 0; counter-reset: etapa; }
.flujo li { counter-increment: etapa; padding: 1rem 1.1rem 1.1rem; border: 1px solid var(--borde); border-left-width: 0; background: var(--nieve); }
.flujo li:first-child { border-left-width: 1px; border-radius: var(--radio) 0 0 var(--radio); }
.flujo li:last-child { border-radius: 0 var(--radio) var(--radio) 0; }
.flujo li::before { content: counter(etapa); display: block; font-size: var(--t-xl); font-weight: 800; font-stretch: 72%; color: var(--uva); line-height: 1; margin-bottom: 0.4rem; }
.flujo b { display: block; }
.flujo span { font-size: var(--t-xs); color: var(--texto-2); }

.firmantes { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.telefono { width: 300px; max-width: 100%; border: 8px solid var(--tinta); border-radius: 28px; background: #e9e4dc; overflow: hidden; margin: 0 auto; }
.telefono-cabeza { background: #1f5c4d; color: #fff; padding: 0.7rem 0.9rem; font-size: var(--t-s); font-weight: 600; }
.telefono-cabeza small { display: block; font-weight: 400; opacity: 0.8; font-size: 0.6875rem; }
.telefono-chat { padding: 0.8rem 0.7rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; min-height: 340px; }
.globo { max-width: 86%; background: #fff; border-radius: 8px; padding: 0.45rem 0.6rem; font-size: 0.78rem; line-height: 1.35; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08); }
.globo.propio { align-self: flex-end; background: #d9f2c9; }
.globo time { display: block; text-align: right; font-size: 0.625rem; color: #7b8a80; margin-top: 0.15rem; }

.matriz td, .matriz th { text-align: center; }
.matriz td:first-child, .matriz th:first-child { text-align: left; }
.si { color: var(--acequia); font-weight: 800; }
.no { color: #b9b4c6; }

.comprobante { font-variant-numeric: tabular-nums; }
.comprobante .cabeza { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: start; border-bottom: 1px solid var(--borde); padding-bottom: 0.9rem; margin-bottom: 0.9rem; }
.comprobante .letra { border: 2px solid var(--texto); width: 3rem; height: 3rem; display: grid; place-items: center; font-size: 1.75rem; font-weight: 800; }
.comprobante .cae { margin-top: 1rem; padding-top: 0.8rem; border-top: 1px dashed var(--borde-fuerte); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: var(--t-xs); color: var(--texto-2); }

.portal-demo { border: 1px solid var(--borde); border-radius: 10px; overflow: hidden; background: var(--nieve); max-width: 420px; }
.portal-demo header { background: var(--uva); color: #fff; padding: 1rem 1.2rem; }
.portal-demo .cuerpo { padding: 1.1rem 1.2rem; display: grid; gap: 0.9rem; }

/* ---------- Pantallas chicas ---------- */

@media (max-width: 1080px) {
  .columnas-lado { grid-template-columns: minmax(0, 1fr); }
  .pegado { position: static; }
}

@media (max-width: 900px) {
  .marco { grid-template-columns: minmax(0, 1fr); }
  .lateral { position: fixed; inset: 0 auto 0 0; width: min(84vw, 290px); transform: translateX(-100%); transition: transform 0.18s ease; z-index: 50; }
  .marco.menu-abierto .lateral { transform: none; box-shadow: 0 0 0 100vmax rgba(36, 23, 51, 0.5); }
  .barra-movil { display: flex; align-items: center; gap: 0.75rem; background: var(--tinta); color: #fff; padding: 0.6rem 1rem; position: sticky; top: 0; z-index: 40; }
  .barra-movil button { background: none; border: 0; color: #fff; padding: 0.3rem; cursor: pointer; }
  .barra-movil button svg { width: 24px; height: 24px; display: block; }
  .barra-movil .marca { padding: 0; font-size: 1.15rem; }
  .contenido { padding: 1.25rem 1rem 3rem; }
  .columnas-2 { grid-template-columns: minmax(0, 1fr); }
  .titular { font-size: var(--t-2xl); }
  .ingreso { grid-template-columns: minmax(0, 1fr); }
  .ingreso-portada { padding: 2rem 1.5rem 9rem; gap: 2.5rem; }
  .cordillera { height: 7.5rem; }
  .c-3, .c-4, .c-5 { grid-column: span 6; }
  .c-6, .c-7, .c-8 { grid-column: span 12; }
  .flujo { grid-template-columns: 1fr 1fr; }
  .flujo li { border-left-width: 1px; border-radius: 0 !important; }
  .mes-grilla .dia { min-height: 72px; }
  .ficha span { display: none; }
}

@media (max-width: 560px) {
  .c-3, .c-4, .c-5 { grid-column: span 12; }
  .mes-grilla .dia-nombre { padding: 0.3rem 0.2rem; text-align: center; }
  .ficha b { font-size: 0.625rem; }
  .pasos li { padding-right: 0.6rem; margin-right: 0.9rem; }
  .pasos li span { display: none; }
  .pasos li[data-estado='actual'] span { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Segunda etapa: ajustes, carga masiva, cierres ---------- */

.entrada-chica { width: 5.5rem !important; min-height: 2rem !important; padding: 0.25rem 0.5rem !important; text-align: right; }
.zona-compacta { padding: 1.6rem 1.25rem; }
.zona-compacta svg { width: 30px; height: 30px; }
.zona-pdf.zona-fija, .zona-pdf.zona-fija:hover { cursor: default; border-color: var(--borde-fuerte); background: var(--nieve); }
.zona-fija .btn svg { width: 16px; height: 16px; color: inherit; }

.plegable { border: 1px solid var(--borde); border-radius: var(--radio); background: var(--nieve); }
.plegable > summary { padding: 0.6rem 0.8rem; cursor: pointer; font-size: var(--t-s); font-weight: 600; color: var(--uva); }
.plegable > summary:hover { color: var(--uva-oscura); }
.plegable[open] > summary { border-bottom: 1px solid var(--borde); }
.plegable > form { padding: 0.9rem 0.8rem; }

.acta-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 14rem); gap: 0.4rem 1rem; align-items: center; padding: 0.4rem 0; border-bottom: 1px solid var(--borde); }
.acta-item:last-child { border-bottom: 0; }
.acta-item input[type='text'] { min-height: 2rem; padding: 0.25rem 0.5rem; font-size: var(--t-s); }

/* Hoja que solo existe para imprimir un documento (acta de entrega). */
.hoja-impresion { display: none; }

@media (max-width: 560px) {
  .acta-item { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  .lateral, .barra-movil, .encabezado-acciones, .avisos { display: none !important; }
  .marco { display: block; }
  body { background: #fff; }
  body:has(.hoja-impresion) > *:not(.hoja-impresion) { display: none !important; }
  .hoja-impresion { display: block; max-width: 17cm; margin: 0 auto; color: #000; font-size: 11pt; line-height: 1.45; }
  .hoja-impresion h1 { font-size: 18pt; margin-bottom: 0.3cm; }
  .hoja-impresion h2 { font-size: 12pt; margin: 0.7cm 0 0.2cm; }
  .hoja-impresion p { margin-bottom: 0.25cm; }
  .hoja-impresion table { width: 100%; border-collapse: collapse; }
  .hoja-impresion td { padding: 0.12cm 0.2cm; border-bottom: 0.5pt solid #999; vertical-align: top; }
  .hoja-impresion td:last-child { text-align: right; white-space: nowrap; }
  .hoja-impresion table:not(.cuenta-cuota) td:first-child { width: 1.2cm; font-weight: 700; }
  .hoja-impresion table:not(.cuenta-cuota) td:last-child { text-align: left; white-space: normal; }
  .hoja-impresion .firmas { display: flex; gap: 2cm; margin-top: 2.5cm; }
  .hoja-impresion .firmas div { flex: 1; border-top: 0.5pt solid #000; padding-top: 0.15cm; font-size: 9.5pt; }
}
