/* ============================================================
   Asociación Vecinal — estilos base
   Paleta: verde "libro contable" + ámbar "sello de recibo"
   Tipografía: Space Grotesk (títulos) / Inter (texto) / IBM Plex Mono (montos)
   ============================================================ */

:root {
  --verde-900: #16332c;
  --verde-700: #1f4d42;
  --verde-500: #2d715f;
  --ambar-500: #e08a2c;
  --ambar-600: #c6741c;
  --crudo-50:  #f6f5f0;
  --crudo-100: #efece3;
  --tinta-900: #1c1c1a;
  --tinta-500: #5b5b55;
  --linea:     #ddd8ca;
  --rojo-600:  #b3412f;
  --verde-ok:  #2f7a4d;

  --radius: 14px;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--crudo-50);
  color: var(--tinta-900);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

body {
  padding-bottom: 84px; /* deja lugar a la bottom nav */
}

h1, h2, h3, .brand, .btn, .stat-num { font-family: var(--font-display); }

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 24px;
}

a { color: inherit; text-decoration: none; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--verde-900);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { font-weight: 600; font-size: 1rem; color: #fff; }
.topbar-logout {
  font-size: .85rem;
  color: var(--crudo-100);
  border: 1px solid rgba(255,255,255,.25);
  padding: 6px 12px;
  border-radius: 999px;
}

/* ---------- Bottom nav (mobile) ---------- */
.bottomnav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--linea);
  display: flex;
  justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  z-index: 30;
}
.bottomnav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: .68rem;
  color: var(--tinta-500);
  padding: 6px 2px;
  border-radius: 10px;
}
.bottomnav a .ic { font-size: 1.15rem; }
.bottomnav a.active { color: var(--verde-700); font-weight: 600; }

/* ---------- Banner de portada ---------- */
.hero-banner {
  background: var(--verde-900);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 20px;
  margin: 8px 0 20px;
  position: relative;
  overflow: hidden;
}
.hero-banner::after {
  content: "";
  position: absolute;
  right: -30px; bottom: -30px;
  width: 130px; height: 130px;
  border-radius: 50%;
  background: rgba(224,138,44,.18);
}
.hero-eyebrow {
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ambar-500);
  font-weight: 600;
}
.hero-title {
  font-size: 1.6rem;
  margin: 6px 0 8px;
  font-weight: 700;
  line-height: 1.15;
}
.hero-sub {
  font-size: .92rem;
  color: #d9e2de;
  line-height: 1.4;
  margin: 0;
}

/* ---------- Tarjetas ---------- */
.card {
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}
.card h2 {
  font-size: 1rem;
  margin: 0 0 12px;
}

/* Tarjeta "recibo" — el elemento distintivo del sistema */
.recibo {
  background: #fff;
  border: 1px dashed var(--verde-500);
  border-radius: 10px;
  padding: 18px;
  position: relative;
}
.recibo::before, .recibo::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 16px; height: 16px;
  background: var(--crudo-50);
  border-radius: 50%;
}
.recibo::before { left: -8px; }
.recibo::after { right: -8px; }
.recibo-monto {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--verde-900);
}
.recibo-linea {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  color: var(--tinta-500);
  padding: 6px 0;
  border-bottom: 1px dashed var(--linea);
}
.recibo-linea:last-child { border-bottom: none; }

/* ---------- Formularios ---------- */
label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  margin: 14px 0 6px;
  color: var(--verde-900);
}
label.first { margin-top: 0; }
input[type=text], input[type=password], input[type=number],
input[type=tel], input[type=date], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--linea);
  border-radius: 10px;
  font-size: 1rem;
  font-family: var(--font-body);
  background: #fff;
  color: var(--tinta-900);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--verde-500);
  outline-offset: 1px;
}
.help { font-size: .76rem; color: var(--tinta-500); margin-top: 4px; }

/* input de monto con estética de ticket */
.input-monto {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 600;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 999px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  text-align: center;
}
.btn-primary { background: var(--ambar-500); color: #1c1300; }
.btn-primary:active { background: var(--ambar-600); }
.btn-outline { background: transparent; color: var(--verde-900); border: 1.5px solid var(--verde-900); }
.btn-secondary { background: var(--verde-900); color: #fff; }
.btn-danger { background: var(--rojo-600); color: #fff; }
.btn-sm { width: auto; padding: 8px 14px; font-size: .82rem; margin-top: 0; border-radius: 8px; }
.btn-block-group { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Alertas / flash ---------- */
.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: .88rem;
  margin-bottom: 14px;
}
.alert-ok { background: #e4f3e8; color: var(--verde-ok); border: 1px solid #bfe3ca; }
.alert-error { background: #fbe9e6; color: var(--rojo-600); border: 1px solid #f3c8c0; }
.alert-info { background: #eaf1ef; color: var(--verde-700); border: 1px solid #cfe0da; }

/* ---------- Badges de estado ---------- */
.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}
.badge-ok { background: #e4f3e8; color: var(--verde-ok); }
.badge-pendiente { background: #fdf0dc; color: var(--ambar-600); }
.badge-devuelto { background: #fbe9e6; color: var(--rojo-600); }

/* ---------- Stats / recaudación ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.stat-box {
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: 12px;
  padding: 14px;
}
.stat-label { font-size: .72rem; color: var(--tinta-500); text-transform: uppercase; letter-spacing: .04em; }
.stat-num { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 600; margin-top: 4px; }
.stat-num.pos { color: var(--verde-ok); }
.stat-num.neg { color: var(--rojo-600); }

/* ---------- Listas de movimientos ---------- */
.mov-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--linea);
  gap: 10px;
}
.mov-item:last-child { border-bottom: none; }
.mov-desc { font-size: .88rem; }
.mov-desc small { display: block; color: var(--tinta-500); font-size: .76rem; margin-top: 2px; }
.mov-monto { font-family: var(--font-mono); font-weight: 600; white-space: nowrap; }
.mov-monto.ingreso { color: var(--verde-ok); }
.mov-monto.gasto { color: var(--rojo-600); }

/* ---------- Tabs de rol (panel admin) ---------- */
.rolebar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: var(--tinta-500);
  margin-bottom: 14px;
}
.rolebar .badge { background: var(--verde-900); color: #fff; }

/* ---------- Utilidades ---------- */
.center { text-align: center; }
.muted { color: var(--tinta-500); }
.mt-0 { margin-top: 0; }
.small { font-size: .82rem; }
.divider { border: none; border-top: 1px solid var(--linea); margin: 18px 0; }

/* ---------- Proyectos especiales ---------- */
.proyecto-card {
  display: block;
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
}
.proyecto-foto {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  background: var(--crudo-100);
}
.proyecto-foto-placeholder {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--verde-900);
  color: rgba(255,255,255,.5);
}
.proyecto-body { padding: 14px; }
.proyecto-titulo { font-family: var(--font-display); font-weight: 600; font-size: 1rem; margin: 0 0 4px; }
.proyecto-desc { font-size: .82rem; color: var(--tinta-500); margin: 0 0 12px; line-height: 1.4; }
.proyecto-finalizado-tag {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  color: var(--verde-ok);
  background: #e4f3e8;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.progreso-bar {
  width: 100%;
  height: 10px;
  background: var(--crudo-100);
  border-radius: 999px;
  overflow: hidden;
}
.progreso-fill {
  height: 100%;
  background: var(--ambar-500);
  border-radius: 999px;
  transition: width .4s ease;
}
.progreso-datos {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 6px;
  font-size: .78rem;
}
.progreso-monto { font-family: var(--font-mono); font-weight: 600; color: var(--verde-900); }
.progreso-pct { color: var(--tinta-500); }

/* Enlace secundario debajo de botones principales */
.link-secundario {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: .88rem;
  color: var(--verde-700);
  font-weight: 600;
}
