:root {
  --ink: #0A0F0D;
  --ink-suave: #111B17;
  --paper: #FFFFFF;
  --gold: #00D46A;
  --gold-strong: #00A854;
  --gold-suave: rgba(0, 212, 106, 0.12);
  --muted: #6B7B73;
  --texto: #101A16;
  --fondo: #F2F7F4;
  --linea: rgba(18, 24, 38, 0.12);
  --exito: #008E4A;
  --alerta: #C55D48;
  --pendiente: #8C98A4;
  --radio: 14px;
  --shadow-soft: 0 18px 42px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 12px 26px rgba(15, 23, 42, 0.04);
}

.tarjeta-movimiento { margin: 12px 0; padding: 16px; border: 1px solid var(--linea); border-radius: 12px; background: white; overflow-wrap: anywhere; }
.tarjeta-movimiento p { margin: 8px 0; line-height: 1.5; }
[hidden] { display: none !important; }
.permisos-edicion { padding: 16px; margin: 16px 0; border: 1px solid var(--linea); border-radius: 10px; }
.permisos-edicion label { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.permisos-edicion input[type=checkbox] { width: 20px; height: 20px; flex-shrink: 0; }
.permisos-edicion button { margin: 6px; }
.cobrador-actividad { display: flex; flex-direction: column; gap: 6px; text-align: left; width: 100%; margin: 12px 0; overflow-wrap: anywhere; }
.cobrador-actividad.reciente { background: #dcfce7; color: #14532d; border: 1px solid #22c55e; }
.cobrador-actividad.sin-actividad { background: #fee2e2; color: #7f1d1d; border: 1px solid #ef4444; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(circle at top, rgba(0,212,106,0.08), transparent 28%),
    linear-gradient(180deg, #f8fbf9 0%, #eef6f1 100%);
  color: var(--texto);
  min-height: 100vh;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  background: linear-gradient(135deg, #00E676 0%, #00B85C 100%);
  color: #04130B;
  box-shadow: 0 10px 20px rgba(0, 160, 80, 0.16);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 22px rgba(18, 24, 38, 0.18);
}

button.secundario {
  background: rgba(255,255,255,0.7);
  color: var(--ink);
  border: 1px solid var(--linea);
  box-shadow: none;
}
button.peligro {
  background: rgba(197,93,72,0.08);
  color: var(--alerta);
  border: 1px solid rgba(197,93,72,0.24);
  box-shadow: none;
}

input, select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(18,24,38,0.12);
  border-radius: 12px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  background: rgba(255,255,255,0.9);
  color: var(--texto);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus {
  outline: none;
  border-color: rgba(0,212,106,0.65);
  box-shadow: 0 0 0 4px rgba(0,212,106,0.10);
}

label { font-size: 13px; font-weight: 700; color: var(--muted); display: block; margin-bottom: 6px; }
a { color: inherit; text-decoration: none; }
.oculto { display: none !important; }

.topbar {
  background: linear-gradient(180deg, #07100c 0%, #0b1711 100%);
  color: white;
  padding: 13px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.03);
}
.topbar h1 {
  font-size: 22px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.03em;
}
.topbar .rol {
  font-size: 12px;
  color: rgba(255,255,255,.52);
  display: block;
  margin-top: 2px;
}
.topbar button {
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,.14);
  padding: 8px 14px;
  font-size: 13px;
  box-shadow: none;
}
.topbar-brand { display:flex; align-items:center; gap:14px; }
.topbar-brand img { width:112px; height:48px; object-fit:cover; mix-blend-mode:screen; border-radius:8px; -webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 8px,#000 100%); mask-image:linear-gradient(to bottom,transparent 0,#000 8px,#000 100%); }
.contexto-sesion-cobrador { max-width: min(46vw, 360px); padding: 8px 10px; border: 1px solid rgba(34,83,166,0.14); border-radius: 8px; background: #f3f7ff; color: var(--ink); font-size: 0.72rem; font-weight: 700; overflow-wrap: anywhere; text-align: right; }
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .contexto-sesion-cobrador { order: 3; flex: 1 0 100%; max-width: 100%; text-align: left; }
}

.contenedor { max-width: 720px; margin: 0 auto; padding: 20px; }

.navinferior {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(180deg, rgba(7,16,12,0.98) 0%, rgba(8,21,15,0.98) 100%);
  display: flex;
  justify-content: space-around;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 -8px 18px rgba(15,23,42,0.12);
}
.navinferior a {
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 10px;
}
.navinferior a.activo {
  color: var(--gold);
  background: rgba(199,154,59,0.08);
}
.navinferior .icono { font-size: 18px; }
body.con-nav-inferior { padding-bottom: 76px; }

@media (max-width: 639px) {
  body { min-width:320px; overflow-x:hidden; }
  .topbar { position:sticky; top:0; z-index:20; min-height:64px; padding:8px 12px; box-shadow:0 6px 20px rgba(5,25,15,.16); }
  .topbar-brand { min-width:0; gap:9px; }
  .topbar-brand img { width:76px; height:36px; flex:0 0 auto; border-radius:6px; }
  .topbar-brand > div { min-width:0; }
  .topbar h1 { font-size:1rem; line-height:1.1; white-space:nowrap; }
  .topbar .rol { max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.65rem; }
  .topbar button { min-height:38px; padding:7px 11px; font-size:.72rem; }
  .navinferior { z-index:30; justify-content:stretch; padding:6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .navinferior a { flex:1 1 25%; min-width:0; min-height:48px; justify-content:center; padding:6px 3px; border-radius:9px; font-size:.64rem; line-height:1.15; }
  .navinferior a.activo { background:rgba(0,212,106,.12); }
}

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; letter-spacing: 0.02em; }
.badge-activo { background: var(--gold-suave); color: var(--gold); }
.badge-al-dia { background: rgba(63,122,86,0.12); color: var(--exito); }
.badge-mora { background: rgba(192,80,59,0.12); color: var(--alerta); }
.badge-finalizado { background: rgba(156,163,168,0.15); color: var(--muted); }
/* Estado compartido en web y Android; visible también sin conexión. */
.estado-sincronizacion { display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:8px 16px; background:#e8f5ed; color:#174b32; font-size:12px; line-height:1.5; }
.estado-sincronizacion[data-pendiente="true"] { background:#fff3cd; color:#533f03; }
.estado-sincronizacion span { flex:1 1 240px; }
.estado-sincronizacion button, .estado-sincronizacion a { padding:5px 9px; border:1px solid currentColor; border-radius:6px; background:transparent; color:inherit; font:inherit; cursor:pointer; }
.estado-sincronizacion [hidden] { display:none; }
.estado-sincronizacion button:disabled { opacity:.5; cursor:default; }

.etiqueta-advertencia { display: inline-block; padding: 8px 12px; border-radius: 8px; background: #fff0c2; color: #624000; font-weight: 800; line-height: 1.4; }
.activacion-zona { margin-bottom: 16px; padding: 20px; border: 1px solid #d6a642; border-left: 5px solid #a46700; border-radius: 14px; background: #fffaf0; color: #44341a; overflow-wrap: anywhere; }
.activacion-zona h2 { margin-bottom: 12px; color: #44341a; }
.activacion-zona p { margin: 12px 0; line-height: 1.6; }
.contactar-whatsapp { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 18px; border-radius: 10px; background: #12613c; color: #fff; font-weight: 700; text-decoration: none; }
.aviso-mensualidad { width: min(540px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; margin: auto; padding: 26px; border: 2px solid #b97808; border-radius: 18px; background: #fff9e9; color: #44341a; overflow-wrap: anywhere; }
.aviso-mensualidad::backdrop { background: #07100cc7; }
.aviso-mensualidad h2 { margin: 18px 0 12px; color: inherit; }
.aviso-mensualidad p { margin-bottom: 18px; line-height: 1.6; }
.aviso-mensualidad button { min-height: 52px; width: 100%; background: #704300; color: white; white-space: normal; }
.aviso-mensualidad[data-etapa="4h"] { border-color: #b13a20; background: #fff1e9; }
.aviso-mensualidad[data-etapa="4h"] .etiqueta-advertencia { background: #ffdacb; color: #842710; }

/* Camera evidence is available from all loan entry screens. */
.loan-evidence { width:min(94vw,520px); max-height:94dvh; padding:20px; border:1px solid #24784c; border-radius:18px; background:#f4fff8; color:#153a27; }
.loan-evidence::backdrop { background:#001a12c9; }
.loan-evidence form { display:flex; flex-direction:column; gap:12px; padding:0; }
.loan-evidence label { display:flex; gap:10px; align-items:flex-start; font-size:1rem; }
.loan-evidence input[type=checkbox] { width:22px; height:22px; flex-shrink:0; }
.loan-evidence button { min-height:44px; }
.loan-evidence [hidden] { display:none !important; }
