/* Consorcio en Orden · web (W2, esqueleto). Colores de diseno/identidad.md. La pasada visual de verdad es W6 (Experiencia + Diseño). */
:root {
  --papel: #f6f7f4; --tinta: #18221f; --suave: #55625d; --acento: #1f6b57; --cartelera: #16302b;
  --hoja: #fbfaf5; --alfiler: #e8a33d; --alerta: #9a3b12; --alerta-fondo: #fbe3d3; --borde: #dfe3df;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --papel: #0f1513; --tinta: #e7ece9; --suave: #9fada7; --acento: #5cc4a3; --cartelera: #0b1a17;
          --hoja: #18211e; --alerta: #f0a27a; --alerta-fondo: #3a2117; --borde: #26312d; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--papel); color: var(--tinta);
       font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.barra { display: flex; align-items: center; justify-content: space-between; gap: 12px;
         background: var(--cartelera); color: #fff; padding: 12px 16px; }
.marca { color: #fff; text-decoration: none; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.marca em { font-style: normal; font-weight: 400; opacity: .75; }
.hoja { width: 14px; height: 18px; background: #fbfaf5; border-radius: 2px; position: relative; }
.hoja::after { content: ""; position: absolute; top: -3px; left: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--alfiler); }
main { max-width: 860px; margin: 0 auto; padding: 20px 16px 48px; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 8px 0 4px; }
h2 { font-size: 1.15rem; margin: 28px 0 8px; }
.sub { color: var(--suave); margin-top: 0; }
a { color: var(--acento); }
.boton { background: var(--acento); color: #fff; border: 0; border-radius: 10px; padding: 12px 18px; font: inherit;
         font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; min-height: 44px; }
@media (prefers-color-scheme: dark) { .boton { color: #0b1a17; } }
.link { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; padding: 8px 0; }
.salir .link { color: #fff; }
:focus-visible { outline: 3px solid var(--alfiler); outline-offset: 2px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--suave); }
input { font: inherit; color: var(--tinta); background: var(--hoja); border: 1px solid var(--borde); border-radius: 8px;
        padding: 10px 12px; min-height: 44px; }
.entrar, .grilla { display: grid; gap: 12px; margin: 12px 0; }
@media (min-width: 640px) { .grilla { grid-template-columns: 1fr 1fr; } .grilla .boton { justify-self: start; } }
details { background: var(--hoja); border: 1px solid var(--borde); border-radius: 12px; padding: 12px 16px; margin: 16px 0; }
summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 16px 0; }
.tarjeta { background: var(--hoja); border: 1px solid var(--borde); border-radius: 12px; padding: 14px 16px;
           display: flex; flex-direction: column; gap: 2px; }
.tarjeta span, .tarjeta small { color: var(--suave); font-size: .85rem; }
.tarjeta strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.tabla { overflow-x: auto; border: 1px solid var(--borde); border-radius: 12px; background: var(--hoja); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--borde); white-space: nowrap; }
th { font-size: .8rem; color: var(--suave); font-weight: 600; }
tfoot td { font-weight: 700; border-bottom: 0; }
.n { text-align: right; font-variant-numeric: tabular-nums; }
.aviso { background: var(--alerta-fondo); color: var(--alerta); border-radius: 10px; padding: 10px 14px; }
.ejemplo { border-left: 4px solid var(--alfiler); padding: 8px 12px; background: var(--hoja); border-radius: 0 10px 10px 0; }
.proximo { color: var(--suave); font-size: .9rem; }
.edificios { list-style: none; padding: 0; display: grid; gap: 10px; }
.edificio a { display: flex; flex-direction: column; padding: 14px 16px; background: var(--hoja); border: 1px solid var(--borde);
              border-radius: 12px; text-decoration: none; color: var(--tinta); }
.edificio span { color: var(--suave); font-size: .9rem; }
@media (max-width: 639px) { .ancho { display: none; } } /* en celular: UF, debía y a pagar; el detalle en compu (W6 decide tarjetas) */
.listo { background: var(--hoja); border-left: 4px solid var(--acento); padding: 10px 14px; border-radius: 0 10px 10px 0; }
.gastos { list-style: none; padding: 0; display: grid; gap: 8px; }
.gasto { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; background: var(--hoja);
         border: 1px solid var(--borde); border-radius: 12px; padding: 12px 14px; }
.gasto small { display: block; color: var(--suave); font-size: .85rem; }
.gasto.propuesto { border-color: var(--alfiler); box-shadow: inset 4px 0 0 var(--alfiler); }
.en-linea { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 0; }
select, textarea { font: inherit; color: var(--tinta); background: var(--hoja); border: 1px solid var(--borde); border-radius: 8px;
                   padding: 10px 12px; min-height: 44px; max-width: 100%; }
textarea { width: 100%; font-family: ui-monospace, monospace; font-size: .85rem; }
.boton.chico { padding: 8px 14px; }
.aviso.pago p { margin: 0; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.gastos { grid-template-columns: minmax(0, 1fr); }
.gasto > div { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.en-linea select { flex: 1 1 160px; min-width: 0; }
.gasto > form { flex: 1 1 100%; min-width: 0; }
.ticket { margin: 12px 0; }
.ticket .foto { cursor: pointer; }
.ticket .sub { margin: 6px 0 0; font-size: .85rem; }
.liquidar { margin: 16px 0; }
.liquidar .sub { margin: 6px 0 0; font-size: .9rem; }
.recibo { background: var(--hoja); border: 1px solid var(--borde); border-radius: 12px; padding: 16px; }
@media print { .barra, .no-imprimir, .salir { display: none; } body { background: #fff; color: #000; } .recibo { border: 0; } }
.caja, .n strong { white-space: nowrap; }
.recibo td:first-child { white-space: normal; }
.recibo td, .recibo th { padding: 10px 8px; }
.meses { display: flex; gap: 14px; flex-wrap: wrap; margin: 20px 0 0; font-size: .95rem; }
.meses a, .meses strong { padding: 8px 0; }
.tilde { flex-direction: row; align-items: center; gap: 8px; color: var(--tinta); margin: 8px 0; }
.tilde input { min-height: auto; width: 20px; height: 20px; }
.alias { font-size: 1.05rem; overflow-wrap: anywhere; }
.tabla td:first-child { white-space: normal; }
.pie { max-width: 860px; margin: 0 auto; padding: 16px 16px 32px; color: var(--suave); font-size: .85rem; border-top: 1px solid var(--borde); }
.consentimiento { grid-column: 1 / -1; background: var(--papel); border: 1px dashed var(--borde); border-radius: 10px; padding: 10px 12px; }
.consentimiento .tilde { align-items: flex-start; }
.consentimiento .tilde input { margin-top: 3px; flex: none; }
.descargo { color: var(--suave); font-size: .85rem; margin-top: 10px; }
.boton.peligro { background: var(--alerta); color: #fff; }
@media (prefers-color-scheme: dark) { .boton.peligro { color: #0b1a17; } }
.progreso { background: var(--hoja); border-left: 4px solid var(--alfiler); padding: 10px 14px; border-radius: 0 10px 10px 0; }
.desglose { font-size: .95rem; }
.consentimiento.falta { border: 2px solid var(--alerta); }
.error-form { grid-column: 1 / -1; margin: 0; }
.ejemplo-lista { font-family: ui-monospace, monospace; font-size: .85rem; background: var(--papel); padding: 8px 10px; border-radius: 8px; }
#pegar-unidades form { display: grid; gap: 10px; }
.con-mail { color: var(--acento); white-space: nowrap; }
.solo-celu { display: none; }
@media (max-width: 639px) { .solo-celu { display: inline; } .tabla .unidad td:nth-child(3) small { display: block; } }
.lista-gastos { margin: 4px 0 12px; padding-left: 18px; color: var(--suave); font-size: .9rem; }
.en-fila { display: inline; }
.mensaje-wa { background: var(--hoja); border: 1px solid var(--borde); border-radius: 12px; padding: 12px 14px; overflow-wrap: anywhere; }
/* Corregir o borrar un gasto ya confirmado (Calidad 04/12, falla alta 1): plegado, debajo del gasto, sin robar lugar */
.gasto details.cambiar { flex-basis: 100%; margin: 6px 0 0; padding: 6px 12px; background: transparent; }
.gasto details.cambiar summary { font-weight: 400; font-size: .9em; min-height: 28px; color: var(--suave); }
/* Unidades en celular: una tarjeta por unidad con lo que importa a la vista (crítico del esqueleto: la deuda quedaba fuera) */
@media (max-width: 639px) {
  .tabla-unidades { overflow: visible; }
  .tabla-unidades thead { display: none; }
  .tabla-unidades tr.unidad { display: grid; grid-template-columns: 2.2em 1fr auto; gap: 2px 10px; padding: 10px 12px; border-bottom: 1px solid var(--borde); }
  .tabla-unidades tr.unidad td { border: 0; padding: 0; white-space: normal; }
  .tabla-unidades tr.unidad td:nth-child(1) { grid-column: 1; grid-row: 1; font-weight: 700; }
  .tabla-unidades tr.unidad td:nth-child(3) { grid-column: 2; grid-row: 1; }
  .tabla-unidades tr.unidad td:nth-child(5) { grid-column: 3; grid-row: 1; }
  .tabla-unidades td.deuda-ini { display: block; grid-column: 2; grid-row: 2; text-align: left; color: var(--suave); font-size: .85rem; }
  .tabla-unidades td.deuda-ini::before { content: attr(data-etiqueta) ": "; }
  .tabla-unidades td.editar { grid-column: 3; grid-row: 2; text-align: right; }
  .tabla-unidades td.editar a { display: inline-block; padding: 6px 0; }
  .tabla-unidades tfoot tr { display: flex; justify-content: space-between; padding: 10px 12px; }
  .tabla-unidades tfoot td { padding: 0; }
  .tabla-unidades tfoot td:empty { display: none; }
}
.version { white-space: nowrap; }
/* W4c · gastos por rubro y hoja de liquidación */
.por-rubro tr.rubro th { text-align: left; font-weight: 600; padding: 10px 8px; white-space: normal; }
.por-rubro tr.rubro th small { color: var(--suave); font-weight: 400; margin-left: 6px; white-space: nowrap; }
.por-rubro tr.de-rubro td { color: var(--suave); font-size: .9rem; padding-top: 4px; padding-bottom: 4px; border-bottom: 0; }
.por-rubro tr.de-rubro td:first-child { padding-left: 22px; white-space: normal; }
.por-rubro tr.rubro th, .por-rubro tr.rubro td { border-top: 1px solid var(--borde); border-bottom: 0; }
.por-rubro tbody tr:first-child th, .por-rubro tbody tr:first-child td { border-top: 0; }
.hoja-liq h2 { margin-top: 22px; }
.prorrateo table { font-size: .85rem; }
.prorrateo td, .prorrateo th { white-space: nowrap; padding: 8px 6px; }
.prorrateo td small { color: var(--suave); }
@media print { .hoja-liq .tabla { overflow: visible; border-color: #999; } .hoja-liq { padding: 0; } .pie { font-size: .7rem; } }
.tabla tr.de-rubro td { color: var(--suave); font-size: .9rem; padding-top: 0; white-space: normal; }
@media (max-width: 700px) { /* en el celular cada unidad es una tarjeta: nada queda escondido a la derecha */
  .prorrateo thead { display: none; }
  .prorrateo table, .prorrateo tbody, .prorrateo tfoot { display: block; }
  .prorrateo tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 10px 12px; border-bottom: 1px solid var(--borde); }
  .prorrateo tfoot tr { border-bottom: 0; }
  .prorrateo td { border: 0; padding: 0; display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; }
  .prorrateo td:first-child { grid-column: 1 / -1; font-size: 1rem; justify-content: flex-start; align-items: baseline; }
  .prorrateo td:empty { display: none; }
  .prorrateo td[data-t]::before { content: attr(data-t); color: var(--suave); }
  .prorrateo td[data-t="A pagar"] { grid-column: 1 / -1; font-size: 1rem; border-top: 1px dashed var(--borde); padding-top: 6px; margin-top: 4px; }
}
@media print { .prorrateo table { font-size: .7rem; } }

/* Pagos del mes (Calidad R3 05/12, falla 1): cada pago con a qué unidad fue y por qué; cambiar o borrar, plegado debajo */
.lista-pagos { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.lista-pagos > li { min-width: 0; }
.lista-pagos select { width: 100%; }
.lista-pagos > li { border: 1px solid var(--borde); border-radius: 10px; padding: 10px 12px; background: var(--papel); }
.pago-linea { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.pago-uf { font-weight: 600; }
.pago-uf.falta { color: var(--alerta); }
.pago-detalle { color: var(--suave); font-size: .9rem; overflow-wrap: anywhere; }
.lista-pagos small { display: block; color: var(--suave); font-size: .85rem; }
.lista-pagos details.cambiar-pago { margin: 6px 0 0; padding: 4px 10px; background: transparent; }
.lista-pagos details.cambiar-pago summary { font-weight: 400; font-size: .9em; min-height: 28px; color: var(--suave); }
.boton.suave { background: transparent; color: var(--acento); border: 1px solid var(--acento); }
.aviso.pago .boton.suave { color: var(--alerta); border-color: var(--alerta); }
.aviso.pago { margin: 10px 0; }
/* Experiencia ronda 3 (05/12): aviso pegado a la sección, recibos que no se cortan en celular, datos pedidos en el momento */
#aviso { scroll-margin-top: 12px; }
.tabla tr.cerrado td:last-child { white-space: normal; }
.tabla tr.cerrado .en-fila { display: block; }
.tabla tr.cerrado .en-fila .link { padding: 6px 0; text-align: left; }
.pedido { background: var(--hoja); border: 1px solid var(--alfiler); border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.pedido p { margin: 0 0 6px; }
.pedido input { flex: 1 1 160px; min-width: 0; }
.que-es { flex: 1 1 100%; }
.que-es small { display: inline; }
/* Tablet (640–900 px): con nombre y mail largos la tabla de unidades quedaba 60 px más ancha que la pantalla; el nombre puede partir renglón */
.tabla tr.unidad td:nth-child(3) { white-space: normal; overflow-wrap: anywhere; }
/* Asignar varios pagos a la misma unidad (Calidad R4 falla 5) */
.lista-varios { list-style: none; margin: 8px 0; padding: 0; max-height: 260px; overflow-y: auto; }
.lista-varios li { min-width: 0; }
.lista-varios .tilde span { overflow-wrap: anywhere; min-width: 0; }
.aviso.varios summary { min-height: 44px; cursor: pointer; font-weight: 600; }
.aviso.varios select { width: 100%; margin-bottom: 8px; }
/* 320 px (Calidad R4 falla 4): los campos de los formularios en grilla no se pasan del ancho */
.grilla > *, .grilla label, .entrar > * { min-width: 0; }
.grilla input, .grilla select, .entrar input { width: 100%; max-width: 100%; box-sizing: border-box; }
details.cambiar form, details.cambiar .grilla { max-width: 100%; }

/* W6 · primeros pasos del alta */
.primeros-pasos { background: var(--hoja); border-left: 4px solid var(--alfiler); padding: 10px 14px; border-radius: 0 10px 10px 0; margin: 12px 0; }
.primeros-pasos h2 { margin: 0 0 6px; font-size: 1.05rem; }
.primeros-pasos ol { margin: 0; padding-left: 1.3em; }
.primeros-pasos li { margin: 4px 0; }
.primeros-pasos li.hecho { opacity: .7; list-style: none; margin-left: -1.3em; }
.primeros-pasos li.ahora { font-weight: 600; }
