:root {
  --bg: #f1f5f9;
  --card: #fff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #1d4ed8;
  --primary-d: #1e40af;
  --ok: #059669;
  --warn: #d97706;
  --bad: #dc2626;
  --border: #e2e8f0;
  --radius: 14px;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
.hidden { display: none !important; }
.pad { padding: 1rem 1rem 5rem; max-width: 28rem; margin: 0 auto; }
.pad.wide { max-width: 56rem; }
.top { padding: 1.25rem 1rem; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.admin-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.brand-title { display: flex; align-items: center; gap: .75rem; }
.brand-logo { width: 148px; height: auto; max-height: 56px; object-fit: contain; border-radius: 8px; background: #fff; padding: .15rem .35rem; border: none; }
h1 { margin: 0; font-size: 1.35rem; }
h3 { margin: 0 0 .75rem; font-size: 1rem; }
.muted { color: var(--muted); margin: .25rem 0 0; }
.small { font-size: .8rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.balance { background: linear-gradient(135deg, #0f172a, #1e3a8a); color: #fff; border: none; }
.balance.warn { background: linear-gradient(135deg, #7f1d1d, #0f172a); }
.balance .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.balance .amount { font-size: 2.25rem; font-weight: 800; margin: .35rem 0; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: .25rem .65rem; border-radius: 999px; background: rgba(255,255,255,.2); }
.badge.ok { background: var(--ok); }
.badge.bad { background: var(--bad); }
.btn { border: none; border-radius: 10px; padding: .65rem 1rem; font-weight: 600; font-size: .9rem; cursor: pointer; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); }
.btn.secondary { background: #e0e7ff; color: #1e3a8a; }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.wa { background: #059669; color: #fff; text-decoration: none; text-align: center; display: block; }
.btn.full { width: 100%; }
.bottom { position: fixed; bottom: 0; left: 0; right: 0; padding: .75rem 1rem; background: var(--card); border-top: 1px solid var(--border); }
.portada-wrap { min-height: 100vh; background: var(--bg); }
.hero-showcase {
  width: 100%;
  background: linear-gradient(135deg, #fff7ed, #e0f2fe);
  line-height: 1;
}
.hero-brand { min-height: min(42vh, 340px); display: grid; place-items: center; padding: 2rem 1rem; }
.hero-logo { width: min(88vw, 460px); height: auto; max-height: 130px; object-fit: contain; background: #fff; border-radius: 14px; padding: .65rem 1rem; filter: drop-shadow(0 10px 24px rgba(15, 23, 42, .12)); }
.hero-photo {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(52vh, 480px);
  object-fit: cover;
  object-position: center 40%;
}
.portada-intro {
  max-width: 22rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem .5rem;
  text-align: center;
}
.hero-tag {
  margin: 0;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.portada-botones { padding: 1.5rem 1.25rem 2rem; display: flex; flex-direction: column; gap: .65rem; max-width: 22rem; margin: 0 auto; }
.form-docs label { display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; font-weight: 600; margin-bottom: .65rem; }
.form-docs input, .form-docs select, .form-docs textarea { padding: .55rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.docs-lista { display: flex; flex-direction: column; gap: .75rem; }
.doc-item { border: 1px solid var(--border); border-radius: 10px; padding: .75rem; background: #f8fafc; }
.doc-item.clasificado { background: #fff; }
.doc-item h4 { margin: 0 0 .5rem; font-size: .9rem; word-break: break-all; }
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.doc-grid label { display: flex; flex-direction: column; gap: .2rem; font-size: .72rem; font-weight: 600; }
.doc-grid input, .doc-grid select { padding: .4rem; border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: .8rem; }
.doc-grid .span2 { grid-column: span 2; }
.doc-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.badge-pend { font-size: .7rem; background: #fef3c7; color: #92400e; padding: .15rem .45rem; border-radius: 6px; font-weight: 700; }
.badge-estado { font-size: .7rem; padding: .15rem .45rem; border-radius: 6px; font-weight: 700; }
.badge-estado.pendiente { background: #fef3c7; color: #92400e; }
.badge-estado.confirmado { background: #d1fae5; color: #065f46; }
.badge-estado.rechazado { background: #fee2e2; color: #991b1b; }
.badge-estado.registrado { background: #e0e7ff; color: #3730a3; }
.badge-flujo { font-size: .65rem; background: #f3f4f6; color: #374151; padding: .1rem .4rem; border-radius: 4px; margin-left: .35rem; }
.acuse-box { margin-top: .75rem; padding: .85rem 1rem; background: #ecfdf5; border: 1px solid #6ee7b7; border-radius: 10px; }
.acuse-box strong { color: #047857; }
.recibos-entrada { margin-top: .75rem; padding: .75rem; background: #f8fafc; border-radius: 8px; font-size: .85rem; }
.recibos-entrada li { margin: .35rem 0; }
.conciliacion-resumen { margin-bottom: .75rem; line-height: 1.5; }
.admin-top .top-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.report-btn { font-size: .85rem; margin-top: .25rem; }
.btn-entrar {
  width: 100%;
  padding: .85rem 1.25rem;
  font-size: 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(29, 78, 216, .28);
}
.portada-info {
  max-width: 28rem;
  margin: 1.5rem auto 2rem;
  padding: 0 1rem;
}
.info-comunidad { overflow: hidden; padding: 0; }
.info-comunidad h2,
.info-comunidad h3,
.info-comunidad p { padding: 0 1.1rem; }
.info-comunidad h2,
.info-comunidad h3 { margin-top: .85rem; }
.info-comunidad p { padding-bottom: 1rem; margin-top: .35rem; }
.info-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: cover;
  object-position: center;
}
.logo-card-img { object-fit: contain; padding: 1.25rem; background: #fff; max-height: 200px; }
.dlg-acceso {
  max-width: 24rem;
  width: calc(100% - 2rem);
  padding: 1.5rem 1.25rem 1.25rem;
  border: none;
  border-radius: var(--radius);
}
.dlg-acceso::backdrop { background: rgba(15, 23, 42, .55); }
.dlg-close {
  position: absolute;
  top: .65rem;
  right: .75rem;
  width: 2rem;
  height: 2rem;
  border: none;
  background: #f1f5f9;
  border-radius: 999px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.dlg-acceso h2 { margin: 0 0 .25rem; font-size: 1.2rem; }
@media (min-width: 640px) {
  .hero-photo { max-height: min(58vh, 520px); }
  .portada-intro { max-width: 26rem; }
  .portada-info { max-width: 32rem; }
  .info-img { max-height: 280px; }
}
.form-claves label { display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; font-weight: 600; margin-bottom: .65rem; }
.form-claves input { padding: .55rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.tabs { display: flex; gap: .35rem; margin: 1rem 0 .75rem; }
.tab { flex: 1; padding: .5rem; border: 1px solid var(--border); background: #f8fafc; border-radius: 8px; font-weight: 600; font-size: .8rem; cursor: pointer; }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tab-panel label { display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; font-weight: 600; margin-bottom: .65rem; }
.tab-panel input { padding: .55rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.sep { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.dlg-wide { max-width: 28rem; }
.dlg-wide label { display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; font-weight: 600; margin: .75rem 0; }
.dlg-wide input, .dlg-wide textarea { padding: .55rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; width: 100%; }
.inv-result { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.code { font-size: 1.5rem; letter-spacing: .15em; font-weight: 800; color: var(--primary); }
.inv-text { width: 100%; margin: .5rem 0; font-size: .8rem; resize: vertical; }
.link-manual { color: var(--primary); font-size: .85rem; text-decoration: underline; }
.report-wrap { margin: .5rem 0 0; text-align: center; }
.report-link { color: #059669; font-size: .85rem; font-weight: 600; }
.btn-link { background: none; border: none; color: var(--primary); font-weight: 600; cursor: pointer; text-decoration: underline; padding: 0; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stat .label { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; }
.stat .amount.sm { font-size: 1.35rem; font-weight: 800; }
.accounting-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.35rem;
  margin-top: .9rem;
}
@media (min-width: 920px) {
  .accounting-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}
.accounting-main h3 { margin: 0 0 .35rem; }
.periodo-banner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.periodo-banner h2 { margin: .15rem 0 0; font-size: 1.5rem; }
.label-upper { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0; }
.morosos-pill { text-align: center; padding: .65rem 1.1rem; background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px; min-width: 5rem; }
.morosos-pill .label { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; }
.morosos-pill strong { font-size: 1.5rem; color: var(--bad); }
.account-card { border: 2px solid var(--border); border-radius: 14px; padding: 1rem 1.15rem; background: #f8fafc; min-width: 0; }
.account-card.privada { border-color: #93c5fd; border-left: 6px solid #1d4ed8; background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%); }
.account-card.casa-club { border-color: #6ee7b7; border-left: 6px solid #0f766e; background: linear-gradient(135deg, #f8fafc 0%, #ecfdf5 100%); }
.account-head { margin-bottom: .85rem; }
.account-head h4 { margin: 0; font-size: 1.05rem; }
.account-sub { margin: .25rem 0 0; font-size: .82rem; color: var(--muted); }
.account-bank { margin: .35rem 0 0; font-size: .78rem; color: #475569; font-weight: 600; }
.account-four { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.account-four .metric {
  background: #fff;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
.account-four .metric.inicial { background: #eff6ff; border-color: #60a5fa; }
.account-four .metric.ing { background: #ecfdf5; border-color: #34d399; }
.account-four .metric.egr { background: #fef2f2; border-color: #f87171; }
.account-four .metric.saldo { background: #eef2ff; border-color: #6366f1; }
.account-four .metric-label {
  display: block;
  font-size: .68rem;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.3;
  margin: 0;
  padding: .45rem .65rem;
  font-weight: 800;
  border-bottom: 1px solid rgba(15, 23, 42, .12);
  background: rgba(255, 255, 255, .55);
}
.account-four .metric.inicial .metric-label { background: #dbeafe; color: #1e3a8a; }
.account-four .metric.ing .metric-label { background: #d1fae5; color: #065f46; }
.account-four .metric.egr .metric-label { background: #fee2e2; color: #991b1b; }
.account-four .metric.saldo .metric-label { background: #e0e7ff; color: #3730a3; }
.account-four .metric-val {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: .55rem .65rem .65rem;
}
.account-four .metric.ing .metric-val { color: var(--ok); }
.account-four .metric.egr .metric-val { color: var(--bad); }
.account-four .metric.saldo .metric-val { color: #3730a3; font-size: 1.08rem; }
.account-four .metric.inicial .metric-val { color: #1d4ed8; }
.account-formula { margin: .75rem 0 0; font-size: .75rem; color: var(--muted); line-height: 1.45; }
.sheet-tabs { display: flex; gap: .5rem; margin: .85rem 0; }
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 0 0 1.25rem;
  padding: .35rem;
  background: #f1f5f9;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.admin-tab {
  flex: 1 1 auto;
  min-width: 7rem;
  padding: .55rem .85rem;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 9px;
  font-weight: 700;
  font-size: .82rem;
  cursor: pointer;
  color: var(--muted);
  transition: background .15s, color .15s, border-color .15s;
}
.admin-tab:hover { background: #fff; color: var(--text); }
.admin-tab.active {
  background: #fff;
  color: var(--primary);
  border-color: var(--border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}
.admin-tab.hidden { display: none; }
.adm-panel.hidden { display: none; }
.adm-panel > .card:first-child { margin-top: 0; }
@media (max-width: 640px) {
  .admin-tab { flex: 1 1 calc(50% - .25rem); min-width: 0; font-size: .78rem; padding: .5rem .55rem; }
}
.sheet-tab { flex: 1; padding: .6rem .75rem; border: 1px solid var(--border); background: #f8fafc; border-radius: 10px; font-weight: 700; font-size: .85rem; cursor: pointer; }
.sheet-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.sheet-tab[data-sheet="ingresos"].active { background: #059669; border-color: #059669; }
.sheet-tab[data-sheet="egresos"].active { background: #dc2626; border-color: #dc2626; }
.sheet-panel.hidden { display: none; }
.sheet-grid { display: grid; grid-template-columns: 1fr; gap: 1.35rem; }
@media (min-width: 920px) {
  .sheet-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
.sheet-block { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.sheet-block.privada { border-top: 4px solid #1d4ed8; }
.sheet-block.casa-club { border-top: 4px solid #0f766e; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .75rem 1rem; background: #f8fafc; border-bottom: 1px solid var(--border); }
.sheet-head h4 { margin: 0; font-size: .92rem; }
.sheet-head strong { font-size: 1.1rem; color: var(--primary); }
.sheet-block .table-wrap { padding: 0 .25rem .5rem; }
.sheet-block td.num { text-align: right; font-weight: 700; white-space: nowrap; }
.export-bar h3 { margin: 0 0 .35rem; }
.export-actions { flex-shrink: 0; }
.export-help { margin: .75rem 0 0; padding-left: 1.1rem; font-size: .82rem; color: var(--muted); }
.export-help li { margin: .25rem 0; }
@media (max-width: 640px) {
  .export-bar .row-between { flex-direction: column; align-items: stretch; }
  .export-actions { width: 100%; }
  .export-actions .btn { flex: 1; }
}
.account-head { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; }
.account-head span { font-size: .78rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.account-head strong { font-size: 1.25rem; }
.account-card dl { display: grid; grid-template-columns: 1fr auto; gap: .4rem .75rem; margin: 0; font-size: .86rem; }
.account-card dt { color: var(--muted); }
.account-card dd { margin: 0; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-grid label { display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; font-weight: 600; }
.form-grid input, .form-grid select { padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.span2 { grid-column: span 2; }
.row-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.row-between { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.search { padding: .45rem .65rem; border: 1px solid var(--border); border-radius: 8px; min-width: 10rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { padding: .5rem .4rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: .7rem; text-transform: uppercase; color: var(--muted); }
.table-padron { border: 2px solid #0f172a; border-radius: 10px; overflow: hidden; }
.table-padron thead { background: #1e293b; }
.table-padron thead th {
  color: #f8fafc;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  padding: .6rem .55rem;
  border: 1px solid #334155;
  white-space: nowrap;
}
.table-padron thead th.col-privada { background: #1d4ed8; }
.table-padron thead th.col-club { background: #0f766e; }
.table-padron tbody td {
  border: 1px solid #cbd5e1;
  padding: .5rem .55rem;
  vertical-align: middle;
}
.table-padron tbody tr:nth-child(even) { background: #f8fafc; }
.table-padron tbody tr:hover { background: #eff6ff; }
.table-padron td.num-cell { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.cuota-badge {
  display: inline-block;
  padding: .25rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.cuota-badge.privada { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.bonif-badge { display: inline-block; padding: .2rem .5rem; border-radius: 6px; background: #fef3c7; color: #92400e; font-size: .75rem; font-weight: 700; margin-right: .35rem; }
.table-padron thead th.col-bonif { background: #b45309; }
.cuota-club { font-size: .78rem; font-weight: 600; }
.sheet-table thead th { background: #334155; color: #fff; border: 1px solid #475569; }
.sheet-table tbody td { border: 1px solid #cbd5e1; }
.sheet-table tbody tr:nth-child(even) { background: #f8fafc; }
.row-actions { gap: .65rem; }
.saldo-ok { color: var(--ok); font-weight: 600; }
.saldo-bad { color: var(--bad); font-weight: 600; }
.dl { margin: 0; font-size: .9rem; }
.dl dt { font-weight: 600; margin-top: .5rem; }
.dl dd { margin: .15rem 0 0; color: var(--muted); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: .55rem 0; border-bottom: 1px solid var(--border); font-size: .85rem; }
.list li:last-child { border: none; }
.dlg { border: none; border-radius: var(--radius); padding: 1.25rem; max-width: 22rem; width: calc(100% - 2rem); position: relative; }
.dlg::backdrop { background: rgba(15,23,42,.45); }
.dlg label { display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; font-weight: 600; margin: 1rem 0; }
.dlg input { padding: .55rem; border: 1px solid var(--border); border-radius: 8px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }
.error { color: var(--bad); font-size: .85rem; }
.msg { font-size: .85rem; margin-top: .5rem; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--bad); }
.informe { background: #f8fafc; padding: .75rem; border-radius: 8px; font-size: .8rem; white-space: pre-wrap; }
.link-copy { font-size: .75rem; color: var(--primary); cursor: pointer; word-break: break-all; }
@media (min-width: 640px) {
  .pad { padding: 1.5rem; }
}
.amount.sm.ing { color: var(--ok); }
.amount.sm.egr { color: var(--bad); }
.saldo-estado { margin-bottom: .75rem; line-height: 1.5; }
.saldo-historial { margin-top: 1rem; font-size: .85rem; }
.saldo-historial li { margin: .5rem 0; padding: .5rem; background: #f8fafc; border-radius: 8px; }
