:root {
  --bg: #0f172a;
  --card: #1a2338;
  --text: #e9e5d6;
  --muted: #8b93a7;
  --accent: #4DB69C;
  --verde: #22c55e;
  --amarillo: #eab308;
  --rojo: #ef4444;
  --gris: #64748b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 72px;
}

header.topbar {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header.topbar h1 { font-size: 1.1rem; margin: 0; }

main { padding: 12px; max-width: 720px; margin: 0 auto; }

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--card); border-radius: 12px; padding: 12px; }
.kpi .label { color: var(--muted); font-size: 0.75rem; }
.kpi .value { font-size: 1.3rem; font-weight: 600; }

.unidad-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
}
.unidad-row:last-child { border-bottom: none; }

.dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.dot.pagado { background: var(--verde); }
.dot.parcial, .dot.parcial_atrasado { background: var(--amarillo); }
.dot.atrasado { background: var(--rojo); }
.dot.pendiente { background: var(--gris); }
.dot.vacia { background: transparent; border: 1px solid var(--muted); }

.unidad-info { flex: 1; }
.unidad-info .nombre { font-weight: 600; }
.unidad-info .sub { color: var(--muted); font-size: 0.8rem; }
.monto { font-weight: 600; }

nav.tabs {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: var(--card);
  border-top: 1px solid rgba(255,255,255,0.08);
}
nav.tabs button {
  flex: 1;
  background: none;
  border: none;
  color: var(--muted);
  padding: 10px 0 6px;
  font-size: 0.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
nav.tabs button.active { color: var(--accent); }
nav.tabs .icon { font-size: 1.2rem; }

button.primary {
  background: var(--accent);
  color: #06231b;
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
}

input, select, textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: #0d1526;
  color: var(--text);
  margin-bottom: 10px;
  font-size: 1rem;
}
label { font-size: 0.8rem; color: var(--muted); }

.hidden { display: none !important; }

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 50;
}
.modal {
  background: var(--card);
  width: 100%; max-width: 480px;
  border-radius: 16px 16px 0 0;
  padding: 20px;
  max-height: 85vh;
  overflow-y: auto;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}
.badge.pagado { background: rgba(34,197,94,0.2); color: var(--verde); }
.badge.parcial, .badge.parcial_atrasado { background: rgba(234,179,8,0.2); color: var(--amarillo); }
.badge.atrasado { background: rgba(239,68,68,0.2); color: var(--rojo); }
.badge.pendiente { background: rgba(100,116,139,0.2); color: var(--gris); }

.login-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { width: 90%; max-width: 320px; text-align: center; }

.list-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
