/* ============================================================
   Control de Pagos — Wall Street Noir (navy + gold)
   ============================================================ */
:root {
  --bg: #0B1526;
  --surface: #121F35;
  --surface-2: #182843;
  --border: #24365A;
  --gold: #D4AF37;
  --gold-light: #E8C766;
  --text: #EDF0F5;
  --muted: #8FA0BC;
  --ok: #3DBF7A;
  --warn: #E8A33D;
  --danger: #E05C5C;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  padding-bottom: 84px; /* espacio para la barra inferior */
}

h1, h2, h3, .display { font-family: "Archivo", "Inter", sans-serif; letter-spacing: -0.01em; }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea {
  font: inherit; color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  width: 100%;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
label { display: block; font-size: 12.5px; color: var(--muted); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Encabezado ---------- */
header.app-header {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 22px 18px 10px;
}
.app-header h1 { font-size: 21px; font-weight: 800; }
.app-header h1 em { font-style: normal; color: var(--gold); }
.app-header .fecha { font-size: 12.5px; color: var(--muted); }

main { padding: 0 14px; max-width: 760px; margin: 0 auto; }

/* ---------- Cinta del mes (firma visual) ---------- */
.cinta-card {
  background: linear-gradient(160deg, var(--surface) 0%, #0F1B30 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 12px;
  margin-bottom: 16px;
}
.cinta-titulo { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.cinta-titulo h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold); font-weight: 700; }
.cinta-titulo span { font-size: 12px; color: var(--muted); }
.cinta { position: relative; height: 54px; }
.cinta-linea { position: absolute; top: 26px; left: 0; right: 0; height: 2px; background: var(--border); border-radius: 2px; }
.cinta-hoy {
  position: absolute; top: 12px; width: 2px; height: 30px;
  background: var(--gold); box-shadow: 0 0 8px rgba(212,175,55,.7);
}
.cinta-hoy::after {
  content: "HOY"; position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  font-size: 9px; letter-spacing: .1em; color: var(--gold); font-weight: 700;
}
.cinta-punto {
  position: absolute; top: 21px; width: 12px; height: 12px; border-radius: 50%;
  transform: translateX(-50%);
  border: 2px solid var(--bg);
}
.cinta-punto.ok { background: var(--ok); }
.cinta-punto.pendiente { background: var(--warn); }
.cinta-punto.atrasado { background: var(--danger); }
.cinta-punto .dia {
  position: absolute; top: 15px; left: 50%; transform: translateX(-50%);
  font-size: 9.5px; color: var(--muted); font-family: "IBM Plex Mono", monospace;
}
.cinta-leyenda { display: flex; gap: 14px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.cinta-leyenda i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.cinta-leyenda .i-ok { background: var(--ok); } .cinta-leyenda .i-p { background: var(--warn); } .cinta-leyenda .i-a { background: var(--danger); }

/* ---------- Secciones y tarjetas ---------- */
.seccion-titulo {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 20px 4px 10px;
}
.seccion-titulo h2 { font-size: 15px; font-weight: 700; }
.seccion-titulo .conteo { font-size: 12px; color: var(--muted); }

.pago-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  margin-bottom: 9px;
}
.pago-item .dias {
  min-width: 52px; text-align: center;
  font-family: "IBM Plex Mono", monospace;
  border-radius: 10px; padding: 7px 4px;
  font-size: 12px; line-height: 1.15; font-weight: 600;
}
.pago-item .dias b { display: block; font-size: 18px; }
.dias.hoy { background: rgba(212,175,55,.16); color: var(--gold-light); border: 1px solid rgba(212,175,55,.4); }
.dias.pronto { background: rgba(232,163,61,.13); color: var(--warn); }
.dias.normal { background: var(--surface-2); color: var(--muted); }
.dias.atrasado { background: rgba(224,92,92,.14); color: var(--danger); }

.pago-item .info { flex: 1; min-width: 0; }
.pago-item .info .nombre { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pago-item .info .detalle { font-size: 12.5px; color: var(--muted); }
.chip-tipo {
  font-size: 10px; padding: 2px 7px; border-radius: 20px; margin-left: 6px;
  text-transform: uppercase; letter-spacing: .05em; vertical-align: middle;
}
.chip-tipo.personal { background: rgba(143,160,188,.15); color: var(--muted); }
.chip-tipo.negocio { background: rgba(212,175,55,.14); color: var(--gold-light); }
.chip-tipo.servicio { background: rgba(61,191,122,.13); color: var(--ok); }

.btn-pagar {
  background: var(--gold); color: #14213B; font-weight: 700;
  border-radius: 10px; padding: 9px 14px; font-size: 13px;
  transition: transform .06s ease;
}
.btn-pagar:active { transform: scale(.96); }
.btn-pagado {
  background: rgba(61,191,122,.15); color: var(--ok);
  border-radius: 10px; padding: 9px 12px; font-size: 13px; font-weight: 700;
}

/* ---------- Vista Tarjetas ---------- */
.tarjeta-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 10px;
}
.tarjeta-card .fila-1 { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tarjeta-card .banco { font-weight: 700; font-size: 15.5px; }
.tarjeta-card .sub { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.tarjeta-card .datos {
  display: flex; gap: 16px; margin-top: 10px; font-size: 12.5px; color: var(--muted);
  flex-wrap: wrap;
}
.tarjeta-card .datos b { color: var(--text); font-family: "IBM Plex Mono", monospace; font-weight: 600; }
.grid-meses { display: flex; gap: 4px; margin-top: 12px; overflow-x: auto; padding-bottom: 2px; }
.mes-chip {
  min-width: 34px; text-align: center; border-radius: 7px; padding: 5px 0 3px;
  font-size: 9.5px; color: var(--muted); background: var(--surface-2);
  border: 1px solid transparent;
}
.mes-chip b { display: block; font-size: 10.5px; margin-top: 1px; font-family: "IBM Plex Mono", monospace; }
.mes-chip.ok { border-color: rgba(61,191,122,.4); } .mes-chip.ok b { color: var(--ok); }
.mes-chip.falta b { color: var(--danger); }
.btn-icono { color: var(--muted); font-size: 17px; padding: 4px 8px; }

.filtros { display: flex; gap: 8px; margin: 4px 0 14px; }
.filtro {
  padding: 7px 14px; border-radius: 20px; font-size: 13px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
}
.filtro.activo { background: rgba(212,175,55,.13); border-color: var(--gold); color: var(--gold-light); font-weight: 600; }

/* ---------- Barra inferior ---------- */
nav.tabs {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-around;
  background: rgba(11,21,38,.92); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 8px 0 max(10px, env(safe-area-inset-bottom));
  z-index: 40;
}
nav.tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; padding: 4px 18px; }
nav.tabs button.activo { color: var(--gold); }
nav.tabs .ico { font-size: 20px; line-height: 1; }

/* ---------- Botón flotante ---------- */
.fab {
  position: fixed; right: 18px; bottom: 86px; z-index: 41;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--gold); color: #14213B; font-size: 26px; font-weight: 700;
  box-shadow: 0 6px 20px rgba(212,175,55,.35);
}

/* ---------- Modal ---------- */
.modal-fondo {
  position: fixed; inset: 0; background: rgba(4,9,18,.7); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px 18px 0 0; width: 100%; max-width: 560px;
  max-height: 88vh; overflow-y: auto; padding: 20px 18px 26px;
}
.modal h3 { margin-bottom: 4px; font-size: 18px; }
.modal .fila-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-acciones { display: flex; gap: 10px; margin-top: 22px; }
.btn-primario {
  flex: 1; background: var(--gold); color: #14213B; font-weight: 700;
  padding: 13px; border-radius: 11px; font-size: 15px;
}
.btn-secundario {
  flex: 1; background: var(--surface-2); border: 1px solid var(--border);
  padding: 13px; border-radius: 11px; color: var(--muted);
}
.btn-peligro { color: var(--danger); font-size: 13px; margin-top: 14px; width: 100%; text-align: center; }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
}
.login .marco { width: 100%; max-width: 380px; }
.login h1 { font-size: 26px; font-weight: 800; text-align: center; }
.login h1 em { font-style: normal; color: var(--gold); }
.login p.sub { color: var(--muted); text-align: center; margin: 6px 0 26px; font-size: 13.5px; }
.login .btn-primario { width: 100%; margin-top: 20px; }
.login .alt { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.login .alt button { color: var(--gold); font-weight: 600; }
.linea-oro { width: 44px; height: 3px; background: var(--gold); margin: 14px auto 0; border-radius: 2px; }

/* ---------- Ajustes ---------- */
.ajuste-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.ajuste-card h3 { font-size: 14px; margin-bottom: 4px; }
.ajuste-card p { font-size: 12.5px; color: var(--muted); }
.switch-fila { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }

/* ---------- Utilidades ---------- */
.vacio { text-align: center; color: var(--muted); padding: 44px 20px; font-size: 14px; }
.vacio .btn-primario { max-width: 300px; margin: 18px auto 0; display: block; }
.aviso-flotante {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--gold);
  color: var(--text); padding: 11px 18px; border-radius: 12px;
  font-size: 13.5px; z-index: 60; box-shadow: 0 8px 24px rgba(0,0,0,.4);
  max-width: 92vw;
}
.oculto { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media (min-width: 700px) {
  .modal-fondo { align-items: center; }
  .modal { border-radius: 18px; }
}
